# ACP adapter for the Claude Agent SDK [![npm](https://img.shields.io/npm/v/%40agentclientprotocol%2Fclaude-agent-acp)](https://www.npmjs.com/package/@agentclientprotocol/claude-agent-acp) Use [Claude Agent SDK](https://platform.claude.com/docs/en/agent-sdk/overview#branding-guidelines) from [ACP-compatible](https://agentclientprotocol.com) clients! This tool implements an ACP agent by using the official [Claude Agent SDK](https://platform.claude.com/docs/en/agent-sdk/overview), supporting: - Context @-mentions - Images - Tool calls (with permission requests) - Compact file changes through the negotiated [AIR diff patch extension](docs/air-extensions.md#diff-patch) - Following - Edit review - TODO lists - Nested subagent transcripts - Interactive (and background) terminals - Custom [Slash commands](https://docs.anthropic.com/en/docs/claude-code/slash-commands) - Client MCP servers - `/mcp` in the chat: the MCP server status as a list. The adapter runs `/mcp reconnect`, `/mcp enable`, and `/mcp disable` through the SDK control API, because Claude Code refuses them in SDK mode. A reconnect of an ACP server that needs authentication starts MCP OAuth through URL elicitation - Session-scoped long-running goals for AIR through the [goal extension](docs/air-extensions.md#goal) under `_meta.jetbrains.air.goal` - Structured errors, recovery, and warnings through the opt-in [session failure extension](docs/air-extensions.md#session-failure) - Concrete model and effort defaults through the opt-in [recommended config value extension](docs/air-extensions.md#recommended-config-values) - Tool permission presentation, editable choices, and durable effects through the [permission extension](docs/air-extensions.md#permission-presentation) - One fact per field in every tool call report, as the [ACP tool call contract](docs/air-extensions.md#tool-call-contract) defines - All AIR extensions, capabilities, and `_meta` keys: [AIR extensions](docs/air-extensions.md) Learn more about the [Agent Client Protocol](https://agentclientprotocol.com/). To try changes that have landed on `main` but are not released yet, install from the `preview` channel — every push to `main` publishes one. See [`docs/RELEASES.md`](docs/RELEASES.md#preview-releases). ```sh npm install @agentclientprotocol/claude-agent-acp@preview ``` ### Subagent sessions Subagents are exposed only after bilateral capability negotiation. Until the released ACP SDKs preserve the draft `clientCapabilities.subagents` field, a supporting client may advertise `nativeSubagentSessions` in `_meta.jetbrains.air.capabilities`; the adapter mirrors the capability in its initialize response. The canonical field remains supported and takes precedence once it is available. Without either client signal, Agent/Task lifecycle keeps its legacy ordinary ACP tool-call representation and child interactions stay on the root session. Clients that use the historical `_meta["subagent-transcript"]` capability or `forwardSubagentText` session option retain the flattened child transcript behavior. See [AIR extensions](docs/air-extensions.md#native-subagent-sessions). ## Contribution Policy This project does not require a Contributor License Agreement (CLA). Instead, contributions are accepted under the following terms: > By contributing to this project, you agree that your contributions will be licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). You affirm that you have the legal right to submit your work, that you are not including code you do not have rights to, and that you understand contributions are made without requiring a Contributor License Agreement (CLA).