展示HN:Claudraband – Claude 代码的高级用户工具
Show HN: Claudraband – Claude Code for the Power User

原始链接: https://github.com/halfwhey/claudraband

Claudraband 是一款实验性工具,旨在增强 Claude Code 的使用体验,提供会话管理和远程控制等功能。它不会取代 Claude SDK,而是*封装*了官方 Claude Code TUI,需要现有的 Claude Code 身份验证。 主要功能包括:**可恢复的工作流**(允许您使用 `cband continue` 稍后继续会话)、用于无头控制的 **HTTP daemon**,以及用于与 Toad 和 Zed 等编辑器集成的 **ACP 服务器**。还提供了一个 TypeScript 库用于自定义工具开发。 您可以通过 tmux 在本地运行 Claude Code 任务,或通过 daemon 远程运行。`cband` 是推荐的命令行界面。会话记录在 `~/.claudraband/` 中,可以列出、附加或关闭。 Claudraband 支持用于无头环境的实验性 Xterm 后端,但 tmux 更适合交互式工作。它非常适合个人、临时使用,并允许查询过去的 Claude 会话。安装方式为 npm 或 bun。

## Claudraband:增强 Claude 代码工作流程 Claudraband 是一款新工具,旨在提升与 Anthropic 的 Claude 代码协作效率。它将 Claude 代码终端用户界面 (TUI) 封装在一个受控的终端环境(使用 tmux 或 xterm.js)中,从而实现更复杂和自动化的交互。 主要功能包括:**可恢复的、非交互式工作流程**(类似于持久的 `claude -p`),内置的 **HTTP 服务器用于远程控制**,与 Zed 和 Toad 等前端兼容的 **ACP 服务器**,以及用于自定义集成的 **TypeScript 库**。 开发者构建 Claudraband 是为了简化自己使用 Claude 代码的过程,特别是取代繁琐的 `tmux send-keys` 命令。它实现了诸如查询过去 Claude 代码会话中的先前决策等功能,为高级用户提供更强大、更有条理的体验。最近有人提出了关于订阅使用是否符合 Anthropic 服务条款的问题。
相关文章

原文

Claude Code for the power user

Experimental: this project is still evolving as Claude Code and ACP clients change.

CLILibraryDaemon APIExamples

claudraband wraps the official Claude Code TUI in a controlled terminal so you can keep sessions alive, resume them later, answer pending prompts, expose them through a daemon, or drive them through ACP.

It provides:

  • Resumable non-interactive workflows. Essentially claude -p with session support: cband continue <session-id> 'what was the result of the research?'
  • An HTTP daemon for remote or headless session control
  • An ACP server for editor and alternate frontend integration
  • A TypeScript library for building these workflows into your own tools

Caveats

  • This is not a replacement for the Claude SDK. It is geared toward personal, ad-hoc usage.
  • We do not touch OAuth and we do not bypass the Claude Code TUI. You must authenticate through Claude Code, and every interaction runs through a real Claude Code session.

Requirements:

  • Node.js or Bun
  • An already authenticated Claude Code
  • tmux for the first-class local and daemon-backed workflow

Install or run:

# one-off
npx @halfwhey/claudraband "review the staged diff"
bunx @halfwhey/claudraband "review the staged diff"

# install once
npm install -g @halfwhey/claudraband

The package installs both claudraband and cband. cband is the recommended shorthand. The package bundles Claude Code @anthropic-ai/[email protected]; set CLAUDRABAND_CLAUDE_PATH if you need to override the binary.

The two first-class paths are local tmux sessions and daemon-backed sessions.

Local persistent sessions

cband "audit the last commit and tell me what looks risky"
cband sessions
cband continue <session-id> "keep going"
cband continue <session-id> --select 2
cband serve --host 127.0.0.1 --port 7842
cband --connect localhost:7842 "start a migration plan"
cband attach <session-id>
cband continue <session-id> --select 2

The daemon defaults to using tmux as the terminal runtime, just like the local path. Use --connect only when creating a new daemon-backed session; after that, tracked continue, attach, and sessions route through the recorded live owner automatically.

Experimental Xterm Backend

--backend xterm exists for local or daemon use, but it is experimental and slower than tmux. Use it when you need a headless fallback, not as the default path for long-lived interactive work. See docs/cli.md for current caveats and backend behavior.

Use ACP when another tool wants to drive Claude through claudraband.

cband acp --model opus

# example: toad
uvx --from batrachian-toad toad acp 'cband acp -c "--model haiku"'

Editor and ACP client support varies by frontend, but claudraband itself supports session follow and resume through ACP.

Live sessions are tracked in ~/.claudraband/.

  • cband sessions lists live tracked sessions
  • continue can resume an existing Claude Code session even when it is no longer live
  • attach only works on live sessions
  • sessions close ... closes live tracked sessions, either local or daemon-backed

Claude can interrogate an older Claude session and justify the choices it made.

Claude interrogating an older Claude session through claudraband

Toad can use claudraband acp as an alternative frontend for Claude Code.

Toad using claudraband ACP as an alternative frontend

That UI is still backed by a real Claude Code pane underneath.

Backing Claude Code pane for the Toad ACP session

Zed can also use claudraband acp as an alternative frontend.

Zed using claudraband ACP as an alternative frontend

Runnable TypeScript examples live in examples/:

For the full API, see docs/library.md. For CLI details, see docs/cli.md. For raw daemon endpoints, see docs/daemon-api.md.

# install or run once
npx @halfwhey/claudraband "review the staged diff"
bunx @halfwhey/claudraband "review the staged diff"
npm install -g @halfwhey/claudraband

# local persistent sessions
cband "audit the last commit"
cband sessions 
cband sessions close --all # close all claudraband controlled sessions
cband continue <session-id> "keep going"

# answer pending prompts
cband continue <session-id> --select 2
cband continue <session-id> --select 3 "xyz"

# daemon mode
cband serve --host 127.0.0.1 --port 7842
cband --connect localhost:7842 "start a migration plan"
cband attach <session-id>

# ACP
cband acp --model opus
联系我们 contact @ memedata.com