Open-source project
chauncygu/collection-claude-code-source-code avatar
chauncygu/collection-claude-code-source-code

chauncygu/collection-claude-code-source-code: a four-part archive for studying Claude Code

A collection of the Claude Code open source. No annotations, docs, or build tooling have been added, use claude-code-source-code for the researched and annotated version.

2,839 stars2,457 forksTypeScriptApache-2.0

At a glance

What is it?
The repository bundles a leaked TypeScript source archive, a decompiled tree with analysis documents, a Python clean-room rewrite, and a minimal multi-provider reimplementation. It is a research collection, not a tool you install and run against your own code.
Who is it for?
Adopt this collection if you are doing source-level research into how a production coding agent is structured, and read the README's own warning that a separate repository, claude-code-source-code, is the researched and annotated version. Do not adopt it as a dependency, a CLI, or a way to run Claude Code yourself: the top-level repository adds no build tooling, and the README states the subprojects are for academic research and educational purposes only.
Can I use it commercially?
Yes. Apache-2.0 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 172 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 25, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What this collection is, and the problem it addresses

Claude Code is Anthropic's official CLI tool. When its TypeScript source became publicly visible in late March 2026, the material that circulated was scattered: a raw archive in one place, commentary threads in another, and rewrites in a third. This repository exists to put those pieces side by side so a reader can compare them.

The README frames the whole thing as study material. It carries a licence and disclaimer block stating that the repository is for academic research and educational purposes only, that all subprojects are built from publicly accessible information, and that users are responsible for complying with applicable laws, regulations, and service terms. That sentence is the honest description of what you are getting. There is no installable product here.

The audience is narrow and specific. Someone reconstructing the architecture of a coding agent, or comparing how a clean-room rewrite differs from the original, will find four trees to read. Someone who wants a working agent to point at their own repository should look elsewhere, because the README's own description of the primary tree says that no annotations, docs, or build tooling have been added, and it points readers to a separate repository for the researched and annotated version.

The README also notes the repository is a collection rather than a single project, and the top-level directory listing confirms it: claude-code-source-code/, claw-code/, clawspring/, docs/, memory/, multi_agent/, original-source-code/, and skill/ sit next to each other, with README.MD and README-CN.md at the root.

The four subprojects and how they differ

The README's comparison table is the clearest artefact in the repository. It lists four subprojects with language, nature, and file count.

original-source-code is TypeScript, described as a raw leaked source archive, at 1,884 files. claude-code-source-code is also TypeScript, described as a decompiled source archive at version v2.1.88 plus documentation, at 1,940 files. claw-code is Python, described as a clean-room architectural rewrite, at 109 files. nano-claude-code is Python, described as a minimal multi-provider reimplementation, at roughly 30 files.

Those four numbers tell you most of what you need to decide where to spend time. The two TypeScript trees are large and largely undocumented by this repository's own admission. The two Python trees are small enough to read end to end, and the README gives them their own sections with architecture notes, core classes, CLI commands, and supported models.

The distinction between the first two matters more than it looks. A raw archive and a decompiled archive are not the same artefact. The decompiled tree ships with documentation and is pinned to a version, which makes it the better reference when you want to cite what a specific release did. The raw tree is closer to what circulated originally.

The README's own warning about the primary tree is worth taking literally. It says the collection has no annotations, docs, or build tooling added, and directs readers to claude-code-source-code for the researched and annotated version. That is a pointer to a different repository, not a directory in this one, and the naming overlap between the two is a genuine source of confusion.

Inside the decompiled tree: tools, commands, permissions, context

The claude-code-source-code section is the only part of the README that describes an internal architecture in any detail, and it is organised into four areas.

The tool system is listed as 40+ tools. The slash command surface is listed at roughly 87 commands. A permission system is called out as its own module, as is context management. The README also describes an overall architecture section, a core execution flow section, and a tech stack section, plus main module descriptions and a docs/ directory of analysis documents.

That structure is the useful part. A reader trying to understand how a production agent constrains itself will care most about the permission system and context management, because those are the two places where an agent either stays inside its lane or does not. The README does not explain the mechanism behind either one; it names them as modules and leaves the code to speak.

The tech stack is TypeScript, consistent with the language column in the comparison table. Beyond that, the README does not enumerate frameworks, runtimes, or package managers for this tree, so anyone planning to build it should treat the build situation as undocumented until they inspect the tree themselves.

The docs/ directory sits at the repository root and holds analysis documents, including a research report referenced in the news list as a PDF. Several of the linked analyses are in Chinese, which the news entries mark explicitly. If you do not read Chinese, the code is still the primary source, but a meaningful share of the surrounding commentary is not.

The Python rewrites: claw-code and nano-claude-code

The two Python subprojects are where this collection becomes readable rather than merely large.

claw-code is described as a clean-room architectural rewrite in 109 files. The README gives it an overall architecture section, a core classes section, a CLI commands section, and a design features section. Clean-room means the authors worked from behaviour and public information rather than copying the TypeScript tree, which is why it can be small: it is not trying to reproduce every tool and command, only the architecture.

nano-claude-code is a minimal multi-provider reimplementation at roughly 30 files. The README lists features, supported models, and a project structure for it. The multi-provider framing is the interesting part, because it implies the agent loop is separable from any single model backend. The README does not name the providers in the excerpt available here, so treat the supported-model list as something to read in the subproject itself.

The news list tracks these rewrites by version and line count: a v1.0 minimal Python reimplementation at roughly 1,300 lines, a v2.0 at roughly 3,400 lines adding skill and memory support and open and closed source models, and a v3.0 described as roughly 5,000 lines with multi-agent packages, a memory package, a skill package with built-in skills, argument substitution, fork and inline execution, AI memory search, git worktree isolation, and agent type definitions. Those entries link to a different organisation's repositories, not to directories in this one, so the line counts describe the upstream projects rather than files you will find here.

The top-level entries memory/, multi_agent/, skill/, and clawspring/ suggest this repository also mirrors some of that material directly, but the README excerpt does not document what those directories contain.

Getting the source and reading a first file

There is no install step in the README, because there is no package to install. The repository is a source archive collection. The README gives no clone command, no package name, and no build instruction for any subproject, so the only concrete step the documentation supports is opening the README and the licence, then reading the subprojects directly.

Start with the README, which carries the comparison table and the licence and disclaimer block. The top-level entries also include README-CN.md and a LICENSE file, listed as Apache-2.0.

From there, use the file counts in the comparison table to choose a tree. If you want the smallest complete picture of the architecture, start with claw-code at 109 files rather than either TypeScript archive. If you want to cite a specific release, the decompiled tree is pinned at v2.1.88 according to the README.

The README gives no build command, no dependency list, and no test command for any subproject. If you intend to compile a tree, that work is yours to reconstruct. Anyone expecting a quickstart will not find one, and that is consistent with the repository's stated purpose rather than an oversight in the documentation.

Where this collection stops being the right tool

The most important limitation is stated by the repository itself. The README says no annotations, docs, or build tooling have been added, and directs readers to a separate repository for the researched and annotated version. If your goal is to understand the code, this repository is the raw material, not the explanation.

The second limitation is legal and practical rather than technical. The disclaimer states the repository is for academic research and educational purposes only and that users are responsible for complying with applicable laws, regulations, and service terms. Nothing in the README grants you the right to reuse the archived source, and the Apache-2.0 licence at the root does not obviously settle the status of code that originated elsewhere. That is a question for a lawyer, not for this page.

The third is coverage. Roughly 87 slash commands and 40+ tools are named as counts, but the README does not document what each one does. A count is not an interface reference. If you need to know the exact behaviour of a specific tool, you are reading source, not documentation.

Finally, the language of the surrounding analysis matters. Several linked reports and walkthroughs are marked as being in Chinese, including the research report PDF and multiple architecture analyses. The code is language-neutral, but a reader expecting an English commentary layer around it will not find one here.

If you want a runnable agent rather than an archive, this is the wrong repository. The README describes subprojects as studies and rewrites, not as products with release channels or support.

Alternatives, and what the difference actually is

The most direct alternative is the repository the README itself points to: claude-code-source-code, described there as the researched and annotated version. The difference is annotation and documentation, not subject matter. Both deal with the same codebase. If you want someone else's reading of the code layered on top, that is the tree to open; if you want to form your own reading from the raw material, this collection is the one that keeps the archives side by side.

A second alternative is the upstream rewrite projects the news list links to, which live in a different organisation's repositories. Those carry version numbers and line counts, and the v3.0 entry describes features such as multi-agent packages, a memory package, built-in skills, and git worktree isolation. The difference in approach is purpose: those are attempts to build a working minimal agent, while this repository is an archive that also mirrors some of that work. If your goal is to run something, the upstream projects are closer to that goal; if your goal is to compare an original against a rewrite, having both in one checkout is the point.

A third option is to skip the collection entirely and read Anthropic's own tooling as a black box: install the CLI, observe its behaviour, and reason from the outside. That avoids every licensing question the disclaimer raises. It also gives you no visibility into the permission system or context management modules that the README names, which is usually the reason people come to a source archive in the first place.

The honest summary is that these options are not substitutes. They answer different questions, and the collection's value is that it lets you ask a comparative question without assembling four checkouts yourself.

Maintenance, licence, and what an upgrade costs

The last push to the default branch was on 2026-04-04, the same timestamp as the v1.01 release, which the release notes describe as covering nano claude code v3.0 and claw code. The repository is not archived, but there has been no push in the roughly five months since that date. Treat the collection as a snapshot tied to a moment in late March and early April 2026, not as a feed.

That matters for upgrade cost in a specific way. The decompiled tree is pinned at v2.1.88 according to the README, and the news entries are dated. If the upstream tool has moved since, nothing in this repository tracks that movement. There is no changelog beyond the release list, no migration notes, and no dependency manifest to diff. Upgrading means re-cloning and re-reading, and the cost is measured in your time rather than in version bumps.

On licensing, the repository root carries Apache-2.0, and the README's disclaimer states the research and educational purpose along with the user's responsibility to comply with applicable laws, regulations, and service terms. Those two statements sit in tension for anyone planning to reuse the archived source, and the README does not resolve it. The practical implication is that the licence file governs the repository's own contents, while the provenance of the archived trees is a separate question the README raises but does not answer. Confirm both before you copy code into another project.

There is no dependency surface to patch and no runtime to keep current, which is the one genuine maintenance advantage of an archive. The cost is that nothing here will tell you when it has gone stale.

Editorial conclusion

Adopt this collection if you are doing source-level research into how a production coding agent is structured, and read the README's own warning that a separate repository, claude-code-source-code, is the researched and annotated version. Do not adopt it as a dependency, a CLI, or a way to run Claude Code yourself: the top-level repository adds no build tooling, and the README states the subprojects are for academic research and educational purposes only. Verify first which subdirectory you actually want, since original-source-code, claude-code-source-code, claw-code, and nano-claude-code differ in language, file count, and whether documentation ships with them. Check the LICENSE file at the repository root before copying anything into your own tree.

Frequently asked questions

What is the Claude AI source code?

In this repository, the term covers two TypeScript trees: original-source-code, described as a raw leaked source archive of 1,884 files, and claude-code-source-code, described as a decompiled archive at v2.1.88 with 1,940 files plus documentation. The README frames the whole collection as study material built from publicly accessible information.

Is Claude Code really open source?

The README does not claim that Claude Code itself is open source. It describes the repository as a collection of subprojects studying Claude Code, Anthropic's official CLI tool, and states that the subprojects are built from publicly accessible information for academic research and educational purposes only.

Is there a source code for Claude Code available on GitHub?

Yes, in the sense that this repository hosts archived TypeScript trees under original-source-code/ and claude-code-source-code/. The README notes that no annotations, docs, or build tooling have been added to the collection and points readers to a separate repository for the researched and annotated version.

Who owns the code generated by Claude Code?

The README does not address ownership of generated code. Its disclaimer covers only the repository's own contents, stating that it is for academic research and educational purposes and that users are responsible for complying with applicable laws, regulations, and service terms.

Official sources

  1. Official README
  2. Project repository
  3. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/chauncygu-collection-claude-code-source-code.svg)](https://hysenlabs.com/projects/chauncygu-collection-claude-code-source-code)