Agent Client Protocol (ACP) bridge for Claude Code CLI.
Use Claude Code with your Pro / Max subscription from any ACP-compatible client — Zed, JetBrains IDEs, and more.
ACP Client (Zed, JetBrains, ...)
↕ stdio (JSON-RPC 2.0)
claude-code-acp
↕ subprocess
claude CLI (logged in with Pro/Max)
Claude's paid plans (Pro / Max) and the Claude API are separate products. API access requires a Console account and API key. However, Claude Code CLI can run under your subscription — no API key needed.
This project wraps Claude Code CLI as an ACP Agent, so ACP-compatible editors can talk to it directly using your existing subscription.
- Node.js >= 20
- Claude Code CLI installed and authenticated
# Install Claude Code if you haven't
npm install -g @anthropic-ai/claude-code
# Log in with your Pro/Max account
claude auth loginImportant: Do NOT set
ANTHROPIC_API_KEYin your environment. If it's present, Claude Code will use API billing instead of your subscription.
npm install -g claude-code-acpOr run directly:
npx claude-code-acpAdd to your Zed settings (settings.json):
{
"agent": {
"profiles": {
"claude-code": {
"provider": "acp",
"binary": {
"path": "npx",
"args": ["claude-code-acp"]
}
}
}
}
}See docs/jetbrains.md for JetBrains setup instructions.
The agent communicates over stdio using newline-delimited JSON-RPC 2.0. Spawn the process and speak ACP:
node /path/to/claude-code-acp/dist/index.jsSee docs/protocol.md for the full message flow.
All configuration is done via environment variables:
| Variable | Description | Default |
|---|---|---|
CLAUDE_ACP_MODEL |
Model to use (sonnet, opus, or full ID) |
(Claude Code default) |
CLAUDE_ACP_ALLOWED_TOOLS |
Comma-separated list of allowed tools | (none) |
CLAUDE_ACP_MAX_TURNS |
Max agentic turns per prompt | (unlimited) |
CLAUDE_ACP_TIMEOUT |
Timeout in milliseconds | 300000 (5 min) |
CLAUDE_ACP_SKIP_PERMISSIONS |
Skip all permission prompts (true/false) |
false |
LOG_LEVEL |
Log verbosity (debug, info, warn, error) |
info |
Example:
CLAUDE_ACP_MODEL=opus CLAUDE_ACP_ALLOWED_TOOLS="Bash,Read,Edit" npx claude-code-acpSee docs/configuration.md for details.
- An ACP client spawns
claude-code-acpas a subprocess - The client sends
initialize, thensession/newto create a session - For each user message, the client sends
session/prompt - Internally, the bridge runs
claude -p --output-format stream-json --verboseand streams results back assession/updatenotifications - Session continuity is maintained by mapping ACP session IDs to Claude Code session UUIDs via
--resume
See docs/architecture.md for a deeper look.
| Feature | Status |
|---|---|
initialize |
Supported |
session/new |
Supported (returns modes + configOptions) |
session/prompt |
Supported (streaming) |
session/cancel |
Supported (returns cancelled stop reason) |
session/load |
Supported |
session/list |
Supported (with cwd filter + pagination) |
session/set_mode |
Supported (code / ask / architect) |
session/set_config_option |
Supported (thought_level) |
authenticate |
No-op (auth is via Claude Code login) |
session/update — text chunks |
Supported |
session/update — tool calls |
Supported |
session/update — thought chunks |
Supported |
session/update — session info |
Supported |
session/update — mode / config |
Supported |
| MCP server passthrough | Supported (stdio transport) |
| Permission requests | Supported (allow/reject once/always) |
| Image / audio prompts | Not yet |
You can use this bridge as a custom agent target for acpx, which enables integration with OpenClaw and other ACP orchestrators.
Add to ~/.acpx/config.json:
{
"agents": {
"claude": {
"command": "node /path/to/claude-code-acp/dist/index.js"
}
}
}Then use it via acpx:
acpx claude exec "summarize this repo"
acpx claude "fix the failing tests"For OpenClaw gateway integration, enable the acpx plugin and set acp.defaultAgent to claude. See docs/openclaw.md for the full setup guide.
git clone https://github.com/harukitosa/claude-code-acp.git
cd claude-code-acp
npm install
npm test # Run all tests (122 tests)
npm run build # Build to dist/
npm run test:watch # Watch modeSee docs/development.md for contribution guidelines.
MIT