Deobfuscated & reconstructed source code of Claude Code CLI
This project reconstructs Anthropic's Claude Code CLI from its obfuscated source into readable, maintainable TypeScript/React modules.
What's included:
- π Deobfuscated
cli.js(7,583 lines β structured modules) - π¦ Clean TypeScript/React architecture
- π οΈ 10+ built-in tools (Bash, Read, Write, Edit, Glob, Grep, etc.)
- π¨ Ink-based terminal UI components
- π Anthropic API client with streaming support
# Install
bun install
# Development
bun run dev
# Build
bun run build
# Compile binary
bun run build:compile./dist/claude --version # Show version
./dist/claude --help # Show help
./dist/claude "Hello, Claude!" # One-shot prompt
./dist/claude # Interactive modesrc/
βββ π api/ # Anthropic API client (streaming, auth, errors)
βββ π cli/ # CLI entry & main React app
βββ π config/ # Version, models, themes, feature flags
βββ π tools/ # Built-in tools (Bash, Read, Write, Edit, Glob, Grep, LSP...)
βββ π types/ # TypeScript definitions
βββ π ui/ # Ink/React components (Box, Text, Spinner, StatusLine...)
βββ π utils/ # Helper functions
| Tool | Description | Confirmation |
|---|---|---|
| π₯οΈ Bash | Execute shell commands | β |
| π Read | Read file contents | β |
| βοΈ Write | Write files | β |
| π§ Edit | String replacement edits | β |
| π Glob | Find files by pattern | β |
| π Grep | Search content in files | β |
| π€ Task | Spawn subagent | β |
| π WebFetch | Fetch URL content | β |
| π WebSearch | Web search | β |
| π‘ LSP | Language Server Protocol | β |
// Supported models
opus: 'claude-opus-4-5-20251101'
sonnet: 'claude-sonnet-4-5-20250929'
haiku: 'claude-haiku-3-5-20250929'| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
π API key for authentication |
CLAUDE_MODEL |
π€ Default model |
CLAUDE_THEME |
π¨ Theme (dark/light/monokai/solarized) |
- π₯ Parse original minified
cli.js - π Analyze patterns using
tweakccinsights - π³ AST parsing with
@babel/parser - β¨ Beautify with
prettier - π¦ Split into logical modules
- π·οΈ Map obfuscated β readable identifiers
- π Generate TypeScript with full types
- π¨ Build with
bun
UNLICENSED - Educational/research project only.
Original source belongs to Anthropic.
π§ Reconstructed with Claude AI assistance