CC
Claude Code
v2.1.88
entertainment
50+

Hidden Discoveries

Most Claude Code users don't know any of these.

The serious engineering is covered elsewhere. This page is for the delightful, surprising, and slightly unhinged things hiding in 512,664 lines of TypeScript.

What you'll discover
  • There's a duck inside Claude Code — one of 18 collectible buddy pets with rarity tiers, hats, and 5 stats including CHAOS and SNARK
  • yoloClassifier is a real ML model in production code that decides if shell commands are safe to auto-approve
  • Fast Mode is internally called Penguin Mode (penguinModeOrgEnabled) and disables extended thinking
  • Claude auto-dreams: after 24h + 5 sessions, it automatically runs /dream to consolidate memories
#1

By the Numbers (The Scary Ones)

🔍 Discovery
512,664
Lines of TypeScript
That's roughly 10 novels worth of code
🔍 Discovery
1,884
Source files
Your IDE just fainted
🔍 Discovery
101
Slash commands
More commands than a military base
🔍 Discovery
5,594
Lines in print.ts
The single largest file. It just prints things.
🔍 Discovery
300KB+
BashTool security
More security than most banks
🔍 Discovery
160+
Loading spinner verbs
'Clauding...' is now a verb
#2

The Buddy System

The Buddy System — Yes, Claude Has Collectible Pets

__ (o>> || _(__)_ ^^^^
duck
/\_/\ ( · ·) ( ω ) (")_(")
cat
/^\ /^\ < · · > ( ~~ ) `-vvvv-`
dragon
.---. / · · \ | | \_/\_/\_/
ghost
.----. ( · · ) ( ) '----'
capybara
18 Species
duckgooseblobcatdragonoctopusowlpenguinturtlesnailghostaxolotlcapybaracactusrobotrabbitmushroomchonk
8 Hats
crowntophatpropellerhalowizardbeanietinyduck
Eyes
· ✦ × ◉ @ °
Rarities
commonuncommonrareepiclegendary
Species names are encoded as String.fromCharCode(0x64,0x75,0x63,0x6b) because one name collides with a model codename in the build checker. The engineers literally obfuscated pet names to avoid tripping their own security scanner. Peak engineering.
#3

The Wizard Speaks

The Wizard Comment (query.ts:151)

query.ts
/**
 * The rules of thinking are lengthy and fortuitous. They require
 * plenty of thinking of most long duration and deep meditation
 * for a wizard to wrap one's noggin around.
 *
 * Heed these rules well, young wizard. For they are the rules of
 * thinking, and the rules of thinking are the rules of the universe.
 * If ye does not heed these rules, ye will be punished with an
 * entire day of debugging and hair pulling.
 */

This is real production code at Anthropic. Someone got paid to write 'wrap one's noggin around.'

#4

The Loading Verb Thesaurus

Loading Spinner Verbs (160+)

Instead of boring 'Loading...', Claude Code cycles through 160+ absurd verbs:

Lollygagging...Beboppin'...Boondoggling...Flibbertigibbeting...Hullaballooing...Clauding...Julienning...Prestidigitating...Razzle-dazzling...Quantumizing...Shenaniganing...Symbioting...Whatchamacalliting...Zesting...Discombobulating...Skedaddling...Bamboozling...Moseying...Dillydallying...Gallivanting...

'Prestidigitating' means performing magic tricks. Someone at Anthropic has a thesaurus and they're not afraid to use it.

#5

Tengu & The Feature Flag Zoo

Codename: Tengu

Internally, Claude Code is codenamed Tengu (a Japanese mythological creature). Every feature flag starts with tengu_:

🎯
tengu_scratchCoordinator
📅
tengu_thinkbackYear in Review
🐝
tengu_kairosAgent swarms
🦦
tengu_amber_stoatBuilt-in agents
🎨
tengu_surreal_daliRemote triggers
🐦
tengu_passport_quailSession memory
🏔️
tengu_glacier_2xrTool search
🌳
tengu_birch_trellisBash perms
🎭
tengu_miraculo_the_bardBG refresh
🦝
tengu_cobalt_raccoonAuto-compact
🏮
tengu_quartz_lanternFile writes
🔮
tengu_collage_kaleidoscopeImage paste
#6

Commands You Didn't Know Existed

Commands You Didn't Know Existed

/btw

Spawn a forked agent for your shower thought while the main conversation continues. The name is perfect.

/think-back

Your Year in Review. Like Spotify Wrapped, but for your coding sessions.

/stickers

Order physical Claude Code stickers. Yes, a CLI tool has merch.

/good-claude

When AI needs positive reinforcement too. Currently disabled but the name lives on.

/teleport

Change directory mid-session. Named after a video game ability, not boring 'cd'.

/bughunter

Unleash Claude as a dedicated bug hunter on your codebase.

The Coordinator Has a No-Permission Scratchpad

In coordinator mode, if the feature gate is on, workers get told about a scratchpad directory they can read and write without permission prompts.

coordinatorMode.ts
if (scratchpadDir && isScratchpadGateEnabled()) {
  content += `\n\nScratchpad directory: ${scratchpadDir}
Workers can read and write here without permission prompts.
Use this for durable cross-worker knowledge.`
}

So yes, multi-agent mode literally has a shared war room.

Internal Codenames: Not Just Tengu, but Bagel and Tungsten Too

bagel

The internal codename for the WebBrowser tool. State fields include bagelActive, bagelUrl, and bagelPanelVisible.

tungsten

The codename for the tmux panel subsystem. State includes tungstenActiveSession, tungstenLastCommand, and tungstenPanelAutoHidden.

Claude Code state reads like a breakfast menu colliding with a chemistry lab.

Even the Spinner Personality Is Configurable

The funniest part is that the spinner isn't just weird by default; users can append, replace, and override spinner behavior in config.

skills/bundled/updateConfig.ts
- spinnerTipsEnabled: Show tips in spinner
- spinnerVerbs: Customize spinner verbs
  { "mode": "append" | "replace", "verbs": [...] }
- spinnerTipsOverride: Override spinner tips
  { "excludeDefault": true, "tips": ["Custom tip"] }

So if you don't like 'Clauding...', you can invent your own spinner religion.

Best Comments in the Code

typescript
// Breaks the yoloClassifier → claudemd → filesystem → permissions cycle.
// bootstrap/state.ts:122

The ML auto-approve classifier is called 'yoloClassifier'. That name tells you everything.

typescript
// TODO: Clean up this hack
// utils/processUserInput/processBashCommand.tsx:48

A tale as old as time. That TODO is shipping in production right now.

typescript
// hasUnvalidatablePathArg → ask.
// This ends the KNOWN_SWITCH_PARAMS whack-a-mole
// tools/PowerShellTool/pathValidation.ts:74

The engineers play whack-a-mole with PowerShell params. They mentioned it twice. They're not having fun.

Architecture Hot Takes

BashTool = small OS

300KB+ of security code including AST parsing, ML classifier, regex, AND PowerShell validator. More security than most banks.

512K lines for a CLI

Linux 1.0 kernel was ~176K lines. Claude Code is 3x that. For a tool that runs in your terminal.

48-char function names

checkStatsigFeatureGate_CACHED_MAY_BE_STALE() — includes an apology in its own name. The analytics type is a full sentence.

MCP = framework in a framework

470KB, 25 files, 4 transport protocols, OAuth, progress tracking. It's an entire SDK bundled as a 'service'.

Auto-Dream: Claude's Subconscious

Claude Code has a background memory consolidation system that auto-triggers when thresholds are met — like dreaming.

Time Gate

24+ hours since last consolidation

📝
Sessions Gate

5+ new sessions created

🔒
Lock Gate

No other process consolidating

It fires a forked agent to run /dream, reads session transcripts, and updates memory files. Claude literally dreams.

The Math Behind Your Buddy Pet

Your companion pet isn't random — it's deterministically generated:

companion.ts
// Mulberry32 PRNG seeded with hash(userId + 'friend-2026-401')
// Bones (appearance) regenerated on every read — never persisted
// Soul (name, personality) stored in config — generated by Claude

Rarity distribution:
  common:    60%    (no hats)
  uncommon:  25%    (hats unlocked)
  rare:      10%
  epic:       4%
  legendary:  1%    (the holy grail)

Shiny chance: 1%   (independent of rarity)
Stats: DEBUGGING, PATIENCE, CHAOS, WISDOM, SNARK
  → one peak stat, one dump stat, rest scattered

Bones never persist, so you can't edit your config to get a legendary pet. Anthropic thought of that.

Commit Attribution: Who Wrote This?

Claude Code precisely tracks human vs Claude contribution per commit — 962 lines dedicated to this:

Character-Level Attribution

Uses common prefix/suffix matching to find the actual changed region, counts claudeContribution chars vs humanChars.

Undercover Mode

When committing to public repos, internal model codenames are sanitized to public names. Private repos keep internal variants.

The code documents a quadratic growth bug: '837 snapshots × 280 files → 1.15 quadrillion chars tracked for a 5KB file.' Fix: only use the last snapshot.

Computer Scientists Hidden in Session IDs

Session slugs are adjective-verb-noun. The noun list (415 words) hides computer science pioneers:

babbagedijkstralovelaceturingknuthhopperberners-lee

Generated using crypto.randomBytes() (cryptographic randomness), not Math.random(). Your session slug is cryptographically secure.

Load-Bearing 'DO NOT' Comments

These comments encode hard-learned lessons — each one has a bug story behind it:

// DO NOT ADD MORE STATE HERE - BE JUDICIOUS WITH GLOBAL STATE
// DO NOT push to the remote repository unless the user explicitly asks
// DO NOT CHANGE THIS TO CUMULATIVE — It would mess up the aggregation
// DO NOT set maxOutputTokens here. The fork piggybacks on main thread's
// DO NOT count Claude's autonomous codebase exploration

The last one is from /insights (3200 lines!) — it only counts user-initiated work, explicitly excluding 'Claude's autonomous codebase exploration.'

Fast Mode's Real Name: Penguin Mode

Fast Mode is internally codenamed 'Penguin Mode'. All variable names are penguin-themed:

penguinModeOrgEnabledOrg-level toggle
tengu_penguins_offKill-switch flag
/api/claude_code_penguin_modeAPI endpoint

The branded name is 'Opus 4.6' but the code is full of penguins. Why penguins? Nobody knows.

Speculation Engine: Claude Predicts Your Next Move

Claude Code has a background speculation system that pre-executes your likely next action before you type:

Copy-on-Write Overlay

Creates virtual filesystem at /tmp/claude/speculation/. Only copies files on write. Reads from main cwd otherwise.

Time Savings Feedback

Shows feedback like 'Speculated 3 tool uses · 2.5K tokens · +1m23s saved (2m18s this session)'.

Safety bounds: Speculation stops at file edits, non-read-only bash, denied tools. Max 20 turns or 100 messages.

The Compaction Agent's Rage

"CRITICAL: Respond with TEXT ONLY. Do NOT call any tools. Tool calls will be REJECTED and will waste your only turn — you will fail the task."

— compaction agent system prompt

The compaction agent's prompt SCREAMS in all caps. It wraps analysis in <analysis> tags that are stripped before delivery. Must cover 9 required sections — including verbatim quotes of user messages.

The Emotionally Intelligent Tip System

Claude Code tips aren't random — each has precise trigger conditions:

🐣

Start with small features or bug fixes

numStartups < 10 (newbie detected)

🎨

Use /color and /rename to tell sessions apart

countConcurrentSessions() >= 2

🌳

Use git worktrees for parallel Claude sessions

worktreeCount <= 1 && numStartups > 50 (power user)

🎟️

Share Claude Code and earn $X of extra usage

User hasn't visited /passes yet

Tips even have A/B tested copy (variant copy_a vs copy_b) and cooldown periods to prevent spam. This isn't a CLI, it's a growth hacking platform.

The Unicode Symbol Library

Claude Code curates a carefully chosen Unicode symbol library in figures.ts:

LIGHTNING_BOLTFast mode
○ ◐ ● ◉
EFFORT_*Effort levels
◇ ◆
DIAMOND_*Running/done
BLOCKQUOTE_BARQuote prefix
↑ ↓
ARROWSScroll hints
STARBuddy rarity
·
MIDDLE_DOTSeparators
ELLIPSISTruncation

How Strict Is the Suggestion Filter?

The prompt suggestion system's bar: 'Would they think I was just about to type that!' It filters 46+ patterns:

Evaluative comments
'Looks good', 'Nice work'
Claude-voice
'Let me...', 'I'll...'
New ideas user didn't ask for
'How about we also...'
Silence meta-reasoning
'(no suggestion needed)'

Allowed single-word suggestions: yes, push, commit, deploy, continue, check. Minimalism.

Learning Mode: Claude Makes YOU Write Code

Claude Code has a built-in Learning mode that deliberately stops and makes you write code — inserting TODO(human) markers in your files:

outputStyles.ts
// Learning Style Active
// Ask the human to contribute 2-10 line code pieces
// when generating 20+ lines involving:
// - Design decisions (error handling, data structures)
// - Business logic with multiple valid approaches
// - Key algorithms or interface definitions

// After user writes code:
"Share one insight connecting their code to broader
 patterns or system effects. Avoid praise or repetition."

An AI coding assistant that... deliberately refuses to write code for you. Peak pedagogical design. There's also an Explanatory mode that adds '★ Insight' blocks before and after every code change.

/good-claude & /issue: Carrot and Stick

😊
/good-claude

Auto-runs when employees give good feedback. Captures what went well. Ant-only.

😤
/issue

Auto-runs on bad feedback or swearing detected. Captures what went wrong.

Anthropic built a full positive/negative feedback loop. Claude accepts both praise and criticism. This is science.

Frustration Detector: Claude Knows You're Swearing

Claude Code has a regex that detects when you're angry. Yes, really.

userPromptKeywords.ts
const negativePattern =
  /\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|
  horrible|awful|piss(ed|ing)? off|
  piece of (shit|crap|junk)|
  what the (fuck|hell)|
  fucking? (broken|useless|terrible|awful)|
  fuck you|screw (this|you)|
  so frustrating|this sucks|damn it)\b/
😤
Detect

Match anger keywords

📋
Trigger

Show feedback survey

📤
Upload

Share transcript (with consent)

When Anthropic employees swear at Claude, it pops up 'Want to share this transcript?' It's an internal dogfooding feature — removed from external builds. So you can swear freely.

The Build Police: excluded-strings.txt

Claude Code has a CI/CD build step that scans the compiled bundle to prevent internal strings from leaking to the public npm package. This leads to hilarious workarounds:

🐛Pet names encoded in hex

String.fromCharCode(0x64,0x75,0x63,0x6b) instead of "duck". Because one pet name collides with a model codename.

🔑API key prefix assembled at runtime

['sk', 'ant', 'api'].join('-') — because writing 'sk-ant-api' directly trips the build checker!

📦Dynamic imports to dodge the checker

At least 6 files use dynamic import() instead of static imports specifically so modules with excluded strings can be tree-shaken out.

Telemetry: What Actually Gets Uploaded?

Good news: no code content or file paths. The type name says it all: AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS.

📊
Analytics

Datadog + 1P events. Boolean/number metadata only.

📈
Metrics

OpenTelemetry → BigQuery. OS type, version, arch. No code.

🔒
Secret Scanner

Scans BEFORE upload. Secrets never leave your machine.

Privacy controls: DISABLE_TELEMETRY disables analytics, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC disables ALL non-essential network traffic.

Session Slug Generator

Every session gets a random slug like calm-purring-clover

magicalwhimsicalcosmicdancingglowingquantumfuzzysparklinggentlemightydragonunicornphoenixoctopuscapybaranebulaaurorameadowcrystalstarlight

Somewhere right now, a production debug session is named 'fuzzy-dancing-capybara.'

Anti-ptrace Defense: Blocking GDB Memory Reads

upstreamproxy.ts
// In CCR containers, Claude Code calls:
prctl(PR_SET_DUMPABLE, 0)
// via Bun FFI → libc

// This prevents same-user processes from ptrace-ing
// (debugging/attaching to) the Claude Code process.

// Why? Session tokens live in heap memory.
// A prompt injection could run: gdb -p $PPID
// → attach to parent → dump heap → steal token

// After reading /run/ccr/session_token:
// DELETE the file. Token only exists in heap now.

OS-level security engineering. They're defending against prompt injection that can execute arbitrary shell commands.

caffeinate: Claude Won't Let Your Mac Sleep

preventSleep.ts
spawn('caffeinate', ['-i', '-t', '300'], { stdio: 'ignore' })

// -i = prevent idle sleep
// -t 300 = 5 min timeout (self-healing if Node dies)
// Restarts every 4 min (before 5 min timeout)
// Reference counting for nested subagents

You start a 30-min refactor, go grab coffee. Mac won't sleep. If Node gets SIGKILL'd, the orphan caffeinate exits after 5 min. Self-healing.

Opus 4.6 Was Once Called Fennec

migrateFennecToOpus.ts
// Ant-only migration script reveals internal codename:
if (model.startsWith('fennec-latest[1m]')) {
  updateSettings({ model: 'opus[1m]' })
} else if (model.startsWith('fennec-fast-latest')) {
  updateSettings({ model: 'opus[1m]', fastMode: true })
}

Fennec → Opus, Penguin → Fast Mode. Anthropic names features after animals. Migration scripts are living fossils of product evolution.

Undercover Mode: Anthropic Staff Go Incognito

undercover.ts
// UNDERCOVER MODE — CRITICAL
// You are operating UNDERCOVER in a PUBLIC repository.
// Do not blow your cover.
//
// NEVER include in commit messages:
// - Internal model codenames (animal names)
// - Unreleased model version numbers
// - The phrase "Claude Code" or mention you are AI
// - Co-Authored-By lines
//
// There is NO force-OFF. If we're not confident
// we're in an internal repo, we stay undercover.

Anthropic engineers may be committing to your open-source project right now, looking fully human. No AI traces. No off switch — the safe default is 'pretend to be human.'

The `date` Command Trap

date +%Y-%m-%d

Read: show current date ✓

date 0101120025

Write: SET system time ✗

Same command, different format = read vs write. BashTool checks if positional arg starts with '+'. hostname too: hostname -f = read, hostname myserver = write.

World's Longest Type Name (56 chars)

metadata.ts
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = never

// Every telemetry string must be cast:
// as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
//
// You can't type that without thinking about what you're sending.
// It's a speed bump — forces you to pause and verify.

Used hundreds of times across the codebase. Each is an explicit declaration: 'I checked — this is not user code.'

#10

Code Archaeology

Interesting Things Buried Deep in the Code

🪲// @ts-ignore on globals

Some files have /* global */ // @ts-ignore comment pairs at the top. This means someone gave up type safety for the entire file and documented both crimes on the same line.

🔢The 13K buffer magic number
typescript
// In compact/compaction.ts:
// Leave 13K token buffer for model response headroom
const COMPACTION_BUFFER_TOKENS = 13_000;

13,000 appears in the compaction system as a hardcoded buffer. No comment explains why 13K and not 10K or 15K. Somewhere an experiment produced this number, and now it lives forever.

🌀Hidden gems in the 160+ loading verbs

Includes 'Clauding' (making the tool name a verb), 'Prestidigitating' (performing magic tricks), and 'Flibbertigibbeting' (behaving in a frivolous manner). Someone opened a real dictionary and wrote all of these.

#11

Design Decisions That Surprised Us

Why They Made These Specific Choices

🌳Why BashTool uses tree-sitter AST instead of regex

Regex parsing of shell commands fails on cases like rm -rf $(cat /etc/hosts). tree-sitter gives you an actual AST, so you can see subshell substitutions, pipe chains, and quoting. The right way to do security, which is also why BashTool has 300KB of security code.

🧊Why the system prompt is frozen for caching

CacheSafeParams freezes the system prompt at fork time. That means the subagent's system prompt bytes are byte-identical to the parent — triggering automatic prompt cache hits. Upside: subagents are essentially free (you only pay for the dynamic tail). Downside: you cannot mutate the system prompt after forking.

📦Why there are 4 compaction strategies instead of 1

micro (delete unimportant messages), auto (AI summary), snip (delete from middle), collapse (fold conversation into summary). Each works best in different conditions: micro for minimal performance impact, auto for best accuracy, snip for task continuity, collapse for fresh start. One size doesn't fit all.