Around March 31, 2026, it became widely known that parts of Claude Code CLI’s implementation could be reconstructed from source maps remaining in its npm package. While not an official open-source release by Anthropic, an analysis of this reconstructed source has shed light on its core design characteristics.
The initial striking observation was the sheer size of the codebase. The reconstructed source revealed approximately 1,900 files and about 510,000 lines of code. This is not a small, single-purpose CLI, but rather a substantial product codebase that integrates terminal UI, tool execution, safety controls, IDE integration, memory, and extension mechanisms into a cohesive system.
Technically, the project is centered on TypeScript, utilizes Bun as its runtime, and employs a React/Ink-style stack for its terminal user interface. This technical foundation suggests it's less of “a small CLI with some AI added on top” and more akin to “a substantial TypeScript product with a sophisticated AI experience layered into it.”
Regarding prompt construction, a significant finding was that a surprisingly large portion of the system instruction layer resides within the client-side code, where runtime context is subsequently injected. This runtime context encompasses elements such as the current date, Git state, recent commits, Git user information, and contents from local instruction files. These components, along with additional instructions and memory-related text, are then composed into something closely resembling the final system prompt.
This is particularly noteworthy because it challenges the intuitive assumption that “the real prompt must be assembled as a black box on the server side.” While it doesn't preclude additional server-side processing, it distinctly demonstrates that a significant amount of prompt logic is executed on the client side.
Another prominent aspect of the design is the distinct layering for tool management: one layer dictates which tools are exposed to the model, and a separate layer manages their execution permissions. The system is clearly feature-rich, yet maintains a sharp distinction between routinely exposed tools and those designated as internal, controlled by feature flags, or otherwise conditionally available.