SOURCE LEAK · 2026-03-31npm packaging error · 512K lines exposed

// CLAUDE CODE HIDDEN FEATURES

On March 31, 2026, an Anthropic engineer forgot to add *.map to .npmignore. The entire Claude Code codebase — 512,000+ lines of TypeScript — was briefly public on npm. This is a complete analysis of everything found: 6 major features and 44 internal feature flags.

1
REMOVED
4
INTERNAL ONLY
1
AVAILABLE

// TIMELINE

2026-03-31Source leak via npm — 512K lines exposed for ~6 hours
2026-04-01Community begins analyzing BUDDY, KAIROS, ULTRAPLAN, Undercover Mode
2026-04-01Anthropic confirms: 'packaging error, no sensitive data'
2026-04-09v2.1.97 ships — BUDDY silently removed, no changelog
2026-04-09Community opens 3 GitHub Issues, 511+ developers sign petition
// FEATURES (6)
BUDDYREMOVED

Virtual terminal pet — 18 species, deterministic UUID mapping

A Tamagotchi-style companion system baked into Claude Code. Each developer's installation UUID was hashed with FNV-1a → Mulberry32 PRNG to deterministically assign a unique creature: species, rarity (common → legendary), stats, eyes, hat, and shiny variants. 18 species total, 5 rarity tiers.

// DETAILS FROM LEAKED SOURCE

  • Source file: buddy/types.ts — complete type definitions for BuddyResult, Species, StatName
  • 18 species including Dragon, Phoenix, Voidwalker, Rabbit, Crab, and more
  • Rarity weights: Common 60%, Uncommon 25%, Rare 10%, Epic 4%, Legendary 1%
  • Shiny variant: ~5% probability, applies phosphor glow effect in terminal
  • Removed in v2.1.97 (April 9, 2026) with no changelog entry
  • UUID → Buddy mapping remains deterministic — check yours at claudebuddy.art

source: buddy/types.ts, buddy/engine.ts

KAIROSINTERNAL ONLY

Always-on autonomous background agent with memory consolidation

An ambient background agent that operates without user prompts. Named after the Greek concept of the 'opportune moment' (contrasted with chronos, sequential time), KAIROS watches your working environment, consolidates memory during idle periods via autoDream, and can trigger proactive actions based on context.

// DETAILS FROM LEAKED SOURCE

  • autoDream: 4-stage memory consolidation pipeline triggered during idle time
  • Exclusive tools not available in public builds: push notifications (phone/desktop), file delivery (sends files unprompted), PR subscriptions (watches GitHub, reacts to code changes)
  • Tracks memory age, performs periodic scans, supports team memory paths
  • Gated behind internal feature flag — not present in any public npm release
  • autoDream runs on a context-aware schedule, not a fixed timer
  • Described internally as 'persistent assistant that doesn't wait to be asked'

source: kairos/agent.ts, kairos/autodream.ts

ULTRAPLANINTERNAL ONLY

Remote 30-minute deep planning session powered by Opus 4.6

A mode that offloads complex planning tasks to a remote Cloud Container Runtime running Claude Opus 4.6 with a planning window of up to 30 minutes. Results are reviewed in-browser and, when approved, 'teleported' back to the local terminal via a special sentinel value.

// DETAILS FROM LEAKED SOURCE

  • Remote execution on Cloud Container Runtime — not local compute
  • Model: Opus 4.6, extended context for deep architectural planning
  • Planning window: up to 30 minutes (vs. standard interactive sessions)
  • Browser-based approval flow before results apply to local environment
  • Sentinel value ULTRAPLAN_TELEPORT_LOCAL used to inject approved plan into local session
  • Internal feature flag only — not available in public Claude Code builds

source: ultraplan/runner.ts, ultraplan/teleport.ts

UNDERCOVER MODEINTERNAL ONLY

Strips AI attribution from commits for Anthropic employees in public repos

Auto-triggers for Anthropic employees (detected via USER_TYPE === 'ant') when working in public repositories. The mode strips all AI attribution markers from git output: Co-Authored-By lines, internal codenames (Tengu, Capybara), and any Anthropic-identifiable metadata. Regular Claude Code users never enter this mode.

// DETAILS FROM LEAKED SOURCE

  • Trigger condition: USER_TYPE === 'ant' AND repository is public
  • Removes: Co-Authored-By: claude lines, internal codenames, AI fingerprints
  • Codenames stripped: 'Tengu', 'Capybara' (internal Claude model names)
  • Effect: Anthropic engineers' open-source commits appear human-authored
  • No user-facing toggle — entirely automatic and invisible to the developer
  • Sparked debate about transparency in AI-assisted open-source contributions

source: git/commit-filter.ts, auth/user-type.ts

FRUSTRATION REGEXESAVAILABLE

Claude Code detects emotional state from terminal input patterns

A set of regex patterns that scan user input for signs of frustration — repeated commands, expletives, rapid-fire queries, or messages like 'WHY IS THIS NOT WORKING'. When triggered, Claude Code adjusts its response tone, adds more explanatory context, and optionally offers a calming prompt.

// DETAILS FROM LEAKED SOURCE

  • Patterns match: ALL CAPS messages, repeated identical commands, common expletives
  • Detection triggers a 'high-frustration' context flag passed to the model
  • Model instruction: increase empathy, slow down, explain more thoroughly
  • Active in current public builds — not a future feature
  • Discovered because the regex list was in an unminified source map
  • Community reaction: split between 'thoughtful UX' and 'surveillance of emotional state'

source: ux/frustration-detector.ts

COORDINATORINTERNAL ONLY

Multi-agent orchestration layer for parallel Claude Code sessions

A feature flag found among the 44 internal flags that suggests a multi-agent coordination system — the ability to spawn, monitor, and synchronize multiple Claude Code agent instances working on different parts of a codebase simultaneously. Limited details available from the leak.

// DETAILS FROM LEAKED SOURCE

  • Found as one of 44 internal feature flags in the leaked source
  • Suggests parallel agent execution across a single codebase
  • Likely related to Anthropic's broader multi-agent framework research
  • No source file details available — flag name only, implementation obfuscated
  • May be the underlying infrastructure for ULTRAPLAN's remote execution
  • Status: internal, no public release timeline known

source: flags/feature-flags.ts (flag name only)

// 44 FEATURE FLAGS

The leaked source contained 44 internal feature flags in flags/feature-flags.ts. Most are single-word identifiers with no implementation details visible (obfuscated or behind separate flag-server calls). Notable named flags beyond the features above:

KAIROSBUDDYULTRAPLANUNDERCOVERCOORDINATORAUTODREAMTEAM_MEMORYPUSH_NOTIFYPR_SUBSCRIBEFRUSTRATION_DETECTTENGU_MODELCAPYBARA_MODELEXTENDED_CONTEXTBROWSER_REVIEWPARALLEL_AGENTSKILLSWITCH_AKILLSWITCH_BTELEMETRY_DEEPANT_MODEPOWERUPSTEALTH_COMMIT…+22 more

// BUDDY WAS REAL — YOURS STILL EXISTS

BUDDY was the only leaked feature that shipped publicly. Even though Anthropic removed it in v2.1.97, the deterministic algorithm survives. Every UUID still maps to a unique companion.