Inside Claude Code: Hidden AI Agent Features Unveiled from the Source Leak

A deep technical dive reveals Claude Code's secret Buddy system, Auto‑Dream memory consolidation, the always‑on KAIROS mode, and powerful Ultra planning and review tools, exposing how Anthropic’s AI agent architecture works and why the recent source leak matters for developers worldwide.

AI Code to Success
AI Code to Success
AI Code to Success
Inside Claude Code: Hidden AI Agent Features Unveiled from the Source Leak

Overview

Accidental publication of the Claude Code npm package omitted the .map source‑map files, exposing roughly 510,000 lines of unminified, commented TypeScript source. The source reveals internal agent architecture that was not publicly documented.

Buddy System ("Shiny" Edition)

Located in src/buddy, the code defines 18 creature prototypes. Each prototype has five attributes and a rarity tier distribution: Common 60%, Rare 25%, Epic 10%, Legendary 1%. Additionally, there is a 1% chance of a “Shiny” variant. The assigned Buddy is deterministic, derived from a hash of the user’s UserID.

Claude Code Buddy illustration
Claude Code Buddy illustration

Auto‑Dream Mechanism

The flag tengu_onyx_plover activates Auto‑Dream. When the agent has no pending tasks, it launches a background “sleep‑time compute” process that scans the /memory logs, deduplicates entries, corrects errors, and compresses conversation fragments. This implements long‑term memory consolidation, mitigating the common “memory drift” problem in AI agents.

KAIROS – Always‑On Digital Companion

Codename “Always‑On Claude”. The agent continuously monitors the developer’s codebase, generates daily logs, pushes proactive notifications, and can predict next steps without explicit commands. During nightly “sleep memory consolidation”, it aggregates the day’s fragmented logs, compresses them, and stores them as stable long‑term memory.

KAIROS always‑on mode diagram
KAIROS always‑on mode diagram

Ultra‑Prefixed Functions

Two unreleased commands were discovered:

Ultraplan – invoked via /ultraplan. Triggers an unreleased Opus 4.6/4.7 model to run a 30‑minute cloud‑based simulation of multiple project trajectories, providing deep planning insights.

Ultrareview – invoked via /ultrareview. Spins up a cluster of 5‑20 agents that concurrently audit code from diverse perspectives for 10‑25 minutes, returning an exhaustive review report.

Additional Hidden Capabilities

Undercover Mode

When operating in non‑whitelisted repositories, the agent deliberately hides AI footprints by mimicking human commit patterns and omitting “Co‑authored‑by” metadata.

Teleport – Cross‑Machine Context Transfer

Packages the entire session context—including local variables and execution stack—allowing a developer to pause work on one machine and resume seamlessly on another without syncing the codebase.

UDS Inbox – Multi‑Agent Messaging

Provides an inter‑process mailbox ( UDS Inbox) that enables distinct agent instances to exchange messages and files, facilitating autonomous collaboration (e.g., one agent handles architecture while another writes code).

Implications

The leak appears to be an accidental omission rather than a deliberate open‑source release; Anthropic has issued DMCA takedown notices to remove forked repositories. Nevertheless, the disclosed architecture offers a concrete reference for handling long contexts, secure shell execution, and multi‑agent collaboration, which may shape the next generation of AI‑assisted development tools.

AI agentsBuddy systemAnthropicClaude Codesource analysisKAIROSAuto-dreamUltra planning
AI Code to Success
Written by

AI Code to Success

Focused on hardcore practical AI technologies (OpenClaw, ClaudeCode, LLMs, etc.) and HarmonyOS development. No hype—just real-world tips, pitfall chronicles, and productivity tools. Follow to transform workflows with code.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.