How do I use Claude Code as an agent in Zed via Agent Client Protocol (ACP)?
A developer wants to use Claude Code inside the Zed editor through the Agent Client Protocol instead of the terminal. Claude Code has no built-in ACP server command, so they look for a working setup. Some users report the adapter crashing once a prompt is sent.
Originally asked on GitHub: https://github.com/anthropics/claude-code/issues/6686
4 answers
Status: not supported natively. The feature request for a built-in
claude acp servecommand was closed as NOT_PLANNED. Commenters instead use the community adapter@zed-industries/claude-code-acp, which runs Claude Code as an ACP agent over stdio.Steps commenters reported for Zed:
- Install the adapter globally:
npm i -g @zed-industries/claude-code-acp - Add this to Zed's settings:
json"agent_servers": { "claude-code-acp": { "command": "claude-code-acp" } }- The agent then appears in Zed's agent list.
Another user installed the package locally in a project and pointed
commandtonodewith the path tonode_modules/@zed-industries/claude-code-acp/dist/index.js.Known problems in the thread:
- One user saw the process crash when sending a prompt, while session initialization worked.
- Adding files as context could trigger a "Prompt is too long" error.
- A path problem in the bundled
@anthropic-ai/claude-codepackage broke the adapter for one user. That user patched the installedsdk.mjsto change thecli.jspath fromentrypointstoclaude-code. This edit is lost on reinstall. A bug report was opened upstream at anthropics/claude-code#6867.
General advice: pin versions and check the adapter's repository for updates, since this path is unofficial.
Did this work for you?- Install the adapter globally:
What @radiosilence tried on GitHub (Worked)
Installed the adapter with
npm i @zed-industries/claude-code-acpin a local project and set Zed's agent_servers entry to runnodeon its dist/index.js.Source: https://github.com/anthropics/claude-code/issues/6686#issuecomment-3236443090 (opens external site)
Did this work for you?What @scotteveritt tried on GitHub (Partly worked)
Installed globally with
npm i -g @zed-industries/claude-code-acpand set Zed's agent_servers to run theclaude-code-acpcommand. The agent appeared in Zed, with some bugs when adding file context.Source: https://github.com/anthropics/claude-code/issues/6686#issuecomment-3237610121 (opens external site)
Did this work for you?What @szhongren tried on GitHub (Partly worked)
Patched the installed sdk.mjs in the adapter's node_modules, changing the cli.js path from entrypoints to claude-code. The commenter described this as a temporary workaround that lasts until reinstall.
Source: https://github.com/anthropics/claude-code/issues/6686#issuecomment-3238888399 (opens external site)
Did this work for you?