Zed Editor Setup
Connect QCode.cc to Claude Code in the Zed editor through the Agent Client Protocol (ACP), enabling the Opus 4.7 1M-context agent panel
Zed Editor Setup¶
Zed is a high-performance modern code editor written in Rust that, since Q1 2026, has natively supported the Agent Client Protocol (ACP) — an open standard that decouples IDE-to-AI-agent communication, much like LSP did for language servers. Zed integrates Claude Code over ACP, exposing an agent panel for orchestrating multi-step coding tasks. This guide shows how to configure QCode.cc as the upstream for Claude Code inside Zed.
Why Use Zed¶
- Native ACP integration: open Claude Code sessions inside the agent panel and watch agent reasoning plus tool calls live in the editor
- 1M context: BYOK mode supports the full 1M-token context window of Opus 4.7
- Rust performance: blazingly fast cold start and an order of magnitude lower memory footprint than VS Code / Electron-based editors
- Multi-pane layout: editor + terminal + agent panel side-by-side for a compact workflow
Prerequisites¶
- Zed installed (macOS / Linux)
- Claude Code CLI installed (Zed's ACP integration uses the CLI as the backend)
- A QCode.cc API Key (starts with
cr_), available from the dashboard - Claude Code CLI already configured with QCode environment variables (per the Quick Start)
Configuration Steps¶
Step 1: Verify the Claude Code CLI Works in Your Terminal¶
Zed launches ACP by spawning a claude process, so verify the CLI works in a terminal first:
export ANTHROPIC_BASE_URL="http://103.236.53.153/api"
export ANTHROPIC_AUTH_TOKEN="cr_xxxxxxxx"
claude --version # should print a version number
echo "ping" | claude # simple echo test
Persist these two environment variables in your shell config (
~/.zshrc/~/.bashrc) so Zed inherits them at startup.
Step 2: Open Zed's Agent Panel¶
- macOS:
Cmd + ? - Linux:
Ctrl + ?
The first time you open it, Zed asks you to choose an agent provider — pick Claude Code (do not pick BYOK Anthropic API; that path bypasses the CLI and requires you to fill in a base URL separately in Zed settings).
Step 3: Verify the Agent Session¶
Type into the agent panel input: "List the exported symbols in the current file." Zed passes the currently open file as context to Claude Code, and the agent invokes the read / grep tools to parse and respond.
If the agent panel reports that it cannot find the claude command, add agent.path in Zed settings (Cmd+,) pointing to the full path of the CLI binary:
{
"agent": {
"path": "/usr/local/bin/claude"
}
}
Fallback Endpoints¶
If the primary endpoint is unreachable, switch ANTHROPIC_BASE_URL:
| Endpoint | Base URL |
|---|---|
| Shenzhen direct (recommended for CN users; supports lookup at probe.qcode.cc) | http://103.236.53.153/api |
| Global (recommended for users outside CN) | https://api.qcode.cc/api |
For the full endpoint reference (including North America, Europe, and Asia fallbacks), see Endpoints and API Paths.
Shared Quota¶
The Claude Code agent inside Zed shares the same QCode API Key and quota with the CLI / Claude Desktop / Codex CLI — there is no double-billing. See Billing for details.
Limitations and Notes¶
- Zed's BYOK Anthropic direct mode uses Zed's built-in Anthropic provider and does not go through the Claude Code CLI. It requires you to manually set
assistant.providers.anthropic.api_urlin Zed settings to point at QCode. The ACP / Claude Code mode covered in this guide is preferred — it preserves the full CLI tool surface (hooks, skills, MCP). - The ACP integration is in Public Beta (since 2026-04); a few APIs may still change. If you observe behavioral differences, the Zed official documentation is authoritative.
- Linux sandbox users: if Zed is installed via Flatpak, spawning the
claudesubprocess may be blocked by the sandbox. We recommend installing the .deb / AppImage / Homebrew build directly.
FAQ¶
Agent panel reports "Failed to start agent"¶
- Does
claudestart correctly in your terminal? Rule out CLI-side configuration issues first. - Did Zed inherit the
ANTHROPIC_*environment variables? On macOS, launching Zed viaopen -a Zedfrom the terminal guarantees inheritance. - Does the
agent.pathin your settings point to a valid path? Verify withwhich claude.
Difference vs. BYOK Anthropic Mode¶
| Dimension | ACP / Claude Code mode (this guide) | Zed BYOK Anthropic mode |
|---|---|---|
| Backend | spawns the claude CLI subprocess |
Zed's built-in HTTP client |
| Tool support | full (all CLI hooks / skills / MCP) | constrained by Zed's built-in agent framework |
| Configuration location | Claude Code CLI environment variables | Zed setting assistant.providers.anthropic.api_url |
| Recommended for | sharing config with the terminal CLI workflow | users who don't want to install the CLI and prefer pure IDE integration |
Next Steps¶
- Claude Code Tutorial — full CLI feature reference
- Endpoints and API Paths — full reference for all five ingress domains
- VS Code Integration — comparison with Electron-based editors
- Billing — shared quota rules