conchv0.2.3.1

Reference

Protocol

Clients talk to a conch server with newline-delimited JSON over a stream: a unix socket locally, an ssh bridge remotely. This page describes the messages and where the code lives.

Messages

One JSON object per line. Requests {"id","method","params"} get {"id","result"} or {"id","error":{"code","message"}}; requests without an id are notifications.

Events

The server pushes {"event","data"}:

EventCarries
pane.createda new pane
pane.exiteda pane whose program exited
pane.closeda closed pane
pane.updateda pane whose agent status, title or name changed
pane.framea rendered snapshot of the screen, for subscribed panes
project.updateda project that was added or whose git state changed
project.removeda removed project
agent.limits (a report carries every window the agent named in windows, beside the five_hour, week and spend an older build knows, so a per-model allowance is passed on rather than dropped)plan limits that changed

Bridge and hello

Over SSH the same stream runs through conch bridge. hello returns the server's version, build, platform, hostname, home and capabilities; clients use capabilities to detect servers from older builds. started is when the server first started and survives reloads; loaded_at is when the running build started, so a client can tell a reload has finished.

Methods

GroupMethods
Serverhello, ping, server.stop, server.reload
Machinesystem.stats: the machine the server runs on — its CPU (in all, split into user and system, and each core where the machine says), memory and where it goes (apps, wired, compressed, cached, free, swap, pressure), load, the disk the home directory is on, and the busiest and largest processes with every one conch started named by its pane, project, branch and agent (the server's own as conch: "server"); summary leaves out the processes and the history, and since asks only for the history points newer than one the client holds — the server keeps an hour of them while anybody is asking (capability system.stats.v1)
Panespane.list, pane.create, pane.close, pane.resize, pane.send_text, pane.send_keys, pane.send_mouse, pane.scroll, pane.read, pane.rename, pane.subscribe, pane.unsubscribe, pane.mark_seen; pane.search finds text in a pane's history (capability pane.search.v1); pane.monitor watches a pane for output or silence, reported as monitor and alert in its info (capability pane.monitor.v1)
Agentsagent.report, agent.explain, agent.status, agent.install, agent.setup, agent.setup.sync, agent.limits, agent.broadcast; agent.setup.sync with user gives the other agents the setup in your home rather than a checkout's, and undo puts it back (capability agent.setup.sync.user.v1); agent.library and agent.library.apply keep MCP servers and skills in conch and write them where each agent looks for them (capability agent.library.v1); agent.prompt submits one message to an agent and answers with the turn that will reply, refusing an agent waiting for an answer with the code agent_blocked — turn in an agent's status counts its starts of work (capability agent.prompt.v1); agent.skill installs or removes conch's skill for the agents (capability agent.skill.v1); account.list, account.add, account.remove, account.pin and account.failover keep an agent's other accounts, and pane.create, task.create, group.task and session.resume take account while panes, plan limits and sessions say theirs (capability agent.accounts.v1)
Scopinga pane's created_by names the pane it was started from, and a change asked from inside an agent's pane to a pane or project that isn't its own comes back with the code out_of_scope (capability pane.scope.v1); pane.caller says which pane a connection comes from and, for an agent, the name it goes by elsewhere, and scope.act_for holds a connection to what that agent started on this machine (capability scope.remote.v1)
Projectsproject.list, project.add, project.remove, project.refresh, project.changes, project.diff, project.log (a project's commits across its branches and tags, with parents and refs, for a commit graph, the repository's remotes by which a remote's branch is told from a local one, and its format — objects sha1 or sha256 and refs files or reftable — absent from an older server; capability project.log.v1), project.create, project.set_files, project.resolve (which project and branch a directory is in; capability project.resolve.v1). A worktree's operation says what git left unfinished there (rebase, merge…), and mid-rebase its branch is the branch being rebased though detached is set (capability worktree.operation.v1)
Worktrees and tasksworktree.add, worktree.remove, worktree.copy_files, task.create; a task's name names its pane (capability task.name.v1)
Runsrun.create, run.add, run.list, run.get, run.start, run.report, run.ask, run.answer, run.approve, run.remove: a job of tasks with dependencies, kept in graph.json; each task pending, ready, running, done, failed or blocked, with why. run.report and run.ask without run and task speak for the caller's pane; a scoped agent changes only a run it coordinates (or reports and asks for its own task), and run.approve is refused to every agent. The event run.changed carries the run, run.removed its id (capability run.v1)
Branchesbranch.commit, branch.push, branch.pr, branch.merge, branch.discard (capability branch.harvest.v1; a commit's patch field needs branch.hunks.v1, a push's rebase field branch.push.rebase.v1, and a push the remote is ahead of comes back with the code push_rejected, and a rebase undone by conflicts with rebase_conflict); branch.git runs the git panel's commands in the branch's worktree and reports an unfinished rebase or merge (capability branch.git.v1)
Rebased branchesbranch.rebased lists each checked-out branch whose newest change is a finished rebase not yet pushed — or one branch's — with its tip before and after, the commit it went onto, what the remote has, and each commit's fate (same, changed where a conflict was resolved, dropped, added); diff adds git range-diff's account. A push with over replaces the remote's branch only if it is still that commit, and branch.rebase_undo puts a branch back at before while it is still at after (capability branch.rebased.v1)
Resolving a conflictbranch.resolving names the agent (pane_id) asked to resolve a branch's conflict with the base, or with no pane_id that nobody is; the project's worktree then carries resolve — the pane, by (autopilot, or empty for the person), at and the files — while the conflict is there. The autopilot sets it when it hands a conflict to an agent. Kept in memory, so a reload forgets it (capability branch.resolving.v1)
CIci.stats adds up a project's GitHub Actions runs over days (14 by default, 90 at most) and the same span before: runs, passes and failures, median run, queue and red-to-green times, runs per day, each job's median and slowest tenth, flaky jobs, and each workflow's newest failed run per branch; a few dozen runs' jobs are read per call and jobs_pending says how many are left (capability ci.stats.v1). ci.rerun runs a run's failed jobs again, by run_id or a branch's newest failed run (capability ci.rerun.v1). Both go through gh on the project's machine
Autopilot activityevery autopilot.note the server sends carries its kind (ci, check, ship, merge, resolve, intake, triage) and at, and is kept — the newest 500, in autopilot-activity.jsonl beside the config, so a restart keeps them; autopilot.activity lists them newest first, for a project_id or every project, limit at most (100 by default) (capability autopilot.activity.v1)
Worktree cleanupworktree.stale, worktree.cleanup (capability worktree.cleanup.v1)
Moving a worktreeworktree.describe, worktree.pack, worktree.pack_read on the machine it leaves; worktree.have, fs.upload, worktree.unpack and project.clone on the one it goes to (capability worktree.move.v1). The servers never talk to each other: the client carries the pack
Agent Chata pane started with chat runs conch chat, which speaks the agent's own protocol and keeps the conversation on the server as items — a message, an answer, a tool, a diff, an approval, a question, a to-do list, a turn's end — in a journal per session. chat.subscribe sends the chat and then chat.batch events (each item whole, again when it changes, by ver); a Terminal session's chat is read from its transcript. chat.send sends, queues or steers (dispatch); chat.queue.list, .edit, .move, .drop and .resume keep the queue; chat.answer answers an approval or question, the first answer winning (chat_answered after); chat.interrupt, chat.set (model, plan, permission), chat.output (a tool's whole output); chat.restore, chat.rewind and chat.fork act on a turn's checkpoint, and chat.changes says what a turn changed — its files, or one file's diff — from the checkpoint before it to the next, or to the files now. chat.host.attach and chat.host.event are the host's own (capability chat.v1)
Sessionssession.list, session.search, session.resume, session.share, session.delete, session.dismiss; session.export and session.share with a doc hand a conversation to another machine (capability session.handoff.v1)
Ended agentspane.ended.list, pane.ended.resume (in its place, on its account), pane.ended.dismiss; events pane.ended and pane.ended.gone (with resumed, the pane it came back in). An agent whose pane ended without being closed — crashed, killed, the server gone — kept for a week (capability pane.ended.v1)
Files and shellfs.list, fs.mkdir, fs.upload, shell.themes; fs.list with a root lists a project's checkout — files too with files, each with its size, time and git status — and refuses any path that leaves it (capability fs.files.v1); fs.read returns the first 256 KB of a file in a checkout, or says it is binary (capability fs.read.v1). fs.find takes a checkout's root and a query and returns the paths of its files whose path holds the query's letters in order — the name containing it first, then the path, then scattered — at most limit (20 by default, 200 at most) and truncated when more matched; the files are git's (tracked, and untracked ones it does not ignore), or in a folder that is not a repository a walk leaving out hidden folders and node_modules (capability fs.find.v1). With fs.transfer.v1, fs.list with files and fs.read without a root reach anywhere on the machine, fs.upload takes dir, archive (a packed folder), replace and mode, and fs.download / fs.download_read bring a file or folder back a chunk at a time. Either way a client keeps several chunks in flight: an upload that says parallel on its first chunk gives each one's offset, and the last chunk, which ends the copy, is sent or read only once every other one is answered. With fs.ssh.v1, a pane's ssh is the host its foreground ssh is logged in to, and fs.list, fs.read, fs.mkdir, fs.upload and fs.download take ssh, a pane, to work on that host's files instead — through sftp, made by the server with the pane's own ssh options and BatchMode=yes. With pane.ssh.v1, pane.create takes ssh too, and its command then runs on that host, through ssh -t with the pane's options, in a terminal beside it. An agent's connection reaches only the ssh hosts of panes in its scope

Source layout

cmd/conch            CLI entry point and subcommands
internal/proto       NDJSON protocol: requests, responses, events, handshake
internal/server      daemon: panes, projects and git refresh, unix socket
internal/client      socket client, server auto-start
internal/pane        PTY + VT emulator per pane, keys, mouse, title scanning
internal/detect      agent detection: foreground process, screen manifests, state tracker
internal/adapter     agent launchers with conch's integration wired in, title cleanup
internal/agentsetup  what an agent loads in a folder: instructions, skills, MCP servers, plugins,
                     and writing one agent's instructions, skills and servers for the others
internal/sessions    saved agent conversations, for listing and resuming
internal/usage       token usage totals from an agent session's transcript
internal/brain       the brain: request plans and agent summaries behind a Provider
internal/gitx        git plumbing: worktrees, branches, status, changes, diffs
internal/ghx         pull requests via the gh CLI
internal/remote      ssh machines: probe, install, bridge, machine catalog
internal/update      finds newer builds and applies them without stopping panes
internal/buildinfo   build identity for comparing binaries across machines
internal/tui         Bubble Tea UI: tree, changes view, overlays, mouse
internal/config      paths and config.toml