Files
zeekay be9065ebb4 docs(dev): Zed ACP runs the hanzo-dev bin from the hanzo package
`npx -y --package=hanzo hanzo-dev acp` replaces `npx -y @hanzo/dev acp`.
hanzo-dev execs the native dev binary with argv verbatim, so `acp` reaches
dev rather than being read as a `hanzo dev` task.
2026-11-03 19:43:25 -08:00

55 lines
1.8 KiB
Plaintext

---
title: Zed Integration
description: Use Hanzo Dev as an external agent in the Zed editor via ACP.
---
## Setup
Add this block to Zed's `settings.json`:
```jsonc
{
"agent_servers": {
"Hanzo Dev": {
"command": "npx",
"args": ["-y", "--package=hanzo", "hanzo-dev", "acp"]
}
}
}
```
## Prerequisites
- **Zed Stable 0.201.5+** (released August 27, 2025) adds ACP support with the Agent Panel
- External agents live inside the Agent Panel (`cmd-?`). Use the `+` button to start a new thread and pick Hanzo Dev from the external agent list
- Zed runs the CLI as a subprocess over JSON-RPC — all prompts and diff previews stay local
## How It Works
The Rust MCP server exposes ACP tools:
- `session/new` — Create a new session
- `session/prompt` — Send prompts
- `session/cancel` — Fast interrupts
Streaming `session/update` notifications bridge events into Zed: answer/reasoning updates, shell command progress, approvals, and apply_patch diffs.
### Client Tools Delegation
Delegate file operations back to Zed:
```toml
[experimental_client_tools]
request_permission = { mcp_server = "zed", tool_name = "requestPermission" }
read_text_file = { mcp_server = "zed", tool_name = "readTextFile" }
write_text_file = { mcp_server = "zed", tool_name = "writeTextFile" }
```
Zed wires these tools automatically when you add the Hanzo Dev agent.
## Troubleshooting
- **Inspect handshake**: Run Zed's `dev: open acp logs` from the Command Palette
- **Prompts hang**: Ensure no other process is bound to the same MCP port and that `~/.hanzo` points to the correct config
- **History/checkpoints**: Not yet supported for third-party agents in Zed — use the TUI for these features
- **Model selector**: After a session starts, Zed lists Hanzo Dev's built-in presets. Picking a new preset updates the running session immediately