claude-code-best f69c705166 Fix/bypass root confirm (#1275)
* fix(ink): 主屏幕模式周期性终端重绘, 防止长时间运行 TUI 显示腐蚀

- 添加 lastMainScreenHealTime 字段, 每 5 秒触发一次全量终端重绘
- 使用 wall-clock 时间替代帧计数, 避免 drain frames (250fps) 加速周期
- 添加 isTTY 守卫, 防止非 TTY 环境泄漏 ANSI 转义序列
- 扩展 needsEraseBeforePaint 到主屏幕模式, BSU/ESU 确保原子性无闪烁
- 修复 log-update cursor 漂移和 blit ghosting 导致的文字重叠/残留

Co-Authored-By: deepseek-v4-pro <deepseek-ai@claude-code-best.win>

* fix(messages): lookups 缓存感知 progress tick 替换, 修复 Bash 进度时间卡死

REPL.tsx 用原地替换处理 ephemeral progress (Bash/PowerShell/MCP) 以
限制 messages 数组增长, 但 computeMessageStructureKey 只把 parentToolUseID
计入 key, 替换前后 key 完全相同, Messages.tsx 的 lookups 缓存命中,
updateMessageLookupsIncremental 长度相同时又直接返回 existing, 导致
progressMessagesByToolUseID 永远停在首条 tick, ShellProgressMessage 的
elapsed time 卡在首次显示值不动.

- computeMessageStructureKey: 加入 progress.uuid, tick 替换后 key 必变
- updateMessageLookupsIncremental: 长度相同 + 末尾为 progress 时返回 null
  触发 full rebuild, 让新 tick 进入 progressMessagesByToolUseID

补充 4 个测试覆盖 bug 行为与 fast path 保护.

Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>

* fix: bypass 模式在 root/sudo 下改为警告 + y 确认而非直接退出

交互式 TTY 下打印风险警告并等待用户输入 y 才进入 bypass 模式;
非 TTY (pipe/ACP/CI) 维持原 exit(1) 行为,因为无法交互确认。

Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>

---------

Co-authored-by: deepseek-v4-pro <deepseek-ai@claude-code-best.win>
Co-authored-by: glm-5.2 <zai-org@claude-code-best.win>
2026-06-19 10:17:47 +08:00
2026-05-04 23:53:28 +08:00
2026-06-15 19:08:31 +08:00
2026-06-19 10:17:47 +08:00
2026-06-19 10:17:47 +08:00
2026-05-01 21:39:30 +08:00
2026-05-01 21:39:30 +08:00
2026-04-19 08:45:06 +08:00
2026-06-14 18:13:49 +08:00
2026-06-15 00:28:17 +00:00
2026-04-11 23:22:55 +08:00
2026-06-09 11:50:46 +08:00
2026-04-06 11:04:13 +08:00
2026-05-01 21:39:30 +08:00
2026-06-18 15:19:26 +08:00
2026-05-31 22:11:29 +08:00
2026-04-01 08:54:08 +08:00

Claude Code Best V5 (CCB)

GitHub Stars GitHub Contributors GitHub Issues GitHub License Last Commit Bun

Which Claude do you like? The open source one is the best.

A reverse-engineered / decompiled source restoration of Anthropic's official Claude Code CLI tool. The goal is to reproduce most of Claude Code's functionality and engineering capabilities. It's abbreviated as CCB.

Documentation (Chinese) — PR contributions welcome.

Sponsor placeholder.

  • v1: Basic runability and type checking pass
  • V2: Complete engineering infrastructure
    • Biome formatting may not be implemented first to avoid code conflicts
    • Build pipeline complete, output runnable on both Node.js and Bun
  • V3: Extensive documentation and documentation site improvements
  • V4: Large-scale test suite for improved stability
    • Buddy pet feature restored Docs
    • Auto Mode restored Docs
    • All features now configurable via environment variables instead of bun --feature
  • V5: Enterprise-grade monitoring/reporting, missing tools补全, restrictions removed
    • Removed anti-distillation code
    • Web search capability (using Bing) Docs
    • Debug mode support Docs
    • Disabled auto-updates
    • Custom Sentry error reporting support Docs
    • Custom GrowthBook support (GB is open source — configure your own feature flag platform) Docs
    • Custom login mode — configure Claude models your way
  • V6: Large-scale refactoring, full modular packaging
    • V6 will be a new branch; main branch will be archived as a historical version

I don't know how long this project will survive. Star + Fork + git clone + .zip is the safest bet.

This project updates rapidly — Opus continuously optimizes in the background, with new changes almost every few hours.

Claude has burned over $1000, out of budget, switching to GLM to continue; @zai-org GLM 5.1 is quite capable.

Quick Start

Prerequisites

Make sure you're on the latest version of Bun, otherwise you'll run into all sorts of weird bugs. Run bun upgrade!

  • Bun >= 1.3.11

Install Bun:

# Linux and macOS
curl -fsSL https://bun.sh/install | bash

# Windows (PowerShell)
powershell -c "irm bun.sh/install.ps1 | iex"

Post-installation steps:

  1. Make bun available in the current terminal

    The installer adds ~/.bun/bin to the matching shell configuration file. On macOS with the default zsh shell, you may see:

    Added "~/.bun/bin" to $PATH in "~/.zshrc"
    

    Restart the current shell as the installer suggests:

    exec /bin/zsh
    

    If you use bash, reload the bash configuration:

    source ~/.bashrc
    

    Windows PowerShell users can close and reopen PowerShell.

  2. Verify that Bun is available:

    bun --help
    bun --version
    
  3. Update to latest version (if already installed):

    bun upgrade
    
  • Standard Claude Code configuration — each provider has its own setup method

Command Execution Location

  • Bun installation and checking commands can be run from any directory: curl -fsSL https://bun.sh/install | bash, bun --help, bun --version, bun upgrade
  • Project dependency installation, development mode, and builds must be run from this repository root, the directory containing package.json.

Install

cd /path/to/claude-code
bun install

Run

# Dev mode — if you see version 888, it's working
bun run dev

# Build
bun run build

The build uses code splitting (build.ts), outputting to dist/ (entry dist/cli.js + ~450 chunk files).

The build output runs on both Bun and Node.js — you can publish to a private registry and run directly.

If you encounter a bug, please open an issue — we'll prioritize it.

First-time Setup /login

After the first run, enter /login in the REPL to access the login configuration screen. Select Anthropic Compatible to connect to third-party API-compatible services (no Anthropic account required).

Fields to fill in:

Field Description Example
Base URL API service URL https://api.example.com/v1
API Key Authentication key sk-xxx
Haiku Model Fast model ID claude-haiku-4-5-20251001
Sonnet Model Balanced model ID claude-sonnet-4-6
Opus Model High-performance model ID claude-opus-4-6
  • Tab / Shift+Tab to switch fields, Enter to confirm and move to the next, press Enter on the last field to save
  • Model fields auto-fill from current environment variables
  • Configuration saves to ~/.claude/settings.json under the env key, effective immediately

You can also edit ~/.claude/settings.json directly:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.example.com/v1",
    "ANTHROPIC_AUTH_TOKEN": "sk-xxx",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5-20251001",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6"
  }
}

Supports all Anthropic API-compatible services (e.g., OpenRouter, AWS Bedrock proxies, etc.) as long as the interface is compatible with the Messages API.

Feature Flags

All feature toggles are enabled via FEATURE_<FLAG_NAME>=1 environment variables, for example:

FEATURE_BUDDY=1 FEATURE_FORK_SUBAGENT=1 bun run dev

See docs/features/ for detailed descriptions of each feature. Contributions welcome.

VS Code Debugging

The TUI (REPL) mode requires a real terminal and cannot be launched directly via VS Code's launch config. Use attach mode:

Steps

  1. Start inspect server in terminal:

    bun run dev:inspect
    

    This outputs an address like ws://localhost:8888/xxxxxxxx.

  2. Attach debugger from VS Code:

    • Set breakpoints in src/ files
    • Press F5 → select "Attach to Bun (TUI debug)"

Contributors

Star History

Star History Chart

License

This project is for educational and research purposes only. All rights to Claude Code belong to Anthropic.

Description
原汁原昧 Claude Code 可运行,可构建版; Typescript 类型全修复; 企业级可靠性; 安全无毒, lock 文件保真, 可直接 bun i; bun run dev 启动
Readme 522 MiB
Languages
TypeScript 99.8%