Skip to content

Agent Client Protocol (ACP)

The Agent Client Protocol (ACP) integration turns OAK into a full coding agent that any ACP-compatible editor can talk to directly. Instead of only enriching other agents through hooks and MCP tools, OAK becomes the agent — with all of team intelligence built in.

ACP is a standardized protocol that lets editors communicate with AI coding agents over a lightweight JSON-RPC transport. ACP-compatible editors like Zed use ACP to connect to agents that can read files, edit code, run commands, and respond conversationally — all within the editor’s UI.

With ACP support, OAK exposes itself as an agent named “OAK Agent” that editors discover and connect to automatically.

When you use OAK through ACP instead of a standalone agent with hooks:

  • CI is built in — No hook latency. Semantic search, memory injection, and context are part of every response.
  • Session recording is automatic — Every prompt, tool call, and response is recorded in the activity store.
  • Focus switching — Switch the agent’s specialization mid-session (documentation, analysis, engineering, maintenance) without starting a new conversation.
  • Permission modes — Control what the agent can do: full access (Code), plan-then-execute (Architect), or ask-per-action (Ask).
Terminal window
oak team start

Zed — Add to your Zed settings (settings.json):

{
"agent_servers": {
"OAK Agent": {
"type": "custom",
"command": "oak",
"args": ["acp", "serve"],
"env": {}
}
}
}

Then select OAK Agent from the agent picker in Zed’s AI panel.

The OAK Agent appears in your editor with full access to semantic code search, project memory, and all CI tools.

The ACP integration uses a three-layer architecture:

Editor ↔ ACP Server — JSON-RPC over stdio. The editor launches oak acp serve as a subprocess and communicates via stdin/stdout.

ACP Server ↔ Daemon — HTTP requests to the daemon’s REST API. The ACP process discovers the daemon port from .oak/ci/daemon.port and authenticates with a local bearer token.

Daemon — All the real work happens here: session management, Claude SDK execution, activity recording, context injection, and memory extraction. The ACP server is deliberately thin — it only translates between the ACP protocol and the daemon’s HTTP API.

The editor exposes three permission modes that control how the agent interacts with your codebase:

ModeBehaviorUse When
CodeFull tool access. The agent reads, writes, and executes freely.You trust the agent to make changes directly.
ArchitectThe agent proposes a plan first. You review and approve before any changes are made.You want to see the approach before execution.
AskThe agent asks permission for each action individually.You want maximum control over every operation.

Switch modes at any time from the editor’s session controls — the change takes effect on the next prompt.

Focus switching lets you specialize the agent for different types of work without starting a new session. Conversation history is preserved when you switch focus.

FocusPurposeTools AvailableCI Access
Oak (default)Interactive coding with full CI contextRead, Write, Edit, Glob, Grep, BashFull: search, memory, sessions, stats, SQL
DocumentationProject documentation maintenanceRead, Write, Edit, Glob, GrepSearch, memory, sessions (no Bash)
AnalysisCI data analysis and project insightsRead, Write, Edit, Glob, GrepSQL queries, memory, stats (no code search)
EngineeringTeam role-based engineering tasksRead, Write, Edit, Glob, Grep, BashFull access including external MCP servers
MaintenanceMemory store health managementRead, Glob, GrepMemory write access for consolidation

The ACP integration adds these endpoints to the daemon’s REST API:

MethodPathDescription
POST/api/acp/sessionsCreate a new interactive session
POST/api/acp/sessions/{id}/promptSend a prompt (streams NDJSON events)
POST/api/acp/sessions/{id}/cancelCancel an in-progress prompt
PUT/api/acp/sessions/{id}/modeSet permission mode
PUT/api/acp/sessions/{id}/focusSet agent focus
POST/api/acp/sessions/{id}/approve-planApprove a proposed plan (Architect mode)
DELETE/api/acp/sessions/{id}Close and clean up a session
MethodPathDescription
GET/api/acp/statusCheck if the ACP server is running
POST/api/acp/startStart the ACP server subprocess
POST/api/acp/stopStop the ACP server subprocess
GET/api/acp/logsGet recent ACP server logs

When you send a prompt, the daemon streams execution events as NDJSON (newline-delimited JSON). The ACP server translates these into editor updates:

EventDescription
textAgent response text (streamed incrementally)
thoughtInternal reasoning (when extended thinking is enabled)
tool_startTool invocation started — includes tool name and inputs
tool_progressTool execution progress update
tool_resultTool completed — includes output
plan_updateTask breakdown for visibility
plan_proposedPlan awaiting user approval (Architect mode)
costToken usage tracking
doneStream end — signals if plan approval is needed
errorExecution error
cancelledExecution was cancelled

Tools are classified into ACP kinds for the editor UI:

  • Read: Read, Glob, Grep, LS, NotebookRead
  • Edit: Edit, MultiEdit, Write, NotebookEdit
  • Command: Bash, Task (and any unrecognized tools)

ACP sessions are fully integrated with the OAK activity store:

  • Prompt batches — Each user prompt creates a batch with source type acp
  • Tool activity — Every tool call is recorded via Claude SDK hooks
  • Observations — Background LLM extracts gotchas, decisions, and discoveries from your session
  • Session summaries — Generated asynchronously when you close the session
  • Plans — Captured automatically when the agent proposes changes in Architect mode

ACP sessions appear alongside hook-captured sessions in the Activities page and are searchable through semantic search and the /oak skill.

OAK daemon is not running. Start it with 'oak team start'.

The ACP server requires the daemon. Start it first:

Terminal window
oak team start

Logs are written to .oak/ci/acp.log (stdout is reserved for JSON-RPC):

Terminal window
tail -f .oak/ci/acp.log

ACP sessions are recorded with agent type oak. Use the Oak filter on the Activities page to find them.

Verify the ACP server works standalone:

Terminal window
oak acp serve

If it exits immediately, check the daemon status with oak team status.