Skip to content

Hidden Features

Claude Code has more features than the documentation shows. Some are feature-gated, some are Easter eggs, some are quietly powerful. Here’s what’s worth knowing.


Buddy Companion System

The codebase includes a fully functional virtual pet system. Not a prototype — a production-grade Tamagotchi built into the terminal UI.

PropertyDetail
Species count18 distinct species
Rarity tiers5 tiers (see table below)
Species assignmentDeterministically derived from your user ID — same account = same species every time
Stats trackedHunger, happiness, energy, hygiene, social
Cosmetics8 hat types
RenderingASCII art via the custom Ink terminal framework
Sprite code~46,000 lines of ASCII sprite definitions
PersistenceStored in config — companion state survives CLI restarts

Rarity tiers:

TierRarityApproximate Frequency
CommonAbundant~40% of users
UncommonOccasional~30% of users
RareInfrequent~18% of users
EpicScarce~9% of users
LegendaryExtremely rare~3% of users

Because species are derived from your user ID, your companion is unique to you but consistent — you won’t get a different species if you reinstall. Two users on the same account see the same pet.

Why does this exist? It is not a gimmick bolted on later. The sprite code, stat system, and persistence layer represent weeks of deliberate engineering. It signals the level of craft applied throughout the codebase — and suggests the team views developer experience as something worth investing in beyond raw utility.


Magic Docs

Any markdown file with a # MAGIC DOC: header is automatically kept in sync by a background agent as your conversation progresses.

FUNCTION magicDocAgent(docPath):
// Restricted agent — cannot use Bash, web access, or spawn subagents
// Only has access to: FileRead, FileWrite, FileEdit
permissions = {
bash: false,
webSearch: false,
spawnAgents: false,
fileEdit: true // only this doc and files explicitly referenced
}
// Monitors conversation for relevant changes
// When code is discussed that affects the doc's scope:
OBSERVE conversation
IF relevantChangeDetected(conversation, docScope):
currentDoc = FileRead(docPath)
updatedDoc = applyChanges(currentDoc, change)
FileWrite(docPath, updatedDoc)

How to activate: Add # MAGIC DOC: [Title] as the very first line of any markdown file in your project. The agent infers scope from the title and file content — an ARCHITECTURE.md file with # MAGIC DOC: Architecture will track architecture-relevant discussion; an API_SPEC.md will track API changes.

Security model: The background agent has no bash, no web access, and cannot spawn further agents. It is restricted to file-editing only. This is intentional — a doc-maintenance agent with shell access would be a significant privilege escalation risk.

Practical use cases:

FileWhat Gets Auto-Updated
ARCHITECTURE.mdComponent descriptions, data flow changes, new dependencies
API_SPEC.mdNew endpoints, changed signatures, added parameters
CHANGELOG.mdImplemented features, fixed bugs, breaking changes
DECISIONS.mdDesign decisions made during the conversation
ONBOARDING.mdSetup steps, new dependencies, changed commands

Magic Docs are available in current public builds — no feature flag required. The # MAGIC DOC: header is the only activation mechanism.


Feature Flags

Approximately 20 compile-time flags control capability access. In public builds, all flags return false. The result: roughly 30% of the codebase’s capabilities are present in the binary but inaccessible.

FlagWhat It Controls
COORDINATOR_MODEMulti-agent coordinator pattern — orchestrates agent teams
FORK_SUBAGENTGit worktree fork agents — each subagent gets its own worktree
KAIROSSession transcripts — structured logging of full session content
KAIROS_DREAMDream memory task — background memory consolidation between sessions
REACTIVE_COMPACTEmergency mid-turn compaction when context overflows unexpectedly
CONTEXT_COLLAPSERead-time context projection — collapses old messages without deleting them
VOICE_MODEVoice input and output — microphone capture + TTS playback
TRANSCRIPT_CLASSIFIERAuto mode LLM classifier — routes requests to optimal model automatically
WORKFLOW_SCRIPTSScripted workflow execution — define multi-step pipelines declaratively
AGENT_TRIGGERSCron scheduling + remote triggers — run Claude Code on a schedule or webhook
flowchart LR BIN["Claude Code Binary\n(all feature code present)"] subgraph FLAGS["Compile-time flags"] F1["Public builds\nAll flags = false"] F2["Enterprise builds\nSelected flags = true"] F3["Internal builds\nAll flags = true"] end BIN --> F1 BIN --> F2 BIN --> F3 F1 -->|"~70% capabilities\naccessible"| PUB["Public experience"] F2 -->|"~85% capabilities\naccessible"| ENT["Enterprise experience"] F3 -->|"~100% capabilities\naccessible"| INT["Internal experience"] style BIN fill:#1e293b,color:#7dd3fc,stroke:#334155 style F1 fill:#1e293b,color:#94a3b8,stroke:#334155 style F2 fill:#1e293b,color:#fcd34d,stroke:#334155 style F3 fill:#1e293b,color:#86efac,stroke:#334155 style PUB fill:#1e293b,color:#94a3b8,stroke:#334155 style ENT fill:#1e293b,color:#fcd34d,stroke:#334155 style INT fill:#1e293b,color:#86efac,stroke:#334155 style FLAGS fill:#1e293b,color:#94a3b8,stroke:#334155

Some flags have already been partially released — REACTIVE_COMPACT and CONTEXT_COLLAPSE are referenced in the Context & Memory layer as Layer 4/5 defenses. They ship in public builds under those flags, activated by specific error conditions rather than user config.

Deep Dive: How Feature Flags Work at the Code Level

The flag system is a single module queried throughout the codebase:

FUNCTION isEnabled(flag: FeatureFlag): boolean:
// In public builds: always returns false
// In flagged builds: reads from compiled flag table
RETURN FEATURE_FLAG_TABLE[flag] ?? false
// Usage pattern throughout the codebase:
IF isEnabled(FeatureFlag.VOICE_MODE):
registerVoiceInputHandler()
registerVoiceOutputHandler()
// else: voice code never runs, but is present in binary
IF isEnabled(FeatureFlag.AGENT_TRIGGERS):
startCronScheduler()
registerWebhookListener()

Because the check is a simple boolean, the compiled binary contains all the implementation code for every flagged feature. A binary analysis of the public build reveals the full feature set — which is how the community has catalogued what’s coming.


Undercover Mode

For Anthropic employees working on public-facing repositories, an “undercover mode” strips internal signals from commits and pull requests.

FUNCTION applyUndercoverMode(commitMessage, diffOutput):
IF isAnthropicEmployee(currentUser) AND isInUndercoverRepoAllowlist(currentRepo):
// Remove model codenames from commit messages
commitMessage = redactModelCodenames(commitMessage)
// Strip version strings that reveal internal build info
commitMessage = redactInternalVersionStrings(commitMessage)
// Remove references to internal tooling not visible externally
diffOutput = stripInternalToolingRefs(diffOutput)
// Remove internal system prompt fragments if accidentally included
diffOutput = redactSystemPromptFragments(diffOutput)
RETURN { commitMessage, diffOutput }

Activation is automatic — it triggers by matching the current repo against an internal allowlist of known Anthropic public repositories (e.g., anthropics/claude-code, anthropics/anthropic-cookbook). No manual toggle required.

This is a safety feature built into the tool itself — preventing accidental leakage of model codenames, internal versioning, or system prompt text that might appear in a diff comment or commit message during normal development.


Why This Matters to You

  • Watch for feature flags being enabled in future releases — the Voice Mode, Workflow Scripts, and Agent Triggers flags represent substantial capability that already exists in the binary, waiting for a release decision
  • Magic Docs is available today — add # MAGIC DOC: to any project markdown file and it will stay in sync without any additional configuration
  • The buddy system is evidence of engineering culture — a team that builds a 46K-line ASCII sprite system for a terminal pet is a team that invests in craft; the same attention shows up in the parts you do depend on
  • If you’re on an Enterprise plan, ask your account team about available feature flags — some are already enabled for enterprise customers on request
  • The Undercover Mode pattern is reusable — if you’re building internal tooling that touches public repos, the same pattern (allowlist + automatic redaction) is worth considering for your own commit hooks

See also: Architecture OverviewThe Agent Loop