An open-source, extended implementation of Anthropic's Claude Code CLI — multi-agent orchestration, Artifacts, ACP protocol, Langfuse, and more.
Claude Code Best (CCB) is a reverse-engineered, open-source implementation of Anthropic's Claude Code CLI, extended with enterprise features that are otherwise restricted. It is a production TypeScript/Bun project with ~90 slash commands, a full multi-provider API layer, workflow orchestration, pipe IPC for multi-instance coordination, ACP protocol for IDE integration, Langfuse observability, and a self-hostable remote control UI.
src/
entrypoints/ CLI boot (cli.tsx) + SDK path
commands/ ~90 slash-command directories, each with index.ts + impl
services/ Background services — goal, ACP, Langfuse, providers, MCP, LSP, memory, etc.
components/ Ink/React terminal UI components
tasks/ Task types — local, workflow, dream, remote, shell, pipe
workflow/ Workflow orchestration engine integration + panel UI
utils/ Pipe IPC registry, LAN beacon, swarm, computerUse, settings, skills
bridge/ Bridge transport layer
packages/ Internal workspace packages
| Command | What it does |
|---|---|
/goal | Set a persistent objective; agent auto-continues across turns. Subcommands: status, clear, pause, resume, complete. Token budget and completion/blocked audit built in. |
/artifacts | List HTML artifacts uploaded to cloud-artifacts in the current session |
/pipes | Inspect pipe registry (main/sub roles, LAN peers), toggle selector, select/deselect named pipes for broadcast |
/workflows | Dual-pane monitoring panel — real-time run/phase/agent progress with keyboard controls |
/poor | Toggle "poor mode": disables extract_memories and prompt_suggestion to reduce token use |
/voice | Toggle voice mode (doubao backend supported); gated by isVoiceAvailable() |
/recap / /away / /catchup | Generate a ≤40-word orientation sentence for current session state |
/triggers / /cron | Manage cloud scheduled agent triggers (requires Claude Pro/Max/Team) |
/teleport / /tp | Resume a Claude Code session from claude.ai by SESSION_ID |
/skills | List available skills |
/buddy | Hatch a coding companion (gated by isBuddyLive()) |
/vault / /local-vault / /memory | Secret storage and memory management |
/fork | Fork a session |
/attach / /detach | Attach/detach pipe IPC sessions |
/compact | Compact context |
/effort | Set effort level |
/plan | UltraPlan |
/mode | Switch persona mode |
/diff, /export, /summary, /review | Code review, diff, export, summarize |
/send | Send message to a named pipe |
| Service | Purpose |
|---|---|
services/goal/ | Goal state machine — persists objective, token budget, completion/blocked audit, auto-continuation |
services/acp/ | ACP (Agent Client Protocol) server — routes stdio to/from IDE clients (Zed, Cursor); manages multiple AcpAgent sessions |
services/langfuse/ | Full Langfuse integration — wraps every agent loop, tool call, and LLM observation with traces and spans |
services/api/ | Multi-provider API clients: Anthropic (+ Bedrock), Gemini, OpenAI-compatible, Grok |
services/autoDream/ | Background memory consolidation (powers /dream) |
services/providerRegistry/ | Dynamic provider registration and runtime switching |
services/compact/ | Context compaction |
services/lsp/ | LSP integration |
services/mcp/ | MCP server management |
services/skillLearning/ | Skill indexing and retrieval |
services/SessionMemory/ | Per-session memory |
services/localVault/ | Local secret vault |
src/utils/pipeRegistry.ts + pipeTransport.ts + lanBeacon.js:
registry.json with file locking tracks all instances by OS-level machineIdmachineId — survives restartsmergeWithLanPeers() integrates cross-machine entriesid, pid, machineId, ip, mac, hostname, pipeName, tcpPort, lanVisible/pipes select <name> adds a pipe to selectedPipes for message broadcastsrc/workflow/service.ts imports from packages/workflow-engine — a deterministic JS script orchestration engine with zero external dependencies.
Scripts define agent, pipeline, parallel, and phase operations. The WorkflowService exposes:
launch(script) // parse → register → detached runWorkflow
kill(runId) // stop a run
killAgent(runId, agentId)
listRuns()
getRun()Persists the 20 most recent runs. The /workflows panel shows real-time run/phase/agent state.
| Package | Purpose |
|---|---|
cloud-artifacts | Cloudflare Worker + R2 HTML artifact host; POST /upload → hash URL, 7d/30d expiry |
workflow-engine | Deterministic JS script orchestration engine (agent/pipeline/parallel/phase) |
remote-control-server | Docker-hosted remote UI (React web + Dockerfile) |
acp-link | ACP protocol link layer |
agent-tools | Agent tool definitions |
builtin-tools | Built-in tool implementations |
mcp-client | MCP client |
audio-capture-napi | Native audio capture (voice mode) |
color-diff-napi | Native color diff renderer |
image-processor-napi | Native image processing |
weixin | WeChat channel integration |
# Primary build (Bun bundler, outputs dist/cli.js + chunks)
bun run build
# Alternative build (Vite pipeline, feature-flag DCE at build time)
bun run build:vite
# Dev
bun run dev
bun run dev:inspect # debugger on port 9229
# Pre-commit gate — must pass zero errors
bun run precheck # typecheck + lint fix + testfeature('...') gates unused code branches at build time — Vite's featureFlagsPlugin dead-code-eliminates disabled features.
# Install from npm — no clone required
npm i -g claude-code-best
ccb # launch
ccb update # update to latest
# From source (Bun >= 1.3.11 required)
bun install
bun run devConfigured via /login:
When LANGFUSE_* env vars are set, every agent loop, tool call, and LLM observation is recorded:
initLangfuse()
createTrace()
createSubagentTrace()
createChildSpan()
recordLLMObservation()
recordToolObservation()
endTrace()Input/output is sanitized before sending (sanitizeToolInput/Output).