mylxsw/cc-src-learning: a five-part study of the leaked Claude Code source
透过 Claude Code 的源码,我们学到了什么?
At a glance
- What is it?
- This repository is not software you install. It is a set of five Markdown chapters that read the leaked Claude Code source and extract its architecture, tool design and prompt engineering, with an explicit AI-generated disclaimer attached.
- Who is it for?
- Read mylxsw/cc-src-learning if you want a structured tour of how a production CLI agent is put together and you accept that the text is a generated analysis of a leaked codebase rather than vendor documentation. Skip it if you need a runnable implementation, an installable package, or an authoritative statement of what Anthropic intended.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 167 days ago.
- What is it written in?
- GitHub does not report a main language for this repository.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What mylxsw/cc-src-learning actually is, and who should read it
The repository contains five Markdown files and an assets directory. That is the whole deliverable. There is no package manifest, no build script, no test suite and no entry point that executes. The README describes the project as originating from a systematic research article and states that it analyses Claude Code across four dimensions: codebase structure, design philosophy, architecture and implementation, and prompt engineering. A fifth chapter collects lessons for developers.
The intended reader is someone building an AI coding tool or an agent framework who wants to see how a shipped product organises itself. The README frames the payoff that way: whether you want to understand how to build an AI application or learn engineering practice, the material is aimed at you. It is not aimed at someone who wants to use Claude Code. Nothing here installs a CLI, and nothing here runs an agent.
One detail deserves attention before anything else. The README carries a disclaimer stating that the article and its illustrations were generated by an AI agent and may contain inaccuracies. Treat the chapters as a reading aid over a codebase, not as a specification. Every structural claim in the text is a claim about source that the reader cannot verify from this repository alone, because the source itself lives in a separate repository referenced from the README.
How the five chapters are organised, from directory layout to prompt assembly
The chapter files are numbered and named in Chinese, and the top-level listing confirms the sequence: macro view of the codebase and core modules, design philosophy, architecture and implementation, the art of prompting, and lessons for developers.
Chapter one covers the overall directory organisation and the architecture of the Agent module. Chapter two is the design chapter, and its subsections are the most concrete part of the outline: a tool system compared to Lego bricks, slash commands as a chat-like interaction model, the permission system and why it prompts for approval, sub-agents and multi-agent collaboration, a Skill system for turning repeated operations into reusable capabilities, and a plugin system for extension. Chapter three moves to runtime concerns: the QueryEngine and how the AI is invoked, a bridge system for IDE-to-CLI communication, a service layer covering API, MCP and OAuth, startup optimisation through parallel preloading, conditional compilation via feature flags, and a first look at code size and directory structure. Chapter four is about prompts: what a system prompt is, how prompts are assembled in layers, per-tool prompts, why static and dynamic content are separated for caching, worked examples for Git operations and file editing, and general principles. Chapter five draws conclusions for developers.
That outline is a reasonable map of the questions anyone reverse-engineering an agent CLI would ask. The weakness is depth signalling: a subsection titled around prompt caching or feature flags could be a paragraph or several pages, and the README gives no indication which. The table of contents promises breadth across four large topics in five files.
Reading it locally: what the repository gives you to work with
There is nothing to install. The repository has no package manifest, no scripts and no documented command for building or serving the chapters. The README points to the five Markdown files and to a separate repository, mylxsw/claude-code, described as holding the complete code, which is where you go when a chapter cites a file you want to see for yourself. Beyond that, the README documents no clone command, no preview command and no tooling of any kind.
What you have is the file listing. The top-level entries are 01-宏观视角:代码库结构与核心模块.md, 02-设计理念:它是如何思考的.md, 03-架构与实现:它是怎么干活的.md, 04-Prompt的艺术:如何让AI正确做事.md, 05-给开发者的启示.md, LICENSE, README.md and assets/.
Because the filenames contain Chinese characters, a terminal with a non-UTF-8 locale may render them as escape sequences rather than readable text. That is a display issue, not a file access issue, and the files remain readable by path. The README also does not document a table of contents generator, a link checker or any other tooling, so the cross-file links in the outline are maintained by hand and may break as files are renamed.
The repository publishes no releases, so there is no version to pin. If you want a stable reference for a citation, record the commit hash you cloned.
The provenance problem: leaked source, generated analysis, no vendor review
The README states plainly that the Claude Code source was leaked and that this presented an opportunity to examine how a top-tier AI application is built. That origin shapes what the document can and cannot be. It is a study of a snapshot of code obtained without the vendor's involvement, and the README's own disclaimer says the text and illustrations were produced by an AI agent and may be inaccurate.
Two consequences follow. First, nothing here reflects Anthropic's intent. Where a chapter explains why the permission system asks for approval before an action, that is the author's reading of the code, not a design document. Second, the code being described is a moving target. The README does not state which version of Claude Code was leaked, and the repository has no releases or tags that would let you match a chapter to a specific build. A reader comparing the study against a current installation may find that modules described in chapter three no longer exist under those names.
The honest use of this repository is as a source of hypotheses. A claim about layered prompt assembly or parallel preloading is worth reading, and worth checking against the linked code repository before you repeat it. It is not citable as evidence of how Claude Code works today.
Maintenance is also worth stating as a fact rather than a judgement. The last push to the default branch was on 2026-04-01. The repository is not archived, but the README does not describe a contribution process, a changelog, or a plan to track upstream changes.
Where a Markdown study loses to a real code walkthrough
The obvious alternative is not another article. It is reading the source directly. If the linked mylxsw/claude-code repository does hold the code, then a reader who wants to understand the tool system can open the tool definitions, read the permission checks, and form an opinion without an intermediary. The difference in approach is stark: this repository gives you a pre-digested narrative with section headings and a stated point of view, while the source gives you the actual control flow at the cost of far more time and no guidance on where to start.
A second alternative is vendor documentation and public engineering writing about agent design. Those sources have the advantage of being authoritative about intent, which this repository cannot be, but they describe how a system is meant to work rather than how a particular leaked build actually does.
The trade-off is guidance versus fidelity. The chapters tell you which parts of a large codebase matter and group them into a story about tools, permissions, sub-agents and prompts. In exchange, you accept a generated summary of code you have not seen, with no version pin and an explicit accuracy warning. If your goal is to copy a pattern into your own project, go to the source. If your goal is to know which patterns are worth looking for, start here and then go to the source.
Licence and the cost of keeping a study current
The project is MIT licensed, and the LICENSE file sits at the repository root alongside the README. MIT is permissive: it allows reuse, modification and redistribution with the licence and copyright notice retained. That covers the prose and any illustrations in the assets directory, assuming the author held the rights to license them.
It does not resolve the question underneath the repository. The subject matter is source code that the README describes as leaked, and the study quotes and paraphrases that code. An MIT licence on the analysis says nothing about the rights status of the analysed material, and this article is not legal advice; if you plan to republish substantial excerpts in a commercial context, that is a question for a lawyer, not for a README.
The upgrade cost is the more practical concern. Because there are no releases and no tags, there is no upgrade path in the usual sense. Keeping the study accurate means tracking changes in the upstream code repository and editing the Markdown by hand, across five files whose internal links point at specific section anchors. Renaming a heading breaks the table of contents in the README and any inbound link to that section. For a documentation-only repository with no CI, that maintenance burden falls entirely on whoever chooses to pick it up.
Editorial conclusion
Read mylxsw/cc-src-learning if you want a structured tour of how a production CLI agent is put together and you accept that the text is a generated analysis of a leaked codebase rather than vendor documentation. Skip it if you need a runnable implementation, an installable package, or an authoritative statement of what Anthropic intended. Before relying on any claim, open the corresponding chapter file on the main branch and check that the section you are quoting still exists, since the repository carries no releases and no version tags to pin against.
Frequently asked questions
Is mylxsw/cc-src-learning a tool I can install and run?
No. The repository contains five Markdown chapter files, a LICENSE, a README and an assets directory, with no package manifest or executable entry point. You read it rather than run it.
Where is the actual Claude Code source that the chapters analyse?
The README links to a separate repository, mylxsw/claude-code, described as holding the complete code. The study repository itself does not include the source it discusses.
What topics do the chapters of mylxsw/cc-src-learning cover?
The outline covers codebase structure and the Agent module, design topics such as the tool system, slash commands, permissions, sub-agents, Skills and plugins, architecture topics including the QueryEngine, the IDE bridge, the service layer, startup preloading and feature flags, and prompt engineering including layered prompt assembly and caching.
Can I rely on the analysis in mylxsw/cc-src-learning as accurate?
The README carries a disclaimer stating that the article and its illustrations were generated by an AI agent and may contain inaccuracies. It also does not state which version of the leaked source was analysed, so claims should be checked against the linked code repository.
What licence applies to mylxsw/cc-src-learning?
The project is MIT licensed, with the LICENSE file at the repository root. That covers the repository's own content; the README does not address the rights status of the leaked source it analyses.
Community notes