CC Bridge API
Legacy route
Use /api/v1/agent-bridge/* for new provider-aware clients. /api/v1/cc-bridge/* remains for compatibility with Claude Code-only integrations.
Monitor and manage live Claude Code terminal sessions.
REST Endpoints
List Sessions
GET /api/v1/cc-bridge/sessionsReturns discovered Claude Code tmux sessions.
Get Preview
GET /api/v1/cc-bridge/sessions/{target}/previewReturns a text snapshot of the terminal pane.
Generate WebSocket Token
GET /api/v1/cc-bridge/token?target={target}&purpose=readonlyReturns a 30-second, single-use token for one exact tmux target and purpose. purpose=interactive requires X-Deck-Operator-Token; agent session tokens do not grant interactive access. Read-only tokens cannot be upgraded by a WebSocket query or mode frame. The modern Agent Bridge uses the same policy.
Spawn Session
POST /api/v1/cc-bridge/sessions{
"directory": "/path/to/project",
"mode": "plain",
"worktree_name": "feature-x",
"skip_permissions": false
}Modes: plain, worktree, resume
The legacy Claude Code endpoint uses the same spawn and kill service as Agent Bridge. Resume with an empty directory requires a matching Claude transcript; otherwise, provide the directory explicitly. Spawning and killing require the operator token.
Kill Session
DELETE /api/v1/cc-bridge/sessions/{target}?cleanup_worktree={bool}WebSocket
Attach to Terminal
WS /api/v1/cc-bridge/sessions/{target}/terminal?mode={mode}Send the token as the single WebSocket subprotocol deck-terminal.{token}, not in the URL. Modes: readonly or interactive, matching the token's purpose and target exactly. Do not log WebSocket subprotocol headers.
Provides full PTY relay — terminal output streams to the client, and in interactive mode, keystrokes are sent to the session.
