← all repositories
mylxsw/cc-src-learning

Claude Code leaked. Here's the engineering autopsy.

A five-chapter teardown of Claude Code's leaked source, translating its agent architecture, tool systems, and prompt engineering into a field guide for AI application builders.

cc-src-learning
Not currently ranked — collecting fresh signals.
star history

What it does

This repository is a systematic, multi-chapter analysis of the leaked Claude Code command-line tool source code. Written in Chinese, it walks through the codebase as a case study in production AI agent engineering—covering directory structure, agent modules, permission systems, and prompt design. The author treats the leak as an accidental textbook, extracting patterns for developers who want to build similar AI applications.

The interesting bit

Instead of simply summarizing files, the project reverse-engineers design intent: why the tool asks for explicit permissions, how prompts are layered and cached (static versus dynamic), and how sub-agents and a “Lego-like” tool system cooperate. It even dissects the QueryEngine, IDE-to-CLI bridge, and conditional compilation via feature flags.

Key highlights

  • Four analytical lenses: codebase structure, design philosophy, architecture implementation, and prompt engineering.
  • Deep dives into the Agent module, slash commands, sub-agents, skills, plugins, and service layers handling API, MCP, and OAuth.
  • Implementation specifics including parallel preloading for startup speed and feature-flag-based conditional compilation.
  • A full chapter on prompt mechanics: system prompt construction, tool descriptions, and a static/dynamic caching split.
  • Explicitly labeled as AI-generated content that may contain inaccuracies.

Caveats

  • The entire analysis is AI-generated and carries a clear disclaimer that details may be inaccurate or fabricated.
  • It studies leaked, unofficial source code, so the findings reflect a snapshot of unknown age and provenance.
  • The README briefly mentions “Cloud Code” in the opening quote while otherwise discussing Claude Code, leaving the exact source slightly ambiguous.

Verdict

Useful if you’re designing a CLI AI agent and want a structured, third-party dissection of a mature codebase. Avoid if you require authoritative, first-party documentation—this is educated guesswork based on unofficial code.

Frequently asked

What is mylxsw/cc-src-learning?
A five-chapter teardown of Claude Code's leaked source, translating its agent architecture, tool systems, and prompt engineering into a field guide for AI application builders.
Is cc-src-learning open source?
Yes — mylxsw/cc-src-learning is open source, released under the MIT license.
How popular is cc-src-learning?
mylxsw/cc-src-learning has 511 stars on GitHub.
Where can I find cc-src-learning?
mylxsw/cc-src-learning is on GitHub at https://github.com/mylxsw/cc-src-learning.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.