桌面端用 bypassPermissions 进入计划模式、退出后,权限选择器停留在"计划模式", 导致下一个工具调用又弹权限申请。两层根因都修: - 回传链路断裂:服务端 WS handler 把 CLI 广播的权限模式变化(status:null + permissionMode)当成 thinking 丢弃,桌面端协议也没有承载权限模式的入站消息, CLI 恢复后的权限永远同步不到 UI。新增 permission_mode_changed 回传通道,桌面端 据此校正选择器(只更新本地、不回发避免回环;未知模式忽略)。 - 重启抹掉 prePlanMode:bypass→plan 因策略"切换涉及 bypass 就重启"而重启 CLI, 新进程直接以 plan 启动、prePlanMode 为空,ExitPlanMode 只能恢复成 default 而非 bypassPermissions。收窄 needsRestart 为只在"进入 bypass"时重启;从 bypass 切出 保持进程不变、走进程内 transition,CLI 才会栈存 prePlanMode 并在退出 plan 时 正确恢复 bypass,与 TUI 行为一致。 测试:服务端 ws-memory-events 新增权限回传 + 重启策略用例;桌面端 chatStore 新增 回传校正 + 防回环 + 未知模式忽略用例。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude Code Haha
A Claude Code build repaired from the source leaked from Anthropic's npm registry on 2026-03-31. Claude Code Haha is now primarily a desktop Claude Code workspace for macOS, Windows, and Linux: sessions, projects, branch / Worktree launch, right-side file changes, code diffs, permission review, provider setup, Computer Use, H5 remote access, IM integration, and scheduled tasks in one app.
Desktop Preview · Install · Highlights · Sponsorship · More Docs
Desktop Preview
The Claude Code Haha desktop app brings sessions, multi-project navigation, branch / Worktree controls, right-side file changes, code diffs, permission review, provider setup, and remote access into one graphical workspace for daily development flows beyond the terminal.
![]() Desktop Workspace |
![]() Right-side Changes & Worktree |
![]() Code Editing & Diff View |
![]() Permission Review & AI Questions |
![]() H5 Remote Access |
![]() Token Usage |
![]() Computer Use |
![]() Scheduled Tasks |
Install the Desktop App
- Download the macOS / Windows / Linux desktop installer from Releases.
- On first launch, configure your model provider, API key, and default model in Settings.
- This build is currently unsigned, so the first launch needs a one-time manual approval (clear quarantine on macOS, click "Run anyway" on Windows). See the desktop installation guide.
Run the CLI from Source
For users who want to debug the underlying CLI, server, or local development flow:
bun install
cp .env.example .env
./bin/claude-haha
See environment variables and global usage for more configuration options.
Desktop Highlights
- Multi-session workspace: tabs, project switching, terminal entry, and session history in one place.
- Branch / Worktree launch: choose a repository branch and decide whether to use the current working tree or an isolated Worktree.
- Right-side file changes: review changed files, added/removed lines, and current workspace state while chatting.
- Visual code changes: inspect edits, file writes, and diffs directly in the desktop app.
- Permission review: approve risky commands, tool calls, and model follow-up questions in the GUI.
- Multi-provider setup: configure Anthropic-compatible APIs, third-party models, WebSearch fallback, and local options.
- Computer Use: let the agent take screenshots, click, type, and control desktop apps after authorization.
- H5 remote access: open the current desktop session from a phone or another device with a one-time token.
- IM integration: chat, switch projects, and approve actions through Telegram / Feishu / WeChat / DingTalk.
- Scheduled tasks and usage stats: create planned tasks and track local token usage trends.
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 |
| Contributing | Local tests, live model baselines, PR gates, and release gates |
| 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 |
| IM Integration | Remote chat, project switching, and permission approval via Telegram / Feishu / WeChat / DingTalk |
| Computer Use | Desktop control (screenshots, mouse, keyboard) — Architecture |
| Desktop App | Electron + 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 |
Tech Stack
| Category | Technology |
|---|---|
| Language | TypeScript |
| Desktop app | Electron |
| Desktop UI | React + Vite |
| Local runtime | Bun |
| Terminal UI | React + Ink |
| CLI parsing | Commander.js |
| API | Anthropic SDK |
| Protocols | MCP, LSP |
Thanks
Thanks to the following open-source projects and community practices for reference and inspiration:
- React: frontend engineering and component-based UI ecosystem.
- Electron: 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.










