Click any tag below to further narrow down your results
Links
The article breaks down the recently leaked source code of Anthropic's Claude Code CLI. It highlights the system's architecture, design choices, and differences from OpenAI's Codex, particularly in handling context overflow and user interactions. Key features like compaction strategies and internal versus external user instructions are explored.
- Claude Code uses a four-tiered compaction strategy (proactive token monitoring, reactive fallback, and a "snip compaction" mode for headless sessions) versus Codex's simpler diff-based approach that just minimizes data sent per turn
- The system prompt uses a boundary marker to cache roughly 3,000 tokens of static instructions across users for performance gains
- Internal users get specialized instructions specifically designed to stop the model from misrepresenting test results or giving misleading status updates
- The codebase includes feature flags and build-time checks specifically to prevent sensitive information from leaking into public builds
The entire source code for Anthropic’s Claude Code CLI has leaked due to an internal error during a package release. This includes nearly 2,000 TypeScript files and over 512,000 lines of code, exposing the application’s inner workings to competitors and developers. Anthropic has acknowledged the mistake and stated it was not a security breach.
- A packaging error in Claude Code v2.1.88 exposed a source map, leaking the entire ~2,000-file, 512,000+ line TypeScript codebase.
- The leaked code was quickly archived and uploaded to GitHub, gaining tens of thousands of forks within a short time.
- Anthropic says no customer data was exposed and calls it human error, not a security breach, while adding safeguards.
- Developers have already begun reverse-engineering internals, like Claude Code's memory architecture and background memory rewriting system.