Skip to content

Claude Code (via the claude-code-acp / claude-agent-acp adapter) ​

Produced by the ACP product case-study pass (2026-07-30), then adversarially verified; corrections below override the body where they conflict.

Claude Code, reached through the claude-code-acp / claude-agent-acp adapter ​

Summary ​

Claude Code has no native Agent Client Protocol (ACP) support. The bridge is a separate, actively maintained TypeScript package that wraps the official Claude Agent SDK and speaks ACP on its behalf. The package has moved twice: it began as @zed-industries/claude-code-acp, was renamed to @zed-industries/claude-agent-acp, and now lives as @agentclientprotocol/claude-agent-acp at github.com/agentclientprotocol/claude-agent-acp, "to better allow multiple teams to contribute and maintain the adapter" (per the migration notice on the deprecated npm package, https://www.npmjs.com/package/@zed-industries/claude-code-acp). Latest published version at retrieval time is 0.63.0 (2026-07-27), Apache-2.0 licensed, engines.node >=22.

What the adapter owns vs. the SDK ​

The adapter is thin protocol glue, not a reimplementation. It depends on @anthropic-ai/claude-agent-sdk@0.3.220 for all agent behavior (the loop, tools, permission semantics, session transcript persistence) and on @agentclientprotocol/sdk@1.3.0 for ACP framing; it reports protocolVersion: 1 at initialize. What the adapter itself adds: (1) the stdio transport wiring, wrapping process.stdin/process.stdout as web streams and redirecting all console logging to stderr so nothing corrupts the JSON-RPC stream (src/index.ts, runAcp() in src/acp-agent.ts); (2) mapping ACP RPCs onto SDK calls, e.g. requestPermission -> methods.client.session.requestPermission, readTextFile/writeTextFile -> methods.client.fs.*; (3) an auth-method menu built from the SDK's own login flows; (4) an invented extension for nested subagent transcripts, since "ACP 1.2 has no standard subagent tool kind," gated behind clientCapabilities._meta["subagent-transcript"]; (5) MCP server config merging between ACP session params and local config before handing off to the SDK.

Invocation and process model ​

Transport is stdio subprocess, full stop: an ACP client spawns claude-agent-acp (bin entry, dist/index.js) and talks JSON-RPC over its stdin/stdout. There is also a --cli passthrough flag that spawns the real native Claude CLI binary with inherited stdio and forwarded signals, used internally to run claude /login, not as a general operating mode.

Auth ​

Three real paths. Non-interactive: set ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN (plus Bedrock/Vertex env switches if applicable) in the spawned process's environment; the underlying SDK subprocess picks these up directly, no ACP-level auth exchange needed. Interactive/OAuth: the adapter advertises ACP AuthMethod entries of type "terminal" (claude-ai-login, console-login) whose args re-invoke itself with --cli auth login --claudeai or --console; a client with terminal capability runs this and a human completes a browser or TUI flow. It also detects remote/SSH environments (SSH_CONNECTION, SSH_TTY, NO_BROWSER, CLAUDE_CODE_REMOTE) and substitutes a TUI-friendly login for the browser redirect. A fourth mode, custom-gateway auth (gateway, gateway-bedrock), is offered only when the client advertises clientCapabilities.auth._meta.gateway.

Headless viability and callability from trogonai ​

trogonai can spawn this adapter as an ACP agent today over stdio, driving session/new (with MCP server passthrough), session/prompt, session/load for resume, and session/cancel, provided it manages a Node >=22 child process and injects ANTHROPIC_API_KEY for unattended auth. That is the only headless-viable auth path; the OAuth/subscription logins require a terminal RPC and a human. Before depending on capability fields, trogonai should diff its pinned ACP schema (1.5.0/1.6.0 per its conformance policy) against this adapter's @agentclientprotocol/sdk@1.3.0 dependency, since the adapter's providers/* methods, sessionCapabilities.fork/list/delete, and mcpCapabilities.sse are all adapter-declared extensions layered on core ACP.

Channel mapping and design lessons ​

No evidence the adapter or Claude Code map Slack/Telegram/WhatsApp/voice channels into ACP sessions; ACP here is strictly the editor/CLI-client boundary. Lessons for trogonai: (1) a thin, single-purpose stdio adapter that owns only transport and RPC mapping, leaving all agent logic to the vendor SDK, is a clean template trogonai could apply to other non-ACP-native CLIs; (2) auth-method advertisement as ACP protocol data (rather than out-of-band config) cleanly separates unattended and interactive auth, worth copying; (3) inventing _meta extensions for gaps in the spec (subagent transcripts) is pragmatic but creates adapter-specific coupling trogonai should track explicitly rather than assume is portable across ACP agents; (4) betting on a community/vendor-controlled npm package that migrated organizations twice in its short life is a governance risk trogonai should watch, not ignore.

Sources ​

Adversarial verification ​

  • confirmed: Claim 1: ACP status is adapter, mechanism is npm package @agentclientprotocol/claude-agent-acp (formerly @zed-industries/claude-code-acp, then @zed-industries/claude-agent-acp), bin claude-agent-acp -> dist/index.js, wraps @anthropic-ai/claude-agent-sdk@0.3.220, speaks ACP via @agentclientprotocol/sdk@1.3.0, reports protocolVersion 1 at initialize. (npm registry for @agentclientprotocol/claude-agent-acp shows latest=0.63.0 with bin {claude-agent-acp: dist/index.js}, dependencies @anthropic-ai/claude-agent-sdk 0.3.220 and @agentclientprotocol/sdk 1.3.0; @zed-industries/claude-code-acp and @zed-industries/claude-agent-acp both exist on npm and both carry deprecated fields pointing to the current package; source file acp-agent.ts line 1439 literally returns protocolVersion: 1.)
  • refuted: Claim 2: Callability from a Rust ACP client host is partial -- trogonai's acp-nats-agent (or an ACP-over-stdio-to-NATS bridge) can spawn npx @agentclientprotocol/claude-agent-acp as a child process today and drive it as a standard ACP agent (session/new with mcpServers, session/prompt, session/load, session/cancel); auth via ANTHROPIC_API_KEY/ANTHROPIC_AUTH_TOKEN/Bedrock-Vertex env vars is the only unattended path; OAuth/subscription logins are terminal-type AuthMethods needing a human; version compatibility (SDK sdk@1.3.0/protocolVersion 1 vs trogonai's pinned wire v1/SDK 2.0.0/schema 1.5.0-1.6.0) needs diffing on providers/*, sessionCapabilities.fork/list/delete, mcpCapabilities.sse before depending on them. (Read the acp-nats-agent and acp-nats-stdio crate source in trogonai: acp-nats-agent is a framework for trogonai to implement AgentHandler (i.e. trogonai plays the ACP AGENT/server role, driven by an external client such as an editor), and acp-nats-stdio's main.rs wraps its OWN process stdin/stdout as the transport an external client connects to, running acp_nats::agent::Bridge plus a NatsClientProxy -- it does not spawn any child process. A repo-wide grep for 'claude-agent-acp', 'claude-code-acp', 'npx', and Command::new/tokio::process::Command inside the acp crates returned zero hits: no code today spawns the Claude adapter or any external ACP agent as a child process from trogonai. The claim's directionality (trogonai as ACP client host spawning and driving an external agent) is inverted from what the codebase implements (trogonai as the ACP agent, hosted by an external client). The auth-path and version-pin sub-details are independently accurate (see next checks) but the core 'can spawn X today and drive it' callability mechanism does not exist in the repo.)
  • confirmed: Sub-claim: auth in headless context is exporting ANTHROPIC_API_KEY/ANTHROPIC_AUTH_TOKEN/Bedrock-Vertex vars into the child env; OAuth logins are terminal-type AuthMethod entries needing a human. (acp-agent.ts initialize() defines claude-ai-login and console-login as AuthMethod with type: 'terminal' and args like [--cli, auth, login, --claudeai/--console], gated on client-advertised terminal capability; a PROVIDER_ROUTING_ENV_VARS list at the bottom of the file explicitly includes ANTHROPIC_BASE_URL, ANTHROPIC_BEDROCK_BASE_URL, ANTHROPIC_VERTEX_BASE_URL, CLAUDE_CODE_USE_BEDROCK, CLAUDE_CODE_USE_VERTEX, ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, confirming these are the provider-routing/auth env vars the subprocess honors.)
  • confirmed: Sub-claim: gateway/gateway-bedrock auth modes offered only when client advertises clientCapabilities.auth._meta.gateway. (acp-agent.ts line 1333: const supportsGatewayAuth = request.clientCapabilities?.auth?._meta?.gateway === true; gatewayAuthMethod and gatewayBedrockAuthMethod are only pushed into authMethods when supportsGatewayAuth is true.)
  • confirmed: Sub-claim: trogonai's ACP wire pin is v1 / Rust SDK 2.0.0, bundled schema effectively 1.5.0, with 1.6.0 as latest upstream schema per its conformance policy. (docs/architecture/acp-conformance.md spec position table states Wire protocol v1, Pinned Rust SDK agent-client-protocol 2.0.0, Bundled schema 1.5.0, Latest upstream schema 1.6.0; the workspace Cargo.toml pins agent-client-protocol = "=2.0.0" and agent-client-protocol-schema = "=1.5.0", matching exactly.)
  • refuted: Sub-claim: providers/* fields need diffing/checking before depending on them. (This is understated as an open risk to check later: the conformance doc already resolves it -- providers/list, providers/set, providers/disable are explicitly marked 'unrepresentable' at trogonai's pinned SDK 2.0.0 boundary (blocked on upstream SDK support), so depending on the adapter's providers capability is already known-impossible today, not merely an unchecked risk.)
  • confirmed: Key fact: Claude Code has no native ACP support; bridge is a separate package @agentclientprotocol/claude-agent-acp, bin claude-agent-acp, latest 0.63.0 (2026-07-27), Apache-2.0. (npm registry time field for version 0.63.0 is 2026-07-27T14:17:28.547Z; package.json license field is Apache-2.0; repo metadata via gh api also reports license.spdx_id Apache-2.0.)
  • confirmed: Key fact: package renamed/moved twice (zed-industries/claude-code-acp -> zed-industries/claude-agent-acp -> agentclientprotocol/claude-agent-acp), old npm packages marked deprecated with migration notice. (@zed-industries/claude-code-acp registry entry carries deprecated: 'This package has been renamed to @agentclientprotocol/claude-agent-acp...'; @zed-industries/claude-agent-acp also exists on npm (latest 0.23.1) with an identical deprecated message, confirming the two-hop rename chain.)
  • confirmed: Key fact: transport is stdio, redirects console.log/info/warn/debug to stderr so logging never corrupts the protocol stream. (src/index.ts fetched via gh api literally reassigns console.log = console.error (and info/warn/debug) with the comment 'we redirect everything else to stderr to make sure it doesn't interfere with ACP', and calls process.stdin.resume() to keep stdio open for the ACP connection.)
  • confirmed: Key fact: adapter has a --cli passthrough mode spawning the native Claude CLI with stdio inherited, forwarding signals and exit codes, used internally for the /login terminal auth flow. (src/index.ts: process.argv.includes('--cli') branch spawns claudeCliPath() via child_process.spawn with stdio: 'inherit', registers SIGINT/SIGTERM/SIGHUP forwarding, and re-raises the child's exit signal/code; acp-agent.ts's terminal AuthMethod entries use args like ['--cli','auth','login','--claudeai'], matching the described usage.)
  • confirmed: Key fact: remote-detection branch (SSH_CONNECTION/SSH_TTY/NO_BROWSER/CLAUDE_CODE_REMOTE) swaps OAuth browser flow for a claude /login TUI flow. (acp-agent.ts lines 1364-1370 define isRemote checking exactly NO_BROWSER, SSH_CONNECTION, SSH_CLIENT, SSH_TTY, CLAUDE_CODE_REMOTE, and branches to a single remote-login AuthMethod (id claude-login, args ['--cli']) instead of the claude-ai-login/console-login pair used otherwise.)

Corrections (authoritative where they conflict with the body) ​

Claim 2 should be corrected to: trogonai does not today contain any code that spawns the Claude ACP adapter (or any external ACP agent) as a child process and drives it as an ACP client host. The acp crates (acp-nats-agent, acp-nats-stdio, acp-nats-server) implement the opposite role: trogonai is the ACP agent/server, hosted by and driven by an external ACP client (e.g. an editor), bridged over NATS. A repo-wide search for claude-agent-acp, claude-code-acp, npx, and process-spawning calls in the acp crates returns zero hits. Building the scenario described (a Rust component spawning npx @agentclientprotocol/claude-agent-acp, wiring its stdio as a JSON-RPC transport, and driving it via session/new, session/prompt, session/load, session/cancel) would be new work, not an existing capability, though nothing in the adapter's own protocol surface (stdio transport, protocolVersion 1, terminal AuthMethods, env-var-based API-key auth) would block building it. Separately, the claim's framing that "providers/* ... should be diffed ... before depending on them" understates a risk that is already resolved: docs/architecture/acp-conformance.md in trogonai already marks providers/list, providers/set, and providers/disable as unrepresentable at the pinned Rust SDK 2.0.0 boundary, so that gap is known today, not merely an open question. All other sub-claims (auth env vars, terminal AuthMethod gating, gateway capability gating, adapter renaming/deprecation history, stdio transport and stderr redirection, --cli passthrough mode, remote-detection env vars, version numbers and publish dates) are confirmed against primary sources.

Released under the Apache License 2.0.