Five gaps closed against the updated product-package spec (http://gitee.ath.cx:3000/xiaohei/heicode/src/branch/main/docs/product-package): P1. /dashboard hero rewritten per §10 §"初始首页" features/dashboard/components/home-hero.tsx replaces the technical CockpitView with four blocks the spec mandates: 主输入 / 继续任务 / 今日焦点 / 辅助入口. Main input is "你想把什么想法变成可以上线的软件?". Submit only stashes the idea to localStorage + toast — the actual task conversation belongs in the desktop client per §13 §5.1. P2. /tasks/$id TaskCard route per §10 §"任务卡" + §11 §3 features/tasks/task-card-view.tsx renders one AgnetDeployment as the user-facing task object: 目标 / 第一版范围 / 自动生成 / 待确认上下文 + Manager 辅助按钮. Linked from Home hero's 继续任务 list. P3. /sk-sources 推荐摘要 dialog per §10 §"推荐确认卡" features/agnet-console/pages.tsx RecommendationSummaryDialog. Five blocks (本次会做 / 本次允许使用 / 本次不会做 / 高危规则 / 预计消耗) + Launch Agnet button with "参数由 Heicode 自动生成" caption. No JSON editor, no permission manifest — §10 高级展开禁令. P4. /audit redacted card view per §10 §"任务用量与审计" + §6 features/agnet-console/pages.tsx AgnetAuditPage. Old裸 table replaced with脱敏 cards exposing only the fields docs allows: resource_id / resource_type / allowed_actions / constraints / secret_ref. Helper function maskIfSecret() catches any stray plaintext credential the backend might leak. Banner says explicitly "明文密钥从不展示". P5. Login screen filters Claude Official provider per §8 cc-haha/desktop/src/components/login/HeicodeLoginPage.tsx hides the legacy `official` preset so the login carries Heicode brand alone. i18n fix (BIG): i18next defaults to `defaultNS = 'translation'`. The earlier custom keys had been written to the JSON root, NOT into translation, so every t('Preparation checklist') was returning the English key as fallback all along. Moved 67 orphan keys (zh+en, both files) into the translation namespace where they're actually resolvable. Verified by loading i18next + zh.json in bun and confirming all keys resolve to the expected Chinese strings. Cache-busting from earlier session (already deployed via SFTP, never committed): index.html / constants.ts / footer.tsx now hold the ?v=h-glass-2 suffixed asset URLs in git, so future docker rebuilds preserve them. Per user directive: tested locally only (TS check clean, i18next resolves correctly). NOT deploying to the VM in this commit — user asked to keep production untouched until they verify the changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Claude Code Haha
A locally runnable version repaired from the leaked Claude Code source, with support for any Anthropic-compatible API endpoint (MiniMax, OpenRouter, etc.). Beyond the full TUI, we've also completed Computer Use (macOS / Windows), built a GUI desktop app, and enabled full remote control via Telegram / Feishu.
Features · Desktop · 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)
- Memory System (cross-session persistent memory) — Usage Guide
- Multi-Agent System (agent orchestration, parallel tasks, Teams collaboration) — Usage Guide | Implementation
- Skills System (extensible capability plugins, custom workflows) — Usage Guide | Implementation
- Channel System (remote Agent control via Telegram/Feishu/Discord IM platforms) — Architecture
- Computer Use desktop control — Guide | Architecture
- Desktop App (Tauri 2 + React GUI client, multi-tab multi-session) — Docs
- 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 |
Desktop Preview
![]() Main Interface |
![]() Code Editing & Diff View |
![]() Permission Control & AI Questions |
![]() Multi-Provider Management |
![]() Scheduled Tasks |
![]() IM Adapters (Telegram / Feishu) |
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/en/guide/env-vars.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"
5. Desktop Development
If you are developing or testing the desktop/ frontend, start both the API server and the desktop frontend.
5.1 Start the API server
cd /Users/nanmi/workspace/myself_code/claude-code-haha
SERVER_PORT=3456 bun run src/server/index.ts
Optional health check:
curl http://127.0.0.1:3456/health
5.2 Start the desktop frontend
cd /Users/nanmi/workspace/myself_code/claude-code-haha/desktop
bun run dev --host 127.0.0.1 --port 2024
Then open:
http://127.0.0.1:2024
5.3 Notes
- If port
3456is already occupied by an old server process, runlsof -nP -iTCP:3456 -sTCP:LISTEN, find the PID, thenkill <PID>. - For chat testing, create a fresh session and re-select a real working directory.
- If an old session points to a deleted directory, the server will return
Working directory does not exist. That is separate from whether the API server is running.
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 |
| Memory System | Cross-session persistent memory usage and implementation |
| Multi-Agent System | Agent orchestration, parallel tasks and Teams collaboration |
| Skills System | Extensible capability plugins, custom workflows and conditional activation |
| Channel System | Remote Agent control via Telegram/Feishu/Discord IM platforms |
| Computer Use | Desktop control (screenshots, mouse, keyboard) — Architecture |
| Desktop App | Tauri 2 + React GUI client — Quick Start | Architecture | Installation |
| 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 |
Sponsorship & Partnership
This project is maintained in the author's spare time. Corporate or individual sponsorships are welcome to support ongoing development. Custom features, integrations, and business partnerships are also open for discussion.
| Sponsor | Description |
|---|---|
|
接口AI |
Thanks to JieKou AI for sponsoring this project. JieKou AI provides official model resources with stable, high-performance API access. Subscription bundles are priced at 20% off the official rate; new users who register through this link and bind GitHub can claim a $3 coupon. |
|
|
Thanks to ShengSuanYun for sponsoring this project. ShengSuanYun is an industrial-grade AI task parallel execution platform for AI Native Teams, aggregating Claude, ChatGPT, Gemini, and other LLM, image, and video model capacity through direct, non-reverse-engineered access. Its platform SLA reaches 99.7%, with service status available online. It also supports dedicated enterprise gateways, cost and permission controls, smart routing, security protection, BYOK, usage-based billing, upcoming tokens plans, and invoicing. New users registering through this link can receive 10 yuan in model credits plus a 10% first top-up bonus. |
📧 Contact: relakkes@gmail.com
☕ Buy Me a Coffee
If this project helps you, consider buying me a coffee — every bit of support keeps this project going ❤️
![]() WeChat Pay |
![]() Alipay |
Buy Me a Coffee |
Thanks
Thanks to the following open-source projects and community practices for reference and inspiration:
- React: frontend engineering and component-based UI ecosystem.
- Tauri: cross-platform desktop app capabilities and engineering practices.
- cc-switch: reference for model provider configuration.
⭐ Star History
If this project helps you, please support it with a ⭐ Star so more people can discover Claude Code Haha.
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.
















