claude-code-best
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseclaude-code-best
claude-code-best
Skill by ara.so — Claude Code Skills collection.
Claude Code Best (CCB) is a reverse-engineered, production-ready implementation of Anthropic's Claude Code CLI. It's written in TypeScript, runs on Bun or Node.js, and provides enterprise-grade features including multi-instance orchestration, ACP protocol support, Langfuse monitoring, remote control, web search, voice mode, and computer/browser automation.
由ara.so提供的技能 —— Claude Code技能合集。
Claude Code Best(CCB)是Anthropic旗下Claude Code CLI的一个逆向工程实现、可用于生产环境的版本。它使用TypeScript编写,可在Bun或Node.js上运行,并提供企业级功能,包括多实例编排、ACP协议支持、Langfuse监控、远程控制、网页搜索、语音模式以及电脑/浏览器自动化。
What It Does
功能介绍
CCB is an AI coding agent terminal interface that:
- Runs Claude (or compatible models) in your terminal with full file system access
- Supports multi-instance coordination via Pipe IPC and LAN discovery
- Integrates with Zed, Cursor, and other IDEs via ACP protocol
- Provides enterprise monitoring (Langfuse, Sentry, GrowthBook)
- Offers web search, voice input, computer/browser control
- Works with any Anthropic-compatible API provider (OpenAI, Gemini, etc.)
CCB是一款AI编码代理终端界面,具备以下功能:
- 在终端中运行Claude(或兼容模型),拥有完整的文件系统访问权限
- 通过Pipe IPC和局域网发现支持多实例协同
- 通过ACP协议与Zed、Cursor等IDE集成
- 提供企业级监控(Langfuse、Sentry、GrowthBook)
- 支持网页搜索、语音输入、电脑/浏览器控制
- 可与任何Anthropic兼容的API提供商(OpenAI、Gemini等)配合使用
Installation
安装方法
From NPM (Recommended)
从NPM安装(推荐)
bash
npm i -g claude-code-bestbash
npm i -g claude-code-bestStart CCB with Node.js
使用Node.js启动CCB
ccb
ccb
Start CCB with Bun runtime
使用Bun运行时启动CCB
ccb-bun
ccb-bun
Update to latest version
更新至最新版本
ccb update
undefinedccb update
undefinedFrom Source
从源码安装
Prerequisites:
bash
undefined前置要求:
bash
undefinedInstall Bun >= 1.3.11
安装Bun >= 1.3.11
curl -fsSL https://bun.sh/install | bash
exec $SHELL # Reload shell
curl -fsSL https://bun.sh/install | bash
exec $SHELL # 重新加载shell
Verify installation
验证安装
bun --version
bun upgrade # Update if needed
**Clone and run:**
```bash
git clone https://github.com/claude-code-best/claude-code.git
cd claude-code
bun installbun --version
bun upgrade # 如有需要进行更新
**克隆并运行:**
```bash
git clone https://github.com/claude-code-best/claude-code.git
cd claude-code
bun installDevelopment mode (version 888)
开发模式(版本888)
bun run dev
bun run dev
Build for production
生产环境构建
bun run build
bun run build
Run built version
运行构建后的版本
node dist/cli.js
node dist/cli.js
or
或
bun dist/cli.js
undefinedbun dist/cli.js
undefinedConfiguration
配置说明
Login to API Provider
登录API提供商
On first run, enter in the REPL:
/loginbash
ccb首次运行时,在REPL中输入:
/loginbash
ccbIn REPL:
在REPL中:
/login
Choose provider type:
- **Anthropic Compatible** - any Claude-compatible API
- **OpenAI Compatible** - OpenAI or compatible services
- **Gemini Compatible** - Google Gemini API
**Required fields:**
| Field | Description | Example |
|-------|-------------|---------|
| Base URL | API endpoint | `https://api.anthropic.com` |
| API Key | Auth token | `$ANTHROPIC_API_KEY` |
| Haiku Model | Fast model | `claude-haiku-4-5-20251001` |
| Sonnet Model | Balanced model | `claude-sonnet-4-6` |
| Opus Model | Premium model | `claude-opus-4-6` |
Use **Tab/Shift+Tab** to navigate, **Enter** to confirm./login
选择提供商类型:
- **Anthropic兼容** - 任何Claude兼容的API
- **OpenAI兼容** - OpenAI或兼容服务
- **Gemini兼容** - Google Gemini API
**必填字段:**
| 字段 | 描述 | 示例 |
|-------|-------------|---------|
| Base URL | API端点 | `https://api.anthropic.com` |
| API Key | 认证令牌 | `$ANTHROPIC_API_KEY` |
| Haiku Model | 快速模型 | `claude-haiku-4-5-20251001` |
| Sonnet Model | 平衡模型 | `claude-sonnet-4-6` |
| Opus Model | 高级模型 | `claude-opus-4-6` |
使用**Tab/Shift+Tab**导航,**Enter**确认。Environment Variables
环境变量
bash
undefinedbash
undefinedEnable features via FEATURE_<NAME>=1
通过FEATURE_<NAME>=1启用功能
FEATURE_BUDDY=1 ccb
FEATURE_BUDDY=1 ccb
Remote control
远程控制
CLAUDE_BRIDGE_BASE_URL=https://remote-control.claude-code-best.win/
CLAUDE_BRIDGE_OAUTH_TOKEN=$YOUR_TOKEN
ccb --remote-control
CLAUDE_BRIDGE_OAUTH_TOKEN=$YOUR_TOKEN
ccb --remote-control
CLAUDE_BRIDGE_BASE_URL=https://remote-control.claude-code-best.win/
CLAUDE_BRIDGE_OAUTH_TOKEN=$YOUR_TOKEN
ccb --remote-control
CLAUDE_BRIDGE_OAUTH_TOKEN=$YOUR_TOKEN
ccb --remote-control
Langfuse monitoring
Langfuse监控
LANGFUSE_PUBLIC_KEY=$YOUR_KEY
LANGFUSE_SECRET_KEY=$YOUR_SECRET
LANGFUSE_HOST=https://cloud.langfuse.com
ccb
LANGFUSE_SECRET_KEY=$YOUR_SECRET
LANGFUSE_HOST=https://cloud.langfuse.com
ccb
LANGFUSE_PUBLIC_KEY=$YOUR_KEY
LANGFUSE_SECRET_KEY=$YOUR_SECRET
LANGFUSE_HOST=https://cloud.langfuse.com
ccb
LANGFUSE_SECRET_KEY=$YOUR_SECRET
LANGFUSE_HOST=https://cloud.langfuse.com
ccb
Poor mode (reduce API calls)
精简模式(减少API调用)
ccb # then type /poor in REPL
undefinedccb # 然后在REPL中输入/poor
undefinedKey Commands
核心命令
In REPL
在REPL中
bash
/login # Configure API provider
/pipes # Show active pipe connections
/poor # Toggle poor mode (reduce costs)
/dream # Organize memory files
/voice doubao # Enable voice input
/teach-me <topic> # Interactive learning about CCB architecturebash
/login # 配置API提供商
/pipes # 显示活跃的管道连接
/poor # 切换精简模式(降低成本)
/dream # 整理内存文件
/voice doubao # 启用语音输入
/teach-me <topic> # 交互式学习CCB架构Examples:
示例:
/teach-me Claude Code architecture
/teach-me React Ink terminal rendering --level beginner
/teach-me Tool system --resume
undefined/teach-me Claude Code architecture
/teach-me React Ink terminal rendering --level beginner
/teach-me Tool system --resume
undefinedCLI Flags
CLI参数
bash
undefinedbash
undefinedStart with remote control
启动远程控制
ccb --remote-control
ccb --remote-control
Enable channels (external notifications)
启用频道(外部通知)
ccb --channels plugin:name@marketplace
ccb --channels plugin:name@marketplace
Debug mode with inspector
带调试器的调试模式
bun run dev:inspect
bun run dev:inspect
Then attach VS Code debugger (F5 → "Attach to Bun (TUI debug)")
然后连接VS Code调试器(F5 → "Attach to Bun (TUI debug)")
undefinedundefinedUsage Patterns
使用模式
Basic Usage
基础使用
typescript
// CCB is primarily a CLI tool, but internally uses these patterns:
// 1. Tool execution (from src/tools/)
import { executeShellCommand } from './tools/bash';
const result = await executeShellCommand({
command: 'ls -la',
workingDir: process.cwd()
});
// 2. Multi-instance coordination (Pipe IPC)
import { PipeManager } from './ipc/pipe-manager';
const pipeManager = new PipeManager();
await pipeManager.broadcast({
type: 'message',
content: 'Task complete'
});
// 3. Memory management
import { MemoryService } from './memory/service';
const memory = new MemoryService();
await memory.extract({
sessionId: 'current',
content: 'User prefers TypeScript over JavaScript'
});typescript
// CCB主要是一款CLI工具,但内部使用以下模式:
// 1. 工具执行(来自src/tools/)
import { executeShellCommand } from './tools/bash';
const result = await executeShellCommand({
command: 'ls -la',
workingDir: process.cwd()
});
// 2. 多实例协同(Pipe IPC)
import { PipeManager } from './ipc/pipe-manager';
const pipeManager = new PipeManager();
await pipeManager.broadcast({
type: 'message',
content: 'Task complete'
});
// 3. 内存管理
import { MemoryService } from './memory/service';
const memory = new MemoryService();
await memory.extract({
sessionId: 'current',
content: 'User prefers TypeScript over JavaScript'
});Remote Control Setup
远程控制设置
bash
undefinedbash
undefinedSelf-hosted Docker setup
自托管Docker部署
docker run -d
-p 3000:3000
-e OAUTH_SECRET=$YOUR_SECRET
claude-code-remote-control
-p 3000:3000
-e OAUTH_SECRET=$YOUR_SECRET
claude-code-remote-control
docker run -d
-p 3000:3000
-e OAUTH_SECRET=$YOUR_SECRET
claude-code-remote-control
-p 3000:3000
-e OAUTH_SECRET=$YOUR_SECRET
claude-code-remote-control
Client connection
客户端连接
CLAUDE_BRIDGE_BASE_URL=http://localhost:3000
CLAUDE_BRIDGE_OAUTH_TOKEN=$YOUR_TOKEN
ccb --remote-control
CLAUDE_BRIDGE_OAUTH_TOKEN=$YOUR_TOKEN
ccb --remote-control
undefinedCLAUDE_BRIDGE_BASE_URL=http://localhost:3000
CLAUDE_BRIDGE_OAUTH_TOKEN=$YOUR_TOKEN
ccb --remote-control
CLAUDE_BRIDGE_OAUTH_TOKEN=$YOUR_TOKEN
ccb --remote-control
undefinedWeb Search Integration
网页搜索集成
typescript
// Enabled automatically when API keys are set
export BING_SEARCH_API_KEY=$YOUR_BING_KEYtypescript
undefinedor
设置API密钥后自动启用
export BRAVE_SEARCH_API_KEY=$YOUR_BRAVE_KEY
ccb
export BING_SEARCH_API_KEY=$YOUR_BING_KEY
In session, ask: "search for latest TypeScript features"
或
undefinedexport BRAVE_SEARCH_API_KEY=$YOUR_BRAVE_KEY
ccb
Langfuse Monitoring
在会话中询问:"search for latest TypeScript features"
bash
undefinedundefinedConfigure via env vars
Langfuse监控
export LANGFUSE_PUBLIC_KEY=pk-lf-xxx
export LANGFUSE_SECRET_KEY=sk-lf-xxx
export LANGFUSE_HOST=https://cloud.langfuse.com
ccb
bash
undefinedEvery agent loop will be tracked in Langfuse dashboard
通过环境变量配置
undefinedexport LANGFUSE_PUBLIC_KEY=pk-lf-xxx
export LANGFUSE_SECRET_KEY=sk-lf-xxx
export LANGFUSE_HOST=https://cloud.langfuse.com
ccb
Computer Use (Screen Control)
每个代理循环都会在Langfuse仪表盘中被追踪
typescript
// Requires computer-use feature enabled
FEATURE_COMPUTER_USE=1 ccb
// In session:
// "take a screenshot of my screen"
// "click on the file menu"
// "type 'hello world' in the editor"undefinedChrome Automation
电脑控制(屏幕操控)
bash
undefinedtypescript
undefinedInstall chrome-use MCP server first
需要启用computer-use功能
npx @modelcontextprotocol/create-server chrome-use
FEATURE_COMPUTER_USE=1 ccb
Configure in CCB
在会话中:
—
"take a screenshot of my screen"
—
"click on the file menu"
—
"type 'hello world' in the editor"
ccb
undefinedIn REPL: configure MCP server path
Chrome自动化
Usage in session:
—
"open chrome and navigate to github.com"
—
"fill out the login form with my credentials"
—
"scrape the table data from this page"
—
undefinedbash
undefinedDevelopment Patterns
先安装chrome-use MCP服务器
Project Structure
—
claude-code/
├── src/
│ ├── cli.ts # Entry point
│ ├── tools/ # Built-in tools (bash, read_file, etc.)
│ ├── ipc/ # Pipe IPC for multi-instance
│ ├── memory/ # Memory extraction & retrieval
│ ├── providers/ # API provider adapters
│ ├── ui/ # React Ink terminal components
│ └── features/ # Feature flag implementations
├── dist/ # Build output (450+ chunks)
├── build.ts # Bun build script
└── package.jsonnpx @modelcontextprotocol/create-server chrome-use
Adding a Custom Tool
在CCB中配置
typescript
// src/tools/my-custom-tool.ts
import { z } from 'zod';
export const MyCustomToolSchema = z.object({
input: z.string().describe('Tool input parameter')
});
export async function executeMyCustomTool(
params: z.infer<typeof MyCustomToolSchema>
): Promise<string> {
// Your tool logic
return `Processed: ${params.input}`;
}
// Register in src/tools/index.ts
export const tools = [
{
name: 'my_custom_tool',
description: 'Does something useful',
input_schema: MyCustomToolSchema,
execute: executeMyCustomTool
},
// ... other tools
];ccb
Debugging in VS Code
在REPL中:配置MCP服务器路径
—
会话中的使用示例:
—
"open chrome and navigate to github.com"
—
"fill out the login form with my credentials"
—
"scrape the table data from this page"
json
// .vscode/launch.json (already configured)
{
"configurations": [
{
"name": "Attach to Bun (TUI debug)",
"type": "bun",
"request": "attach",
"url": "ws://localhost:8888"
}
]
}Steps:
- Terminal:
bun run dev:inspect - Set breakpoints in
src/ - VS Code: F5 → Select "Attach to Bun (TUI debug)"
undefinedCommon Issues
开发模式
Installation Fails
项目结构
bash
undefinedclaude-code/
├── src/
│ ├── cli.ts # 入口文件
│ ├── tools/ # 内置工具(bash、read_file等)
│ ├── ipc/ # 多实例Pipe IPC
│ ├── memory/ # 内存提取与检索
│ ├── providers/ # API提供商适配器
│ ├── ui/ # React Ink终端组件
│ └── features/ # 功能标志实现
├── dist/ # 构建输出(450+个代码块)
├── build.ts # Bun构建脚本
└── package.jsonClear old versions
添加自定义工具
npm rm -g claude-code-best
typescript
// src/tools/my-custom-tool.ts
import { z } from 'zod';
export const MyCustomToolSchema = z.object({
input: z.string().describe('Tool input parameter')
});
export async function executeMyCustomTool(
params: z.infer<typeof MyCustomToolSchema>
): Promise<string> {
// 你的工具逻辑
return `Processed: ${params.input}`;
}
// 在src/tools/index.ts中注册
export const tools = [
{
name: 'my_custom_tool',
description: 'Does something useful',
input_schema: MyCustomToolSchema,
execute: executeMyCustomTool
},
// ... 其他工具
];Install specific version
在VS Code中调试
npm i -g claude-code-best@5.0.0
json
// .vscode/launch.json(已配置)
{
"configurations": [
{
"name": "Attach to Bun (TUI debug)",
"type": "bun",
"request": "attach",
"url": "ws://localhost:8888"
}
]
}步骤:
- 终端:
bun run dev:inspect - 在中设置断点
src/ - VS Code:F5 → 选择"Attach to Bun (TUI debug)"
If Bun install has issues, use npm
常见问题
—
安装失败
npm i -g claude-code-best
undefinedbash
undefinedBun Not Found After Install
清除旧版本
bash
undefinednpm rm -g claude-code-best
macOS/Linux - reload shell
安装特定版本
exec $SHELL
npm i -g claude-code-best@5.0.0
Or manually source
如果Bun安装有问题,使用npm
source ~/.zshrc # or ~/.bashrc
npm i -g claude-code-best
undefinedWindows - reopen PowerShell
安装后找不到Bun
undefinedbash
undefinedFeature Not Working
macOS/Linux - 重新加载shell
bash
undefinedexec $SHELL
Check feature flags are set
或手动加载
FEATURE_NAME=1 ccb
source /.zshrc # 或/.bashrc
Example for all features:
Windows - 重新打开PowerShell
FEATURE_BUDDY=1
FEATURE_FORK_SUBAGENT=1
FEATURE_WEB_SEARCH=1
ccb
FEATURE_FORK_SUBAGENT=1
FEATURE_WEB_SEARCH=1
ccb
undefinedundefinedAPI Connection Issues
功能无法使用
bash
undefinedbash
undefinedVerify credentials in REPL
检查功能标志是否已设置
/login
FEATURE_NAME=1 ccb
Re-enter Base URL and API Key
启用所有功能的示例:
Test with simple request
—
In session: "what's 2+2"
—
undefinedFEATURE_BUDDY=1
FEATURE_FORK_SUBAGENT=1
FEATURE_WEB_SEARCH=1
ccb
FEATURE_FORK_SUBAGENT=1
FEATURE_WEB_SEARCH=1
ccb
undefinedBuild Errors
API连接问题
bash
undefinedbash
undefinedUpdate Bun to latest
在REPL中验证凭据
bun upgrade
/login
Clean install
重新输入Base URL和API Key
—
用简单请求测试
—
在会话中:"what's 2+2"
rm -rf node_modules bun.lockb
bun install
undefinedRebuild
构建错误
bun run build
undefinedbash
undefinedRemote Control Not Connecting
更新Bun到最新版本
bash
undefinedbun upgrade
Verify env vars are exported
清理安装
echo $CLAUDE_BRIDGE_BASE_URL
echo $CLAUDE_BRIDGE_OAUTH_TOKEN
rm -rf node_modules bun.lockb
bun install
Test with official hosted version
重新构建
CLAUDE_BRIDGE_BASE_URL=https://remote-control.claude-code-best.win/
CLAUDE_BRIDGE_OAUTH_TOKEN=test-my-key
ccb --remote-control
CLAUDE_BRIDGE_OAUTH_TOKEN=test-my-key
ccb --remote-control
undefinedbun run build
undefinedAdvanced Configuration
远程控制无法连接
Multi-Instance Pipe IPC
—
bash
undefinedbash
undefinedTerminal 1 (main instance)
验证环境变量是否已导出
ccb
echo $CLAUDE_BRIDGE_BASE_URL
echo $CLAUDE_BRIDGE_OAUTH_TOKEN
Terminal 2 (sub instance, auto-discovers main)
使用官方托管版本测试
ccb
CLAUDE_BRIDGE_BASE_URL=https://remote-control.claude-code-best.win/
CLAUDE_BRIDGE_OAUTH_TOKEN=test-my-key
ccb --remote-control
CLAUDE_BRIDGE_OAUTH_TOKEN=test-my-key
ccb --remote-control
undefinedIn main REPL:
高级配置
—
多实例Pipe IPC
/pipes # Shows connected instances
bash
undefinedShift+↓ to broadcast message to all pipes
终端1(主实例)
undefinedccb
LAN Cross-Machine Discovery
终端2(子实例,自动发现主实例)
bash
undefinedccb
Machine A
在主REPL中:
FEATURE_LAN_DISCOVERY=1 ccb
/pipes # 显示已连接的实例
Machine B (same network)
Shift+↓ 向所有管道广播消息
FEATURE_LAN_DISCOVERY=1 ccb
undefinedInstances automatically discover and connect
局域网跨机器发现
undefinedbash
undefinedChannels (External Notifications)
机器A
bash
undefinedFEATURE_LAN_DISCOVERY=1 ccb
Install channel plugin (e.g., Slack)
机器B(同一网络)
ccb --channels plugin:slack@marketplace
FEATURE_LAN_DISCOVERY=1 ccb
Configure webhook in REPL
实例会自动发现并连接
Now external events can push messages into session
—
undefinedundefinedCustom Memory Optimization
频道(外部通知)
bash
undefinedbash
undefinedIn REPL, manually trigger memory organization
安装频道插件(如Slack)
/dream
ccb --channels plugin:slack@marketplace
Or configure auto-dream
在REPL中配置webhook
—
现在外部事件可以将消息推送到会话中
FEATURE_AUTO_DREAM=1 ccb
undefinedundefinedResources
自定义内存优化
- Homepage: https://ccb.agent-aura.top/
- Documentation: https://ccb.agent-aura.top/docs/
- GitHub: https://github.com/claude-code-best/claude-code
- Discord: https://discord.gg/uApuzJWGKX
- Feature Docs: See in repository
docs/features/
bash
undefinedExample Session
在REPL中手动触发内存整理
bash
$ ccb
Claude Code Best v5.0.0
You: I need to analyze all TypeScript files in src/ and create a dependency graph/dream
—
或配置自动整理
—
FEATURE_AUTO_DREAM=1 ccb
undefined—
资源
—
- 主页: https://ccb.agent-aura.top/
- 文档: https://ccb.agent-aura.top/docs/
- GitHub: https://github.com/claude-code-best/claude-code
- Discord: https://discord.gg/uApuzJWGKX
- 功能文档: 查看仓库中的目录
docs/features/
—
示例会话
—
bash
$ ccb
Claude Code Best v5.0.0
You: I need to analyze all TypeScript files in src/ and create a dependency graph