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.
| Property | Detail |
|---|---|
| Species count | 18 distinct species |
| Rarity tiers | 5 tiers (see table below) |
| Species assignment | Deterministically derived from your user ID — same account = same species every time |
| Stats tracked | Hunger, happiness, energy, hygiene, social |
| Cosmetics | 8 hat types |
| Rendering | ASCII art via the custom Ink terminal framework |
| Sprite code | ~46,000 lines of ASCII sprite definitions |
| Persistence | Stored in config — companion state survives CLI restarts |
Rarity tiers:
| Tier | Rarity | Approximate Frequency |
|---|---|---|
| Common | Abundant | ~40% of users |
| Uncommon | Occasional | ~30% of users |
| Rare | Infrequent | ~18% of users |
| Epic | Scarce | ~9% of users |
| Legendary | Extremely 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:
| File | What Gets Auto-Updated |
|---|---|
ARCHITECTURE.md | Component descriptions, data flow changes, new dependencies |
API_SPEC.md | New endpoints, changed signatures, added parameters |
CHANGELOG.md | Implemented features, fixed bugs, breaking changes |
DECISIONS.md | Design decisions made during the conversation |
ONBOARDING.md | Setup 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.
| Flag | What It Controls |
|---|---|
COORDINATOR_MODE | Multi-agent coordinator pattern — orchestrates agent teams |
FORK_SUBAGENT | Git worktree fork agents — each subagent gets its own worktree |
KAIROS | Session transcripts — structured logging of full session content |
KAIROS_DREAM | Dream memory task — background memory consolidation between sessions |
REACTIVE_COMPACT | Emergency mid-turn compaction when context overflows unexpectedly |
CONTEXT_COLLAPSE | Read-time context projection — collapses old messages without deleting them |
VOICE_MODE | Voice input and output — microphone capture + TTS playback |
TRANSCRIPT_CLASSIFIER | Auto mode LLM classifier — routes requests to optimal model automatically |
WORKFLOW_SCRIPTS | Scripted workflow execution — define multi-step pipelines declaratively |
AGENT_TRIGGERS | Cron scheduling + remote triggers — run Claude Code on a schedule or webhook |
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 Overview — The Agent Loop