
Claude Code Source Recovery
Study how a production AI coding CLI wires commands, MCP, sessions, and terminal UI when you are building or auditing similar agent tooling.
Overview
Claude Code Source Recovery is an agent skill most often used in Build (also Idea, Ship) that guides exploration of recovered Claude Code 2.1.88 TypeScript covering CLI architecture, commands, MCP, and terminal UI.
Install
npx skills add https://github.com/aradotso/trending-skills --skill claude-code-source-recoveryWhat is this skill?
- Maps ~700k lines of recovered Claude Code 2.1.88 TypeScript into entrypoints, commands, MCP, and Ink/React UI areas
- Explains real-world MCP client patterns and session/auth flows from a shipped CLI bundle
- Documents source-map recovery workflow for auditing accidentally published bundles
- Covers CLI bootstrap, command registration, and terminal UI component layout
- ~700,000 lines of recovered TypeScript organized under src/
- Recovered from a 57MB cli.js.map source map (Claude Code 2.1.88)
Adoption & trust: 598 installs on skills.sh; 31 GitHub stars; 0/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want to design or debug an agent CLI but only have opaque bundles or hearsay about how production tools implement MCP, commands, and terminal UI.
Who is it for?
Indie builders shipping Claude Code–style CLIs who learn best by reading annotated maps of a real agent runtime.
Skip if: Teams seeking a supported Anthropic API or expecting a maintained, licensable fork of Claude Code without legal review.
When should I use this skill?
User asks to explore claude code source, understand CLI architecture, MCP integration source, terminal UI components, or recover source from a source map.
What do I get? / Deliverables
You get a structured mental model of entrypoints, commands, MCP, and Ink/React UI modules so you can trace patterns in your own repo or review checklist.
- Architecture notes tied to entrypoints, commands, MCP, and UI modules
- Answered questions on specific CLI subsystems the user names
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Build because the recovered tree is agent-runtime and CLI implementation reference material, not a go-to-market or ops playbook. agent-tooling fits skills that explain MCP integration, tool execution, and command systems inside coding agents.
Where it fits
Compare how a production agent CLI registers commands before you pick your own plugin model.
Trace MCP client setup and tool execution paths while implementing your coding agent integration.
Cross-check session and auth handling assumptions during a security-minded CLI review.
How it compares
Use as deep architecture study, not as a starter template skill like brainstorming or writing-plans.
Common Questions / FAQ
Who is claude-code-source-recovery for?
Solo and indie developers building or evaluating AI coding CLIs who need concrete references for MCP, commands, and terminal UI patterns.
When should I use claude-code-source-recovery?
During Idea research when comparing agent architectures, during Build agent-tooling when implementing MCP or Ink UI, and during Ship review when validating how tools and sessions behave.
Is claude-code-source-recovery safe to install?
Treat it as third-party reference material about recovered sources; review the Security Audits panel on this Prism page and your license policy before relying on it in production workflows.
SKILL.md
READMESKILL.md - Claude Code Source Recovery
# Claude Code 2.1.88 Source Recovery > Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection. ## What This Project Is This repository contains the recovered TypeScript source code of `@anthropic-ai/claude-code` version 2.1.88. On 2026-03-31, Anthropic accidentally published a `cli.js.map` (57MB) source map to npm that contained the full `sourcesContent` of the bundled CLI. After extraction and reconstruction, the result is ~700,000 lines of TypeScript source code organized into a readable directory structure. The project is useful for: - Studying production CLI architecture patterns (Ink/React in terminal) - Understanding how MCP (Model Context Protocol) is implemented in a real CLI - Learning how Claude Code manages sessions, commands, authentication, and tool execution --- ## Repository Structure ``` src/ ├── entrypoints/ # CLI bootstrap and initialization ├── commands/ # Command definitions (login, mcp, review, tasks, etc.) ├── components/ # Ink/React terminal UI components ├── services/ # Core business logic (sync, remote capabilities, policies) ├── hooks/ # Terminal state management hooks ├── utils/ # Auth, file ops, process management helpers └── ink/ # Custom terminal rendering infrastructure ``` --- ## Installing the Original 2.1.88 Package (Tencent Mirror Cache) The official npm version was pulled. Use the Tencent mirror cache while available: ```bash npm install -g https://mirrors.cloud.tencent.com/npm/@anthropic-ai/claude-code/-/claude-code-2.1.88.tgz ``` --- ## Extracting Source from the Source Map If you have the original `cli.js.map`, you can recover sources programmatically: ```typescript import fs from "fs"; import path from "path"; import zlib from "zlib"; interface SourceMap { version: number; sources: string[]; sourcesContent: (string | null)[]; mappings: string; } async function extractSourceMap(mapPath: string, outDir: string) { const raw = fs.readFileSync(mapPath, "utf-8"); const sourceMap: SourceMap = JSON.parse(raw); for (let i = 0; i < sourceMap.sources.length; i++) { const sourcePath = sourceMap.sources[i]; const content = sourceMap.sourcesContent[i]; if (!content) continue; // Normalize path: strip webpack/bundle prefixes const normalized = sourcePath .replace(/^webpack:\/\/\//, "") .replace(/^\.\//, ""); const outPath = path.join(outDir, normalized); fs.mkdirSync(path.dirname(outPath), { recursive: true }); fs.writeFileSync(outPath, content, "utf-8"); } console.log(`Extracted ${sourceMap.sources.length} source files to ${outDir}`); } extractSourceMap("cli.js.map", "./recovered-src"); ``` --- ## Key Architectural Patterns ### 1. CLI Entrypoint Bootstrap ```typescript // src/entrypoints/cli.ts (representative pattern) import { render } from "ink"; import React from "react"; import { App } from "../components/App"; import { parseArgs } from "../utils/args"; async function main() { const args = parseArgs(process.argv.slice(2)); if (args.command) { // Dispatch to named command handler const handler = await loadCommand(args.command); await handler.run(args); } else { // Default: launch interactive REPL via Ink render(React.createElement(App, { initialArgs: args })); } } main().catch((err) => { console.error(err); process.exit(1); }); ``` ##