Skip to content
Back to search

claude-code

SkillWorks with Claude CodeGitHub

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/codeaashu-claude-code/badge.svg)](/listings/codeaashu-claude-code)

HTML

<a href="/listings/codeaashu-claude-code"><img src="/api/listings/codeaashu-claude-code/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

The MCP server is published as [`warrioraashuu-codemaster`](https://www.npmjs.com/package/warrioraashuu-codemaster) on npm — no need to clone the repo:

# Claude Code
claude mcp add warrioraashuu-codemaster -- npx -y warrioraashuu-codemaster

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 490 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. # Claude Code — Leaked Source
  3. **The full source code of Anthropic's Claude Code CLI, leaked on March 31, 2026**
  4. [![TypeScript](https://img.shields.io/badge/TypeScript-512K%2B_lines-3178C6?logo=typescript&logoColor=white)](#tech-stack)
  5. [![Bun](https://img.shields.io/badge/Runtime-Bun-f472b6?logo=bun&logoColor=white)](#tech-stack)
  6. [![React + Ink](https://img.shields.io/badge/UI-React_%2B_Ink-61DAFB?logo=react&logoColor=black)](#tech-stack)
  7. [![Files](https://img.shields.io/badge/~1,900_files-source_only-grey)](#directory-structure)
  8. [![MCP Server](https://img.shields.io/badge/MCP-Explorer_Server-blueviolet)](#-explore-with-mcp-server)
  9. [![npm](https://img.shields.io/npm/v/warrioraashuu-codemaster?label=npm&color=cb3837&logo=npm)](https://www.npmjs.com/package/warrioraashuu-codemaster)
  10. [![Twitter Follow](https://img.shields.io/twitter/follow/warrioraashuu?style=social)](https://twitter.com/intent/follow?screen_name=warrioraashuu)
  11. > The original unmodified leaked source is preserved in the [`backup` branch](https://github.com/codeaashu/claude-code/tree/backup).
  12. </div>
  13. ---
  14. <div align="center">
  15. <table>
  16. <tr>
  17. `The X-Ray Intelligence Engine for Your Codebase.`
  18. <td width="120" align="center">
  19. <img src="https://repoxray.2clabs.tech/logo.png" width="80" height="80" alt="RepoXray Logo"/>
  20. </td>
  21. <td>
  22. <h2 align="center">Understand Any Codebase<br>X-Ray Any Repo, in Seconds.<br>
  23. <a href="https://repoxray.2clabs.tech/"><strong>repoxray.2clabs.tech</strong></a></h2>
  24. </td>
  25. </tr>
  26. </table>
  27. `Spend less time reading code, more time building.`
  28. </div>
  29. ---
  30. ## Table of Contents
  31. - [How It Leaked](#how-it-leaked)
  32. - [What Is Claude Code?](#what-is-claude-code)
  33. - [Documentation](#-documentation)
  34. - [Explore with MCP Server](#-explore-with-mcp-server)
  35. - [Directory Structure](#directory-structure)
  36. - [Architecture](#architecture)
  37. - [Tool System](#1-tool-system)
  38. - [Command System](#2-command-system)
  39. - [Service Layer](#3-service-layer)
  40. - [Bridge System](#4-bridge-system)
  41. - [Permission System](#5-permission-system)
  42. - [Feature Flags](#6-feature-flags)
  43. - [Key Files](#key-files)
  44. - [Tech Stack](#tech-stack)
  45. - [Design Patterns](#design-patterns)
  46. - [GitPretty Setup](#gitpretty-setup)
  47. - [Contributing](#contributing)
  48. - [Disclaimer](#disclaimer)
  49. ---
  50. ## How It Leaked
  51. [Chaofan Shou (@Fried_rice)](https://x.com/Fried_rice) discovered that the published npm package for Claude Code included a `.map` file referencing the full, unobfuscated TypeScript source — downloadable as a zip from Anthropic's R2 storage bucket.
  52. > **"Claude code source code has been leaked via a map file in their npm registry!"**
  53. >
  54. > — [@Fried_rice, March 31, 2026](https://x.com/Fried_rice/status/2038894956459290963)
  55. ---
  56. ## What Is Claude Code?
  57. Claude Code is Anthropic's official CLI tool for interacting with Claude directly from the terminal — editing files, running commands, searching codebases, managing git workflows, and more. This repository contains the leaked `src/` directory.
  58. | | |
  59. |---|---|
  60. | **Leaked** | 2026-03-31 |
  61. | **Language** | TypeScript (strict) |
  62. | **Runtime** | [Bun](https://bun.sh) |
  63. | **Terminal UI** | [React](https://react.dev) + [Ink](https://github.com/vadimdemedes/ink) |
  64. | **Scale** | ~1,900 files · 512,000+ lines of code |
  65. ---
  66. ## � Documentation
  67. For in-depth guides, see the [`docs/`](docs/) directory:
  68. | Guide | Description |
  69. |-------|-------------|
  70. | **[Architecture](docs/architecture.md)** | Core pipeline, startup sequence, state management, rendering, data flow |
  71. | **[Tools Reference](docs/tools.md)** | Complete catalog of all ~40 agent tools with categories and permission model |
  72. | **[Commands Reference](docs/commands.md)** | All ~85 slash commands organized by category |
  73. | **[Subsystems Guide](docs/subsystems.md)** | Deep dives into Bridge, MCP, Permissions, Plugins, Skills, Tasks, Memory, Voice |
  74. | **[Exploration Guide](docs/exploration-guide.md)** | How to navigate the codebase — study paths, grep patterns, key files |
  75. Also see: [CONTRIBUTING.md](CONTRIBUTING.md) · [MCP Server README](mcp-server/README.md)
  76. ---
  77. ## �🔍 Explore with MCP Server
  78. This repo ships an [MCP server](https://modelcontextprotocol.io/) that lets any MCP-compatible client (Claude Code, Claude Desktop, VS Code Copilot, Cursor) explore the full source interactively.
  79. ### Install from npm
  80. The MCP server is published as [`warrioraashuu-codemaster`](https://www.npmjs.com/package/warrioraashuu-codemaster) on npm — no need to clone the repo:
  81. ```bash
  82. # Claude Code
  83. claude mcp add warrioraashuu-codemaster -- npx -y warrioraashuu-codemaster
  84. ```
  85. ### One-liner setup (from source)
  86. ```bash
  87. git clone https://github.com/codeaashu/claude-code.git ~/claude-code \
  88. && cd ~/claude-code/mcp-server \
  89. && npm install && npm run build \
  90. && claude mcp add claude-code-explorer -- node ~/claude-code/mcp-server/dist/index.js
  91. ```
  92. <details>
  93. <summary><strong>Step-by-step setup</strong></summary>
  94. ```bash
  95. # 1. Clone the repo
  96. git clone https://github.com/codeaashu/claude-code.git
  97. cd claude-code/mcp-server
  98. # 2. Install & build
  99. npm install && npm run build
  100. # 3. Register with Claude Code
  101. claude mcp add claude-code-explorer -- node /absolute/path/to/claude-code/mcp-server/dist/index.js
  102. ```
  103. Replace `/absolute/path/to/claude-code` with your actual clone path.
  104. </details>
  105. <details>
  106. <summary><strong>VS Code / Cursor / Claude Desktop config</strong></summary>
  107. **VS Code** — add to `.vscode/mcp.json`:
  108. ```json
  109. {
  110. "servers": {
  111. "claude-code-explorer": {
  112. "type": "stdio",
  113. "command": "node",
  114. "args": ["${workspaceFolder}/mcp-server/dist/index.js"],
  115. "env": { "CLAUDE_CODE_SRC_ROOT": "${workspaceFolder}/src" }
  116. }
  117. }
  118. }
  119. ```
  120. **Claude Desktop** — add to your config file:
  121. ```json
  122. {
  123. "mcpServers": {
  124. "claude-code-explorer": {
  125. "command": "node",
  126. "args": ["/absolute/path/to/claude-code/mcp-server/dist/index.js"],
  127. "env": { "CLAUDE_CODE_SRC_ROOT": "/absolute/path/to/claude-code/src" }
  128. }
  129. }
  130. }
  131. ```
  132. **Cursor** — add to `~/.cursor/mcp.json` (same format as Claude Desktop).
  133. </details>
  134. ### Available tools & prompts
  135. | Tool | Description |
  136. |------|-------------|
  137. | `list_tools` | List all ~40 agent tools with source files |
  138. | `list_commands` | List all ~50 slash commands with source files |
  139. | `get_tool_source` | Read full source of any tool (e.g. BashTool, FileEditTool) |
  140. | `get_command_source` | Read source of any slash command (e.g. review, mcp) |
  141. | `read_source_file` | Read any file from `src/` by path |
  142. | `search_source` | Grep across the entire source tree |
  143. | `list_directory` | Browse `src/` directories |
  144. | `get_architecture` | High-level architecture overview |
  145. | Prompt | Description |
  146. |--------|-------------|
  147. | `explain_tool` | Deep-dive into how a specific tool works |
  148. | `explain_command` | Understand a slash command's implementation |
  149. | `architecture_overview` | Guided tour of the full architecture |
  150. | `how_does_it_work` | Explain any subsystem (permissions, MCP, bridge, etc.) |
  151. | `compare_tools` | Side-by-side comparison of two tools |
  152. **Try asking:** *"How does the BashTool work?"* · *"Search for where permissions are checked"* · *"Show me the /review command source"*
  153. ### Custom source path / Remove
  154. ```bash
  155. # Custom source location
  156. claude mcp add claude-code-explorer -e CLAUDE_CODE_SRC_ROOT=/path/to/src -- node /path/to/mcp-server/dist/index.js
  157. # Remove
  158. claude mcp remove claude-code-explorer
  159. ```
  160. ---
  161. ## Directory Structure
  162. ```
  163. src/
  164. ├── main.tsx # Entrypoint — Commander.js CLI parser + React/Ink renderer
  165. ├── QueryEngine.ts # Core LLM API caller (~46K lines)
  166. ├── Tool.ts # Tool type definitions (~29K lines)
  167. ├── commands.ts # Command registry (~25K lines)
  168. ├── tools.ts # Tool registry
  169. ├── context.ts # System/user context collection
  170. ├── cost-tracker.ts # Token cost tracking
  171. │
  172. ├── tools/ # Agent tool implementations (~40)
  173. ├── commands/ # Slash command implementations (~50)
  174. ├── components/ # Ink UI components (~140)
  175. ├── services/ # External service integrations
  176. ├── hooks/ # React hooks (incl. permission checks)
  177. ├── types/ # TypeScript type definitions
  178. ├── utils/ # Utility functions
  179. ├── screens/ # Full-screen UIs (Doctor, REPL, Resume)
  180. │
  181. ├── bridge/ # IDE integration (VS Code, JetBrains)
  182. ├── coordinator/ # Multi-agent orchestration
  183. ├── plugins/ # Plugin system
  184. ├── skills/ # Skill system
  185. ├── server/ # Server mode
  186. ├── remote/ # Remote sessions
  187. ├── memdir/ # Persistent memory directory
  188. ├── tasks/ # Task management
  189. ├── state/ # State management
  190. │
  191. ├── voice/ # Voice input
  192. ├── vim/ # Vim mode
  193. ├── keybindings/ # Keybinding configuration
  194. ├── schemas/ # Config schemas (Zod)
  195. ├── migrations/ # Config migrations
  196. ├── entrypoints/ # Initialization logic
  197. ├── query/ # Query pipeline
  198. ├── ink/ # Ink renderer wrapper
  199. ├── buddy/ # Companion sprite (Easter egg 🐣)
  200. ├── native-ts/ # Native TypeScript utils
  201. ├── outputStyles/ # Output styling
  202. └── upstreamproxy/ # Proxy configuration
  203. ```
  204. ---
  205. ## Architecture
  206. ### 1. Tool System
  207. > `src/tools/` — Every tool Claude can invoke is a self-contained module with its own input schema, permission model, and execution logic.
  208. | Tool | Description |
  209. |---|---|
  210. | **File I/O** | |
  211. | `FileReadTool` | Read files (images, PDFs, notebooks) |
  212. | `FileWriteTool` | Create / overwrite files |
  213. | `FileEditTool` | Partial modification (string replacement) |
  214. | `NotebookEditTool` | Jupyter notebook editing |
  215. | **Search** | |
  216. | `GlobTool` | File pattern matching |
  217. | `GrepTool` | ripgrep-based content search |
  218. | `WebSearchTool` | Web search |
  219. | `WebFetchTool` | Fetch URL content |
  220. | **Execution** | |
  221. | `BashTool` | Shell command execution |
  222. | `SkillTool` | Skill execution |
  223. | `MCPTool` | MCP server tool invocation |
  224. | `LSPTool` | Language Server Protocol integration |
  225. | **Agents & Teams** | |
  226. | `AgentTool` | Sub-agent spawning |
  227. | `SendMessageTool` | Inter-agent messaging |
  228. | `TeamCreateTool` / `TeamDeleteTool` | Team management |
  229. | `TaskCreateTool` / `TaskUpdateTool` | Task management |
  230. | **Mode & State** | |
  231. | `EnterPlanModeTool` / `ExitPlanModeTool` | Plan mode toggle |
  232. | `EnterWorktreeTool` / `ExitWorktreeTool` | Git worktree isolation |
  233. | `ToolSearchTool` | Deferred tool discovery |
  234. | `SleepTool` | Proactive mode wait |
  235. | `CronCreateTool` | Scheduled triggers |
  236. | `RemoteTriggerTool` | Remote trigger |
  237. | `SyntheticOutputTool` | Structured output generation |
  238. ### 2. Command System
  239. > `src/commands/` — User-facing slash commands invoked with `/` in the REPL.
  240. | Command | Description | | Command | Description |
  241. |---|---|---|---|---|
  242. | `/commit` | Git commit | | `/memory` | Persistent memory |
  243. | `/review` | Code review | | `/skills` | Skill management |
  244. | `/compact` | Context compression | | `/tasks` | Task management |
  245. | `/mcp` | MCP server management | | `/vim` | Vim mode toggle |
  246. | `/config` | Settings | | `/diff` | View changes |
  247. | `/doctor` | Environment diagnostics | | `/cost` | Check usage cost |
  248. | `/login` / `/logout` | Auth | | `/theme` | Change theme |
  249. | `/context` | Context visualization | | `/share` | Share session |
  250. | `/pr_comments` | PR comments | | `/resume` | Restore session |
  251. | `/desktop` | Desktop handoff | | `/mobile` | Mobile handoff |
  252. ### 3. Service Layer
  253. > `src/services/` — External integrations and core infrastructure.
  254. | Service | Description |
  255. |---|---|
  256. | `api/` | Anthropic API client, file API, bootstrap |
  257. | `mcp/` | Model Context Protocol connection & management |
  258. | `oauth/` | OAuth 2.0 authentication |
  259. | `lsp/` | Language Server Protocol manager |
  260. | `analytics/` | GrowthBook feature flags & analytics |
  261. | `plugins/` | Plugin loader |
  262. | `compact/` | Conversation context compression |
  263. | `extractMemories/` | Automatic memory extraction |
  264. | `teamMemorySync/` | Team memory synchronization |
  265. | `tokenEstimation.ts` | Token count estimation |
  266. | `policyLimits/` | Organization policy limits |
  267. | `remoteManagedSettings/` | Remote managed settings |
  268. ### 4. Bridge System
  269. > `src/bridge/` — Bidirectional communication layer connecting IDE extensions (VS Code, JetBrains) with the CLI.
  270. Key files: `bridgeMain.ts` (main loop) · `bridgeMessaging.ts` (protocol) · `bridgePermissionCallbacks.ts` (permission callbacks) · `replBridge.ts` (REPL session) · `jwtUtils.ts` (JWT auth) · `sessionRunner.ts` (session execution)
  271. ### 5. Permission System
  272. > `src/hooks/toolPermission/` — Checks permissions on every tool invocation.
  273. Prompts the user for approval/denial or auto-resolves based on the configured permission mode: `default`, `plan`, `bypassPermissions`, `auto`, etc.
  274. ### 6. Feature Flags
  275. Dead code elimination at build time via Bun's `bun:bundle`:
  276. ```typescript
  277. import { feature } from 'bun:bundle'
  278. const voiceCommand = feature('VOICE_MODE')
  279. ? require('./commands/voice/index.js').default
  280. : null
  281. ```
  282. Notable flags: `PROACTIVE` · `KAIROS` · `BRIDGE_MODE` · `DAEMON` · `VOICE_MODE` · `AGENT_TRIGGERS` · `MONITOR_TOOL`
  283. ---
  284. ## Key Files
  285. | File | Lines | Purpose |
  286. |------|------:|---------|
  287. | `QueryEngine.ts` | ~46K | Core LLM API engine — streaming, tool loops, thinking mode, retries, token counting |
  288. | `Tool.ts` | ~29K | Base types/interfaces for all tools — input schemas, permissions, progress state |
  289. | `commands.ts` | ~25K | Command registration & execution with conditional per-environment imports |
  290. | `main.tsx` | — | CLI parser + React/Ink renderer; parallelizes MDM, keychain, and GrowthBook on startup |
  291. ---
  292. ## Tech Stack
  293. | Category | Technology |
  294. |---|---|
  295. | Runtime | [Bun](https://bun.sh) |
  296. | Language | TypeScript (strict) |
  297. | Terminal UI | [React](https://react.dev) + [Ink](https://github.com/vadimdemedes/ink) |
  298. | CLI Parsing | [Commander.js](https://github.com/tj/commander.js) (extra-typings) |
  299. | Schema Validation | [Zod v4](https://zod.dev) |
  300. | Code Search | [ripgrep](https://github.com/BurntSushi/ripgrep) (via GrepTool) |
  301. | Protocols | [MCP SDK](https://modelcontextprotocol.io) · LSP |
  302. | API | [Anthropic SDK](https://docs.anthropic.com) |
  303. | Telemetry | OpenTelemetry + gRPC |
  304. | Feature Flags | GrowthBook |
  305. | Auth | OAuth 2.0 · JWT · macOS Keychain |
  306. ---
  307. ## Design Patterns
  308. <details>
  309. <summary><strong>Parallel Prefetch</strong> — Startup optimization</summary>
  310. MDM settings, keychain reads, and API preconnect fire in parallel as side-effects before heavy module evaluation:
  311. ```typescript
  312. // main.tsx
  313. startMdmRawRead()
  314. startKeychainPrefetch()
  315. ```
  316. </details>
  317. <details>
  318. <summary><strong>Lazy Loading</strong> — Deferred heavy modules</summary>
  319. OpenTelemetry (~400KB) and gRPC (~700KB) are loaded via dynamic `import()` only when needed.
  320. </details>
  321. <details>
  322. <summary><strong>Agent Swarms</strong> — Multi-agent orchestration</summary>
  323. Sub-agents spawn via `AgentTool`, with `coordinator/` handling orchestration. `TeamCreateTool` enables team-level parallel work.
  324. </details>
  325. <details>
  326. <summary><strong>Skill System</strong> — Reusable workflows</summary>
  327. Defined in `skills/` and executed through `SkillTool`. Users can add custom skills.
  328. </details>
  329. <details>
  330. <summary><strong>Plugin Architecture</strong> — Extensibility</summary>
  331. Built-in and third-party plugins loaded through the `plugins/` subsystem.
  332. </details>
  333. ---
  334. ## GitPretty Setup
  335. <details>
  336. <summary>Show per-file emoji commit messages in GitHub's file UI</summary>
  337. ```bash
  338. # Apply emoji commits
  339. bash ./gitpretty-apply.sh .
  340. # Optional: install hooks for future commits
  341. bash ./gitpretty-apply.sh . --hooks
  342. # Push as usual
  343. git push origin main
  344. ```
  345. </details>
  346. ---
  347. ## Contributing
  348. Contributions to documentation, the MCP server, and exploration tooling are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
  349. > **Note:** The `src/` directory is the original leaked source and should not be modified.
  350. ---
  351. ## Disclaimer
  352. This repository archives source code leaked from Anthropic's npm registry on **2026-03-31**. All original source code is the property of [Anthropic](https://www.anthropic.com). This is not an official release and is not licensed for redistribution. Contact [aashuu ✦](https://x.com/warrioraashuu) for any comments.
  353. ---
  354. <a href="https://www.star-history.com/?repos=codeaashu%2Fclaude-code&type=date&legend=bottom-right">
  355. <picture>
  356. <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/image?repos=codeaashu/claude-code&type=date&theme=dark&legend=bottom-right" />
  357. <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/image?repos=codeaashu/claude-code&type=date&legend=bottom-right" />
  358. <img alt="Star History Chart" src="https://api.star-history.com/image?repos=codeaashu/claude-code&type=date&legend=bottom-right" />
  359. </picture>
  360. </a>
  361. ---
  362. Cooked by aashuu ✦ (Ashutosh Kumar)<br>
  363. Founder of [2C Labs](https://www.2clabs.tech)
  364. I build tech businesses through SaaS products across every layer of the internet ( Web2 ▪︎ Web3 ▪︎ AI-native ▪︎ Infrastructure )
  365. Connect here:<br>
  366. Website [www.aashuu.me](https://www.aashuu.me) ✦ 𝕏 [@warrioraashuu](https://x.com/warrioraashuu) ✦ LinkedIn [@warrioraashuu](https://www.linkedin.com/in/warrioraashuu/)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.