explaingit

chinasiro/claude-code-sourcemap

9,172TypeScriptAudience · developerComplexity · 4/5LicenseSetup · hard

TLDR

A community-reconstructed TypeScript source of Anthropic's Claude Code CLI, reverse-engineered from npm source maps, for research and learning only, not an official Anthropic repository.

Mindmap

mindmap
  root((claude-code-sourcemap))
    What it is
      Source reconstruction
      Research only
    Contents
      4756 restored files
      TypeScript source
    Architecture
      30 plus tool implementations
      40 plus command handlers
      MCP services
    Use Cases
      Architecture study
      AI CLI research
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Study how Anthropic structured Claude Code's 30-plus tool implementations to understand AI coding assistant architecture.

USE CASE 2

Explore the multi-agent coordination and skill/plugin system design used in a production AI CLI tool.

USE CASE 3

Examine the Model Context Protocol service implementation to learn how Claude Code connects to external tools.

Tech stack

TypeScriptTSXJavaScript

Getting it running

Difficulty · hard Time to first run · 1day+

This is a research-only reconstruction, it cannot be run as the official Claude Code tool and has no official build or run instructions.

Research and learning use only, commercial use is not permitted and the source code belongs to Anthropic.

In plain English

This is an unofficial, community-assembled reconstruction of the source code for Claude Code, Anthropic's command-line coding assistant. The original tool ships as a compiled, bundled JavaScript file through the npm package registry. Because that package included source maps (files that link compiled code back to the original TypeScript files), someone was able to reverse the process and recover what appears to be the underlying TypeScript source code. The recovered version corresponds to release 2.1.88 of the CLI. The repository contains 4,756 restored files, including 1,884 TypeScript and TSX source files. The directory structure reveals how the tool is organized: a main entry point for the command-line interface, more than 30 tool implementations (Bash execution, file editing, search), over 40 command handlers (commit, review, configuration), services for connecting to the Anthropic API and the Model Context Protocol, utility functions for git operations and authentication, multi-agent coordination, a plugin system, a skill system, voice interaction, and a Vim editing mode. The project page explicitly states that this is not the official Anthropic development repository, that the source code belongs to Anthropic, and that the repository exists for technical research and learning only. Commercial use is not permitted. The README notes that if there are any intellectual property concerns, the repository can be taken down on request. This kind of source map extraction is a known technique in the software world. Compiled JavaScript bundles often ship with source maps to help developers debug errors in production. Those maps can be used in reverse to reconstruct the original code structure, though the result may not perfectly match the internal development version.

Copy-paste prompts

Prompt 1
Walk me through the directory structure of this Claude Code source reconstruction. What are the main modules and how do they relate?
Prompt 2
Show me how the Bash execution tool is implemented in this Claude Code source. What safety checks or restrictions does it apply?
Prompt 3
Explain how multi-agent coordination works in this codebase. How does the main agent spawn and communicate with sub-agents?
Prompt 4
How is the plugin and skill system architected in this Claude Code reconstruction? Where are the entry points?
Open on GitHub → Explain another repo

← chinasiro on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.