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

A Raw Archive of Claude Code's Leaked Source, Plus Two Clean-Room Python Rebuilds

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,831 stars2,456 forksTypeScriptApache-2.0

At a glance

What is it?
This repository bundles the leaked Claude Code TypeScript source, a decompiled v2.1.88 archive with analysis docs, and two Python reimplementations (claw-code and nano-claude-code) for research. It is a study resource, not a drop-in replacement.
Who is it for?
Adopt this repository if you are a researcher, security analyst, or educator who needs to study Claude Code's internal architecture without reverse-engineering it from scratch. Do not adopt it if you want a maintained, installable tool: the raw source is a legal liability, the decompiled archive is unannotated, and the Python rewrites are minimal research projects.
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 157 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 14, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What This Repository Actually Contains

For engineers deciding whether to adopt this, the first question is what problem you are solving. If you want to understand how Claude Code implements its tool system, permission checks, or context management, this collection gives you the actual code to read. If you want a working CLI tool, this is the wrong place. The Python rewrites are minimal and explicitly labeled as research reimplementations. The README's news section lists several Chinese-language analyses and a research report PDF, which suggests the intended audience is people who study AI coding agents, not end users.

The Raw Leaked Source and Its Legal Cloud

The README references a Hacker News discussion and a thread about 'Claude Code's source code appears to have leaked: here's what we know.' That context matters because it frames the entire repository as a response to a leak, not as an official release. If you are a vendor building a commercial product, this repository is a minefield. If you are a researcher studying how a production AI agent is built, the legal risk is lower but still present. The disclaimer does not absolve you; it merely states the obvious.

The Decompiled Archive: v2.1.88 With Analysis Docs

A key distinction: the raw source and the decompiled source are different things. The raw archive is the leaked TypeScript as it was. The decompiled archive is a separate extraction, possibly from a bundled or minified distribution, and it has been organized with docs. The file counts differ slightly (1,884 vs 1,940), which suggests the decompiled version includes additional files or generated documentation. The README says no annotations have been added to the raw source, but the decompiled subproject has analysis documents. That is a useful separation: you can read the raw code without any interpretation, or read the decompiled version with guides. For a researcher, the decompiled version is probably the better starting point because the docs explain the architecture. For someone who wants to verify the docs, the raw source is the ground truth.

claw-code: A Clean-Room Architectural Rewrite

This is a significant piece of work, but it is still a research artifact. The README does not provide installation instructions or a package name for claw-code. There is no pip install command, no setup.py mention, no usage examples beyond the table of contents. To run it, you would have to clone the repository and explore the Python files yourself. The fact that it is a clean-room rewrite means the code is not identical to Claude Code's implementation, so behavior will differ in edge cases. If you want to see how a minimal agent can be built with similar concepts, claw-code is a useful study. If you want a production-ready tool, it is not.

nano-claude-code: A Minimal Multi-Provider Reimplementation

The supported models are not enumerated in the README, only described as 'open and closed source models.' That vagueness is a limitation. You cannot know which specific providers or model names are supported without reading the code. The README does not give a command to run nano-claude-code either. This is consistent with the repository's research purpose: it is a source archive, not a packaged tool. For someone who wants to see a minimal implementation of an agent loop with memory and skills, nano-claude-code is a compact example. For someone who needs to integrate a CLI agent into their workflow, it is not.

Comparing the Subprojects: What Each One Is Good For

A practical comparison: if you want to learn how Claude Code handles permissions, you should read the decompiled TypeScript source and the analysis docs. If you want to see how a multi-agent system can be built in Python with git worktree isolation, claw-code is the example. If you want a quick overview of an agent loop with skills and memory, nano-claude-code is the shortest path. The comparison table is a useful index, but it does not include performance benchmarks or maintainability metrics. The README does not claim any of the Python rewrites are production-ready, so you should not treat them as such.

Getting It Running: Commands and Configuration

This lack of setup instructions is a real limitation. The repository is not designed to be run; it is designed to be read. If you are an engineer who wants to test a feature, you will have to reverse-engineer the project structure yourself. The README's news section includes a video analysis and a research report, which are the closest thing to a guided tour. For a researcher, that is acceptable. For a developer looking for a quick start, it is a barrier. The absence of build tooling also means there is no test suite, no linter configuration, and no dependency manifest that you can trust. You are on your own.

Maintenance, Upgrades, and the Apache-2.0 License

Upgrade cost is low in the sense that the repository is a collection of snapshots. There is no API to keep up with, no dependencies to update. The cost is in understanding what you have. If you adopt the raw source as a reference, you must track the original Claude Code's evolution separately, because this repository is a point-in-time archive. If you adopt the Python rewrites, you must maintain them yourself, since they are research projects without a community. The README's news section shows a flurry of activity in late March and early April 2026, but that does not guarantee future updates. For a researcher, this is a snapshot worth citing. For a product team, it is a dead end.

Editorial conclusion

Adopt this repository if you are a researcher, security analyst, or educator who needs to study Claude Code's internal architecture without reverse-engineering it from scratch. Do not adopt it if you want a maintained, installable tool: the raw source is a legal liability, the decompiled archive is unannotated, and the Python rewrites are minimal research projects. Before using it, verify the provenance of each subproject against the linked news items and check the license terms of the original Claude Code, since the repository's own disclaimer says users are responsible for compliance. The concrete next step is to read the analysis PDF in docs/ and compare the tool list against the decompiled source to confirm what you are actually studying.

Official sources

  1. Official README
  2. Project repository
  3. Release notes
Community notes

Community notes