Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

ACP is how a code editor and a coding agent talk to each other — JSON-RPC over a pipe. Two roles share one connection, and each can call the other:

  • the agent answers initialize, opens sessions, and runs prompt turns
  • the client — the editor — receives progress, answers permission prompts, and serves files and terminals on the agent’s behalf

cacp implements both ends. Which one you want decides where to start:

you are writingyou implementstart at
a coding agent an editor drivesAgentServing an agent
an editor, TUI or app driving an agentClientDriving an agent
a frontend with an event loop alreadynothingAn event loop

Whichever role you serve, only a handful of methods are required. Everything else answers method not found until you implement it, so a half-built peer is a working peer — it just advertises less.