- Slim down README from ~400 lines to ~140 lines, keeping only essential content - Reorganize docs/ into guide/, features/, reference/, images/ subdirectories - Add GitHub badges (stars, forks, issues, PRs, license, language switch) - Extract env vars, FAQ, fixes, project structure, global usage into separate docs - Add LICENSE file (educational and research use only) - Update all cross-references and issue template links
5.9 KiB
Claude Code Haha
A locally runnable version repaired from the leaked Claude Code source, with support for any Anthropic-compatible API endpoint such as MiniMax and OpenRouter.
The original leaked source does not run as-is. This repository fixes multiple blocking issues in the startup path so the full Ink TUI can work locally.
Features · Architecture · Quick Start · Env Vars · FAQ · Global Usage · More Docs
Features
- Full Ink TUI experience (matching the official Claude Code interface)
--printheadless mode for scripts and CI- MCP server, plugin, and Skills support
- Custom API endpoint and model support (Third-Party Models Guide)
- Computer Use desktop control — Guide
- Memory System (cross-session persistent memory) — Usage Guide
- Fallback Recovery CLI mode (
CLAUDE_CODE_FORCE_RECOVERY_CLI=1 ./bin/claude-haha)
Architecture Overview
![]() Overall architecture |
![]() Request lifecycle |
![]() Tool system |
![]() Multi-agent architecture |
![]() Terminal UI |
![]() Permissions and security |
![]() Services layer |
![]() State and data flow |
Quick Start
1. Install Bun
# macOS / Linux
curl -fsSL https://bun.sh/install | bash
# macOS (Homebrew)
brew install bun
# Windows (PowerShell)
powershell -c "irm bun.sh/install.ps1 | iex"
On minimal Linux images, if you see
unzip is required, runapt update && apt install -y unzipfirst.
2. Install Dependencies and Configure
bun install
cp .env.example .env
# Edit .env with your API key — see docs/guide/env-vars.en.md for details
3. Start
macOS / Linux
./bin/claude-haha # Interactive TUI mode
./bin/claude-haha -p "your prompt here" # Headless mode
./bin/claude-haha --help # Show all options
Windows
Prerequisite: Git for Windows must be installed.
# PowerShell / cmd — call Bun directly
bun --env-file=.env ./src/entrypoints/cli.tsx
# Or run inside Git Bash
./bin/claude-haha
4. Global Usage (Optional)
Add bin/ to your PATH to run from any directory. See Global Usage Guide:
export PATH="$HOME/path/to/claude-code-haha/bin:$PATH"
Tech Stack
| Category | Technology |
|---|---|
| Runtime | Bun |
| Language | TypeScript |
| Terminal UI | React + Ink |
| CLI parsing | Commander.js |
| API | Anthropic SDK |
| Protocols | MCP, LSP |
More Documentation
| Document | Description |
|---|---|
| Environment Variables | Full env var reference and configuration methods |
| Third-Party Models | Using OpenAI / DeepSeek / Ollama and other non-Anthropic models |
| Computer Use | Desktop control (screenshots, mouse, keyboard) |
| Memory System | Cross-session persistent memory usage and implementation |
| Global Usage | Run claude-haha from any directory |
| FAQ | Common error troubleshooting |
| Source Fixes | Fixes compared with the original leaked source |
| Project Structure | Code directory structure |
Disclaimer
This repository is based on the Claude Code source leaked from the Anthropic npm registry on 2026-03-31. All original source code copyrights belong to Anthropic. It is provided for learning and research purposes only.








