程序员阿江(Relakkes) e0142b286b Keep built-in provider presets aligned with vendor-supported model IDs
The provider picker had two separate preset definitions and some defaults had
started to drift from the model IDs vendors document for Claude Code /
Anthropic-compatible usage. This change moves built-in presets to one
server-side JSON source, serves that source through the existing presets API,
and makes the desktop settings page consume the API instead of a duplicated
frontend constant. The preset defaults were then corrected against vendor docs
so the built-in values match documented model IDs and casing.

Constraint: Built-in provider defaults must match official vendor Claude Code or Anthropic docs
Rejected: Keep duplicated frontend and backend preset lists | values and casing drifted independently
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Update src/server/config/providerPresets.json and rerun provider-presets tests before changing built-in provider defaults again
Tested: bun test src/server/__tests__/provider-presets.test.ts; cd desktop && bun run lint
Not-tested: Manual desktop settings UI interaction after fetching presets from the API
2026-04-22 17:06:35 +08:00

Claude Code Haha

Claude Code Haha

GitHub Stars GitHub Forks GitHub Issues GitHub Pull Requests License 中文 English Docs

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)
  • --print headless 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 controlGuide | 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
Overall architecture
Request lifecycle
Request lifecycle
Tool system
Tool system
Multi-agent architecture
Multi-agent architecture
Terminal UI
Terminal UI
Permissions and security
Permissions and security
Services layer
Services layer
State and data flow
State and data flow

Desktop Preview

Download Desktop   Install Guide

Main UI
Main Interface
Code Editing
Code Editing & Diff View
Permission Control
Permission Control & AI Questions
Provider Settings
Multi-Provider Management
Scheduled Tasks
Scheduled Tasks
IM Adapters
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, run apt update && apt install -y unzip first.

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 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
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.

📧 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
WeChat Pay
Alipay
Alipay
Buy Me a Coffee
Buy Me a Coffee

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.

Description
Claude Code 泄露源码 - 本地可运行版本,新增跨平台桌面端软件补齐Computer Use(附带核心模块解析)
Readme 115 MiB
Languages
TypeScript 99.4%
Python 0.2%
Shell 0.2%
Rust 0.1%