mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
- Add Tauri sidecar architecture: Rust shell spawns claude-server binary, dynamic port allocation, health-check wait loop, graceful shutdown - Fix CORS middleware to accept `tauri://localhost` and `https://tauri.localhost` origins from Tauri WebView, and add CORS headers to /health endpoint - Enable native macOS window decorations (traffic lights) with Overlay title bar, add data-tauri-drag-region on sidebar for window dragging - Conditionally apply desktop-only padding (44px for traffic lights) vs web (12px) - Generate brand identity: light-background app icon, horizontal logo, full icon set (icns/ico/png) for Tauri bundle - Add brand mark + GitHub link in sidebar, replace mascot SVG with app icon in EmptySession page - Update README (zh/en) and docs hero image with new branding - Add sidecar build scripts and launcher entry points - Gitignore Rust target/, Tauri gen/, and brand-assets candidates Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
195 lines
8.0 KiB
Markdown
195 lines
8.0 KiB
Markdown
# Claude Code Haha
|
|
|
|
<p align="center">
|
|
<img src="docs/images/app-icon.jpg" alt="Claude Code Haha" width="128" style="border-radius: 22px;">
|
|
</p>
|
|
|
|
<p align="center">
|
|
<img src="docs/images/logo-horizontal.jpg" alt="Claude Code Haha" width="480">
|
|
</p>
|
|
|
|
<div align="center">
|
|
|
|
[](https://github.com/NanmiCoder/cc-haha/stargazers)
|
|
[](https://github.com/NanmiCoder/cc-haha/network/members)
|
|
[](https://github.com/NanmiCoder/cc-haha/issues)
|
|
[](https://github.com/NanmiCoder/cc-haha/pulls)
|
|
[](https://github.com/NanmiCoder/cc-haha/blob/main/LICENSE)
|
|
[](README.md)
|
|
[](README.en.md)
|
|
[](https://claudecode-haha.relakkesyang.org)
|
|
|
|
</div>
|
|
|
|
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.
|
|
|
|
<p align="center">
|
|
<a href="#features">Features</a> · <a href="#architecture-overview">Architecture</a> · <a href="#quick-start">Quick Start</a> · <a href="docs/en/guide/env-vars.md">Env Vars</a> · <a href="docs/en/guide/faq.md">FAQ</a> · <a href="docs/en/guide/global-usage.md">Global Usage</a> · <a href="#more-documentation">More Docs</a>
|
|
</p>
|
|
|
|
---
|
|
|
|
## Features
|
|
|
|
- Full Ink TUI experience (matching the official Claude Code interface)
|
|
- `--print` headless mode for scripts and CI
|
|
- MCP server, plugin, and Skills support
|
|
- Custom API endpoint and model support ([Third-Party Models Guide](docs/en/guide/third-party-models.md))
|
|
- **Memory System** (cross-session persistent memory) — [Usage Guide](docs/memory/01-usage-guide.md)
|
|
- **Multi-Agent System** (agent orchestration, parallel tasks, Teams collaboration) — [Usage Guide](docs/agent/01-usage-guide.md) | [Implementation](docs/agent/02-implementation.md)
|
|
- **Skills System** (extensible capability plugins, custom workflows) — [Usage Guide](docs/skills/01-usage-guide.md) | [Implementation](docs/skills/02-implementation.md)
|
|
- **Channel System** (remote Agent control via Telegram/Feishu/Discord IM platforms) — [Architecture](docs/en/channel/01-channel-system.md)
|
|
- **Computer Use desktop control** — [Guide](docs/en/features/computer-use.md) | [Architecture](docs/en/features/computer-use-architecture.md)
|
|
- Fallback Recovery CLI mode (`CLAUDE_CODE_FORCE_RECOVERY_CLI=1 ./bin/claude-haha`)
|
|
|
|
---
|
|
|
|
## Architecture Overview
|
|
|
|
<table>
|
|
<tr>
|
|
<td align="center" width="25%"><img src="docs/images/01-overall-architecture.png" alt="Overall architecture"><br><b>Overall architecture</b></td>
|
|
<td align="center" width="25%"><img src="docs/images/02-request-lifecycle.png" alt="Request lifecycle"><br><b>Request lifecycle</b></td>
|
|
<td align="center" width="25%"><img src="docs/images/03-tool-system.png" alt="Tool system"><br><b>Tool system</b></td>
|
|
<td align="center" width="25%"><img src="docs/images/04-multi-agent.png" alt="Multi-agent architecture"><br><b>Multi-agent architecture</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="25%"><img src="docs/images/05-terminal-ui.png" alt="Terminal UI"><br><b>Terminal UI</b></td>
|
|
<td align="center" width="25%"><img src="docs/images/06-permission-security.png" alt="Permissions and security"><br><b>Permissions and security</b></td>
|
|
<td align="center" width="25%"><img src="docs/images/07-services-layer.png" alt="Services layer"><br><b>Services layer</b></td>
|
|
<td align="center" width="25%"><img src="docs/images/08-state-data-flow.png" alt="State and data flow"><br><b>State and data flow</b></td>
|
|
</tr>
|
|
</table>
|
|
|
|
---
|
|
|
|
## Quick Start
|
|
|
|
### 1. Install Bun
|
|
|
|
```bash
|
|
# 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`, run `apt update && apt install -y unzip` first.
|
|
|
|
### 2. Install Dependencies and Configure
|
|
|
|
```bash
|
|
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
|
|
|
|
```bash
|
|
./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](https://git-scm.com/download/win) must be installed.
|
|
|
|
```powershell
|
|
# 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](docs/en/guide/global-usage.md):
|
|
|
|
```bash
|
|
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
|
|
|
|
```bash
|
|
cd /Users/nanmi/workspace/myself_code/claude-code-haha
|
|
SERVER_PORT=3456 bun run src/server/index.ts
|
|
```
|
|
|
|
Optional health check:
|
|
|
|
```bash
|
|
curl http://127.0.0.1:3456/health
|
|
```
|
|
|
|
#### 5.2 Start the desktop frontend
|
|
|
|
```bash
|
|
cd /Users/nanmi/workspace/myself_code/claude-code-haha/desktop
|
|
bun run dev --host 127.0.0.1 --port 2024
|
|
```
|
|
|
|
Then open:
|
|
|
|
```text
|
|
http://127.0.0.1:2024
|
|
```
|
|
|
|
#### 5.3 Notes
|
|
|
|
- If port `3456` is already occupied by an old server process, run `lsof -nP -iTCP:3456 -sTCP:LISTEN`, find the PID, then `kill <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](https://bun.sh) |
|
|
| Language | TypeScript |
|
|
| Terminal UI | React + [Ink](https://github.com/vadimdemedes/ink) |
|
|
| CLI parsing | Commander.js |
|
|
| API | Anthropic SDK |
|
|
| Protocols | MCP, LSP |
|
|
|
|
---
|
|
|
|
## More Documentation
|
|
|
|
| Document | Description |
|
|
|------|------|
|
|
| [Environment Variables](docs/en/guide/env-vars.md) | Full env var reference and configuration methods |
|
|
| [Third-Party Models](docs/en/guide/third-party-models.md) | Using OpenAI / DeepSeek / Ollama and other non-Anthropic models |
|
|
| [Memory System](docs/memory/01-usage-guide.md) | Cross-session persistent memory usage and implementation |
|
|
| [Multi-Agent System](docs/agent/01-usage-guide.md) | Agent orchestration, parallel tasks and Teams collaboration |
|
|
| [Skills System](docs/skills/01-usage-guide.md) | Extensible capability plugins, custom workflows and conditional activation |
|
|
| [Channel System](docs/en/channel/01-channel-system.md) | Remote Agent control via Telegram/Feishu/Discord IM platforms |
|
|
| [Computer Use](docs/en/features/computer-use.md) | Desktop control (screenshots, mouse, keyboard) — [Architecture](docs/en/features/computer-use-architecture.md) |
|
|
| [Global Usage](docs/en/guide/global-usage.md) | Run claude-haha from any directory |
|
|
| [FAQ](docs/en/guide/faq.md) | Common error troubleshooting |
|
|
| [Source Fixes](docs/en/reference/fixes.md) | Fixes compared with the original leaked source |
|
|
| [Project Structure](docs/en/reference/project-structure.md) | 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](https://www.anthropic.com). It is provided for learning and research purposes only.
|