Skip to content

kurom1ii/claude-code-source

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Claude Code Community

Deobfuscated & reconstructed source code of Claude Code CLI

TypeScript Bun React Ink

πŸ“‹ Overview

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

⚑ Quick Start

# Install
bun install

# Development
bun run dev

# Build
bun run build

# Compile binary
bun run build:compile

πŸš€ Usage

./dist/claude --version          # Show version
./dist/claude --help             # Show help
./dist/claude "Hello, Claude!"   # One-shot prompt
./dist/claude                    # Interactive mode

πŸ“ Project Structure

src/
β”œβ”€β”€ πŸ“‚ 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

πŸ› οΈ Available Tools

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 ❌

🎯 Models

// Supported models
opus: 'claude-opus-4-5-20251101'
sonnet: 'claude-sonnet-4-5-20250929'
haiku: 'claude-haiku-3-5-20250929'

βš™οΈ Environment Variables

Variable Description
ANTHROPIC_API_KEY πŸ”‘ API key for authentication
CLAUDE_MODEL πŸ€– Default model
CLAUDE_THEME 🎨 Theme (dark/light/monokai/solarized)

πŸ”¬ Deobfuscation Process

  1. πŸ“₯ Parse original minified cli.js
  2. πŸ” Analyze patterns using tweakcc insights
  3. 🌳 AST parsing with @babel/parser
  4. ✨ Beautify with prettier
  5. πŸ“¦ Split into logical modules
  6. 🏷️ Map obfuscated β†’ readable identifiers
  7. πŸ“ Generate TypeScript with full types
  8. πŸ”¨ Build with bun

πŸ“œ License

UNLICENSED - Educational/research project only.
Original source belongs to Anthropic.


πŸ”§ Reconstructed with Claude AI assistance

About

🧹 Claude Code v2.1.30 source - Clean, simple, with build

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors