Anthropic just accidentally leaked their entire Claude Code source in an npm package. I went through the repo. Boy, is it messy. But it was also a fun read, and they've spoiled some upcoming releases.
Under the hood
- Anti-distillation: ANTI_DISTILLATION_CC injects fake tool definitions into API requests. If someone scrapes the traffic to train a competing model, they get poisoned data.
- Undercover Mode: When Anthropic engineers use Claude on open-source repos, it prevents the AI from revealing itself or leaking codenames. Commits look human. No force-off switch.
- Client attestation: every API request includes a computed hash to verify it came from a real install, not a wrapper or scraper.
- They detect user frustration with a hardcoded regex chain for swear words. Not an LLM call (if anyone from Anthropic is reading this, you forgot 'jfc').
The unreleased features
- "Dream" system: a background memory consolidation engine. Three-gate trigger (24h since last dream + 5 sessions + consolidation lock). Four phases: orient, gather, consolidate, prune. The prompt literally says "You are performing a dream." Read-only access to your project. It's purely reflective.
- KAIROS: always-on Claude that doesn't wait for you to type. It watches, logs, and proactively acts on things it notices. 15-second blocking budget so it doesn't annoy you. Gets exclusive tools like PushNotification and SubscribePR.
- Coordinator Mode: turns Claude Code into a multi-agent system. Research workers run in parallel, a coordinator synthesizes, implementation workers execute per spec, verification workers test. The prompt bans lazy delegation: "Do NOT say 'based on your findings.' Read the actual findings."
- BUDDY: a full Tamagotchi pet system. 18 species across 5 rarity tiers. Gacha mechanics. Shiny variants. Stats including CHAOS, SNARK, and DEBUGGING. A possible April fools easter egg.
- ULTRAPLAN: offloads complex planning to a remote Opus session with 30 minutes of thinking time.
The internal culture
- Model codenames: Tengu is Claude Code's internal project name (hundreds of feature flags start with tengu_). Fennec was the predecessor to Opus (migration path: fennec-latest → opus). Capybara is the model behind Opus 4.6 (hex-encoded in the buddy system to dodge build canaries). Opus-4-7 and Sonnet-4-8 are referenced as planned future versions.
- The permission system has a mode called "yolo" which ironically means deny-all.
Everyone's debating whether this matters. "It's just a client, there's no moat." Maybe. But every competitor now has a detailed blueprint of the most popular AI coding agent. The architecture, the feature roadmap, the multi-agent patterns, and the prompt engineering. Any team can point an agent at this repo and have a full summary in 20 minutes, just like I did.
The leading AI labs now have to decide whether to look at the most useful codebase that just landed in their lap, or pretend they didn't see it. We all know what they'll do.