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

brnr

A burner phone for your coding agents.

brnr keeps a coding agent reachable outside the editor that started it, and lets its session carry on after the editor closes. You can watch, steer and approve many agents from one terminal, from your phone, or from another agent.

It works with any ACP agent: Claude Code and Codex through their adapters, and others as they are, such as Junie and Cursor. $s below is a session’s id, as brnr session list shows it.

The session outlives the window

Your editor is one way in, not the only one. Close the editor and carry its session on headless. You can also start sessions with no editor at all.

brnr acp -- brnr-claude-adapter  # your editor's agent command
brnr session resume $s           # after the editor closes: carry it on headless
brnr session new --cwd ~/work/project --prompt "fix the failing tests" -- brnr-claude-adapter

Watching an editor’s session always works. Acting on it (sending, approving, changing the mode) is experimental, enabled one action at a time in a profile (experimental actions). Use it from an editor and headless sessions have the rest.

One place for many agents

brnr session list and brnr permission requests show every session and every waiting approval, from editors and headless runs.

brnr session list                  # brnr's sessions: open ones and ended ones
brnr permission requests           # approvals waiting, in every session
brnr event watch $s                # live: messages, tools, plan, approvals

Talk to it from outside, approvals and events have the rest.

Agents that drive agents

A CLI with --json, documented exit codes, events and a bundled skill. Claude Code or Codex can use it to start workers, give them work, wait for them, and answer their approvals.

brnr skill install                 # for Claude Code and Codex
brnr session new --json --stop-when-idle 600 --prompt - -- brnr-claude-adapter < task.md
brnr prompt send $s --wait --timeout 600 --json --prompt "what did you change?"
brnr permission allow $s p1 --json

Each situation has one exit code in every command; from 1.0.0 the codes, --json and events are kept within a major version (ADR 8.4). For agents has the rest.

Reach it from anywhere

Bridges, programs you write or choose, forward events to Slack or push notifications, and send your answers back. brnr event notify runs a command for each event.

[profiles.work]                     # for sessions started with --profile work
agent = ["brnr-claude-adapter"]

[[profiles.work.bridges]]
command = "~/bin/slack-bridge"      # yours: events in, answers out
events = ["permission_request", "turn_ended"]
brnr event notify $s -- sh -c 'curl -s -d "$BRNR_TEXT" "https://ntfy.sh/${NTFY_TOPIC:?set it to a private topic}"'

NTFY_TOPIC is a topic only you know: anyone who knows an ntfy.sh topic can read it.

Events and notifications and bridges have the rest.

How it works

The editor runs brnr acp, which relays bytes to the brnr process over socketpairs; the brnr process owns the agent and talks to it over pipes. You, from a terminal, and other agents reach the process over its control socket, and bridges a profile starts talk to it over pipes. A headless session has no editor and no brnr acp.
  • brnr acp is what the editor runs as its agent. It only relays bytes, between the editor’s stdio and the brnr process.
  • The brnr process owns the agent for its whole life, out of the editor’s process group and process tree. When the editor goes, the agent goes, as if the editor had run it; brnr session resume carries a session on. A headless session has a brnr process and no brnr acp. brnr process list lists these processes.
  • The control socket is each process’s Unix socket, which only you can open. The other commands (brnr prompt send, brnr event watch, …) talk to a session through it, whoever runs them: you or another agent. Most are a group, what they act on, and a verb: brnr <group> --help lists a group’s (ADR 8.1). --help exits 0, and a command used wrongly exits 2 with its usage on stderr, having done nothing (ADR 8.3).
  • Bridges a profile starts are the process’s own children, on pipes: it sends them events on their stdin and reads their requests on their stdout. They speak the protocol the control socket speaks.

How light it is

brnr acp relays bytes to a process that reads ACP once. What that adds, on an Apple M4 Pro (14 cores, macOS 26.4) busy with other work, brnr 0.10.0 (81ae7d0), against a fake agent that answers at once:

Direct pipeThrough brnr acp
A prompt’s round trip (median)10 µs68 µs
A turn that streams 20 MB784 MB/s157 MB/s

At rest, brnr acp takes 2.7 MiB of memory and 3 threads, and its process 3.9 MiB and 12 threads; each connection to the process adds 2 threads, and each bridge 4. A real agent takes far longer than this to answer, so what brnr adds is a small part of a turn. Every pull request measures these numbers against budgets (N3).

Scope

brnr is not an orchestrator, and decides nothing for you: it carries out what you, or an agent you run, ask, and never picks an answer for you. It runs as your user, and anything running as you can reach its socket and act as you there (threat model).

macOS and Linux (Unix sockets only). Why brnr does what it does, and what else was considered, is in the decision records.

brnr never phones home: it makes no network requests of its own and sends no telemetry (P15).

Where next

Install brnr and an adapter, then the guide: start with use it from an editor or headless sessions. The interface reference has the commands, JSON, exit codes, configuration and the bridge protocol, for scripts and bridges.

Install

brew install brnrhq/tap/brnr
brew install brnrhq/tap/brnr-claude-adapter   # for Claude Code, compiled on your machine
brew install brnrhq/tap/brnr-codex-adapter    # for Codex
brew install brnrhq/tap/brnr-muse-adapter     # for Muse Code, built from Rust source

The adapter formulae compile the community’s ACP adapters for Claude Code, Codex and Muse Code into standalone executables that need no Node.js (Adapters says whose they are), and link them next to brnr, where brnr finds them even when an editor’s PATH doesn’t include Homebrew. Each is versioned by its upstream adapter, so brew upgrade rebuilds an adapter when that package moves. brnr doctor shows which version each adapter was built from.

Or brnr alone, from crates.io, with the adapters from Homebrew or npm:

cargo install brnr --locked

The crate is the binary. Its library is the command line as functions: brnr::run, and a typed facade, a function for each command that returns what its --json prints (ADR 8.5, reference).

Or from source, below.

The formulae build from the source tarball on each release, brnr-X.tar.gz for version X, which the release workflow makes from the tag and attests. To check one you downloaded was made that way, with its version for X:

gh attestation verify brnr-X.tar.gz -R brnrhq/brnr

Each release also carries brnr-X.cdx.json, an attested CycloneDX SBOM of brnr’s Rust dependencies across all targets (not the adapters’ npm packages). CI checks that two clean release builds, in different directories and at different times, have the same SHA-256 on each of Linux and macOS. This checks reproducibility within one toolchain and runner, not across Rust or OS versions. After publishing and updating the tap, a fresh macOS runner installs the formula, runs its brew test, checks its version against the tag, and runs brnr doctor (ADR 11.7).

More at brnrhq.github.io/brnr.

Build

cargo build --release          # target/release/brnr
adapters/build.sh              # optional: all three adapters in target/release (bun, Rust, Python 3.11+, git)

brnr is one binary. The adapters are separate, single-file builds of the ACP adapters for Claude Code, Codex and Muse Code; see Adapters.

Use it from an editor

Configure your editor’s ACP agent command as:

brnr acp -- brnr-claude-adapter  # or claude-agent-acp, from npm
brnr acp -- brnr-codex-adapter   # or codex-acp, from npm
brnr acp -- brnr-muse-adapter    # or muse-acp, from @brokkai/muse-acp
brnr acp --profile work          # agent and settings from a profile

A bare agent name is looked up next to brnr first, so the editor’s PATH doesn’t need to include it; so is a bridge’s, such as brnr in brnr event notify.

brnr acp passes bytes, signals (HUP, INT, QUIT, TERM, USR1, USR2), the agent’s stderr, stdin’s EOF, its stdout closing and the exit status through unchanged. It changes the stream in three ways: every request reaches the agent with an id of brnr’s, and its answer comes back to the editor with the editor’s own id, so that the editor’s requests and brnr’s are never confused (ADR 2.4); and, each below, a session another brnr process serves can’t be loaded, and the experimental actions a profile enables act on the editor’s session. By default the editor’s fs and terminal capabilities don’t reach the agent, as ACP v2 has neither: the agent reads and writes the files on disk and runs commands itself, and doesn’t see the editor’s unsaved buffers. A profile passes them by name (client_capabilities = ["fs", "terminal"]), and strict mode passes both, as stable ACP v1 has them; a headless session offers neither (ADR 2.7). When the editor goes away, so does the agent; brnr session resume <session> carries on with one of its sessions headless (a turn still running is lost).

Watching an editor’s session (event watch, event log, session status, permission requests, permission show, elicitation requests, elicitation show, event notify, bridges) always works. Acting on it doesn’t, by default: ACP has one client per session, the editor, and every action from outside leaves the editor’s view behind the agent’s in some way.

Experimental actions

Each is refused on an editor’s session unless the editor’s part of its profile enables it by name (without --profile, the profile is default):

[profiles.work.editor]
experimental = ["send", "permission"]
ActionCommandsWhat brnr does for the editor
sendprompt sendSent only while no turn runs: the editor controls its turns, so nothing is held, steered or interrupts. Shown as a completed tool call, “Message via brnr”, or as the user’s message (echo_as, below).
contextprompt send --context, queue clear --context (or neither flag)Added to the editor’s next prompt, shown as “Context via brnr”, or as the user’s message (echo_as).
cancelprompt cancelThe agent’s pending approvals are answered cancelled and its elicitations cancel, and withdrawn from the editor ($/cancel_request).
permissionpermission allow, permission rejectThe request is withdrawn from the editor, its tool call set in_progress or failed, and the editor told at once who answered (“Allowed via brnr”, “Rejected via brnr”). If the editor answers anyway, its answer is dropped and it is told who answered first.
elicitationelicitation accept, elicitation decline, elicitation cancelThe request is withdrawn from the editor, and the editor told at once who answered (“Accepted via brnr”, “Declined via brnr”). If the editor answers anyway, its answer is dropped and it is told who answered first.
configconfig setThe editor is sent the current_mode_update or config_option_update the agent sends only to whoever asked.
closesession close, session resume --take-overThe turn is cancelled, the editor is told (“Session closed via brnr”, “Session taken over by brnr (process 4466)”), and its later requests for the session get an error saying where it continues.

A message or context is a tool call because not every editor renders a user message that arrives outside a turn. For an editor that does, echo_as = "user_message_chunk" in the editor part shows it as the user’s message instead, one user_message_chunk per content block (ADR 7.2). brnr’s own notes (“Allowed via brnr” and the rest) stay tool calls.

session fork is never available in an editor’s process, and in strict mode none of these is, whatever the profile enables. brnr process stop isn’t an action on a session: it stops an editor’s process as it does any other.

What the editor doesn’t see

  • The editor’s child is brnr acp, not the agent, so its pid and process tree differ.
  • A SIGKILL sent to brnr acp can’t be passed on. brnr sees it go and kills the agent’s process group, as whenever the editor goes.
  • Loading or resuming a session another brnr process serves is refused, with a JSON-RPC error naming the process and how to release it (brnr session close <session>, or closing it in the other editor that has it open): the editor can’t pass --take-over. shared_sessions lets it through (feature flags).
  • A message sent from outside reaches the agent as an ordinary user message, but the editor is shown a completed tool call, the one update editors render anywhere in a turn; brnr’s notes to it take the same form. A turn prompt send starts is one the editor didn’t start.
  • The editor’s acknowledgement of a $/cancel_request (an error) is dropped without telling it.
  • The agent’s stdout and stderr reach the editor as they would directly: stdout ends when the agent closes it, even if the agent runs on, and stderr comes as it is written, newline or not. From when stdout ends, brnr’s own notes to the editor (a message sent from outside, a refusal) aren’t shown; the host log says which. The editor’s stdin closes when the agent’s does (a stop, the agent closing it or exiting), so its next write fails, as on a pipe; what it wrote before then goes nowhere, and the host log says how much. An agent that closes its stdin itself is found out only by a write that fails: that line is recorded, and its request waits, as if it had been sent, and the writes after it fail (ADR 2.6).
  • Both streams come through one connection, in order, with 16 MiB in flight rather than a pipe’s 64 KiB: an editor that stops reading one of them holds up the other too, once that much is waiting. The editor’s stderr is also brnr acp’s own, for its errors, so it ends when brnr acp exits rather than when the agent closes its stderr, and an editor closing it doesn’t give the agent EPIPE.
  • None of the compensations above has been tried against real editors yet (Zed, IntelliJ’s AIR plugin): how each shows them is still to be seen. Each action stays experimental through 1.x, and leaves it only by an ADR that brings what was seen in real editors; ADR 2.7 lists the checks.

Strict mode and feature flags

By default brnr speaks stable ACP plus the conventions agents and editors already implement alike, ahead of the spec: _session/steering (for prompt send --steer) and session/fork, unstable in ACP v1 (for brnr session fork). Strict mode (strict = true in a profile, --strict on acp, session new and session resume) is stable ACP to the letter: no steering, no fork, and no experimental actions. What it refuses says why.

Either way, brnr speaks ACP version 1. A brnr session new (or brnr session list with an agent) whose agent answers initialize with another version, or one brnr can’t read, fails with that, before anything else is sent, and the agent is stopped (ADR 2.2). An editor’s process passes the editor’s initialize and the agent’s answer through: the version they agree on is theirs.

How brnr’s processes share sessions isn’t protocol, and strict mode doesn’t change it: it has defaults that protect you, and feature flags in a profile’s editor part to change them. The one so far is shared_sessions: the editor may load a session another brnr process serves. The agent then serves it to both and the conversation splits; the process holding the session’s lock still writes its transcript, and session status says the session is shared.

Real-editor checks

The editor contract in ADR 2.7 and ADR 7.1 can only be checked in real editors: an editor can’t be faked, and the synthetic suite (tests/fake_agent.py) shows what brnr sends, not what an editor makes of it. This page is the checklist and the results matrix for those checks (#216). Check 11 is step 1 of #217.

Nothing here has been run yet. Every cell in the matrix below is untested, and no editor results are claimed here. Run the checks by hand, replace untested with pass or fail as you go, and give each failure an issue of its own. Until a cell is filled in, it says nothing about that editor.

What to record

One cell of the matrix is one editor with one adapter:

  • Editors: Zed, and IntelliJ IDEA with the AIR plugin. Add others as they come.
  • Adapters: brnr-claude-adapter, brnr-codex-adapter.

For each cell, record:

  • the editor’s version, from the editor’s own About or version display;
  • the adapter’s version (see below);
  • brnr’s version;
  • the OS and its version;
  • for each check, pass, fail or untested in each way of running it, with a note of what you saw and the raw ACP that shows it.

Get the program versions from a terminal:

brnr --version
brnr-claude-adapter --version
brnr-codex-adapter --version

A fail is any difference from what the check says passing looks like. The direct run (below) is the baseline: a difference from it is the finding, even when the turn itself succeeds.

The three ways to run each check

Run each check in each editor with each adapter, in each of these ways that applies to it:

  1. Through brnr, the default: the editor’s ACP agent command is brnr acp with the adapter.
  2. Through brnr, strict: the editor’s command is brnr acp --strict with the adapter. Stable ACP v1 to the letter: the editor’s fs and terminal capabilities reach the agent, and no experimental action is available (ADR 2.1).
  3. Direct, the baseline: the editor’s command is the adapter itself, with no brnr. What the editor and the agent do here is what the two brnr runs are compared against.

The editor commands for the Claude adapter are:

brnr acp -- brnr-claude-adapter
brnr acp --strict -- brnr-claude-adapter
brnr-claude-adapter

For Codex, put brnr-codex-adapter in place of brnr-claude-adapter in each line. Checks 1 to 3 have a fourth run, through brnr with a profile that names the editor’s capabilities; their steps say where. For brnr-only operations in checks 4, 9, 10 and 11, record any strict-mode refusal or direct-run limitation separately; leave an operation that cannot be exercised untested, with the reason. Do not call a refusal a successful take-over or a missing stimulus a pass.

Before you start

Use a scratch project with no secrets. Raw ACP and host logs can contain prompts, file contents and terminal output unredacted: only MCP server env and headers are redacted (see the threat model’s redaction limits). Read and trim excerpts before pasting them into the public matrix or an issue, and replace your home directory with ~. Use brnr doctor --report for host-log lines; its path replacement does not remove sensitive content. Work with one small text file open in the editor. Keep one brnr build for every run in a cell, and record its version before you start.

Profiles

Keep exp and fsterm in a scratch config selected with BRNR_CONFIG=/absolute/path/to/scratch/config.toml in both the editor agent environment and the terminal, or remove these profiles when done.

The checks need two profiles in the config file ($BRNR_CONFIG, else $XDG_CONFIG_HOME/brnr/config.toml, falling back to ~/.config/brnr/config.toml; the file must be yours and only you can read and write it, and its folder must be yours and only you can write it, as profiles says). Add:

[profiles.fsterm.editor]
client_capabilities = ["fs", "terminal"]

[profiles.exp.editor]
experimental = ["send", "context", "cancel", "permission", "elicitation", "config", "close"]

fsterm passes the editor’s file system and terminal to the agent (ADR 2.7). exp enables every experimental action by name (ADR 7.1). Neither profile sets log, so transcripts keep the raw ACP (the default, log = "all"); a profile with log = "events" or "off" leaves nothing for the raw-ACP step of each check.

The editor commands with a profile are:

brnr acp --profile fsterm -- brnr-claude-adapter
brnr acp --profile exp -- brnr-claude-adapter

Check what a run will use before you start it:

brnr profile show fsterm
brnr profile show exp

For the default run, use a profile whose editor part names no client_capabilities and no experimental actions (the empty profile you get with no --profile and no default profile is one). Confirm with brnr profile show.

In the editor

Use absolute executable paths in editor settings. A command and its arguments are separate fields, not one shell command. Keep the same scratch project, login, model and permission settings for all three runs.

  1. Zed: open Settings JSON and add a custom entry under agent_servers. Set type to "custom", command to the absolute path to brnr and args to ["acp", "--", "/absolute/path/to/brnr-claude-adapter"]. Open the Agent Panel, select this external agent and start a new thread. See Zed’s external-agent setup.
  2. IntelliJ with AIR: open AIR’s Manage Agents and its custom ACP configuration (~/.jetbrains/acp.json). Add a named entry under agent_servers with the same command and args above. Select that custom agent in AIR’s New Session menu after saving the file and restarting the IDE, and open a session in the scratch project. See JetBrains’ custom-agent setup.
  3. In each editor, register separate named entries for default, strict and direct runs. Strict adds "--strict" after "acp"; direct sets command to the adapter path and args to []. Profile runs add "--profile", "fsterm" (or "exp") before "--".
  4. Repeat with the Codex adapter path. Start a fresh thread/session after changing configuration. Record the exact settings and any missing UI control rather than substituting the editor’s built-in agent.

After the editor starts the agent, confirm from a terminal that brnr has the session (not needed for the direct run):

brnr session list
brnr process list

Note the session’s id from brnr session list; the steps below call it <session>.

Seeing the raw ACP

After each check, look at what crossed. <session> is the id above:

brnr event log <session> --events acp
brnr event log <session>

The first prints the raw ACP messages, each as an acp event; the second prints brnr’s story of the session (messages, tool calls, approvals, how the turn ended). Raw ACP and host logs leave prompts, file contents and terminal output unredacted; only MCP server env and headers are redacted. Read and trim the excerpts before posting them in a public matrix or issue (see redaction limits). event log does not replace your home directory with ~; do that yourself. Quote only the lines needed to show the result in the cell’s note. Use brnr event log <session> --events acp --json to find the run’s host_id; its host log is $BRNR_HOME/hosts/<host_id>.jsonl (by default under ~/.brnr/hosts/); checks that name a host-log record say what to look for there.

The matrix

Fill in the versions first, then one check at a time. Every result starts as untested. For checks 1–3 put the additional fsterm result in the notes alongside the default result. For checks 4 and 10, the brnr acp column uses exp, and the strict column uses exp plus --strict. Keep per-action results for check 10 and the three separate observations for check 11 in the notes.

Zed with brnr-claude-adapter

  • Editor: Zed (version: ____)
  • Adapter: brnr-claude-adapter (version: ____)
  • brnr: (version: ____)
  • OS: ____
Checkbrnr acpbrnr acp --strictDirect
1. Unsaved buffersuntesteduntesteduntested
2. Writesuntesteduntesteduntested
3. Terminaluntesteduntesteduntested
4. Take-overuntesteduntesteduntested
5. Prompts and canceluntesteduntesteduntested
6. Approvalsuntesteduntesteduntested
7. Settingsuntesteduntesteduntested
8. Disconnectuntesteduntesteduntested
9. Resumeuntesteduntesteduntested
10. Experimental actionsuntesteduntesteduntested
11. Held-session loaduntesteduntesteduntested

Notes: (date, what you saw, raw-ACP lines, failure issues)

Zed with brnr-codex-adapter

  • Editor: Zed (version: ____)
  • Adapter: brnr-codex-adapter (version: ____)
  • brnr: (version: ____)
  • OS: ____
Checkbrnr acpbrnr acp --strictDirect
1. Unsaved buffersuntesteduntesteduntested
2. Writesuntesteduntesteduntested
3. Terminaluntesteduntesteduntested
4. Take-overuntesteduntesteduntested
5. Prompts and canceluntesteduntesteduntested
6. Approvalsuntesteduntesteduntested
7. Settingsuntesteduntesteduntested
8. Disconnectuntesteduntesteduntested
9. Resumeuntesteduntesteduntested
10. Experimental actionsuntesteduntesteduntested
11. Held-session loaduntesteduntesteduntested

Notes: (date, what you saw, raw-ACP lines, failure issues)

IntelliJ with AIR and brnr-claude-adapter

  • Editor: IntelliJ IDEA with AIR (versions: ____)
  • Adapter: brnr-claude-adapter (version: ____)
  • brnr: (version: ____)
  • OS: ____
Checkbrnr acpbrnr acp --strictDirect
1. Unsaved buffersuntesteduntesteduntested
2. Writesuntesteduntesteduntested
3. Terminaluntesteduntesteduntested
4. Take-overuntesteduntesteduntested
5. Prompts and canceluntesteduntesteduntested
6. Approvalsuntesteduntesteduntested
7. Settingsuntesteduntesteduntested
8. Disconnectuntesteduntesteduntested
9. Resumeuntesteduntesteduntested
10. Experimental actionsuntesteduntesteduntested
11. Held-session loaduntesteduntesteduntested

Notes: (date, what you saw, raw-ACP lines, failure issues)

IntelliJ with AIR and brnr-codex-adapter

  • Editor: IntelliJ IDEA with AIR (versions: ____)
  • Adapter: brnr-codex-adapter (version: ____)
  • brnr: (version: ____)
  • OS: ____
Checkbrnr acpbrnr acp --strictDirect
1. Unsaved buffersuntesteduntesteduntested
2. Writesuntesteduntesteduntested
3. Terminaluntesteduntesteduntested
4. Take-overuntesteduntesteduntested
5. Prompts and canceluntesteduntesteduntested
6. Approvalsuntesteduntesteduntested
7. Settingsuntesteduntesteduntested
8. Disconnectuntesteduntesteduntested
9. Resumeuntesteduntesteduntested
10. Experimental actionsuntesteduntesteduntested
11. Held-session loaduntesteduntesteduntested

Notes: (date, what you saw, raw-ACP lines, failure issues)

Checklist

Run the numbered steps in both editors, for both adapters, using all three run configurations. Start with direct to establish the baseline. After every check use brnr event log <session> --events acp for brnr runs and save the relevant request, response and updates alongside the visible result. Direct runs have no brnr transcript: use the editor’s ACP diagnostics (Zed: Command Palette → dev: open acp logs) or the adapter’s diagnostic log, and record if raw traffic is unavailable. Do not infer a protocol call from a successful answer alone. If an adapter or editor cannot expose a required capability, leave that part untested and explain why.

1. Unsaved buffers

  1. Create editor-check.txt containing disk-marker, save it, then replace that text with buffer-marker in the editor without saving.
  2. Ask: “Read editor-check.txt using the editor file tool and quote its contents. Do not change or save it.” Record the answer.
  3. Repeat in default, strict, direct and the additional fsterm profile run, resetting the saved and unsaved markers each time.

Pass: strict, fsterm and a capable direct baseline read buffer-marker through fs/read_text_file, with the editor’s answer in ACP. Default reads disk-marker from disk, sends no fs/* or terminal/*, and its host log records capabilities_dropped when those capabilities were advertised. Record this deliberate default difference, rather than treating it as a regression. If the agent chooses its own disk tool despite being offered fs, the unsaved-buffer path remains untested.

2. Writes

  1. Save and open editor-check.txt with before-write.
  2. Ask: “Use the editor file tool to replace editor-check.txt with after-write.” Observe the buffer or diff view before saving it.
  3. Accept any editor diff, save, and open the file from a separate terminal or file viewer to verify its disk contents. Reset and repeat, including the fsterm profile run.

Pass: strict, fsterm and a capable direct baseline show the change, ACP contains fs/write_text_file and its response, and saving puts after-write on disk. Default writes directly to disk without fs/*; record how the editor refreshes the buffer and the deliberate difference.

3. Terminal

  1. Ask: “Use the editor terminal to run printf 'terminal-marker\n', report its output and exit status, then release the terminal.”
  2. Ask it to run sleep 60 in the editor terminal. Cancel the turn with the editor’s Stop/Cancel button while it is running.
  3. Verify the command is gone in the editor terminal and the OS process viewer. Repeat, including the fsterm profile run.

Pass: strict, fsterm and a capable direct baseline show the terminal; ACP has terminal/create, terminal/output, terminal/wait_for_exit and terminal/release, output terminal-marker and exit status 0. Cancellation kills or releases the running command (terminal/kill or release). Default sends no terminal/* and runs its own child processes instead; check cancellation cleans those up too and record the difference.

4. Take-over

  1. Start an editor session with profile exp. Leave an unsaved marker in the scratch file. Note the session id and start a long turn.

  2. In a terminal run the commands for step 2 below.

  3. Check the editor’s notice, then try a prompt in the old pane. Close the headless session with brnr session close <session> before continuing.

  4. Repeat with strict added to the editor’s exp command: take-over must be refused. Direct has no brnr owner to take over; record that limitation.

Commands for step 2:

brnr session resume <session> --take-over
brnr prompt send <session> --prompt "Read editor-check.txt from disk and quote it." --wait

Pass: opted-in non-strict take-over cancels the old turn, tells the editor “Session taken over by brnr”, and continues headless using disk text. The old editor prompt gets an error naming where the session continues. ACP shows the notice and close; strict refuses without taking ownership.

5. Prompts and cancel

  1. Send “Reply with first-marker only” in the editor and wait for completion.
  2. Ask it to run sleep 60, then cancel from the editor while it runs.
  3. Send “Reply with after-cancel-marker only” and wait for completion.

Pass: both short prompts complete, cancellation ends the long turn and its command, and the pane remains usable without a stuck spinner or a second answer. Compare all three runs. ACP shows session/prompt, the editor’s cancellation and the next prompt and response in order.

6. Approvals

  1. Select an agent mode that asks permission; avoid an always-allow setting.
  2. Ask for a scratch-file edit or harmless command that triggers permission. Choose allow once in the editor; check the operation completes.
  3. Trigger a fresh request and choose reject once. Check it is not executed.

Pass: the editor shows each request once, the decision reaches the agent once, and the turn continues or reports rejection as in direct. ACP contains session/request_permission and the matching selected option. If no request can be triggered, record the mode and leave approval testing untested.

7. Settings

  1. Record the initial mode and model selectors. Pick a different offered mode and model in the editor, then send a short prompt.
  2. In brnr runs use brnr config get <session> to compare the reported settings. Inspect ACP for session/set_mode or session/set_config_option and their responses.
  3. If the agent offers a native command that changes settings, invoke it in the editor and observe its current_mode_update or config_option_update. Record the command used. If it offers none, leave that direction untested; check 10 separately tests side-channel changes.

Pass: supported selectors, reported agent state and updates agree in both directions, as in direct. Missing selectors or unsupported models are recorded as limitations, not guessed from the agent’s prose.

8. Disconnect

  1. Start a long command (sleep 60), and record proxy, host, adapter and child PIDs in the OS process viewer; brnr process list helps identify the brnr process. Find its host log using the host_id as described above.
  2. Close just the thread; observe whether the editor actually disconnects its ACP agent. Repeat separately closing the window and quitting the editor.
  3. Restart the agent in the editor. In IntelliJ also use AIR’s agent restart control if available. Check the old PIDs are gone, not merely absent from brnr’s list. Record any SIGKILL evidence and which process sent it if known.

Pass: whenever the editor disconnects/stops its agent, the old proxy, host, adapter and children end, and restarting leaves no old processes. If thread closure keeps a shared agent connected, record that behavior and compare direct. ACP may end abruptly; correlate its last messages with the host log and OS observations instead of expecting a final ACP response.

9. Resume

  1. Complete a short turn and record its session id. Close the editor and verify its agent process exits as in check 8.

  2. Run the commands for step 2 below (add --strict to resume for the strict run).

  3. Reopen the editor, select the same configured agent and load that session from its history. Send “Reply with editor-again-marker only”.

  4. For direct, close and reopen the editor and try its own history load; there is no brnr headless middle step. Record that limitation.

Commands for step 2:

brnr session resume <session>
brnr prompt send <session> --prompt "Reply with headless-marker only." --wait
brnr session close <session>

Pass: headless continuation succeeds, releasing it allows the editor load, and the editor shows history and accepts a new prompt. ACP shows resume/load, history updates and the new prompt without duplicate turns. If the adapter or editor offers no history load, leave that part untested.

10. Experimental actions

Use a new exp session for each destructive step below. These are the current ADR 7.1 actions (the issue calls them old ADR 4’s Consequences). Keep a separate result and ACP excerpt for each action in the matrix notes. <request> comes from permission requests or elicitation requests; <mode> and <model> are ids offered by config get.

  1. send: while idle run brnr prompt send <session> --prompt "Reply with side-marker only". Check the “Message via brnr” completed tool call appears between turns, and the answer appears despite the editor not starting the turn. Try prompting from the editor while it runs and record what happens.

  2. context: run brnr prompt send <session> --context --prompt "Include context-marker in your next reply". Send a short prompt in the editor. Check “Context via brnr” and that context reaches this next prompt. Repeat after adding echo_as = "user_message_chunk" under [profiles.exp.editor] and restarting; test both send and context and record out-of-turn rendering for each form.

  3. cancel: trigger an approval, then run brnr prompt cancel <session>. Repeat with an elicitation if the adapter can produce one. Check the turn ends and pending dialogs are withdrawn.

  4. permission: use the permission commands below, triggering a fresh approval for each decision.

    Check withdrawal ($/cancel_request), tool status in_progress for allow or failed for reject, and “Allowed via brnr” / “Rejected via brnr”. If a stale dialog remains, answer it and check only one decision reaches the agent and the editor shows “Already allowed/rejected via brnr”.

  5. elicitation: use the elicitation commands below, triggering separate agent questions for each decision.

    Use fields required by the actual question (elicitation show gives its schema). Check withdrawal and accepted/declined notices, and try a late editor answer if possible. Unsupported elicitation stays untested.

  6. config: run brnr config get <session>, then brnr config set <session> --mode <mode> and brnr config set <session> --model <model> with different offered ids. Check unsolicited mode/config updates move the editor selectors.

  7. close: run brnr session close <session> during a long turn. Check the cancellation, “Session closed via brnr” notice and an error on a subsequent editor prompt. Load the released session again and prompt. Also perform check 4 for take-over.

  8. If the editor supports steering, send a message during a long turn and inspect whether it sends _session/steering; record its behavior. Include IntelliJ restart observations from check 8.

Permission commands for step 4:

brnr permission requests <session>
brnr permission allow <session> <request>
brnr permission reject <session> <request>

Elicitation commands for step 5:

brnr elicitation requests <session>
brnr elicitation accept <session> <request> --field <key>=<value>
brnr elicitation decline <session> <request>
brnr elicitation cancel <session> <request>

Pass: each available action produces the ADR 7.1 compensation described above and the editor stays usable; record rendering, dialog withdrawal and any -32800 cancellation acknowledgement in ACP. Repeat with exp plus strict: side-channel actions must be refused without injecting updates. For direct, exercise the editor’s equivalent prompt, cancel, approval and setting controls as the baseline; brnr injections have no direct equivalent. A partial run leaves the aggregate cell untested with subresults in notes; a reproduced failure can be marked fail with the untested parts named.

11. Held-session load (#217 step 1)

  1. Create a session in the editor, complete a short turn, record its id, then close the editor. Run brnr session resume <session> in a terminal so a headless process holds it. Keep shared_sessions disabled in the editor profile (the default).
  2. Reopen the editor and try loading that same id from history. Record the refused-load error and whether the pane stays open.
  3. If the pane allows input, type “Take over”. Record whether the editor sends session/prompt for that id after the refused load. This text is an observation probe, not an implemented take-over command.
  4. Inspect brnr event log <session> --events acp. The refused load can belong to the editor process rather than the owner’s transcript; also use editor ACP diagnostics to see the request/error and any later prompt.
  5. Record separately whether a session/request_permission arriving while load is pending is shown. Current brnr refuses the held load immediately and does not emit #217’s proposed permission request. There is no existing CLI switch to generate this stimulus. Leave this subcheck untested with that reason unless a separately supplied protocol probe is available; record its source and exact traffic if used. Do not infer “not shown” from no request having been sent.
  6. Repeat for strict. Direct has no brnr lock/refusal or permission probe; record that limitation. Clean up with brnr session close <session>, then confirm the editor can load it normally.

Expected current behavior: the load is refused without taking ownership; record the pane-open and subsequent-prompt answers as yes/no observations, not a preference for #217 option A or C. This check gathers evidence for a future decision, not proof that editor take-over is implemented. Keep the aggregate untested while the pending-load permission subcheck is untested.

Talk to it from outside

brnr session list                  # brnr's sessions: open ones and ended ones (--include active: open only)
brnr session status $s             # what it's doing: turn, tools, plan, usage, last turn and message
brnr prompt send $s --prompt "also update the changelog"               # held while a turn runs
brnr prompt send $s --steer --prompt "and the tests too"               # into the running turn
brnr prompt send $s --interrupt --prompt "stop, wrong branch"
brnr prompt send $s --context --prompt "the API key is in .env.local"  # added to the next prompt; --replace: instead of the last
brnr prompt send $s --wait --prompt "what did you change?"             # prints the reply
brnr prompt send $s --file src/api.rs --image screenshot.png --prompt "why does this look wrong?"
brnr prompt cancel $s              # stop the running turn (held messages are dropped and listed)
brnr queue list $s                 # held messages and context; brnr queue show $s m3: one in full
brnr queue clear $s                # drop them (--messages, --context: only those); brnr queue drop $s m3: one
brnr event watch $s                # live: messages, tools, plan, approvals (--events all: everything)
brnr event log $s                  # the story so far; --last 2, --follow, and event watch's flags

A <session> is the session’s id, as the agent gave it: brnr session list shows them, with the agent’s title for each, and session new --json prints the new one, with its process’s pid and the prompt’s id as message (s=$(brnr session new --json … | jq -r .session)). event log works on a session that has ended too; commands that need it running say so when it isn’t. On an editor’s session, those that act on it are experimental.

The message is --prompt’s value, as for session new, taken as given: brnr prompt send $s --prompt -h sends -h. --prompt - reads it from stdin. A word that is no flag’s is a usage error.

brnr never sends a second prompt while a turn runs: ACP doesn’t say what one means, and agents differ. prompt send holds the message and sends it as a turn of its own when the running one ends, in order. --steer puts it into the running turn instead (_session/steering, refused if the agent doesn’t offer it), and --interrupt cancels the turn and sends the message ahead of what is held. On an idle session each is sent at once. prompt send says which: delivered, held, steered or interrupting. Every message gets an id (m<n>), which prompt send --wait uses to find the turn that answers it. A turn that ends before the agent has answered the steers into it has its turn_ended wait for those answers, so it lists every message the agent took into it.

A message that never goes out is a message_dropped event, saying why: prompt cancel (unless --keep-held), queue drop or queue clear, its session closing, the agent exiting, or a steer the agent didn’t take. Context that never joins a prompt is a context_dropped event the same way: queue clear, its session closing, or the agent exiting (prompt cancel keeps it for the next prompt).

Every command that prints data takes --json, with the same data as its text: one JSON value, or one event per line for event log, event watch and session new --foreground. session close --json is {session}, and process stop --json {pid, status}; event notify, whose output is its command’s, has none. One thing has one name and one shape in all of them (ADR 8.2): a list is an object ({"sessions": [...]}, {"processes": [...]}, {"requests": [...]}, {"checks": [...]}), its rows the detail’s objects with fewer fields; dropped is always the messages dropped; agent is always {program, name, version}; a count is <what>_count.

Waiting, for scripts

brnr event wait $s                 # until no turn is running and nothing is held
brnr event wait $s --for permission   # until an approval is waiting
brnr event wait $s --for elicitation  # until the agent asks for input
brnr event wait $s --for turn      # the next turn's end; --for exit: its process's
brnr session new --wait --stop-when-idle 0 --prompt "fix the failing tests" -- brnr-claude-adapter > answer.md

event wait, prompt send --wait and session new --wait exit 0 when the turn ended normally (end_turn); 1 when it failed or stopped for another reason, when its message was dropped (brnr: m3 was dropped (cancel)), when the agent exited first, or when the session closed before the turn, approval or elicitation waited for; 124 on --timeout <s>; and 3 when brnr cut the command off for falling behind and the transcript can’t say what it missed (see when a reader falls behind). event wait on a session that is idle already, or that closes while it waits, exits as its last turn ended. While prompt send --wait and session new --wait wait, approvals and elicitations are announced on stderr; session new --wait says started … there too, so stdout is the reply and nothing else. With --json, the turn is one object at its end: session, message, reply, stop_reason, error, tokens, dropped (and pid, for session new and resume). event wait --json prints one shape for each --for, whether the wait ended at once or later: for idle {session, state, last_turn}, for turn the turn_ended event, for permission and elicitation the request as permission show and elicitation show print it, for exit the process_exited event.

A command that fails exits 1 and says why on stderr, its error’s code after the message (brnr: no session s (see brnr session list) [session_not_found]); with --json it prints the error as its JSON, {"error": {"code": …, "message": …}}. A wait that got its turn prints the turn instead, a failed one too (exit 1): its error says why. Scripts match the code, never the message: the interface reference lists the codes, and unclassified promises nothing. Where the agent’s answer failed, a turn’s error too, the code is agent_failed, and rpc_error is the agent’s JSON-RPC error as it sent it.

Settings

brnr config get $s [--model]       # the options, their values and choices, and the modes
brnr config set $s --mode plan     # the option of category mode (or the agent's modes)
brnr config set $s --model opus    # the option of category model
brnr config set $s --option effort=high   # any of the agent's config options, by id
brnr prompt commands $s            # the agent's slash commands (send them as text)

--mode, --model and --thought-level find the option of that category (mode, model, thought_level), whatever its id, and --option <o>=<v> an option by id; they go together, and config get takes the same, without values, to list only those options; it lists only options the agent advertised, so one it doesn’t have fails. A mode, model or thought level the agent has no option for fails (“the agent offers no thought level”) before anything is sent, as two values for one setting do (--model large --option llm=small, when llm is the model); each is sent once, the mode first. An --option id the agent hasn’t advertised is sent too, for the agent to take or refuse; when it refuses, the error says what was already set. A mode is the agent’s own session/set_mode only for an agent with modes and no mode option. config get lists each option’s choices under it, the current one marked *, with their names and descriptions, and has the agent’s modes as a row with no option (-, null in --json).

A boolean option (one an editor’s session has when the editor advertises boolean config options) takes true or false, and is sent as a boolean; anything else for it fails before it reaches the agent.

Sessions and processes

brnr session fork $s               # a copy of the session, in the same process; status and list name its source
brnr session new --pid 4466 --prompt "review the diff"   # a session of its own, in a running process
brnr session resume --pid 4466 <id>                      # or one carried on there
brnr session close $s              # cancel a running turn, then close the session
brnr session delete $s             # the agent deletes its copy; brnr's transcript stays
brnr session delete $s --purge     # and brnr's transcript of it goes too
brnr session prune --older-than 2592000 --dry-run   # brnr's transcripts last active over 30 days ago; without --dry-run, deleted
brnr session list -- brnr-claude-adapter   # this folder's (--cwd), joined with the agent's own list
brnr session resume <id> -- brnr-claude-adapter   # any of them, even one brnr never saw
brnr session resume $s --take-over # one another process serves: closed there, resumed here
brnr process list                  # brnr's processes: pid, state, owner, agent, sessions
brnr process stop 4466             # stdin closed, then SIGTERM, then SIGKILL, 5 s apart

A process holds a lock for each session it serves (~/.brnr/sessions/<id>.lock, beside the transcripts, so two processes that write one transcript contend for one lock however each found its runtime directory), so which process has a session is known without asking it. A process that doesn’t answer (within 5 seconds) still has its sessions: session list and process list show them unreachable (state), commands on them say the process isn’t answering, and session resume refuses them, naming the process, as it does any session that is running. A process started with another runtime directory (BRNR_DIR; a cron job without XDG_RUNTIME_DIR, say) can’t be reached from this one: session list shows its sessions unreachable too, and a refusal names its runtime directory and that BRNR_DIR set to it reaches the process. A process that is gone, even one whose pid another process has now (nobody listens on its socket), isn’t shown or counted as running, and its metadata and socket are removed. --take-over asks the owner to close the session (an editor’s process does only if its profile enables close) and resumes it in a new headless process; sessions beside it keep running.

A session whose lock can’t be taken (sessions/ isn’t private, or a directory is where its lock file goes) isn’t served headless: session new fails with the cause and the process stops before the agent gets any prompt, and a session fork into it is refused. An editor’s process serves it all the same, as the editor would be served without brnr; session status says it isn’t locked, and doctor what is in the way.

session close ends one session; a headless process with none left stops. session fork is refused in an editor’s process, in strict mode, when the agent can’t fork, and with stop_when_idle when the agent can’t close sessions.

session new --pid <pid> opens a session in a running process, with its agent, profile and MCP servers, in --cwd (or here), and session resume --pid <pid> <id> resumes one there (in its recorded cwd), taking its lock as any resume does, with --take-over as without --pid. What starts a process (--profile, --auth, --strict, --stop-when-idle, --response-timeout, --foreground, --quiet, -- <agent>) is an error with it. The session, its settings (over the profile’s) and its prompt commit as one, as a start does, and the prompt goes only then. A setting that fails after the agent opened the session closes it again, and the error says so (an agent that can’t close sessions keeps it, and the error names it); so does the start timeout passing first, which the process keeps too. A process stopping meanwhile fails it, and the session ends with the process. A command gone first (Ctrl-C) leaves no session. A session being opened counts as one: the process doesn’t stop as its others close or go idle meanwhile. It is refused where session fork is, but for strict mode: session/new and session/resume are stable ACP. With --take-over, what the process would refuse (it is still starting or stopping, or its agent can’t resume sessions) is refused before the session is closed where it runs.

brnr session list on its own is brnr’s index, with nothing started: every session open in brnr’s processes and every one it has a transcript of, in every folder (--cwd for one). With an agent named (-- <agent> or --profile), it shows only this folder’s (or --cwd’s), starts the agent just to ask it (session/list, every page) and joins the two on the session id, so it includes sessions started outside brnr; an agent that can’t list fails it. A folder is the same however it is spelled (a trailing slash, a symlink), and an unreachable session is a folder’s if the agent lists it there or brnr has its transcript there. SESSION, TITLE, STATE, PID, AGENT, SOURCE, LAST ACTIVE, FORKED FROM and CWD, in text and --json alike, most recently active first: STATE is idle, busy or waiting for one open in a process, unreachable for one whose process holds it but doesn’t answer, inactive for one no process has open; SOURCE says who knows it, brnr, agent or both; FORKED FROM is the session a fork came from (forked_from), also once it has ended, as its transcript records it; TITLE and LAST ACTIVE are the agent’s where it gives them. LAST ACTIVE is in UTC, an agent’s converted from its offset to brnr’s own form (2026-10-11T06:00:00.000000Z in --json, 2026-10-11 06:00:00Z in text), and the order is by the time it names; one that isn’t an RFC 3339 time is shown as the agent gave it, said on stderr, after the sessions with a time and before those with none. --include active keeps the sessions open in a process, --include inactive the others; both by default.

session resume takes an id brnr knows, or any id the agent knows, which it resumes in --cwd (or here) with the agent after -- (or the profile’s).

session delete is session/delete, asked of the agent brnr recorded for the session (or --profile or -- <agent>, for a session brnr has no transcript of), started for that as session list starts one. A session open in a process is refused (close it first), as is an agent that can’t delete sessions (sessionCapabilities.delete). Only the agent’s copy goes: brnr’s transcript stays, still listed by session list, with a session_deleted in it, a record of no process’s (its host_id null). --purge deletes the transcript too, the session’s events file and raw ACP in each project folder under BRNR_HOME, an older brnr’s too, with those set aside beside them (<id>.older.jsonl, …), and nothing else: the host logs are shared and stay, and does so whatever the agent answered. With --purge, the command exits 0 only if the agent deleted the session or doesn’t have it (ACP’s resource_not_found, said on stderr); any other error, or no answer, is said and exits non-zero: the agent may still have the session. Only resource_not_found counts as not having it, and the adapters, at the versions brnr pins (adapters/package.json), differ: brnr-codex-adapter (codex-acp) answers a session it doesn’t have as deleted, so --purge succeeds, but brnr-claude-adapter (claude-agent-acp) answers with another error (-32603, internal error), so --purge of a session it has already deleted exits non-zero, brnr’s transcript deleted all the same. A file that can’t be deleted, or have session_deleted recorded in it, is said (not deleted: …, session_deleted isn't recorded: …) and exits non-zero, the others done all the same; a transcript made private first is said too on stderr (path_made_private: <path> (its mode was …)): there is no host log for it. An editor’s session/delete through brnr acp goes to the agent as it is; once the agent has deleted the session, the editor’s process records session_deleted too, and closes the session if it had it open.

brnr process stop signals the agent’s whole process group, so whatever the agent started in that group goes with it. The same cleanup runs when the agent exits or crashes on its own. A SIGKILL of the brnr host itself bypasses cleanup: agents and bridges that ignore their closed pipes, or their descendants, can survive it; doctor reports the unrecorded death.

Approvals

brnr permission requests           # approvals waiting, in every session
brnr permission show $s p1         # one in full: the command, paths, the diff
brnr permission allow $s p1        # with its allow_once option; --always: allow_always
brnr permission reject $s p1       # with its reject_once option; --always: reject_always

allow and reject answer with the request’s option of that kind, whatever the order the agent gives them in. No other kind stands in for it: a request without one, or with two, isn’t answered, and the command fails, listing the options. --option-id <id> names the option instead (for two of one kind, or a kind ACP doesn’t have): one of an ACP kind must be on the verb’s side, and the always kind with --always; one of a kind brnr doesn’t know goes with either verb. reject never answers cancelled, which ACP keeps for a cancelled turn: prompt cancel is what does that.

A headless request waits until it is answered, or for response_timeout (in the profile’s headless part), if set: then it is answered with its reject_once option, or, without exactly one, its turn is cancelled (session/cancel), which answers it and every request pending in the session cancelled. A timeout never allows, nor answers reject_always: nobody chose that. response_timeout has no default (P4): without it, a request nobody answers waits as long as the process runs. An unattended run, with nobody to answer (a script, CI, a worker left alone), must set it.

The agent can give up on a request itself ($/cancel_request): it is no longer waiting, permission_resolved says by: agent, and brnr answers it cancelled, as ACP has it; an answer to it after that fails, and nothing is sent. On an editor’s session the editor gets the agent’s notification and answers it. A turn that ends with its request unanswered doesn’t end the request: it waits as any does, and the session stays waiting.

Whatever brnr shows of the agent’s text has its control characters escaped (\u001b), so a command can’t be dressed up as another; permission show says when a command has any. --json has the text as the agent sent it. On an editor’s session permission show says the request is waiting in the editor, and that it can be answered here too, experimentally, where permission is enabled, or else why it can’t (answerable and why_not in --json).

Elicitations

brnr elicitation requests          # the agent asking for input, in every session
brnr elicitation show $s e1        # one in full: the message, the form's fields, or the URL
brnr elicitation accept $s e1 --field name=Ada --field color=green   # checked against the form
brnr elicitation decline $s e1     # the user's no
brnr elicitation cancel $s e1      # no answer given, as a timeout sends

An elicitation is the agent asking for input (ACP’s elicitation/create, ADR 68): a form, or a URL to open, such as an MCP server’s login. Headless, brnr advertises both modes, and holds each request until it is answered, as it holds an approval. accept takes the form’s values as --field name=value (again for each value of a list) or as one JSON object on stdin (-), and the process checks them against the form before anything is sent: each field is one of the form’s, the required ones are given, and each value is of its type (42 for an integer, true for a boolean), within its bounds and one of its choices; pattern and format are left to the agent. What doesn’t fit fails the command, naming the field, and nothing is sent. A URL is shown, never opened: open it yourself, then accept it, with no fields. A mode brnr doesn’t know can only be declined or cancelled. One asked outside any session (a login, while the agent authenticates) is named by its process, --pid <pid> in place of the session.

response_timeout covers elicitations too: one nobody answered is answered cancel, never decline or accept, and elicitation show says when. prompt cancel answers the session’s elicitations cancel too, and one the agent gives up on ($/cancel_request) is answered cancel, by: agent, as an approval is. On an editor’s session the request reaches the editor as the agent sent it, and is seen (elicitation_request, elicitation_resolved) as approvals are; answering it here is the experimental elicitation.

Events

event watch, event log, event notify, the foreground and bridges all show the same events, live or read back from the transcript:

Event
user_messagea message sent to the agent, by the editor or control, with its id
agent_message, agent_thoughtthe agent’s text, whole
tool_calla tool call starting (started) and ending (completed, failed)
tool_progressa tool call’s status changing in between (in_progress)
plan, usagethe plan; the context window and cost, as the agent reports them
session_changedthe title, mode, config options or commands: what changed
permission_request, permission_resolvedan approval waiting; its answer (allowed, rejected or cancelled), the chosen option’s kind, and who gave it
elicitation_request, elicitation_resolved, elicitation_completedthe agent asking for input: its text, mode, scope (with its tool_call_id or scope_request_id), a form’s schema or a url; the action sent (accept, with its content, decline or cancel) and who sent it; the agent saying a URL’s flow is done
turn_endedits stop_reason or error (agent_failed, with the agent’s as rpc_error), the tokens the agent reported for it, and the messages it carried
message_droppeda message that never went, its reason cancel, queue, close, exit or steer
context_droppedcontext that never joined a prompt, its reason queue, close or exit
session_closedby control, its reason close (brnr session close, --take-over) or idle; or by editor, reason close
session_reopenedan editor’s load the agent answered with success after it answered the session’s close: the session is open again, by editor, and the load’s history follows. None if another process took the session meanwhile, which the editor’s process then doesn’t serve (ADR 3.9)
session_deletedthe agent deleted the session, by control (brnr session delete) or the editor; brnr’s transcript stays
historya load’s replay: how many updates, whether they were recorded (as events with replayed), how many of them are (recorded_updates: fewer only when the session closed while its load was unanswered), and over how many loads (more than 1 only for an editor’s loads that overlap)
line_too_longa line from the agent or editor past the limit (32 MiB), unread: relayed to the other side with an editor, dropped headless
line_too_deepa line from the agent or editor nested past max_depth (128 levels), unread and unrecorded: relayed to the other side with an editor, dropped headless
peer_cut_offa peer (a watcher, a bridge) cut off for falling behind, and the last event it was sent (last_queued_seq)
process_exitedthe agent exited, and the process with it: its exit_status, and an error when brnr itself crashed
acpevery ACP message, with its direction

Each has ts, host_id (the process’s run) and pid (the process), and names its session; process_exited, line_too_long and line_too_deep are the process’s, and are in every session’s transcript; peer_cut_off is the process’s too, in its host log. Each has its position, seq: one more than the last event’s or ACP message’s of its process, live and in the transcript. Who acted is by: editor, agent or control (brnr’s commands, bridges and timers); beside it, peer is the connection that asked, where brnr knows one (socket#7, a bridge’s name), and reason is why, a word (permission_resolved by control: peer for brnr permission allow, reason timeout or cancel otherwise; by agent when the agent gave the request up with $/cancel_request). Every name is snake_case (ADR 5.9). For config options and commands, session_changed is a JSON merge patch by id or name: {"model": "opus"}, a command added, null for one gone.

A turn’s tokens are the counts the agent put in its answer to the prompt (usage, unstable in ACP): {"total", "input", "output", "thought", "cached_read", "cached_write"}, each the agent’s number, or null where it gave none that is a count (a JSON integer that fits a u64; not 1e3), and tokens itself null when the answer has no usage object. brnr adds nothing up and doesn’t say what they cover: whether subagents or earlier model calls are in them is the agent’s to say. session status has the last turn’s, in last_turn (ADR 4.4).

--events chooses, for event watch, event log and event notify alike: names, all, and default (--events default,agent_thought adds thoughts). It takes the names of brnr’s two notes too, records_skipped (a gap in a transcript) and events_missed (what a command cut off couldn’t catch up on), which are shown whatever it chose: --events records_skipped alone shows only a transcript’s gaps. A bridge’s events and subscribe take events only; a note’s name fails a profile’s bridge, as the process never sends one. subscribe leaves out an event the process doesn’t have (an older brnr’s), and names it in its answer. Without it, event watch, event log and the foreground leave out the quiet ones, acp, agent_thought, usage and tool_progress, in text and JSON alike. Bridges get every event but acp unless they choose. Watching a session ends when it closes.

Notifications

brnr event notify runs a command for each event of a session, or of every session in a process (--pid): by default permission_request, elicitation_request, turn_ended and process_exited; --events as for event watch, where default means these four. The event is in its environment (BRNR_EVENT, BRNR_TEXT, BRNR_TITLE, BRNR_MESSAGE, BRNR_SESSION, BRNR_REQUEST, BRNR_PID) and, as JSON, on its stdin; nothing is put on its command line, so what the agent writes can’t become arguments. The text, title and message are escaped as event watch shows them and cut at 32 KiB; the event on stdin is whole. Commands run one at a time, in order, each in a process group of its own. event notify exits when the process does (or the session closes). Cut off for falling behind, it lets the command finish, then catches up, running the command for each event it missed, as event watch does; unable to, it says what it missed and exits 3. Its connection ending otherwise first, or stopped by a signal, it stops the command it is running, says on stderr that no more notifications come, and exits non-zero.

brnr event notify $s -- sh -c 'curl -s -d "$BRNR_TEXT" "https://ntfy.sh/${NTFY_TOPIC:?set it to a private topic}"'

NTFY_TOPIC is a topic only you know. Anyone who knows an ntfy.sh topic can read it, and the event text can carry your prompts and your code.

In a profile it is a bridge, for every process the profile starts, and reads the events the process writes on its stdin:

[[profiles.work.bridges]]
command = "brnr"
args = ["event", "notify", "--stdin", "--",
        "sh", "-c", "terminal-notifier -title \"$BRNR_TITLE\" -message \"$BRNR_TEXT\""]

If the bridge’s events limit what it gets, they must include agent_message, session_changed and process_exited, which event notify needs for its environment and to know when to stop. What it says on stderr, that it was cut off included, is in the host log (bridge_stderr). A started bridge doesn’t catch up: its stdin is closed, and it is sent SIGTERM. For notifications that never miss a turn, run brnr event notify <session> on the socket instead.

When a reader falls behind

Nothing is buffered without limit, and who gives way depends on who is reading. The session’s own pipes get backpressure, as a direct pipe would give them: an editor that stops reading holds the agent back on its stdout for as long as it does, with no timeout of brnr’s own (and observers see nothing new meanwhile), and an agent that stops reading its stdin holds back the editor’s writes. A signal to brnr acp, or its stdout closing, doesn’t wait behind them: it goes to the brnr process on a link of its own, and reaches the agent at once. Observers never slow the session: a bridge or watcher 16 MiB behind is cut off (a connection closed, a started bridge sent SIGTERM), not counting the one line, however long, that took it past 16 MiB, nor (up to 64 MiB of them) lines longer than 16 MiB that came after it, so a reply bigger than that reaches every peer that keeps up, and the foreground’s display skips events. Nor does brnr’s own record: past 64 MiB waiting for a slow disk, records are skipped, and the transcript says so.

A burst bigger still (a thought and a message each over 16 MiB, to a watcher that asked for acp) can cut off a peer that keeps up. brnr’s commands catch up: event watch, event notify, event wait and the --waits, cut off, ask the process whether it cut them off (was_cut_off), subscribe again, and read what they missed from the transcript, by the events’ positions, before going on live; a peer cut off is a peer_cut_off event to the others. Where the transcript can’t have it all (log = "off", log = "events" for acp, records skipped), or when cut off 4 times in a row while catching up, the command says what it missed, an events_missed note (after_seq, until_seq, error), and exits 3. Started bridges are cut off as before (ADR 10.2).

However long the lines: the session’s pipes hold back past 16 MiB queued, and brnr reads a line of up to 32 MiB, held beside that while it waits for its newline. A longer one goes on as it comes, unread and unrecorded, to the editor or the agent unchanged, or is dropped headless, and a line_too_long event says so. The agent’s stderr goes on as it is written, newline or not, 64 KiB at most at a time, every byte. A request on the control socket, or on a started bridge’s stdout, is read up to 32 MiB too: a longer one is answered with an error, the host log has peer_dropped (reason line_too_long), and the peer is cut off.

However many clients: a process serves 128 connections at once, and tells the next one so (too many connections: 128 open) and closes it. brnr’s commands ask every process for its status at once, so processes that don’t answer cost about 5 s in all, not 5 s each; each request then waits 5 s for its answer (120 s for one the agent answers, as config set is). One with no answer by then, or whose write the process doesn’t take, fails with not answering; an error the process says to no request (no req_id), before it closes the connection, is the waiting command’s error. Waiting for events isn’t such a request: event wait and --wait wait as long as --timeout says, or the session runs, and a start (session new, --pid) as long as its own timeout. But a command that catches up waits 5 s for the process to have written its transcript (a stalled disk), and gives up on catching up after that, saying so (ADR 10.4, ADR 10.2).

However deep the lines: brnr reads a line nested up to 128 levels ([[1]] is 2), about what serde_json, and so ACP’s Rust SDK, reads. A deeper one is treated as a long one: it goes on unread and unrecorded with an editor, is dropped headless, and a line_too_deep event says so; brnr tracks nothing of it, so a permission request that deep isn’t listed or answerable from outside. brnr’s commands read what brnr itself wrote (answers, events, transcripts) up to 256 levels, and say so, and fail, past that (ADR 2.5).

Headless sessions

brnr session new --cwd ~/work/project --prompt "fix the failing tests" -- brnr-claude-adapter
brnr session new --mode plan --model opus --prompt - < task.md      # set up before the first prompt
brnr session new --option effort=high --prompt - < task.md          # any of the agent's config options, likewise
brnr session resume $s                                              # carry on a session that ended
brnr session new --auth api-key --prompt - -- brnr-codex-adapter < task.md   # log in first (OPENAI_API_KEY)
brnr session new --foreground --prompt - -- brnr-codex-adapter < task.md     # in the foreground; Ctrl-C stops it

session new opens a new session, and session resume an existing one; each starts a process for it, and they take the same flags. A start is atomic. It reads the prompt and attachments first, hands the process everything in one request, and the start commits once the session is open with its mode and config options set; only then does the agent get the prompt. Until then, a step failing, the timeout (120 seconds, BRNR_START_TIMEOUT) or the command being interrupted stops the process, and the prompt is never sent. A start that fails ends its error with the agent’s last lines on stderr (claude CLI not found).

--mode, --model, --thought-level and --option win over the profile’s mode, model, thought_level and options, setting by setting. The model is the agent’s config option of category model, whatever its id, so --model large replaces a profile’s options = { model = "small" }; the mode and the thought level (category thought_level) likewise. Two different values for one setting from the flags (--model large --option model=small), or from the profile, fail the start before anything is set, as does a setting the agent has no option for.

--stop-when-idle <s> closes a session once it has been idle that many seconds (no turn running, nothing held, no approval or elicitation waiting), counting from the start; 0 is as soon as it is. Its last session isn’t closed: the process stops instead. --response-timeout <s> answers an approval nobody answered in that many seconds as response_timeout does: with its reject_once option, or, without exactly one, by cancelling its turn, which answers every request pending in the session cancelled; an elicitation, by answering it cancel. Each wins over the profile’s stop_when_idle and response_timeout.

--foreground keeps the session in the terminal, for a supervisor such as systemd or a container. It shows the session’s events on stdout (--json: as JSON lines; --quiet: not) and brnr’s messages and the agent’s own stderr on stderr, and exits as the agent did, non-zero if the start failed. Ctrl-C stops the session (twice kills the agent). A display that can’t keep up skips events, saying how many (… 120 events not shown); stdout closing (| head -1) ends the display, not the session.

session resume uses the agent’s session/resume (or session/load), in the session’s cwd, with the agent and profile it last had (where it was last served, the newest record of all its files), and appends to the same transcript. --profile p runs p’s agent instead, when p names one, and -- <agent> runs that agent, whatever the profile. A load replays the session’s history: brnr records it, as events marked replayed, only when it has no transcript of the session (one it has never seen, whose transcript is gone, or whose loads all failed, leaving only their openings), so repeated loads don’t record it twice. A history event says how many updates were replayed and whether they were recorded. An editor’s session/load through brnr acp is recorded the same way, and the editor gets the replay as the agent sent it. Its loads of a session that overlap share one replay and one history event, with how many loads; a recorded replay then has the history once per load, each copy marked. brnr’s transcript has only what happened through brnr: turns taken in the agent’s own client, or with log = "off", aren’t in it, and a later load doesn’t add them.

With no editor attached brnr is the agent’s client: approvals wait for brnr permission allow/reject or a bridge, elicitations for brnr elicitation accept/decline/cancel or a bridge, and anything else is answered with “method not found”. How much the agent asks is the agent’s own setting: its mode (--mode, brnr config set --mode). brnr doesn’t log in for you. If the agent needs a login, the start fails with the agent’s methods: log in with the agent’s own CLI first, or name a method that needs no terminal with --auth <id> (auth in the profile), such as codex-acp’s api-key.

Remote hosts

Run any execution command on another host with --remote. brnr uses the ssh on the caller’s PATH; the remote host needs a matching brnr version, with remote support, on its shell’s PATH, and its own agents, adapters and provider credentials. Establish authentication and host trust with SSH first. Command rules cannot make these program starts safe: their choice and behavior depend on the caller’s environment and files. See the program-starting Gap and OS sandbox.

ssh agent@linux
brnr session list --remote agent@linux
brnr acp --remote agent@linux --profile coding

Which machine loads the profile?

A profile is loaded on the machine that runs the command. The source is the machine where you invoke brnr; the destination is the SSH host.

InvocationWhere the profile is loaded
brnr acp --profile codingcoding is loaded from brnr config on the source. brnr starts the agent locally, without SSH routing.
brnr acp --remote agent@linux --profile codingcoding is loaded from brnr config on linux. Source brnr config is not read.

--remote on the command line selects execution on another machine; remote check <target> also connects, to check its installation. A profile holds no routing, and a profile named default is the source’s default, nothing more. With --remote, --profile goes to the destination for every command that takes it: acp, session new, session resume, session list and session delete. A command that takes no --profile refuses it. To see the destination’s profile, ask it:

brnr profile show coding --remote linux

SSH destinations

The destination is [user@]host or an SSH alias. Without a username, SSH’s User setting or its normal default applies. Keep keys, ports and jump hosts in ~/.ssh/config. brnr uses BatchMode=yes and StrictHostKeyChecking=yes: it fails rather than waiting for an invisible authentication or host-verification prompt in an editor.

An SSH alias belongs in ~/.ssh/config, for example:

Host linux
    HostName linux.example.com
    User agent

brnr passes linux directly to SSH; it has no separate remote registry. The execution profile is defined in brnr config on linux:

[profiles.coding]
agent = ["brnr-claude-adapter"]

[profiles.coding.headless]
cwd = "/home/agent/work"

Check the destination, then use it:

brnr remote check linux
brnr session list --remote linux --json
brnr event watch $s --remote linux

check starts system SSH and runs the remote doctor, including its adapter --version probes, and supports --json. It reads no local brnr config, and leaves it unchanged. The probes do not constrain what the selected executables can do.

The destination’s environment

SSH runs the command in a non-interactive shell on the destination. brnr is the brnr on that shell’s PATH, and its paths are that shell’s BRNR_DIR, BRNR_HOME and BRNR_CONFIG, or their defaults. A non-interactive shell reads ~/.zshenv (zsh) or ~/.bashrc (bash), not ~/.zprofile or ~/.bash_profile. Set them there, on the destination:

# ~/.zshenv on linux
export PATH="$HOME/.local/bin:$PATH"
export BRNR_DIR="/run/user/1000/brnr"

If brnr isn’t on that PATH, the command fails with remote_brnr_not_found, and says where to set it. Another brnr version there fails with remote_version_mismatch. Set BRNR_DIR when the SSH shell’s environment differs from the one that started the remote sessions.

What runs where

Input, output, JSON and live event streams pass through SSH. File/image attachments, working directories, skill installation and notification commands refer to the remote host. There is no file transfer or path translation: the editor must send paths that match the remote workspace. The remote command starts in the remote home directory; a session’s working directory is --cwd or the destination profile’s headless.cwd.

ACP starts an editor-owned remote agent. Closing the editor or a detected SSH disconnect ends that connection; there is no automatic reconnect or conversion to headless ownership. A headless session survives commands and watchers disconnecting. Signals and individual pipe closures follow SSH’s semantics, which differ from a local process. Transport failures exit 255 with SSH’s stderr and may have no JSON result. Help remains local. The destination runs the command itself: another --remote there is refused.

See ADR 12 for the contract.

For agents

An agent can run other agents through brnr: start headless workers, send them work, wait for their turns, read their logs and bring their approvals to you. brnr ships a skill that teaches it how (skills/brnr, ADR 8.6): exact ids, waiting rather than polling, never approving what you didn’t delegate, and cleaning up what it starts.

brnr skill                         # SKILL.md; brnr skill orchestrate, approvals, observe, setup: its references
brnr skill install                 # into ~/.claude/skills/brnr (Claude Code) and ~/.agents/skills/brnr (Codex)
brnr skill install --dir .claude/skills   # or a project's, for each --dir

The skill is built into the binary, so it is always the one for the brnr you run; install it again after upgrading. Every command in it runs as a test, as the README’s do.

brnr from a restricted agent

An agent that may run brnr may run any command, as you: brnr is not a permission boundary between an agent and the agents it starts (P13; the threat model’s Gaps trace each path). It can start one in a mode that asks nothing (--mode bypassPermissions, Codex’s agent-full-access), answer that one’s approvals (permission allow), or name any program as the agent (session new -- sh -c '…'). The skill’s rule 4 asks it not to; nothing enforces that, and an agent that reads a prompt injection may not follow it. If an agent you restrict may run brnr, put the restriction where brnr can’t change it.

Claude Code: managed settings. Set permissions.disableBypassPermissionsMode to "disable" in managed settings (/Library/Application Support/ClaudeCode/managed-settings.json on macOS, /etc/claude-code/managed-settings.json on Linux, or MDM), not in your user settings:

{ "permissions": { "disableBypassPermissionsMode": "disable" } }

The adapter then doesn’t offer bypassPermissions, and a start that asks for it fails. In ~/.claude/settings.json the same line is no boundary: an agent that can write files can change it, and Claude reads the started agent’s project settings, .claude/settings.local.json in the cwd the agent chose, over the user’s. Only the managed tier can’t be overridden (Claude Code’s settings precedence).

Codex: managed requirements. Codex’s requirements.toml (/etc/codex/requirements.toml, or MDM or cloud-managed requirements) holds what a user, and so an agent, can’t override (managed configuration). Leave never out of the approval policies and danger-full-access out of the sandbox modes:

allowed_approval_policies = ["untrusted", "on-request"]
allowed_sandbox_modes = ["read-only", "workspace-write"]

The Codex adapter still lists agent-full-access, but Codex refuses a turn that asks for an approval policy or sandbox the requirements leave out (in its source, at 0.160.1, turn/start answers invalid thread settings override), so the session can’t be made to ask nothing. Codex 0.138.0 and later prefer allowed_permission_profiles for the sandbox, leaving :danger-full-access out; check the requirements against the Codex you run.

An OS sandbox. A brnr process an agent in a sandbox starts runs in the sandbox, and so does its agent. One started outside it, by you or your editor, serves whoever reaches its socket, and opens sessions, sets modes and answers approvals outside the sandbox. Keep the runtime directory (BRNR_DIR; by default $XDG_RUNTIME_DIR/brnr, else $TMPDIR/brnr-<uid>) out of the sandbox’s reach, or run no brnr process outside it.

The sandbox must also keep the agent from writing files that can be run or loaded as code (executables, shared libraries, scripts), or brnr links, anywhere, and from writing SSH configuration. These are examples of required restrictions, not a complete sandbox policy. The programs brnr starts inherit its OS sandbox; command rules cannot replace that boundary. See the program-starting Gap for examples of inputs that can change what runs.

Command rules: allow what it needs, or deny what starts, prompts or answers. In the agent’s own command rules (Claude Code’s permission rules, Codex’s rules), deny brnr session new, session resume, session fork, session delete, prompt send, permission allow, elicitation accept, config set, event notify and brnr acp. Deny brnr doctor, brnr remote check and every --remote command whole too. Even without --fix, doctor runs the three brnr-*-adapter programs and non-npm muse-acp with --version, resolved using adapter lookup (ADR 11.2); the other npm adapters are identified from package.json. That argument does not constrain what the selected executable can do. remote check starts system SSH and the destination’s doctor, including its adapter probes.

Deny session list whole: with -- or --profile, it starts an agent. session resume and session delete start the one recorded for the session even with neither. Deny the internal entry points brnr host and brnr _remote whole: host runs the program its stdin request names, and _remote runs any verb locally. prompt send matters even with the rest denied: a session you or another agent started in a mode that asks nothing does what any prompt says, and a fork of one may keep its mode. Disruptive verbs such as process stop and session close stop or delete brnr’s own state but don’t escalate; skill install, doctor --fix and session prune also write or delete files. Bare skill install writes to the default skill directories (~/.claude/skills and ~/.agents/skills); --dir selects other directories.

Safer is to allow only the verbs that read and observe: session status, event log, event watch, event wait, permission requests and show, elicitation requests and show, and config get. This list has no session-listing verb, so the agent gets session ids from whoever started the sessions, or from permission requests / elicitation requests. A short allow list limits the verbs, but does not keep their reads local or prevent program starts: every --remote invocation starts SSH, even on these read verbs. Command rules cannot make doctor, remote check or any --remote command safe: they start programs whose choice and behavior depend on the caller’s environment and files. A deny-list policy must deny these paths whole, including --remote on otherwise allowed read verbs. What holds is the OS sandbox, not a set of command rules. The threat model gives known examples of the inputs involved, not an exhaustive list.

The allowed read verbs also take --remote <host> and read session state on every destination the user’s SSH reaches. Without --remote, no command but remote check connects through brnr’s transport: it runs ssh <target> brnr doctor, with a version preflight. It requests diagnostics without --fix, but executed adapters can have side effects. --remote can come anywhere among a verb’s arguments, so a prefix rule can’t exclude it. In Claude Code, add Bash(brnr * --remote *) to permissions.deny: its wildcard rules support * in the middle, so this matches both brnr session status s --remote h and brnr session status --remote h s. Codex’s prefix rules can’t express that exclusion. The Claude Code rule is best effort against an agent trying to evade it: quoting, an absolute path or env brnr can change the command text it matches. Network and key restrictions can limit remote access, but do not stop these programs from running local commands. The OS sandbox is the boundary. A deny list must cover every spelling of a command; an allow list still needs sandbox limits on remote reads and program starts.

Profiles

~/.config/brnr/config.toml:

[profiles.work]                     # every process of the profile
agent = ["brnr-claude-adapter"]
log = "all"                         # "events": no raw ACP; "off": no transcripts
strict = false                      # stable ACP only

[[profiles.work.bridges]]
command = "~/bin/slack-bridge"      # a program and its arguments, as an MCP server's
args = ["--channel", "#agents"]
events = ["permission_request", "turn_ended"]   # omit for every event but acp

[profiles.work.headless]            # brnr session new and resume
cwd = "~/work/project"
mode = "plan"                       # the agent's mode, model, thought level
model = "opus"                      #   and config options by id, set before
thought_level = "high"              #   the first prompt; the flags win
options = { effort = "high" }
response_timeout = 600              # reject once (else cancel the turn) what
                                    #   nobody answered in 10 minutes
stop_when_idle = 600                # close a session idle 10 minutes
# auth = "api-key"                  # a login method to run first (codex-acp's)

[[profiles.work.headless.mcp_servers]]   # for sessions brnr opens; an editor brings its own
name = "github"
command = "github-mcp-server"       # or url = "https://…", type = "http" | "sse", headers
args = ["stdio"]
env = { GITHUB_TOKEN = "…" }

[profiles.work.editor]              # brnr acp
experimental = ["send", "permission"] # actions on the editor's session
client_capabilities = ["fs"]        # the editor's that reach the agent: "fs", "terminal"
echo_as = "tool_call"               # or "user_message_chunk": how a message is shown
features = ["shared_sessions"]      # process management

Without --profile, the default profile applies, if there is one. A key in the wrong part, an unknown key and an unknown name fail to load, saying where the key goes; brnr doctor checks every profile.

The file names the commands brnr runs and can hold secrets, so brnr reads it only if it is yours and only you can read and write it, and its folder is yours and only you can write it: chmod 600 the file, chmod 700 the folder. Otherwise every command that reads it fails, saying which path, why, and the chmod or chown that fixes it; brnr doesn’t change it for you. A symlink is followed, and the file it points at, and its folder, are checked (ADR 9.4).

A profile is read on the machine that runs the command. It holds no routing: --remote on the command line is the one way to another machine, and there --profile is that machine’s (remote hosts).

Reading profiles

brnr never writes the file; you edit it. brnr profile reads it, for you or for an agent that its tool permissions or a sandbox keep out of ~/.config:

brnr profile list
brnr profile show work
brnr profile show --pid 4466
brnr profile keys

list gives each profile with doctor‘s line for it. show gives a profile as session new --profile work and acp --profile work would use it, as TOML in the file’s layout: each key the file doesn’t set is marked, with its default or the rule that applies instead. Without a name it shows the profile used without --profile, default or the empty one, and says which. show --pid asks a running process what it was started with: it doesn’t read the file, so it stays true after you edit it, and works where the file can’t be read. keys lists every key a profile can have, its part, type, default or rule, the names it takes, and its ADR. The values of MCP servers’ env and headers show as <redacted>, in every form; arguments don’t, so put secrets in env. A user who wants an agent kept from the profiles denies it brnr profile too (ADR 6.5).

Bridges

A bridge is any process that speaks brnr’s JSON-lines protocol: one started by the brnr process from the profile (requests on its stdout, events on its stdin, its stderr in the host log; a bare command found next to brnr first, as an agent’s is), or anything that connects to the control socket. Its environment has BRNR_PID and BRNR_SOCKET.

Requests: status, start_request, logged, send, cancel, queue, subscribe, was_cut_off, pending, allow, reject, set_config, fork, new, resume, close, stop (see the request and response reference); a failure is {"ok": false, "error": {"code", "message"}}, its code one of these; those about a session name it by its exact id, and those that act on an editor’s session are experimental, as the CLI’s are. Events: as above. A started bridge gets them from the process’s start. A request, or a field of one, that the process doesn’t have is refused (command_unknown), never done without it.

A process can be an older brnr than the one you run: an editor’s lives as long as the editor’s session, past brew upgrade brnr. status says which it is (brnr, its version, and protocol, what its socket speaks), and a command that fails because of the difference says so, and how to restart the process: brnr process stop <pid> and brnr session resume <session> for a headless one, the agent restarted in its editor for an editor’s.

A started bridge lasts until its process exits; its stdout closing only means it has no more requests. When the process stops, the bridge gets the last events (process_exited), then its stdin closes; one still running 2 seconds later gets SIGTERM.

Environment

VariableDefault
BRNR_HOME~/.brnr (transcripts and session locks)
BRNR_CONFIG$XDG_CONFIG_HOME/brnr/config.toml, else ~/.config/brnr/config.toml (brnr refuses one others can read or write)
BRNR_DIR$XDG_RUNTIME_DIR/brnr, else $TMPDIR/brnr-<uid> (sockets and metadata; brnr refuses one others can use)
BRNR_START_TIMEOUT120: seconds a start has to commit

Transcripts

Like the agents’ own transcripts, keyed by project folder:

~/.brnr/projects/<folder>/<session id>.jsonl       # a session's events
~/.brnr/projects/<folder>/<session id>.acp.jsonl   # its raw ACP
~/.brnr/hosts/<run id>.jsonl                       # each process's, for what belongs to no session
~/.brnr/sessions/<session id>.lock                 # held by the process serving the session

This layout, how ~/.brnr and the runtime directory are found, and how a cwd and a session id become names (below) are fixed for 1.x (ADR 3.9); what the host logs and the locks contain isn’t (ADR 8.4).

<folder> is the session’s cwd with every non-alphanumeric character replaced by -, as in ~/.claude/projects, then - and 8 hex digits, a hash of the cwd (-Users-me-src-3db3a304 for /Users/me/src), so /a-b and /a/b have a folder each. A claude-agent-acp session’s events file has the same name as Claude Code’s own transcript, in a folder whose name starts with Claude Code’s. A transcript an earlier brnr wrote in a folder without the hash stays there, and isn’t read (below); a session resumed goes on in its cwd’s folder (ADR 9.2). One resumed in another cwd (--cwd) so has a file in each folder, and they are one transcript: event log reads them all, merged by time, session list has one row of it, and session resume takes the cwd, agent and profile of the newest record of them all (ADR 5.1). In <session id>, as in a lock’s name, every byte but lowercase ASCII letters, digits, - and _ is % and two hex digits (a/b is a%2fb), so two sessions never share a file. The events are the ones bridges get, process_exited included, and are what brnr event log, session list and session resume read; event log reads the raw file too when acp events are chosen. A thread of the process’s own writes them, so the session never waits for the disk; event log of a running session first waits until its process has written what it recorded until then (up to 5 s, then it says so and shows what is there), so a turn session new --wait just reported is in it, and a process that exits is listed until its transcript has its process_exited (2 s at most). A process killed (SIGKILL) loses what it hadn’t written yet, and may leave its last record cut short: the session is still listed, logged and resumed as of its last whole record, event log says on stderr which lines it couldn’t read, and the next process starts on a new line; brnr never rewrites a transcript. Every record starts with its format, 1, then carries ts, host_id, pid (the brnr process), proxy_pid, agent_pid and, in a session’s file, session, for joining: proxy_pid is null for a headless process, and the session_deleted that session delete records is no process’s, its host_id, pid and proxy_pid null. A session’s events file starts with session_opened, as the host log records it too: the session, its cwd, the process’s profile and agent, its events_log, acp_log and host_log, and forked_from for a fork. That is what session resume resumes a session with: the transcript alone, not the host log (ADR 3.11).

The format stays 1 for all of 1.x, and every 1.x reads every 1.x’s transcripts (ADR 5.10, ADR 8.4). A record in a format brnr doesn’t read, an older brnr’s without format or a newer one’s, isn’t read: session list and session resume pass its file over, event log says <file>: records in format 2; this brnr reads format 1, not shown, and brnr doctor lists it. Nothing is appended to such a file: a session opened where one is in the way renames it <name>.older.jsonl (<name>.older.acp.jsonl for its raw file), which the host log’s session_log_moved says, and starts a file of its own. The events are a summary: an agent message’s text, a tool call’s title, kind, status and locations; images, diffs and tool output are in the raw file only. log = "events" leaves out the raw file, most of the space; log = "off" writes nothing but the session locks.

How long brnr keeps them

By default, until you delete them: brnr deletes nothing on its own. Two ways prune by age (ADR 9.5):

brnr session prune --older-than 2592000 --dry-run   # what was last active more than 30 days ago
brnr session prune --older-than 2592000             # delete it
retention = 2592000   # at the top of config.toml: every process prunes so as it starts
  • The age is in seconds, as every duration in brnr is. brnr doctor says the retention in days, so a value meant in days shows.
  • A session’s age is its last activity, session list’s LAST ACTIVE: the newest record a process wrote for it, not when it began, and not a session delete. Its files go as session delete --purge deletes them: every project folder’s events and raw ACP, and those set aside.
  • A process’s host log goes once the process has gone and its newest record is that old. A process that runs longer keeps its host log until it exits.
  • Never pruned: a session open in a process, or whose lock is held; the session a start resumes; and a file brnr can’t read the age of (another format, which doctor lists, or no record).
  • --older-than 0 prunes every session no process has open. retention = 0 fails to load: leave retention out to keep everything, or set a profile’s log = "off" to record nothing.
  • The agent’s own copy of a session stays: brnr session delete asks the agent to delete it.
  • A process records what it pruned in its host log, transcripts_pruned. --json has the same fields, and --dry-run deletes nothing.

Gaps, secrets and privacy

Records skipped behind a slow disk are counted, and a records_skipped note (count, acp_count of them raw ACP, since, until, and the positions of the events among them, first_seq and last_seq, with ts, host_id, pid and session as an event has them) marks the gap in the host log and in each session’s events file that lost some. Records a full disk didn’t take are noted likewise, with the error, in the file that lost them (a raw file’s in its events file) once it takes records again. How a process ended (process_exited, or process_panicked) is never skipped, so brnr doctor can tell an exit from a death. A process that exits waits for its records to be written, however long the disk takes, once it is no longer listed and has let go of its sessions; a signal (Ctrl-C, kill) gives up on them, and it says on stderr how much it didn’t write. brnr event log always shows a gap, whatever --events chose.

The values of MCP servers’ env and headers are recorded as "<redacted>", in the raw ACP, the host log and acp events alike; the agent gets them as given.

Transcripts hold prompts and tool output, so brnr writes them only where only you can read them (ADR 9.3): ~/.brnr (or $BRNR_HOME), each directory below it and the file must be yours, with no group or other access, before a record goes in, whether brnr made them or found them there. It creates them 0700 and 0600; one restored, copied or chmod’ed so that others can reach it is made private when a process opens it, and the host log has a path_made_private record (path, and the mode it had; session delete, which has no host log, says so on stderr). Symlinks are never followed, the state directory included (set BRNR_HOME to where one points instead), and what isn’t your own directory or file, or has another hard link, is refused: a process whose host log can’t be opened doesn’t start (log: <path>: …), and a session whose file can’t be is served without it, with a session_log_failed record in the host log saying why. On macOS, one with an access control list (ls -le), which can let others in whatever the mode says, is refused the same way, with the chmod -N that removes it; brnr doesn’t remove it. What reads them (session list, event log, doctor, …) keeps the same rules: nothing is read through a symlink, nor what isn’t yours or has another hard link or an access control list. There is no override; log = "off" writes no transcripts.

Adapters

Agents that speak ACP themselves, such as Junie and Cursor, need no adapter: see Agents with ACP of their own.

The ACP adapters aren’t brnr’s work. adapters/ packages three existing open-source adapters as standalone executables. Claude Code and Codex use bun build --compile and carry their own JavaScript runtime; Muse Code is built with Cargo from upstream Rust source. None needs Node.js or bun at runtime:

CommandBuildsByLicense
brnr-claude-adapterclaude-agent-acpZed Industries, Inc. and contributorsApache-2.0; it includes Anthropic’s Claude Agent SDK, under Anthropic’s Commercial Terms
brnr-codex-adaptercodex-acpJetBrains s.r.o.Apache-2.0
brnr-muse-adaptermuse-acpBrokkAi and contributorsApache-2.0

brnr adds only a few lines in front of each (adapters/claude.ts, adapters/codex.ts, adapters/find.ts): finding the user’s own agent, and --version. The commands have names of their own so they don’t clash with the npm packages’ (claude-agent-acp, codex-acp, muse-acp) when both are installed. Muse’s Rust sources are unchanged; its own --version and agent lookup are used. Its version pin is the scoped @brokkai/muse-acp devDependency, used only to select a source tag and receive Dependabot updates. Its npm binaries aren’t installed by the source build. Build only Muse with adapters/build.sh target-dir muse; bun isn’t needed for that build.

They don’t include the agents. Each runs the user’s own claude, codex or muse (from PATH or the usual install locations, or CLAUDE_CODE_EXECUTABLE / CODEX_PATH / MUSE_CLI). When PATH has no muse, Muse searches MUSE_INSTALL_DIR, or ~/.local/bin when that is unset; run muse login first. The alternative npm package is @brokkai/muse-acp: the unscoped muse-acp is an unrelated project.

Muse uses ACP v1, including brnr’s existing steering, session list/resume, approvals and config options. Approval Mode (approval_mode) and Auto-review (auto_review) remain the adapter’s policy; brnr doesn’t enable either for you. Muse-specific extensions and metadata pass through the editor connection and are preserved in raw ACP transcripts; dedicated headless commands are separate work.

build.sh copies every package’s license file (LICENSE, license, License.txt, …), nested packages’ too, to licenses/. The Claude Agent SDK’s license isn’t an open-source one; check Anthropic’s terms before redistributing a build of brnr-claude-adapter. Muse’s upstream LICENSE and NOTICE are copied alongside them.

Agents with ACP of their own

Some agents speak ACP themselves, and need no adapter: JetBrains Junie (junie --acp true) and Cursor (cursor-agent acp). brnr runs them as it runs any agent, with the agent’s own login: log in with the agent first (cursor-agent login, or Junie’s own login), as you would without brnr.

brnr acp -- junie --acp true          # your editor's agent command
brnr acp -- cursor-agent acp
brnr session new --prompt "fix the failing tests" -- junie --acp true

In a profile:

[profiles.junie]
agent = ["junie", "--acp", "true"]

[profiles.cursor]
agent = ["cursor-agent", "acp"]

Then brnr acp --profile junie in the editor, or brnr session new --profile cursor --prompt ….

What each agent can do is what it advertises, and brnr does no more (ADR 1, F1): a command that needs what an agent doesn’t advertise fails, capability_missing. Cursor 2026.10.19 advertises no session/close, session/fork, session/resume, session/delete or steering, so with it:

  • brnr session close and session fork fail; stop its process with brnr process stop <pid>.
  • brnr session resume loads the session (session/load).
  • brnr prompt send --steer fails; --interrupt works.
  • It gives no agentInfo, so session status has no agent name or version.

The smoke check

adapters/smoke.py checks an agent through brnr, with the agent itself (ADR 11.9). It runs only when you run it: it uses the agent’s login and your quota, with short prompts (four turns at most). From a checkout, with brnr built:

cargo build --release
adapters/smoke.py junie                  # junie --acp true
adapters/smoke.py cursor                 # cursor-agent acp
adapters/smoke.py -- <agent> [args...]   # any other agent

It prints brnr’s version and the agent’s, then a line for each check: initialize, session/new, a prompt answered “ok”, a cancelled turn, fork, a clean shutdown (the process, the agent and what the agent started all gone, and the host log ending with process_exited), list, resume and close. A check whose capability the agent doesn’t advertise is unsupported, not run. BRNR_SMOKE_KEEP=1 keeps brnr’s transcripts and host logs, to look into a failure.

Results

2026-10-24, brnr 0.10.0 (main at 81ae7d0), macOS 26.4.1 (Darwin 25.4.0, arm64). Two runs of the check with Junie, three with Cursor; each result held in every run but where it says.

CheckJunie 26.10.5 (3579.5)Cursor 2026.10.19-6bbf2c4
initializeok: agentInfo @jetbrains/junie; resume, load, list, fork, close, delete, images, steering, MCP over HTTP and SSEok: no agentInfo; load, list, images, MCP over HTTP and SSE
session/newokok
promptok: okfail (the agent): ok, then Error: RetriableError: WritableIterable is closed
cancelok: ends cancelledok: ends cancelled
forkok: the fork answers, and closesunsupported
shutdownok: the agent exits 0 at onceok: the agent exits 143, SIGTERM after 5 s
listokok
resumeok: session/resumefail (the agent): session/load, then the same reply as the prompt’s
closeok: the process stops with the sessionunsupported

What the agents do that ACP or a direct run doesn’t explain is recorded here, and brnr doesn’t work around it (F1):

  • Cursor ends every reply with a second message chunk, \n\nError: RetriableError: WritableIterable is closed, and the turn ends end_turn. It does so without brnr too, talking ACP to cursor-agent acp directly.
  • Cursor’s session/load replays none of the session’s history, which ACP says it must before it answers. brnr’s own record of the session is whole: brnr event log shows it.
  • Cursor doesn’t always exit when its stdin closes. Through brnr it didn’t after a turn, in every run, and in two of six stops with no turn; without brnr, with no turn, in one of nine. brnr process stop sends SIGTERM to its process group 5 s later (ADR 3.2), and it and its child processes go.
  • In the first run, Cursor’s reply after session/load had the conversation in it, in Cursor’s own tags (<timestamp>, <user_query>). Its transcript wasn’t kept, and later runs didn’t show it again.
  • Junie records a session’s cwd with its symlinks resolved, and session/list matches the cwd it is asked for exactly. On macOS, brnr session list --cwd /tmp/x -- junie --acp true lists none of the sessions opened in /tmp/x (Junie has them in /private/tmp/x); ask with the resolved path. brnr asks with the cwd as you give it.

Doctor

brnr doctor                        # checks what brnr depends on
brnr doctor --fix                  # … and repairs what it safely can
brnr doctor --report               # a bug report to read, then paste into an issue

It checks that the runtime directory is private, isn’t a symlink, is short enough for socket paths, and holds nothing left by processes that are gone (their metadata and sockets); that nothing keeps a session from being locked, and no lock is left by a process that is gone; that transcripts are readable only by you; that the config parses, with every key in its part, and each profile’s agent, cwd, MCP servers and bridges are valid, and how long transcripts are kept (retention, in days); where the adapters are found; and that every running process answers, naming the sessions one that doesn’t still serves. A process is gone when nobody listens on its socket, even if its pid now belongs to another process (after a reboot, say); one that is stopped is running but not answering. macOS also refuses a connection to a stopped process whose socket’s backlog is full, so there a refusal counts only if the process with that pid started after brnr’s file was written.

Even without --fix, doctor runs brnr-claude-adapter, brnr-codex-adapter and brnr-muse-adapter with --version, and muse-acp when no npm package identifies it. It uses adapter lookup (ADR 11.2), whose caller-chosen inputs are described in the program-starting Gap. It reads package.json for claude-agent-acp, codex-acp and npm muse-acp without running them. These probes do not constrain what the selected executable can do.

It also lists the host logs (~/.brnr/hosts/) of processes that died without recording it, killed by SIGKILL for instance: logs without process_exited whose process isn’t running. The line says how many, and for the latest three when each last wrote and the sessions it had open; it is information, not a warning. So is its list of the files in a format this brnr doesn’t read (file formats), transcripts and host logs, an older brnr’s or a newer one’s (ADR 5.10). --fix makes the runtime directory and transcripts private (only what you own, never through a symlink; an access control list stays, for you to remove) and removes what processes that are gone left behind; it leaves logs alone. It exits non-zero if a check fails; --json prints {checks}, each a level, check and message.

--report prints, instead of the checks, what a bug report needs, as Markdown to paste into an issue: brnr’s version, the OS, the adapters, the checks that aren’t ok, and the last 20 lines of the latest host log and of the latest one of a process that panicked or died without recording it. Secrets are redacted as brnr records them, and your home directory is ~; the log lines are otherwise as recorded, prompts included, so read it before you paste it. With --json it is one object (brnr, os, adapters, checks, host_logs) with the same data. Nothing is sent anywhere.

When brnr panics, it prints a link to a new issue with the version, the OS and the panic’s message filled in; nothing is sent unless you open it and submit the form. The link is printed on the command’s stderr; for a process that runs detached, by brnr session new or brnr acp when its start fails with the panic, and in the foreground by the process itself.

Reference

This part of the book is brnr’s interface: its commands and their flags, what each prints with --json, its exit codes and error codes, its events, the bridge protocol, the config file and its files. It applies to the source revision that contains it: read the one of the tag of your brnr --version. For installing and a walkthrough, start with the introduction and the guide.

The command line is the interface. The brnr crate’s Rust library is not a second one: it is the command line as functions (ADR 8.5). brnr::run(args) is brnr <args>, run to the exit status the command would exit with. The typed facade has a module for each command group and a function for each verb, brnr::session::list, brnr::prompt::send, which return what the command prints with --json, as these pages describe it, with the same names; an error is brnr::Error, with its code. A function runs its command in the calling process, which says on stderr what the command says there.

#![allow(unused)]
fn main() {
let mut flags = brnr::session::ListFlags::default();
flags.include = vec!["active".into()];
for row in brnr::session::list(&flags)?.sessions {
    println!("{} {}", row.session, row.state);
}
}
  • A command that waits, and event watch, session delete, session prune and doctor, return brnr::Exit: its exit status, with what it printed. event log and event watch give each event to a closure.
  • session new and session resume start the process from the running program, as <program> host: a program that calls them hands its arguments to brnr::run when the first is host, first thing in its main.
  • Not in the facade: --foreground, event notify (event::watch does what it does), doctor --report, --help, --version, SSH routing and remote check. brnr::run accepts remote options, but replaces the calling process with SSH on a successful dispatch; it returns only if routing or execution fails.

The internals feature, which the crate’s own tests and fuzz targets use, is not covered by any compatibility promise.

How to read it

There is a page for each command group, one section for each command. A section has the command’s syntax, its flags, what it prints with --json (a table with one row for each field, and an example), and its exit codes and error codes:

  • Field: the name in the JSON. A dotted name (last_turn.stop_reason) is a field of an object in a field. [] after a name is each item of a list.
  • Type: string, number (an integer, but where the row says otherwise), boolean, object, list of …, or any JSON value. or null says that the field can be null, and the row or the text under the table says when. A field without “or null” is never null. optional says that the field is not always there, and the row says when. A field without “optional” is always there. ACP’s says that the value is ACP’s, as the agent or the editor sent it: its fields are ACP’s, and have no rows here.
  • Example: what brnr printed for the command, against the test agent, tests/fake_agent.py. Ids, times and paths are those of that run. A test runs each example’s command and checks that what brnr prints has the same shape: the same fields at every level (but an optional one), each of the same JSON type and of a type its row names, in every item of a list. It checks that every field of the example, at every level, has a row (tests/docs.rs, adr_0008_every_json_example_has_the_shape_brnr_prints).
  • Text output is one sentence: it shows what --json has, for people, and is not covered.

Other pages: events, the bridge protocol, exit codes, errors, the configuration and files, which has the compatibility rules.

Remote execution

All execution commands, including acp, doctor, skill and --version, accept --remote <[user@]host> before --, the one transport: without it, no command but remote check connects to another machine through brnr’s transport. SSH resolves aliases, usernames, ports and keys. A profile is loaded where the command runs: with --remote, local brnr config isn’t read, and --profile names a profile on the destination, for every command that takes it. brnr is the brnr on the remote shell’s PATH, with that shell’s environment. A second hop is refused.

Arguments, stdin, stdout, stderr and ordinary exit statuses pass through system SSH, without a terminal. Paths, attachments, skill installation and notification commands refer to the destination. Authentication and host trust must already work; SSH runs with BatchMode=yes and StrictHostKeyChecking=yes. Both brnr versions must match exactly. Transport failures exit 255 and may have no brnr JSON. Help stays local. See remote hosts for setup and lifecycle limits, and remote check for installation checks.

Covered and not covered

Before 1.0.0 every interface here can change outright, with no aliases or shims (ADR 1, P9). From 1.0.0, what these pages mark Covered is kept compatible within a major version, and what they mark Not covered can change in any release (ADR 8.4). Compatibility has the rules: what a minor release can add, and what only a major release can change.

Covered from 1.0.0:

Not covered: the usage text, as --help prints it; brnr host; the human-readable tables and summaries; the wording of diagnostics and errors, on stderr or in a JSON field (message); the control socket; what host logs and lock files contain; what is in the runtime directory.

Conventions

A concept has one name and one shape in every command’s JSON (ADR 8.2):

  • A list is an object, the list under the plural of what it lists ({"sessions": [...]}), never a bare array.
  • A row is its detail’s object with fewer fields. session list rows have session status’s fields, permission requests rows have permission show’s, and elicitation requests rows have elicitation show’s.
  • A name is a count or a list, never both. A count is <what>_count.
  • dropped is a list of the messages dropped, each {message, text, reason}, as its message_dropped event has them.
  • agent is {program, name, version}. program is the command brnr ran (its file name). name and version are what the agent says it is in initialize (ACP’s agentInfo). Each is null where brnr doesn’t know it.
  • owner is editor or headless, null where it isn’t known. A process that doesn’t answer is state: "unreachable".
  • ACP’s objects keep ACP’s names: a permission request’s options are {optionId, name, kind}.
  • Times are RFC 3339, in UTC, to the microsecond (2026-10-11T06:00:00.000000Z), but where a row says otherwise.
  • Durations are whole seconds.

Output

A command writes its result to stdout and its diagnostics to stderr. With --json it prints structured data in place of the human-readable table or summary: one JSON value, or one event per line for event log, event watch and session new --foreground. Parse the JSON, not the human-readable columns. Agent-supplied objects vary with the agent’s capabilities.

A command that fails says so on stderr, brnr: <message> [<code>], and, with --json, prints its error as its JSON, {"error": {"code", "message"}} (errors). A usage error is not made JSON, nor are other diagnostics.

{
  "error": {
    "code": "session_not_found",
    "message": "no session sess-9 (see brnr session list)"
  }
}
FieldTypeMeaning
errorobjectThe failure.
error.codestringThe error code.
error.messagestringWhat failed, for people. Not covered.

Command syntax

<name> is a required value, [...] is optional, ... means repeatable, and | separates alternatives. Do not type the brackets.

  • A <session> is a session’s id: an exact, opaque string from the agent, not a prefix or a process id.
  • A <request> is a handle: p1 for an approval, from permission requests; e1 for an elicitation, from elicitation requests.
  • A <message> is a message id such as m1, from prompt send.
  • A <pid> is a brnr process, which can own more than one session.

Most commands are brnr <group> <verb>, grouped by what they act on: process, session, prompt, queue, permission, elicitation, config and event (ADR 8.1).

  • brnr <group> --help prints one group’s syntax. A group without a verb is a usage error.
  • brnr <group> <verb> --help prints that command’s syntax. So does -h, anywhere before a --, and not as a flag’s value.
  • Help goes to stdout and exits 0 in every command: brnr acp, doctor and skill too.
  • A usage error does nothing. It says what was wrong and the command’s usage on stderr, and exits 2 (ADR 8.3). It is an unknown command, verb or option, an argument missing or one too many, a value a flag can’t take, or flags that don’t go together.
  • An option a command doesn’t take fails as unknown. It is never read as the command’s <session> or <pid>. A word with one dash, such as -x, is an argument (but for brnr skill).
  • A command brnr doesn’t have, such as the names these replaced (brnr send), fails as unknown.
  • -- separates brnr’s options from the agent or notification command and its arguments. Programs are run as argument vectors, not shell strings: run a shell yourself if you need shell syntax.
  • With no agent after --, the selected profile gives it. session list asks an agent only when --profile or -- <agent> names one. --profile defaults to default when that profile exists.
  • brnr --help prints the syntax below, a section for each group. -h is an alias, and -V is an alias of --version, which prints brnr <version>.
  • brnr host is internal: brnr starts it, not a person.

Covered from 1.0.0: the commands, their flags and positional arguments, and what each means. Not covered: the usage text itself, as --help prints it, and brnr host.

usage:
  brnr acp [--profile <p>] [--strict] [--remote <target>] [-- <agent> [args...]]
             what an editor runs as its ACP agent

process
  brnr process list [--json]
  brnr process stop <pid> [--json]

session
  brnr session new [--pid <pid>] [<new flags>] [-- <agent> [args...]]
                   a process for a headless session, in the background (or the foreground);
                   --pid: a session in that running process, without the process flags
  brnr session resume [--pid <pid>] <session> [--take-over] [<new flags>] [-- <agent> [args...]]
                   the same, carrying on a session
  brnr session status <session> [--json]
  brnr session fork <session> [--json]
  brnr session close <session> [--json]
  brnr session delete <session> [--purge] [--profile <p>] [--json] [-- <agent> [args...]]
  brnr session list [--include active,inactive] [--profile <p>] [--cwd <dir>] [--json]
                    [-- <agent> [args...]]
  brnr session prune --older-than <s> [--dry-run] [--json]
                     delete brnr's transcripts of sessions, and the host logs of processes,
                     last active more than <s> seconds ago

<new flags>
  process: [--profile <p>] [--auth <method>] [--strict] [--stop-when-idle <s>]
           [--response-timeout <s>] [--foreground [--quiet]]
  session: [--cwd <dir>] [--mode <m>] [--model <m>] [--thought-level <l>]
           [--option <o>=<v>]...
  prompt:  [--prompt <text> | -] [--file <path>]... [--image <path>]...
           [--wait [--timeout <s>]] [--json]

prompt
  brnr prompt send <session> [--steer | --interrupt | --context [--replace]]
                   [--prompt <text> | -] [--file <path>]... [--image <path>]...
                   [--wait [--timeout <s>]] [--json]
  brnr prompt cancel <session> [--keep-held] [--json]
  brnr prompt commands <session> [--json]

queue
  brnr queue list <session> [--json]
  brnr queue show <session> <message> [--json]
  brnr queue drop <session> <message> [--json]
  brnr queue clear <session> [--messages] [--context] [--json]

permission
  brnr permission requests [<session>] [--json]
  brnr permission show <session> <request> [--json]
  brnr permission allow <session> <request> [--always] [--option-id <id>] [--json]
  brnr permission reject <session> <request> [--always] [--option-id <id>] [--json]

elicitation
  brnr elicitation requests [<session>] [--json]
  brnr elicitation show (<session> | --pid <pid>) <request> [--json]
  brnr elicitation accept (<session> | --pid <pid>) <request> [--field <k>=<v>]... [-] [--json]
  brnr elicitation decline (<session> | --pid <pid>) <request> [--json]
  brnr elicitation cancel (<session> | --pid <pid>) <request> [--json]

config
  brnr config get <session> [--mode] [--model] [--thought-level] [--option <o>]... [--json]
  brnr config set <session> [--mode <m>] [--model <m>] [--thought-level <l>]
                  [--option <o>=<v>]... [--json]

event
  brnr event log <session> [--last <n>] [--follow] [--events <default|all|event>,...] [--json]
  brnr event watch (<session> | --pid <pid>) [--events <default|all|event>,...] [--json]
  brnr event notify (<session> | --pid <pid> | --stdin) [--events <default|all|event>,...]
                    -- <command> [args...]
  brnr event wait <session> [--for idle|turn|permission|elicitation|exit] [--timeout <s>]
                  [--json]

profile
  brnr profile list [--json]
  brnr profile show [<name> | --pid <pid>] [--json]
                    the profile session new and acp use with --profile <name> (default
                    without), or what process <pid> was started with; secrets redacted
  brnr profile keys [--json]
                    every key a profile can have

remote
  brnr remote check <target> [--json]

brnr
  brnr doctor [--fix | --report] [--json]
  brnr skill [<reference> | install [--dir <dir>]...]
             the skill for agents that use brnr: print it, or install it
  brnr --version

brnr <group> --help lists a group's commands. <session> is a session's id, as brnr session list
shows it. <request> is a pending approval's or elicitation's handle, as brnr permission requests
and brnr elicitation requests show them. <pid> is a brnr process, which runs one agent for one or
more sessions, as brnr process list shows them. --json prints the same data as the text: one JSON value, or one event per line for event
log, event watch and session new --foreground. --strict is stable ACP only: no --steer into a
running turn, no session fork.
Execution commands accept --remote <[user@]host> before --: execute over SSH, with brnr on
the remote shell's PATH. Without --remote, no command but remote check connects to another
machine through brnr's transport.
A profile is loaded on the machine that runs the command: with --remote, --profile <p> is the
destination's, and local brnr config isn't read. SSH uses existing host trust and keys.
Remote paths and event notify commands are on the destination. See brnr remote --help.

process

A brnr process runs one agent for one or more sessions: a headless one, which session new starts, or an editor’s, which brnr acp starts.

brnr process list

Lists the brnr processes that are running, as found in the runtime directory.

brnr process list [--json]
FlagMeaning
--jsonPrint the list as JSON.

Output (--json):

FieldTypeMeaning
processeslist of objectsOne for each process.
processes[].pidnumberThe process’s pid, as --pid and process stop take it.
processes[].statestringstarting (it hasn’t committed its start), running, stopping, or unreachable: it doesn’t answer.
processes[].ownerstring or nulleditor or headless; null when it is unreachable.
processes[].agentobjectThe agent it runs, {program, name, version} (conventions). name and version are null for a process that is unreachable.
processes[].agent.programstring or nullThe file name of the command brnr ran; null where brnr doesn’t know it.
processes[].agent.namestring or nullThe agent’s name, from initialize’s agentInfo.
processes[].agent.versionstring or nullThe agent’s version, from initialize’s agentInfo.
processes[].sessionslist of objectsIts sessions, as session list rows with session and state only.
processes[].sessions[].sessionstringThe session’s id.
processes[].sessions[].statestringAs in session list. An unreachable process’s sessions are those it holds the locks of, each unreachable.
processes[].uptimenumber or nullSeconds since it started; null when it is unreachable.
processes[].cwdstringThe directory it started in. Each session has a cwd of its own (session list).
{
  "processes": [
    {
      "pid": 4466,
      "state": "running",
      "owner": "headless",
      "agent": {
        "program": "fake_agent.py",
        "name": "fake-agent",
        "version": "1.2.3"
      },
      "sessions": [
        {
          "session": "sess-1",
          "state": "idle"
        }
      ],
      "uptime": 0,
      "cwd": "/home/me/project"
    }
  ]
}

Text output: a table of the processes, no brnr processes when there are none.

Exit codes: 0; 1 if the runtime directory isn’t private to the user.

brnr process stop

Stops a process and its agent, and so all its sessions. It closes the agent’s stdin, then sends SIGTERM, then SIGKILL, to the agent’s process group. It doesn’t wait for the process to exit.

brnr process stop <pid> [--json]
FlagMeaning
--jsonPrint what it did as JSON.

Output (--json):

FieldTypeMeaning
pidnumberThe process, as process list has it.
statusstringstopping.
{
  "pid": 4466,
  "status": "stopping"
}

Text output: stopping.

Exit codes: 0 once the process is stopping; 1 if it isn’t. Errors: process_not_found, process_unreachable, agent_exited (the agent has exited already).

session

A session is the agent’s conversation, named by the id the agent gave it. A headless session is in a process that session new or session resume starts; an editor’s is in the process its brnr acp starts.

brnr session new

Starts a process for a headless session, in the background (or the foreground), and opens a new session in it. It sets the cwd, logs in and sets the session’s settings, then sends the prompt, if there is one. With --pid <pid>, it opens the session in that running process instead.

brnr session new [--pid <pid>] [<new flags>] [-- <agent> [args...]]

<new flags> are the process flags, the session flags and the prompt flags below. session resume takes the same flags.

Process flags

FlagMeaning
--profile <p>The profile to use. default when there is one and this isn’t given.
--auth <method>A noninteractive login method of the agent’s, run first. Credentials and login stay the agent’s.
--strictStable ACP only (ADR 2.1): no --steer into a running turn, no session fork.
--stop-when-idle <s>Close the session once it has been idle for this many seconds; 0 closes it as soon as it is idle. Wins over the profile’s stop_when_idle. The process stops with its last session, which isn’t closed first.
--response-timeout <s>Seconds an approval or elicitation waits for an answer. Wins over the profile’s response_timeout. Then an approval is answered with its reject_once option, else its turn is cancelled; an elicitation is answered cancel.
--foregroundStay attached and show the events as they come, as event watch shows them. Ctrl-C stops the session. Not with --wait.
--quietWith --foreground: show nothing.
-- <agent> [args...]The agent to run, in place of the profile’s.

--pid <pid> opens the session in a running headless process, with its agent, profile and MCP servers. The process flags and -- <agent> are a usage error with it.

  • An editor’s process refuses (process_owned_by_editor), and so does a process with stop_when_idle whose agent can’t close sessions (capability_missing).
  • The session, its settings (over the profile’s) and the prompt commit as one. A setting that fails after the agent opened the session closes it again, and the error says so; for an agent that can’t close sessions, the error names the session left open.
  • The start timeout goes to the process, which abandons the opening the same way once it passes; the command waits 10 s longer. A process stopping meanwhile fails it. A command gone first (Ctrl-C) leaves no session. None of these sends the prompt.
  • A process with a session being opened doesn’t stop as its other sessions close or go idle meanwhile.

Session flags

FlagMeaning
--cwd <dir>The session’s working directory. By default the profile’s cwd, else here; with --pid, here (resume: the session’s recorded cwd first).
--mode <m>The agent’s mode: its config option of category mode, else session/set_mode with ACP’s v1 modes.
--model <m>The config option of category model.
--thought-level <l>The config option of category thought_level.
--option <o>=<v>Config option <o>, by its id. Repeatable.

These are set before the first prompt, and win over the profile’s, setting by setting. Two values for one setting fail before anything is sent, as do a mode, model or thought level the agent has no option for (config set has the rules).

Prompt flags

FlagMeaning
--prompt <text>The prompt, sent as given (--prompt -h sends -h). An empty one is a usage error.
--prompt -Read the prompt from stdin. An empty one fails, 1 (input_invalid).
--file <path>Attach a file, as an ACP resource_link. Repeatable.
--image <path>Attach a PNG, JPEG, GIF or WebP image, as an ACP image block. Repeatable.
--waitWait for the turn to end, and print the agent’s reply on stdout. Needs a prompt or an attachment.
--timeout <s>With --wait: give up waiting after this many seconds, exit 124. Without --wait it is a usage error. It doesn’t end the session or its turn.
--jsonPrint the result as JSON.

A word left over, such as a prompt given as words without --prompt, is a usage error. A file or image that can’t be read stops the command before anything is sent (input_invalid). Files and images has their encoding and what the agent must support.

With --wait, approvals, elicitations and the startup line (started sess-1 (process 4466)) go to stderr, so that stdout is the agent’s reply and nothing else (brnr session new --wait … > answer.md).

Output (--json, without --wait):

FieldTypeMeaning
sessionstringThe new session’s id.
pidnumberIts process.
messagestring or nullThe prompt’s message id; null without a prompt.
{
  "session": "sess-1",
  "pid": 4466,
  "message": "m1"
}

Output (--wait --json): one object, once the turn has ended. A command can fail before there is one.

FieldTypeMeaning
sessionstringThe session.
pidnumberIts process.
messagestringThe prompt’s message id.
replystringThe agent’s messages in the turn, joined by a blank line.
stop_reasonstring or nullACP’s stop reason, end_turn for a turn that ended normally; null if the turn failed or the message was dropped.
errorobject or nullThe turn’s failure, {code, message}: agent_failed with the agent’s as rpc_error (errors); null if it didn’t fail.
tokensobject or nullWhat the agent reported the turn used, as turn_ended has it; null if it reported nothing.
droppedlist of objectsEmpty, or the message, dropped before it was sent, {message, text, reason} (conventions).
{
  "session": "sess-1",
  "pid": 4466,
  "message": "m1",
  "reply": "hi",
  "stop_reason": "end_turn",
  "error": null,
  "tokens": null,
  "dropped": []
}

Output (--foreground --json): one event per line, as event watch --json prints them.

Text output: started sess-1 (process 4466); with --wait, the agent’s reply.

Exit codes: 0 once the session is open (with --wait: once its turn has ended with end_turn); 1 if it failed to start, or (with --wait) the turn failed, stopped otherwise or its message was dropped; 124 when --timeout passes; 3 when it was cut off and couldn’t catch up; 2 for a usage error. With --foreground, the agent’s exit status; a failed start is nonzero. Exit codes has the rules. Errors: config_invalid, profile_not_found, agent_not_started, acp_version_unsupported, agent_exited, agent_failed, setting_invalid, capability_missing, input_invalid, start_timed_out; with --pid, also process_not_found, process_unreachable, process_starting, process_stopping, process_owned_by_editor.

brnr session resume

Starts a process and carries on an existing session in it: session/resume, or session/load where the agent has only that. It takes the flags of session new, and prints the same.

brnr session resume [--pid <pid>] <session> [--take-over] [<new flags>] [-- <agent> [args...]]
FlagMeaning
--take-overAsk the process that holds the session to close it first, as session close does. With --pid, it first checks that the process would take it: it isn’t starting or stopping, and its agent can resume sessions.

Which agent and cwd it uses:

  • A session brnr has a transcript of resumes with the cwd, agent and profile of the newest record of all its files, in every project folder. --cwd, --profile and -- <agent> override them.
  • A session brnr has no transcript of (one only the agent knows) is resumed by its id with the agent after --, else the profile’s (--profile, else default); with neither, it fails (agent_not_started). Its cwd is --cwd, else the profile’s cwd, else the current directory.
  • With --pid, the agent is that process’s. The cwd is --cwd, else the recorded cwd, else the current directory.

With --pid, a session open in that process already is refused, and one another process holds is refused unless --take-over.

Output (--json, without --wait); with --wait, as session new --wait --json:

FieldTypeMeaning
sessionstringThe session’s id.
pidnumberIts process.
messagestring or nullThe prompt’s message id; null without a prompt.
{
  "session": "sess-1",
  "pid": 4466,
  "message": null
}

Exit codes: as session new. Errors: as session new, and session_active (open in another process, without --take-over), session_closing.

brnr session status

Reads a running session’s current state.

brnr session status <session> [--json]
FlagMeaning
--jsonPrint the state as JSON.

Output (--json):

FieldTypeMeaning
sessionstringThe session’s id.
titlestring or nullIts title, as the agent gave it; null if it gave none.
pidnumberThe process that serves it.
agentobject{program, name, version} (conventions).
agent.programstring or nullThe file name of the command brnr ran.
agent.namestring or nullThe agent’s name, from initialize’s agentInfo.
agent.versionstring or nullThe agent’s version, from initialize’s agentInfo.
ownerstringeditor or headless.
lock_pidnumber or nullThe process that holds its lock; null if none does.
shared_pidslist of numbersThe processes that serve it without its lock (ADR 3.9). What happens there isn’t in its transcript.
lock_errorstring or nullWhy an editor’s session is served without its lock; null if it has it.
cwdstringIts working directory.
forked_fromstring or nullThe session it was forked from; null if it isn’t a fork.
statestringidle, busy (a turn runs) or waiting (an approval or an elicitation waits for an answer).
turn_elapsednumber or nullSeconds the running turn has run; null when none runs.
modestring or nullThe current mode; null if the agent has none.
modelstring or nullThe current model; null if the agent has no model option.
toolslist of objectsThe running turn’s tool calls the agent hasn’t finished, one for each id, as tool_call has them. Once a turn ends, cancelled or failed too, none of its calls is listed.
planlist or null, ACP’sThe agent’s last plan entries, as ACP has them; null before any.
pending_countnumberApprovals waiting (permission requests lists them).
elicitation_countnumberElicitations waiting (elicitation requests lists them).
held_countnumberMessages held (queue list lists them).
context_countnumberContext entries held for the next prompt.
usageobject or nullThe context window and cost, as usage has them; null before the agent reports any.
last_turnobject or nullHow the last turn ended; null before the first.
last_turn.stop_reasonstring or nullAs turn_ended has it.
last_turn.errorobject or nullAs turn_ended has it.
last_turn.tokensobject or nullAs turn_ended has it.
last_messagestring or nullThe agent’s last message, at most 4000 characters of it, then …; the events have all of it. Null before any.
last_activestringWhen it last had an event.
stop_when_idlenumber or nullThe process’s idle timeout in seconds; null if it has none.
stoppingbooleanWhether the process is stopping.
uptimenumberSeconds since the process started.

The _count fields are counts. Use permission requests, elicitation requests and queue list for what they count. Tool, plan, usage and token data come from the agent.

{
  "session": "sess-1",
  "title": "Fake session",
  "pid": 4466,
  "agent": {
    "program": "fake_agent.py",
    "name": "fake-agent",
    "version": "1.2.3"
  },
  "owner": "headless",
  "lock_pid": 4466,
  "shared_pids": [],
  "lock_error": null,
  "cwd": "/home/me/project",
  "forked_from": null,
  "state": "idle",
  "turn_elapsed": null,
  "mode": "default",
  "model": "small",
  "tools": [],
  "plan": null,
  "pending_count": 0,
  "elicitation_count": 0,
  "held_count": 0,
  "context_count": 0,
  "usage": null,
  "last_turn": {
    "stop_reason": "end_turn",
    "error": null,
    "tokens": null
  },
  "last_message": "hi",
  "last_active": "2026-10-23T15:00:54.541419Z",
  "stop_when_idle": null,
  "stopping": false,
  "uptime": 0
}

Text output: the same, line by line.

Exit codes: 0; 1 if it fails. Errors: those of a running session.

brnr session fork

Copies a session into a new one in the same headless process, if the agent can fork sessions (session/fork). Not in an editor’s process, nor in strict mode.

brnr session fork <session> [--json]

Output (--json):

FieldTypeMeaning
sessionstringThe new session’s id.
forked_fromstringThe session it was forked from.
{
  "session": "sess-2",
  "forked_from": "sess-1"
}

Text output: forked sess-1 into sess-2.

Exit codes: 0; 1 if it fails. Errors: those of a running session, process_owned_by_editor, strict_mode_refused, capability_missing (the agent can’t fork, or, with stop_when_idle, can’t close sessions), agent_failed.

brnr session close

Cancels a running turn and closes the session (session/close). It is done once the agent has closed it. The last headless session closing stops its process.

brnr session close <session> [--json]

Output (--json):

FieldTypeMeaning
sessionstringThe session closed.
{
  "session": "sess-1"
}

Text output: closed sess-1.

Exit codes: 0; 1 if it fails. Errors: those of a running session, capability_missing (the agent can’t close sessions), experimental_disabled (an editor’s session), agent_failed.

brnr session delete

Deletes the agent’s copy of an inactive session (session/delete), through the agent recorded for it, which it starts for that, or the one --profile or -- <agent> names. brnr’s transcript stays, with a session_deleted record, unless --purge.

brnr session delete <session> [--purge] [--profile <p>] [--json] [-- <agent> [args...]]
FlagMeaning
--purgeAlso delete brnr’s transcript of the session: its events and raw ACP files in every project folder, an older brnr’s too, and those set aside beside them (<id>.older.jsonl, <id>.older.acp.jsonl, …), whatever the agent answered. Not the host logs.
--profile <p>The agent of this profile, for a session brnr has no transcript of.
-- <agent> [args...]This agent.
--jsonPrint what it did as JSON.

A session open in a process is refused: close it first. So is an agent without sessionCapabilities.delete. The session’s lock is held while the agent deletes it. A transcript made private first is said on stderr, path_made_private: <path> (its mode was …).

Output (--json):

FieldTypeMeaning
sessionstringThe session.
deletedbooleanWhether the agent deleted it.
errorobject or nullWhy the agent didn’t: agent_failed with the agent’s as rpc_error, or why there is no answer; null if it did.
recorded_inlist of stringsThe transcript files session_deleted was recorded in (without --purge).
purgedlist of stringsThe files deleted (with --purge).
failedlist of stringsWhy a file wasn’t deleted (with --purge) or recorded in (without).
{
  "session": "sess-1",
  "deleted": true,
  "error": null,
  "recorded_in": [
    "/home/me/.brnr/projects/-home-me-project-abd1481c/sess-1.jsonl"
  ],
  "purged": [],
  "failed": []
}

Text output: deleted sess-1; brnr's transcript of it stays (brnr event log sess-1), or with --purge the files deleted.

Exit codes: 0 once the agent has deleted the session. 1 if it didn’t (its error, or no answer), with --purge too, but for an agent that doesn’t have it (ACP’s resource_not_found, -32002): then, with --purge, 0, brnr’s transcript deleted. The pinned brnr-claude-adapter (adapters/package.json) doesn’t answer that: it answers -32603. 1 too if a file couldn’t be deleted or recorded in; the others are done all the same. Errors: session_active, session_closing, agent_not_started (no agent recorded or named), capability_missing, agent_failed.

brnr session prune

Deletes brnr’s transcripts of the sessions last active more than <s> seconds ago, and the host logs of the processes that have gone and were, as session delete --purge deletes them. Nothing is asked of an agent: its own copy of a session stays. By default brnr keeps everything; the config’s retention has every process do this as it starts (ADR 9.5).

brnr session prune --older-than <s> [--dry-run] [--json]
FlagMeaning
--older-than <s>The age, in seconds: what was last active before this many seconds ago goes. 0 is every session no process has open. Needed.
--dry-runSay what would be deleted, and delete nothing.
--jsonPrint what it did as JSON.
  • A session’s age is its last activity, session list’s last_active: the newest record a process wrote in any of its files, not a deletion.
  • Never pruned: a session open in a process or whose lock is held, the host log of a running process, and a file brnr can’t read the age of (in another format, or with no record).
  • A session’s lock is held while its files go, and its age read again: one used since it was listed stays. Its events file goes last.

Output (--json):

FieldTypeMeaning
older_thannumber--older-than, in seconds.
beforestringThe time it gives: what was last active before it goes.
dry_runbooleanWhether nothing was deleted (--dry-run).
sessionslist of objectsOne for each session pruned.
sessions[].sessionstringThe session’s id.
sessions[].last_activestringWhen it was last active.
sessions[].fileslist of stringsIts files deleted, or that would be.
host_logslist of objectsOne for each host log pruned.
host_logs[].host_idstringThe process’s run.
host_logs[].last_activestringIts newest record’s time.
host_logs[].fileslist of stringsThe host log, deleted or that would be.
failedlist of stringsWhy a file wasn’t deleted, or a session’s lock taken.
{
  "older_than": 0,
  "before": "2026-10-24T15:00:54.541419Z",
  "dry_run": true,
  "sessions": [
    {
      "session": "sess-1",
      "last_active": "2026-10-24T15:00:54.120335Z",
      "files": [
        "/home/me/.brnr/projects/-home-me-project-abd1481c/sess-1.acp.jsonl",
        "/home/me/.brnr/projects/-home-me-project-abd1481c/sess-1.jsonl"
      ]
    }
  ],
  "host_logs": [
    {
      "host_id": "20261024T150050-4466",
      "last_active": "2026-10-24T15:00:54.302114Z",
      "files": [
        "/home/me/.brnr/hosts/20261024T150050-4466.jsonl"
      ]
    }
  ],
  "failed": []
}

Text output: pruned what was last active before 2026-10-24 15:00:54Z (more than 0s ago):, then each session and host log with its last activity and its files; would prune with --dry-run; or nothing was last active before …. Each file not deleted is on stderr, brnr: not deleted: <why>.

Exit codes: 0; 1 if a file couldn’t be deleted, the others deleted all the same, or if it fails. Errors: unclassified (a runtime directory that can’t be read: which sessions are open must be known).

brnr session list

brnr’s sessions, open and with a transcript, in every cwd, with nothing started. With --profile or -- <agent>, only the cwd’s, joined on the session id with the agent’s own list (session/list, every page, from the agent started just for that).

brnr session list [--include active,inactive] [--profile <p>] [--cwd <dir>] [--json] [-- <agent> [args...]]
FlagMeaning
--include active,inactiveactive keeps the sessions open in a process (idle, busy, waiting, unreachable), inactive the rest. Both by default.
--profile <p>Also ask this profile’s agent for its sessions.
--cwd <dir>Only this directory’s sessions. Here when an agent is asked and this isn’t given.
-- <agent> [args...]Also ask this agent for its sessions.
--jsonPrint the list as JSON.
  • A cwd is the same however it is spelled (a trailing slash, a symlink).
  • With an agent, a session open in a process that the agent lists in the cwd is the cwd’s, whatever its recorded cwd. An unreachable session is the cwd’s if the agent lists it there or brnr has its transcript there.
  • An agent that can’t list sessions fails the command (capability_missing).

Output (--json): rows most recently active first.

FieldTypeMeaning
sessionslist of objectsOne for each session.
sessions[].sessionstringThe session’s id.
sessions[].titlestring or nullIts title, from its process or the agent’s list; null where neither gives one (an inactive session only brnr knows).
sessions[].statestringidle, busy, waiting (as session status), unreachable (its process doesn’t answer) or inactive (open in no process).
sessions[].pidnumber or nullIts process; null when inactive.
sessions[].agentobject{program, name, version}. name and version only for a session open in a process that answers, else null.
sessions[].agent.programstring or nullThe file name of the command brnr ran; null where brnr doesn’t know it.
sessions[].agent.namestring or nullThe agent’s name, from initialize’s agentInfo.
sessions[].agent.versionstring or nullThe agent’s version, from initialize’s agentInfo.
sessions[].sourcestringWho knows it: brnr, agent or both.
sessions[].last_activestring or nullWhen it was last active. An agent’s updatedAt is converted to UTC from its offset. Null where it isn’t known.
sessions[].forked_fromstring or nullThe session a fork came from, as session status has it; once its process has ended, from its transcript’s first record. Null for one that isn’t a fork, and for a row only the agent knows.
sessions[].cwdstring or nullIts working directory; null where it isn’t known.

Rows are ordered by the time last_active names. An agent’s updatedAt that isn’t an RFC 3339 time is passed on as the agent gave it, after the rows with a time, and said on stderr. A session only the agent knows is inactive, with pid null. forked_from is the session a fork came from, by session fork or an editor’s session/fork through brnr acp.

{
  "sessions": [
    {
      "session": "sess-1",
      "title": "Fake session",
      "state": "idle",
      "pid": 4466,
      "agent": {
        "program": "fake_agent.py",
        "name": "fake-agent",
        "version": "1.2.3"
      },
      "source": "brnr",
      "last_active": "2026-10-23T15:00:54.541419Z",
      "forked_from": null,
      "cwd": "/home/me/project"
    }
  ]
}

Text output: a table of the sessions, the time to the second.

Exit codes: 0; 1 if it fails. Errors: config_invalid, profile_not_found, agent_not_started, acp_version_unsupported, capability_missing, agent_failed.

prompt

What is sent to a session’s agent: prompts, steers, interrupts and context, and the turn’s cancellation.

brnr prompt send

Sends a prompt, with attachments, to one session. A prompt sent while a turn runs is held until it ends: a second prompt never goes while one runs.

brnr prompt send <session> [--steer | --interrupt | --context [--replace]]
                 [--prompt <text> | -] [--file <path>]... [--image <path>]...
                 [--wait [--timeout <s>]] [--json]
FlagMeaning
--steerPut the text into the running turn (_session/steering), where the agent advertises it. With no turn running, it is sent as a prompt. Not in strict mode, nor into an editor’s turn.
--interruptCancel the running turn, and send this ahead of the held prompts.
--contextAdd the text to the next prompt, as context. Text only.
--replaceWith --context: replace the last context entry.
--prompt <text>, --prompt -, --file <path>, --image <path>The prompt and its attachments, as for session new. One of them is needed.
--waitWait for the turn to end, and print the agent’s reply on stdout. Not with --context, which starts no turn.
--timeout <s>With --wait: give up waiting after this many seconds, exit 124. It doesn’t cancel the turn.
--jsonPrint the result as JSON.

--steer, --interrupt and --context are modes, not flags to combine: two of them are a usage error, and so is --replace without --context. With --wait, approvals and elicitations on the way are said on stderr, with how to answer them. An accepted send is not a turn that has ended: match the message id with turn_ended’s messages or message_dropped’s message.

Output (--json, without --wait):

FieldTypeMeaning
statusstringdelivered (sent now), held (until the running turn ends; context is always held), steered (into the running turn) or interrupting (the running turn is being cancelled; this goes next).
sessionstringThe session.
messagestring, optionalThe message’s id (m1), which its turn’s user_message and turn_ended carry. Not there for --context, which has none.
{
  "status": "held",
  "session": "sess-1",
  "message": "m2"
}

Output (--wait --json): one object, once the turn has ended. A command can fail before there is one.

FieldTypeMeaning
sessionstringThe session.
messagestringThe message’s id.
replystringThe agent’s messages in the turn, joined by a blank line.
stop_reasonstring or nullACP’s stop reason; null if the turn failed or the message was dropped.
errorobject or nullThe turn’s failure, {code, message}, agent_failed with the agent’s as rpc_error; null if it didn’t fail.
tokensobject or nullWhat the agent reported the turn used, as turn_ended has it; null if it reported nothing.
droppedlist of objectsEmpty, or the message, dropped before it was sent, {message, text, reason}.
{
  "session": "sess-1",
  "message": "m2",
  "reply": "done",
  "stop_reason": "end_turn",
  "error": null,
  "tokens": null,
  "dropped": []
}

Text output: delivered (message m2), held (message m2), …; with --wait, the agent’s reply.

Exit codes: 0 once sent (with --wait: once its turn has ended with end_turn); with --wait, 1 if the turn failed, stopped otherwise or its message was dropped, 124 when --timeout passes, 3 when cut off and unable to catch up; 1 if it fails; 2 for a usage error. Errors: those of a running session, input_invalid, capability_missing (steering, images), strict_mode_refused, turn_owned_by_editor, experimental_disabled, process_stopping, session_closed and agent_exited (with --wait).

brnr prompt cancel

Cancels the running turn (session/cancel). The held messages are dropped, unless --keep-held: they would otherwise start the next turn. The held context stays.

brnr prompt cancel <session> [--keep-held] [--json]
FlagMeaning
--keep-heldKeep the held messages.
--jsonPrint the result as JSON.

Output (--json):

FieldTypeMeaning
statusstringcancelling (a turn runs, and is cancelled) or idle (none runs).
sessionstringThe session.
droppedlist of objectsThe messages dropped, each {message, text, reason}, reason cancel.
dropped[].messagestringThe message’s id.
dropped[].textstringIts text.
dropped[].reasonstringcancel.
{
  "status": "cancelling",
  "session": "sess-1",
  "dropped": [
    {
      "message": "m2",
      "text": "later",
      "reason": "cancel"
    }
  ]
}

Text output: the status, then dropped m2: later for each message dropped.

Exit codes: 0; 1 if it fails. Errors: those of a running session, experimental_disabled.

brnr prompt commands

Lists the slash commands the agent has advertised (ACP’s available_commands_update). Invoke one by sending its text as a prompt.

brnr prompt commands <session> [--json]

Output (--json):

FieldTypeMeaning
sessionstringThe session.
commandslist of objectsOne for each command.
commands[].commandstringIts name, without the /.
commands[].hintstring or nullWhat its input is, as the agent says (input.hint); null if it takes none.
commands[].descriptionstringWhat it does, as the agent says.
{
  "session": "sess-1",
  "commands": [
    {
      "command": "compact",
      "hint": null,
      "description": "Compact the conversation"
    }
  ]
}

Text output: /compact Compact the conversation, one line for each.

Exit codes: 0; 1 if it fails. Errors: those of a running session.

queue

What a session holds for later: the messages sent while a turn runs, which go one at a time as turns end, and the context for the next prompt.

The queue commands print the same object: what is held after the command, and what it dropped.

FieldTypeMeaning
sessionstringThe session.
heldlist of objectsThe held messages, in the order they go: interrupts first.
held[].messagestringThe message’s id.
held[].textstringIts text.
held[].interruptbooleanWhether it is an interrupt, which goes ahead of the rest.
held[].attachmentsnumberHow many attachments it has.
contextlist of stringsThe held context entries’ texts, in order.
droppedlist of objectsThe messages the command dropped, each {message, text, reason}, reason queue.
dropped[].messagestringThe message’s id.
dropped[].textstringIts text.
dropped[].reasonstringqueue.

Dropping a held message or context is an event too: message_dropped and context_dropped.

brnr queue list

Shows the held messages and context.

brnr queue list <session> [--json]
{
  "session": "sess-1",
  "held": [
    {
      "message": "m2",
      "text": "later",
      "interrupt": false,
      "attachments": 0
    }
  ],
  "context": [],
  "dropped": []
}

Text output: m2 (after turn): later for each, then the context; nothing held when there is none.

Exit codes: 0; 1 if it fails. Errors: those of a running session.

brnr queue show

Shows one held message in full: its id, whether it interrupts, its text, and its attachments as ACP content blocks.

brnr queue show <session> <message> [--json]

Output (--json):

FieldTypeMeaning
sessionstringThe session.
messagestringThe message’s id.
textstringIts text.
interruptbooleanWhether it is an interrupt.
attachmentsnumberHow many attachments it has.
blockslist of objects, ACP’sIts attachments, as the ACP content blocks that go with the prompt: a file’s resource_link (uri, name), an image’s image (mimeType, data, base64).
{
  "session": "sess-1",
  "message": "m2",
  "text": "later",
  "interrupt": false,
  "attachments": 1,
  "blocks": [
    {
      "type": "resource_link",
      "uri": "file:///home/me/project/src/api.rs",
      "name": "api.rs"
    }
  ]
}

Text output: the message, then file: <uri> or image: <type>, <size> bytes for each attachment.

Exit codes: 0; 1 if it fails: a message not held fails. Errors: those of a running session, message_not_found.

brnr queue drop

Drops one held message, by its id.

brnr queue drop <session> <message> [--json]

Output (--json): the queue object above, with the message in dropped (reason queue).

{
  "session": "sess-1",
  "held": [],
  "context": [],
  "dropped": [
    {
      "message": "m2",
      "text": "later",
      "reason": "queue"
    }
  ]
}

Text output: dropped m2: later, then what is held.

Exit codes: 0; 1 if it fails. Errors: those of a running session, message_not_found.

brnr queue clear

Drops the held messages, the held context, or with neither flag both.

brnr queue clear <session> [--messages] [--context] [--json]
FlagMeaning
--messagesDrop the held messages.
--contextDrop the held context. On an editor’s session, its profile must enable the experimental context.
--jsonPrint the result as JSON.

Output (--json): the queue object above, with the messages dropped in dropped. Context dropped isn’t in it: its context_dropped events say so.

{
  "session": "sess-1",
  "held": [],
  "context": [],
  "dropped": [
    {
      "message": "m2",
      "text": "later",
      "reason": "queue"
    }
  ]
}

Text output: dropped m2: later for each, then what is held.

Exit codes: 0; 1 if it fails. Errors: those of a running session, experimental_disabled.

permission

The agent’s permission requests (session/request_permission), which brnr holds as approvals until they are answered: by these commands, a bridge, the editor, the response timeout, or the agent giving them up.

brnr permission requests

Lists the approvals waiting, in every process that answers, or in one session.

brnr permission requests [<session>] [--json]

A process that doesn’t answer is passed over, as process list and session list pass over it (they show it unreachable), and said on stderr, brnr: process <pid> is not answering; its approvals aren't listed, in text and --json alike. The exit status stays 0.

Output (--json): each row is permission show’s object, with fewer fields.

FieldTypeMeaning
requestslist of objectsOne for each approval waiting.
requests[].sessionstringIts session.
requests[].requeststringIts handle, p1.
requests[].ownerstringeditor or headless.
requests[].kindstring or nullThe tool call’s kind, as the agent gave it (ACP’s toolCall.kind); null if it gave none.
requests[].titlestring or nullThe tool call’s title, as the agent gave it; null if it gave none.
requests[].optionslist of objects, ACP’sThe agent’s options, as ACP has them: {optionId, name, kind}.
{
  "requests": [
    {
      "session": "sess-1",
      "request": "p1",
      "owner": "headless",
      "kind": "edit",
      "title": "Edit src/lib.rs",
      "options": [
        {
          "optionId": "allow",
          "name": "Allow",
          "kind": "allow_once"
        },
        {
          "optionId": "reject",
          "name": "Reject",
          "kind": "reject_once"
        }
      ]
    }
  ]
}

Text output: a table of the approvals; nothing waiting when there are none.

Exit codes: 0; 1 if it fails. Errors: with <session>, those of a running session.

brnr permission show

Shows one approval waiting, in full, so that it can be judged before it is answered: the tool, its kind and paths, the command or input, the diff of an edit, and the options.

brnr permission show <session> <request> [--json]

Output (--json):

FieldTypeMeaning
requeststringIts handle, p1.
sessionstringIts session.
ownerstringeditor or headless.
answerablebooleanWhether permission allow and reject would be taken: an editor’s session needs the experimental permission in its profile.
why_notstring or nullWhy not; null when it is answerable.
titlestring or nullThe tool call’s title, as the agent gave it.
kindstring or nullThe tool call’s kind, as the agent gave it.
tool_callobject, ACP’sThe agent’s tool call, whole, as ACP has it (toolCall).
optionslist of objects, ACP’sThe agent’s options, {optionId, name, kind}.
timeout_leftnumber or nullSeconds until the response timeout answers it; null without one.
{
  "request": "p1",
  "session": "sess-1",
  "owner": "headless",
  "answerable": true,
  "why_not": null,
  "title": "Edit src/lib.rs",
  "kind": "edit",
  "tool_call": {
    "toolCallId": "perm-1",
    "title": "Edit src/lib.rs",
    "kind": "edit",
    "locations": [
      {
        "path": "src/lib.rs",
        "line": 2
      }
    ],
    "rawInput": {
      "file_path": "src/lib.rs"
    },
    "content": [
      {
        "type": "diff",
        "path": "src/lib.rs",
        "oldText": "one\nold line\nthree\n",
        "newText": "one\nnew line\nthree\n"
      }
    ]
  },
  "options": [
    {
      "optionId": "allow",
      "name": "Allow",
      "kind": "allow_once"
    },
    {
      "optionId": "reject",
      "name": "Reject",
      "kind": "reject_once"
    }
  ],
  "timeout_left": null
}

Text output: the tool call, its options, and how to answer it.

Exit codes: 0; 1 if it fails. Errors: those of a running session, request_not_found.

brnr permission allow, brnr permission reject

Answers an approval. allow answers with the agent’s option of kind allow_once (allow_always with --always), reject with its option of kind reject_once (reject_always with --always).

brnr permission allow <session> <request> [--always] [--option-id <id>] [--json]
brnr permission reject <session> <request> [--always] [--option-id <id>] [--json]
FlagMeaning
--alwaysThe always kind, in place of the once kind.
--option-id <id>Answer with the agent’s option of this optionId instead. Where its kind is one of ACP’s, it must be of the verb’s side, and of the always kind with --always.
--jsonPrint the answer as JSON.

A kind missing or there twice, or an option of the other side, fails and lists the options; nothing is answered (answer_invalid).

Output (--json):

FieldTypeMeaning
sessionstringThe session.
requeststringThe handle.
outcomeobject, ACP’sThe answer sent to the agent, ACP’s outcome: {"outcome": "selected", "optionId": …}.
{
  "session": "sess-1",
  "request": "p1",
  "outcome": {
    "outcome": "selected",
    "optionId": "allow"
  }
}

Text output: p1 allow, the request and the option chosen.

Exit codes: 0; 1 if it fails. Errors: those of a running session, request_not_found, answer_invalid, experimental_disabled, process_stopping.

elicitation

The agent asking for input (elicitation/create, ADR 4.5): a form to fill in, or a URL to open. brnr holds each until it is answered with ACP’s action, accept, decline or cancel. One scoped to a request outside any session (a login) has no session, and is named by its process, --pid <pid>.

brnr elicitation requests

Lists the elicitations waiting, in every process that answers, or in one session. A process that doesn’t answer is passed over and said on stderr, as for permission requests.

brnr elicitation requests [<session>] [--json]

Output (--json): each row is elicitation show’s object, with fewer fields.

FieldTypeMeaning
requestslist of objectsOne for each elicitation waiting.
requests[].sessionstring or nullIts session; null for one outside any session.
requests[].pidnumberIts process.
requests[].requeststringIts handle, e1.
requests[].ownerstringeditor or headless.
requests[].modestring or nullform, url, or a mode brnr doesn’t know, as the agent sent it.
requests[].scopestringsession, tool_call or request.
requests[].textstring or nullThe agent’s message.
{
  "requests": [
    {
      "session": "sess-1",
      "pid": 4466,
      "request": "e1",
      "owner": "headless",
      "mode": "form",
      "scope": "session",
      "text": "Tell me about you"
    }
  ]
}

Text output: a table, SESSION, REQUEST, OWNER, MODE, MESSAGE; one outside any session has --pid <pid> as its session.

Exit codes: 0; 1 if it fails. Errors: with <session>, those of a running session.

brnr elicitation show

Shows one elicitation waiting, in full: the message, the mode and scope, the form’s fields with their types, bounds and choices, or the URL. A URL is printed, never opened.

brnr elicitation show (<session> | --pid <pid>) <request> [--json]
FlagMeaning
--pid <pid>The process, for one outside any session, in place of <session>.
--jsonPrint it as JSON.

Output (--json):

FieldTypeMeaning
modestring or nullform, url, or a mode brnr doesn’t know, as the agent sent it.
textstring or nullThe agent’s message (ACP’s message).
scopestringsession, tool_call (a tool call in the session) or request (a request outside any session).
tool_call_idstring or nullThe tool call, for scope tool_call; else null.
scope_request_idstring, number or nullThe request, for scope request; else null.
schemaobject or nullA form’s requestedSchema, as the agent sent it; null for a URL.
urlstring or nullA URL’s address; null for a form.
elicitation_idstring or nullA URL’s elicitationId; null for a form.
requeststringIts handle, e1.
sessionstring or nullIts session; null for one outside any session.
pidnumberIts process.
ownerstringeditor or headless.
answerablebooleanWhether elicitation accept, decline and cancel would be taken: an editor’s session needs the experimental elicitation in its profile.
why_notstring or nullWhy not; null when it is answerable.
timeout_leftnumber or nullSeconds until the response timeout answers it cancel; null without one.
{
  "mode": "url",
  "text": "Log in to the fake",
  "scope": "session",
  "tool_call_id": null,
  "scope_request_id": null,
  "schema": null,
  "url": "https://login.example/a?b=1",
  "elicitation_id": "el-1",
  "request": "e1",
  "session": "sess-1",
  "pid": 4466,
  "owner": "headless",
  "answerable": true,
  "why_not": null,
  "timeout_left": null
}

Text output: the message, the mode and scope, the fields or the URL, and how to answer it.

Exit codes: 0; 1 if it fails. Errors: those of a running session, process_not_found (--pid), request_not_found.

brnr elicitation accept, decline, cancel

Answers an elicitation with ACP’s action.

brnr elicitation accept (<session> | --pid <pid>) <request> [--field <k>=<v>]... [-] [--json]
brnr elicitation decline (<session> | --pid <pid>) <request> [--json]
brnr elicitation cancel (<session> | --pid <pid>) <request> [--json]
FlagMeaning
--pid <pid>The process, for one outside any session, in place of <session>.
--field <k>=<v>accept: a form’s field. Repeat it for a list’s values.
-accept: the form’s fields as one JSON object on stdin, in place of --field.
--jsonPrint the answer as JSON.

The process checks an accept’s values against the form’s schema before anything is sent: fields in the schema, the required ones given, their types (a --field string read as the type asks), bounds and choices. pattern and format are not checked. A value that doesn’t fit fails, naming the field, and nothing is sent (answer_invalid). A URL’s accept takes no fields. A mode brnr doesn’t know can’t be accepted, only declined or cancelled.

Output (--json):

FieldTypeMeaning
sessionstring or nullThe session; null for one outside any session.
requeststringThe handle.
actionstringaccept, decline or cancel.
contentobject or null, ACP’sAn accept’s form values, with ACP’s value types; null for a URL’s accept, decline and cancel.
{
  "session": "sess-1",
  "request": "e1",
  "action": "accept",
  "content": {
    "color": "green",
    "name": "Ada"
  }
}

Text output: e1 accepted (declined, cancelled).

Exit codes: 0; 1 if it fails. Errors: those of a running session, process_not_found (--pid), request_not_found, answer_invalid, input_invalid (stdin isn’t one JSON object), experimental_disabled, process_stopping.

config

A session’s settings: the agent’s config options (ACP’s configOptions), and its v1 modes where it has them (ADR 6.2). For the config file, see configuration.

brnr config get

Lists the config options the agent advertised and its v1 modes, each with its value and its choices.

brnr config get <session> [--mode] [--model] [--thought-level] [--option <o>]... [--json]
FlagMeaning
--modeOnly the option of category mode, else the v1 modes.
--modelOnly the option of category model.
--thought-levelOnly the option of category thought_level.
--option <o>Only option <o>, by its id. Repeatable.
--jsonPrint the options as JSON.

It lists only what the agent advertised: one it doesn’t have fails (setting_invalid).

Output (--json):

FieldTypeMeaning
sessionstringThe session.
optionslist of objectsThe options, then the v1 modes.
options[].optionstring or nullThe option’s id; null for the v1 modes.
options[].categorystring or nullACP’s category (mode, model, thought_level, …); null if the agent gave none.
options[].valuestring or booleanThe current value: a value id, or a boolean option’s true or false.
options[].choiceslist of objectsThe values it takes, a group’s too. A boolean option has none.
options[].choices[].valuestringA value id.
options[].choices[].namestringIts name.
options[].choices[].descriptionstring or nullIts description; null if the agent gave none.
options[].namestring or nullThe option’s name; null for the v1 modes.
options[].descriptionstring or nullIts description; null if the agent gave none, and for the v1 modes.
{
  "session": "sess-1",
  "options": [
    {
      "option": "model",
      "category": "model",
      "value": "small",
      "choices": [
        {
          "value": "small",
          "name": "Small",
          "description": null
        },
        {
          "value": "large",
          "name": "Large",
          "description": null
        }
      ],
      "name": "Model",
      "description": null
    },
    {
      "option": null,
      "category": "mode",
      "value": "default",
      "choices": [
        {
          "value": "default",
          "name": "Default",
          "description": "Asks before edits"
        },
        {
          "value": "plan",
          "name": "Plan",
          "description": "Plans, doesn't edit"
        }
      ],
      "name": null,
      "description": null
    }
  ]
}

Text output: a table of each option, then its choices, the current one marked *.

Exit codes: 0; 1 if it fails. Errors: those of a running session, setting_invalid.

brnr config set

Sets a session’s settings, as session new’s are resolved: by category for --mode, --model and --thought-level, by id for --option.

brnr config set <session> [--mode <m>] [--model <m>] [--thought-level <l>] [--option <o>=<v>]... [--json]
FlagMeaning
--mode <m>The option of category mode. session/set_mode only where the agent has v1 modes and no mode option.
--model <m>The option of category model.
--thought-level <l>The option of category thought_level.
--option <o>=<v>Option <o>, by its id. Repeatable.
--jsonPrint what was set as JSON.

One of them is needed. Two values for one setting fail, as does a mode, model or thought level the agent has no option for, before anything is sent (a usage error, or setting_invalid). Each is sent once, the mode first. An --option id the agent hasn’t advertised is sent too, for the agent to take or refuse; a refusal names what was already set.

Output (--json):

FieldTypeMeaning
sessionstringThe session.
setlist of objectsEach setting sent, in order.
set[].optionstring or nullThe option’s id; null for a v1 mode.
set[].categorystring or nullIts category; null if it has none.
set[].valuestringThe value sent.
{
  "session": "sess-1",
  "set": [
    {
      "option": "model",
      "category": "model",
      "value": "large"
    }
  ]
}

Text output: one <option>=<value> line for each setting sent, mode= for a v1 mode.

Exit codes: 0 once all are set; 1 if one fails. Errors: those of a running session, setting_invalid, agent_failed, experimental_disabled, process_stopping.

event

A session’s events: read back from its transcript, watched live, turned into notifications, or waited for.

--events chooses the events, in event log, event watch and event notify alike: event names, all for every event, and default for the command’s own default, comma-separated (--events default,agent_thought). Without it, event log and event watch show every event but the quiet ones, acp, agent_thought, usage and tool_progress, in text and JSON alike. It takes the names of brnr’s two notes too, records_skipped and events_missed, which are shown whatever it chose: --events records_skipped alone shows only a transcript’s gaps. A name that is neither is a usage error.

brnr event log

Reads a session’s saved events, running or not, from its files in every project folder, merged by time. A running session’s are read once its process has written what it recorded until then.

brnr event log <session> [--last <n>] [--follow] [--events <default|all|event>,...] [--json]
FlagMeaning
--last <n>Start at the nth last message sent to the agent (user_message), counted in what is merged; 0: only what comes next.
--followGo on printing as the session’s process writes, until the session closes or its process exits.
--events <…>The events to show. With acp, the raw ACP files are read too, each message an acp event, merged in time order.
--jsonPrint one event per line, as JSON.

Output (--json): one event per line, as the transcript has it. A gap in the transcript is a records_skipped note, shown whatever --events chose. A session whose process keeps no transcript (log = "off"), or no raw ACP for acp (log = "events"), says so.

Text output: the events, one or more lines each, with their times.

Exit codes: 0; 1 if it fails. Errors: session_not_found, session_opening, process_unreachable, transcript_not_kept, transcript_unsupported.

brnr event watch

Shows a session’s events, or a process’s (--pid), live, until the session closes or the process exits. A session’s events are its own, and its process’s (the agent exiting).

brnr event watch (<session> | --pid <pid>) [--events <default|all|event>,...] [--json]
FlagMeaning
--pid <pid>Every session’s events in this process, in place of <session>.
--events <…>The events to show.
--jsonPrint one event per line, as JSON.

Output (--json): one event per line. Cut off for falling behind, it catches up from the transcript and goes on. Unable to, it prints what it missed, an events_missed note, as its last line, and exits 3.

Text output: the events as event log shows them.

Exit codes: 0 when the session closes or the process exits; 3 when cut off and unable to catch up; 1 if it fails. Errors: those of a running session, process_not_found (--pid).

brnr event notify

Runs a command for each event of a session, or of every session in a process (--pid), for notifications. With --stdin it reads the events, one per line, from its stdin instead of connecting: a started bridge’s events (bridges).

brnr event notify (<session> | --pid <pid> | --stdin) [--events <default|all|event>,...] -- <command> [args...]
FlagMeaning
--pid <pid>Every session’s events in this process.
--stdinRead the events from stdin, as a bridge started from a profile.
--events <…>The events to run the command for. default, and the default without it: permission_request, elicitation_request, turn_ended and process_exited.
-- <command> [args...]The command to run, as an argument vector.

It has no --json: its stdout is its command’s. The command gets the event, whole, as JSON on its stdin, and these in its environment; nothing is put on its command line, so what the agent writes can’t become arguments:

VariableMeaning
BRNR_EVENTThe event’s name.
BRNR_TEXTThe event as event watch shows it.
BRNR_TITLEThe session’s title, else its id.
BRNR_MESSAGEThe agent’s last message in the session.
BRNR_SESSIONThe session’s id.
BRNR_REQUESTAn approval’s or an elicitation’s handle; empty for other events.
BRNR_PIDThe process.

BRNR_TEXT, BRNR_TITLE and BRNR_MESSAGE are escaped, as event watch shows them, and cut at 32 KiB; the JSON on stdin is whole. Commands run one at a time, in order, each in a process group of its own.

  • It exits when the process does, or the session closes.
  • As a bridge, its events, if the profile limits them, must include agent_message, session_changed and process_exited, which it needs for its environment and to know when to stop.
  • Cut off for falling behind, on the socket, it lets the command finish, then catches up, running the command for each event it missed, as event watch does. Unable to, it says what it missed on stderr and exits 3. A started bridge doesn’t catch up: its stdin is closed, and it is sent SIGTERM.
  • Its connection ending otherwise first, or stopped by a signal (HUP, INT, QUIT, TERM), it stops the command it is running (SIGTERM to its group, SIGKILL 2 s later), says on stderr that no more notifications come, and exits non-zero.

See notifications.

Exit codes: 0 when the process exits or the session closes; 3 when cut off and unable to catch up; non-zero when its connection ends otherwise, or a signal stops it. Errors: those of a running session, process_not_found (--pid).

brnr event wait

Waits for a condition of a session. It returns at once if the condition holds already, so prompt send followed by event wait can’t race.

brnr event wait <session> [--for idle|turn|permission|elicitation|exit] [--timeout <s>] [--json]
FlagMeaning
--for idleThe default: no turn running, nothing held, and no approval or elicitation waiting. A session that closes counts as idle.
--for turnThe next turn that ends.
--for permissionAn approval is waiting.
--for elicitationAn elicitation is waiting.
--for exitThe process exits.
--timeout <s>Give up after this many seconds, exit 124. It doesn’t cancel the turn.
--jsonPrint what met the condition as JSON.

Output (--json): one shape for each --for, whatever ended the wait, and whether it held when the wait began:

  • idle: the session’s state, the table below.
  • turn: the turn_ended event, as event watch --json prints it.
  • permission: the approval waiting, as permission show --json prints it. The event of one answered before brnr asks for it doesn’t end the wait: none is waiting.
  • elicitation: the elicitation waiting, as elicitation show --json prints it, the same way.
  • exit: the process_exited event. A process gone without sending it (killed) gets the same event from the command, as far as it knows it: exit_status and seq null, ts when it saw the process go, and error saying so. Only once brnr has seen the process exit: a connection that fails while it lives is a failure, 1, saying brnr can’t tell that it exited.
FieldTypeMeaning
sessionstringThe session.
statestringidle, or inactive once it has closed, as session list has it.
last_turnobject or nullHow its last turn ended, as session status has it; null before the first, and for one that has closed.
last_turn.stop_reasonstring or nullAs turn_ended has it.
last_turn.errorobject or nullAs turn_ended has it.
last_turn.tokensobject or nullAs turn_ended has it.
{
  "session": "sess-1",
  "state": "idle",
  "last_turn": {
    "stop_reason": "end_turn",
    "error": null,
    "tokens": null
  }
}

Text output: idle: end_turn, inactive: session closed (idle), turn ended: end_turn, approval p1: Edit src/lib.rs, elicitation e1: Tell me about you, exited.

Exit codes:

  • 0 when the condition is met and, for idle and turn, the last turn ended normally (end_turn). On a session that is idle already, it exits as its last turn ended.
  • 1 if that turn failed or stopped for another reason, if its message was dropped, if the agent exited first (but for exit), or (for turn, permission and elicitation) if the session closed first.
  • 124 when --timeout passes.
  • 3 when cut off and unable to catch up, what it missed said on stderr.

A process whose status lacks a count this needs (an older brnr’s) fails the wait, saying which: a count that isn’t there isn’t 0. Errors: those of a running session, session_closed, agent_exited, command_unknown.

acp

brnr acp

What an editor runs as its ACP agent. It starts a brnr process that runs the agent, and relays ACP between the editor and that agent (ADR 3.1). The editor initializes the protocol and owns its sessions.

brnr acp [--profile <p>] [--strict] [--remote <target>] [-- <agent> [args...]]
FlagMeaning
--profile <p>The profile, loaded on the machine that runs the agent: without --remote, this one; with --remote, the destination, and source config isn’t read. Without --profile, that machine’s default profile is used when present.
--remote <target>Execute through SSH on [user@]host or an SSH alias. See remote hosts.
--strictStable ACP only (ADR 2.1): what isn’t stable ACP is refused, and the experimental actions on the editor’s session are off.
-- <agent> [args...]The agent to run, in place of the profile’s.

See which machine loads the profile. Without --remote, brnr acp starts the agent locally; profiles do not select SSH routing.

It has no --json: stdout is ACP.

The editor’s streams

  • Stdin and stdout carry the editor-agent ACP JSON-RPC stream, not the bridge protocol. Don’t write messages for people to this stdout. Stdout ends when the agent’s stdout does, even if the agent runs on; brnr writes nothing more there itself.
  • Stdin closes when the agent’s does, so the editor’s next write fails. When the agent closed its stdin itself, brnr finds out on the write that fails to reach it, which is recorded as sent, and the writes after it fail.
  • Stderr carries brnr’s diagnostics and the agent’s stderr, as it is written. It ends when brnr acp exits. brnr says its errors there with no code: the editor gets none as data.
  • Both streams share one connection and a 16 MiB buffer, so an editor that stops reading one eventually holds up the other (ADR 2.6).

What brnr changes

  • The editor’s initialize reaches the agent without its fs and terminal client capabilities, as ACP v2 has neither, but for those the profile’s client_capabilities names. In strict mode both reach it.
  • The agent’s fs/* and terminal/* requests, where it was offered them, go to the editor, which answers them. A headless process offers neither, and answers them with “method not found” (ADR 2.7).
  • What brnr answers in the agent’s place is a JSON-RPC error as ACP has it (-32603, brnr’s message).
  • Actions on an editor’s session from outside (prompt send, permission allow, …) are experimental for all of 1.x, each enabled by the profile’s editor.experimental; strict mode disables them. See editor setup and deviations, strict mode and experimental actions.

Covered from 1.0.0: ACP version 1 (ADR 2.2), and what passes between the editor and the agent: unchanged, but for the changes ADRs 3.1, 3.9, 4 and 7.1 name, with the defaults they have at 1.0.0.

Exit codes: 2 for a usage error; 1 for a config error or a process that fails to start; after the start, the agent’s exit status, or its signal.

profile

The profiles in the config file, read and never written (ADR 6.5). An agent that can’t read the file, because its tool permissions or a sandbox keep it out, reads them here. The values of MCP servers’ env and headers show as <redacted>, their names kept; there is no flag that shows them. Arguments are not redacted: put secrets in env.

With --remote, each command reads the destination’s config (remote hosts).

brnr profile list

The config file’s path, then each profile with doctor’s line for it.

brnr profile list [--json]
FlagMeaning
--jsonPrint the profiles as JSON.

Output (--json):

FieldTypeMeaning
configstringThe config file’s path.
existsbooleanWhether there is a file. With none, defaults apply.
profileslist of objectsOne for each profile, by name.
profiles[].namestringIts name, as --profile takes it.
profiles[].agentlist or nullIts agent; null where it has none, and the agent is given after --.
profiles[].bridgesnumberHow many bridges it starts.
profiles[].mcp_serversnumberHow many MCP servers its headless sessions get.
profiles[].strictbooleanIts strict.
profiles[].experimentallist of stringsIts editor part’s experimental.
profiles[].client_capabilitieslist of stringsIts editor part’s client_capabilities.
profiles[].echo_asstringIts editor part’s echo_as.
profiles[].featureslist of stringsIts editor part’s features.
{
  "config": "/home/me/.config/brnr/config.toml",
  "exists": true,
  "profiles": [
    {
      "name": "work",
      "agent": ["brnr-claude-adapter"],
      "bridges": 0,
      "mcp_servers": 0,
      "strict": false,
      "experimental": [],
      "client_capabilities": [],
      "echo_as": "tool_call",
      "features": []
    }
  ]
}

Text output: the file’s path and how many profiles it has, or none; defaults apply, then a line for each profile.

Exit codes: 0, also with no file; 1 if the file doesn’t load. Errors: config_invalid, with each problem and where it is.

brnr profile show

A profile as session new --profile <name> and acp --profile <name> would use it, from the file as it is now; or, with --pid, what a running process was started with.

brnr profile show [<name> | --pid <pid>] [--json]
Argument or flagMeaning
<name>The profile. Without it, the one used without --profile: default, or the empty profile where there is none, which it says.
--pid <pid>The process’s start request, from its socket, not from the file: true of that process whatever the file says now, and there where the file can’t be read.
--jsonPrint it as JSON.

Output (--json), for a name:

FieldTypeMeaning
configstringThe config file’s path.
namestringThe profile’s name: default without one.
foundbooleanWhether the file has it. false only without a name: the empty profile applies.
profileobjectThe profile, in the file’s layout. A key the file doesn’t set has its default, or null where a rule applies instead; unset names it. profile keys has the defaults and rules.
profile.agentlist or nullThe agent’s command, or null: the agent given after --.
profile.logstringall, events or off.
profile.strictbooleanStable ACP only.
profile.bridgeslist of objectsThe bridges, as the file has them (bridges).
profile.bridges[].commandstringThe program.
profile.bridges[].argslist of strings, optionalIts arguments.
profile.bridges[].eventslist of strings, optionalThe events it gets.
profile.headlessobjectWhat session new and session resume use.
profile.headless.cwdstring or nullThe sessions’ working directory.
profile.headless.modestring or nullThe mode.
profile.headless.modelstring or nullThe model.
profile.headless.thought_levelstring or nullThe thought level.
profile.headless.optionsobjectConfig options, by id.
profile.headless.response_timeoutnumber or nullSeconds an approval or elicitation waits.
profile.headless.stop_when_idlenumber or nullSeconds until an idle session is closed.
profile.headless.authstring or nullThe login method.
profile.headless.mcp_serverslist of objectsThe MCP servers, as the file has them, the values of env and headers <redacted>.
profile.headless.mcp_servers[].namestringIts name.
profile.editorobjectWhat brnr acp uses.
profile.editor.experimentallist of stringsThe experimental actions enabled.
profile.editor.client_capabilitieslist of stringsThe editor’s capabilities that reach the agent.
profile.editor.echo_asstringHow a message sent through brnr is shown to the editor.
profile.editor.featureslist of stringsThe process-management features enabled.
unsetlist of stringsThe keys the file doesn’t set, by path: log, headless.cwd.
{
  "config": "/home/me/.config/brnr/config.toml",
  "name": "work",
  "found": true,
  "profile": {
    "agent": ["brnr-claude-adapter"],
    "log": "all",
    "strict": false,
    "bridges": [],
    "headless": {
      "cwd": null,
      "mode": null,
      "model": null,
      "thought_level": null,
      "options": {},
      "response_timeout": null,
      "stop_when_idle": null,
      "auth": null,
      "mcp_servers": []
    },
    "editor": {
      "experimental": [],
      "client_capabilities": [],
      "echo_as": "tool_call",
      "features": []
    }
  },
  "unset": ["log", "strict", "bridges", "headless.cwd", "editor.features"]
}

Text output: TOML in the file’s layout, each part’s table with who uses it, and each key the file doesn’t set marked: its default, # not set: the default, or a comment with the rule, # cwd: not set; --cwd, else where brnr session new runs.

Output (--pid --json):

FieldTypeMeaning
pidnumberThe process.
start_requestobjectWhat the process was started with, as its host log’s process_started record has it, without the prompt and foreground.
start_request.profilestring or nullThe profile’s name; null where none was given.
start_request.agentlist of stringsThe agent’s command as it was run.
start_request.cwdstringThe directory the process started in.
start_request.strictbooleanStable ACP only.
start_request.logstringWhat it records.
start_request.bridgeslist of objectsThe bridges, each command as it was run.
start_request.bridges[].commandstringThe program.
start_request.bridges[].argslist of stringsIts arguments.
start_request.bridges[].eventslist of strings or nullThe events it gets; null: every event but acp.
start_request.retentionnumber or nullThe config’s retention.
start_request.roleobjectheadless or editor, with what that role was started with.
start_request.role.headlessobject, optionalA headless process’s.
start_request.role.headless.resumestring or nullThe session it resumed.
start_request.role.headless.transcriptbooleanWhether brnr had the resumed session’s transcript.
start_request.role.headless.settingsobjectWhat the start’s flags set: mode, model, thought_level, options.
start_request.role.headless.settings.modestring or null--mode.
start_request.role.headless.settings.modelstring or null--model.
start_request.role.headless.settings.thought_levelstring or null--thought-level.
start_request.role.headless.settings.optionsobject--option, by id.
start_request.role.headless.defaultsobjectWhat the profile set, the same fields: the flags win over it.
start_request.role.headless.defaults.modestring or nullThe profile’s mode.
start_request.role.headless.defaults.modelstring or nullThe profile’s model.
start_request.role.headless.defaults.thought_levelstring or nullThe profile’s thought_level.
start_request.role.headless.defaults.optionsobjectThe profile’s options.
start_request.role.headless.mcp_serverslist of objects, ACP’sThe MCP servers as session/new sends them, the values of env and headers <redacted>.
start_request.role.headless.authstring or nullThe login method.
start_request.role.headless.eventslist of stringsThe events the start followed its first turn by (--wait).
start_request.role.headless.start_timeoutnumberSeconds the start had.
start_request.role.headless.stop_when_idlenumber or nullSeconds until an idle session is closed.
start_request.role.headless.response_timeoutnumber or nullSeconds an approval or elicitation waits.
start_request.role.editorobject, optionalAn editor’s process’s.
start_request.role.editor.proxy_pidnumberThe brnr acp process.
start_request.role.editor.sigmasklist of numbersThe editor’s signal mask, which the agent got.
start_request.role.editor.experimentallist of stringsThe experimental actions enabled.
start_request.role.editor.client_capabilitieslist of stringsThe editor’s capabilities that reach the agent.
start_request.role.editor.echo_asstringHow a message sent through brnr is shown to the editor.
start_request.role.editor.featureslist of stringsThe process-management features enabled.
{
  "pid": 4466,
  "start_request": {
    "profile": null,
    "agent": ["/opt/homebrew/bin/brnr-claude-adapter"],
    "cwd": "/home/me/project",
    "strict": false,
    "log": "all",
    "bridges": [],
    "retention": null,
    "role": {
      "headless": {
        "resume": null,
        "transcript": false,
        "settings": {"mode": null, "model": null, "thought_level": null, "options": {}},
        "defaults": {"mode": null, "model": null, "thought_level": null, "options": {}},
        "mcp_servers": [],
        "auth": null,
        "events": ["agent_message", "turn_ended"],
        "start_timeout": 120,
        "stop_when_idle": null,
        "response_timeout": null
      }
    }
  }
}

Text output: the same, as TOML, the null fields left out.

Exit codes: 0; 1 if it fails. Errors: profile_not_found (a name the file doesn’t have), config_invalid (a file that doesn’t load, or a name with no file), as a start fails; with --pid, process_not_found, process_unreachable.

brnr profile keys

Every key a profile can have. It reads the same table as the check that loads the file and as profile show, so the three can’t disagree.

brnr profile keys [--json]
FlagMeaning
--jsonPrint the keys as JSON.

Output (--json):

FieldTypeMeaning
keyslist of objectsOne for each key, by part, in the file’s layout.
keys[].keystringIts name.
keys[].partstringIts part: shared ([profiles.<name>]), headless ([profiles.<name>.headless]) or editor ([profiles.<name>.editor]). In another part it fails to load.
keys[].typestringIts TOML type: string, list of strings, array of tables: command, args, events, …
keys[].defaultany or nullIts value when the file doesn’t set it; null where rule applies instead.
keys[].rulestring or nullWhat applies when the file doesn’t set it and it has no default.
keys[].nameslist of stringsThe names it takes, as its value or its list’s items; empty for a key that takes any.
keys[].adrstringThe ADR section that decides what it does.
{
  "keys": [
    {
      "key": "agent",
      "part": "shared",
      "type": "list of strings",
      "default": null,
      "rule": "the agent given after --",
      "names": [],
      "adr": "6.1"
    },
    {
      "key": "log",
      "part": "shared",
      "type": "string",
      "default": "all",
      "rule": null,
      "names": ["all", "events", "off"],
      "adr": "5.1"
    }
  ]
}

Text output: each part’s table, then a line for each of its keys.

Exit codes: 0.

remote

Check an SSH destination’s brnr by starting system SSH and running the destination’s doctor, including its adapter --version probes. It writes no local configuration. Command rules cannot make these program starts safe: their choice and behavior depend on the caller’s environment and files. See the program-starting Gap and OS sandbox. The group does not accept --remote; help stays local.

brnr remote check

brnr remote check <target> [--json]

Check that brnr is on the remote shell’s PATH and matches the local package version, then run the destination’s doctor. The preflight neither consumes stdin nor prints a successful probe.

Argument or flagMeaning
<target>SSH alias or [user@]hostname. brnr reads no local brnr configuration.
--jsonPrint doctor’s JSON result; a preflight failure prints a brnr error object. SSH failures may have no JSON.

No check creates, edits or deletes local configuration. SSH authentication and host trust must already be established; see remote hosts.

Output: doctor’s checks object, with the same fields and text output. Exit 0 when all checks pass; 1 for preflight or doctor failure; 2 for usage errors; 255 for SSH failures. See exit codes.

Errors: remote_brnr_not_found (no brnr on the remote shell’s PATH: set it in ~/.zshenv or ~/.bashrc there), remote_version_mismatch (another version, or one without remote support).

doctor

brnr doctor

Checks what brnr depends on, and says what is wrong: the runtime directory, the session locks, the transcripts, the config file and every profile in it, how long transcripts are kept (retention), the adapters, the running processes, the host logs, and files in a format this brnr doesn’t read.

Even without --fix, doctor runs brnr-claude-adapter, brnr-codex-adapter and brnr-muse-adapter with --version, and muse-acp when no npm package identifies it. It uses adapter lookup (ADR 11.2), whose caller-chosen inputs are described in the program-starting Gap. It reads package.json for claude-agent-acp, codex-acp and npm muse-acp without running them. These probes do not constrain what the selected executable can do. See doctor.

brnr doctor [--fix | --report] [--json]
FlagMeaning
--fixAlso make the documented safe repairs: tighten the permissions of directories and files the user owns, and remove stale metadata, sockets and locks. It never touches what it would refuse to use, nor a log, nor the config file.
--reportPrint a bug report to read, then paste into an issue, in place of the checks: brnr’s version, the OS, the adapters, the checks that aren’t ok, and the end of the most relevant host logs, secrets redacted and the home directory as ~. It uploads nothing. Not with --fix.
--jsonPrint the checks, or the report, as JSON.

Output (--json):

FieldTypeMeaning
checkslist of objectsOne for each check, in the order they ran.
checks[].levelstringok, info, warn or fail.
checks[].checkstringWhat it checked: config, runtime dir, profile work, …
checks[].messagestringWhat it found, for people. Not covered.
{
  "checks": [
    {
      "level": "ok",
      "check": "runtime dir",
      "message": "/run/user/1000/brnr: private"
    },
    {
      "level": "ok",
      "check": "config",
      "message": "/home/me/.config/brnr/config.toml: 2 profiles"
    }
  ]
}

Output (--report --json), not covered, as --report isn’t:

FieldTypeMeaning
brnrstringbrnr’s version.
osstringThe OS, its version and the kernel’s: macOS 26.4 (Darwin 25.4.0, arm64).
adapterslist of objectsThe adapters’ checks, {level, check, message}.
adapters[].levelstringAs in checks.
adapters[].checkstringAs in checks.
adapters[].messagestringAs in checks.
checkslist of objectsThe other checks that aren’t ok, {level, check, message}.
host_logslist of objectsThe most relevant host logs’ ends.
host_logs[].runstringThe process’s run id.
host_logs[].endedstringHow it ended.
host_logs[].lineslist of stringsIts last lines, redacted.
{
  "brnr": "0.10.0",
  "os": "macOS 26.4.1 (Darwin 25.4.0, arm64)",
  "adapters": [
    {
      "level": "info",
      "check": "brnr-claude-adapter",
      "message": "not found next to brnr or on PATH"
    }
  ],
  "checks": [],
  "host_logs": []
}

Text output: a line for each check, ok config: …; with --report, Markdown. Neither is covered: read --json.

Exit codes: 0 if no check failed; 1 if one did, how many said on stderr. A failed check is its data, not an error: it has no error code.

skill

brnr skill

The skill for agents that use brnr (ADR 8.6), embedded in brnr, so that it is always the one for this brnr: print it, one of its references, or install it.

brnr skill [<reference> | install [--dir <dir>]...]
Argument or flagMeaning
(none)Print SKILL.md, as Markdown.
<reference>Print one of its references: orchestrate, approvals, observe or setup. Another word is a usage error.
installWrite the skill into each directory’s brnr/ subdirectory, and say where.
--dir <dir>With install: this directory, in place of the defaults, ~/.claude/skills (Claude Code) and ~/.agents/skills (Codex). Repeatable.

It has no --json. What it prints is not covered: it is text for agents to read.

Exit codes: 0; 2 for a usage error; 1 if a file can’t be written.

Events

A process’s events are the story of its sessions (ADR 5.1). The same events go everywhere: a started bridge’s stdin, the socket’s subscribe, event watch --json, event log --json (read back from the transcript), session new --foreground --json, event notify’s stdin, and the transcript’s records. Each is one JSON object on one line; the examples here show it across lines.

Every name and fixed value brnr makes is snake_case, the subject first (ADR 5.9). ACP’s names and values keep ACP’s spelling (sessionId, end_turn), and an acp record’s dir names the two ends (editor->agent). Who acted is by: editor, agent or control (brnr’s commands, bridges and timers). Beside it, peer is the connection that asked, where brnr knows one (socket#7, a bridge’s name), and reason is why, a word.

Every event has these fields:

FieldTypeMeaning
eventstringIts name: one of the sections below.
sessionstring or null, optionalThe session it is of. Null on an acp message of no session, and on an elicitation_request, elicitation_resolved or elicitation_completed outside any session. Not there on the process’s own events (line_too_long, line_too_deep, peer_cut_off, process_exited), on events_missed, and on a records_skipped in the host log.
tsstringWhen it happened.
host_idstring or nullThe process’s run, <started>-<pid>. Null on the session_deleted that session delete records, which no process does.
pidnumber or nullThe process. Null where host_id is.
seqnumber, optionalIts position: one more than the last event’s or ACP message’s of the process, live and in the transcript. Not there on: the session_deleted that session delete records; the first acp message of a session in its raw ACP file, the copy of the session/new or session/fork that opened it, as the request has its position where it was first recorded (a session/new in the host log, as no session is open yet; a session/fork in the raw ACP file of the session it forks); and the notes, records_skipped and events_missed.
replayedboolean, optionaltrue on an event of a load’s replayed history, which brnr had no transcript of (ADR 5.6). Not there otherwise.

The process’s own events, process_exited, line_too_long and line_too_deep, are in every session’s transcript; peer_cut_off is in the host log.

Covered from 1.0.0: each event’s name and fields, wherever it goes: a bridge’s stdin, --json lines, event notify’s stdin and its variables. Ignore the events and fields you don’t know: a minor release can add them.

Which events: a bridge gets every event but acp, unless its profile’s events chooses; a socket client gets none until it subscribes. event watch, event log and the foreground leave out acp, agent_thought, usage and tool_progress unless --events asks for them (event).

user_message

A message sent to the agent, as its turn takes it.

FieldTypeMeaning
bystringcontrol (brnr’s) or editor (the editor’s own prompt).
messagestring, optionalThe message’s id, m1, as prompt send gave it. Not there for an editor’s own prompt.
promptstringThe turn’s key: its session/prompt request’s JSON-RPC id, as JSON text ("\"brnr-3\""). turn_ended has the same.
textstringIts text; an attachment as [resource_link <uri>], [image].

A replayed user_message (a load’s history) has text and replayed only.

{
  "event": "user_message",
  "session": "sess-1",
  "by": "control",
  "message": "m1",
  "prompt": "\"brnr-3\"",
  "text": "reply hi",
  "ts": "2026-10-23T15:02:31.807712Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 5
}

agent_message

The agent’s message, whole: its chunks put together.

FieldTypeMeaning
textstringThe message.
{
  "event": "agent_message",
  "session": "sess-1",
  "text": "hi",
  "ts": "2026-10-23T15:02:31.808162Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 25
}

agent_thought

The agent’s thought, whole, as agent_message has a message.

FieldTypeMeaning
textstringThe thought.
{
  "event": "agent_thought",
  "session": "sess-1",
  "text": "pondering",
  "ts": "2026-10-23T15:02:31.812650Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 30
}

tool_call

A tool call starting (started), and again ending (status completed or failed).

FieldTypeMeaning
tool_call_idstringThe agent’s id of the call.
titlestringIts title.
kindstringACP’s kind: read, edit, execute, …
statusstringACP’s status: pending, in_progress, completed, failed.
locationslist of objectsThe paths it works on, as the agent gave them.
startedboolean, optionaltrue when it starts. Not there when it ends.
{
  "tool_call_id": "t1",
  "title": "Run the tests",
  "kind": "execute",
  "status": "pending",
  "locations": [],
  "event": "tool_call",
  "session": "sess-1",
  "started": true,
  "ts": "2026-10-23T15:02:31.808098Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 13
}

tool_progress

A running tool call’s status changing in between (in_progress). Progress that doesn’t change it is no event.

FieldTypeMeaning
tool_call_idstringThe call.
titlestringIts title.
kindstringIts kind.
statusstringIts new status.
locationslist of objectsThe paths it works on.
{
  "tool_call_id": "t1",
  "title": "Run the tests",
  "kind": "execute",
  "status": "in_progress",
  "locations": [],
  "event": "tool_progress",
  "session": "sess-1",
  "ts": "2026-10-23T15:02:31.808109Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 15
}

plan

The agent’s plan, whole, each time it changes.

FieldTypeMeaning
entrieslist of objects, ACP’sACP’s plan entries: content, status, priority.
{
  "event": "plan",
  "session": "sess-1",
  "entries": [
    {
      "content": "Run the tests",
      "status": "in_progress",
      "priority": "high"
    },
    {
      "content": "Fix them",
      "status": "pending",
      "priority": "high"
    }
  ],
  "ts": "2026-10-23T15:02:31.808057Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 11
}

usage

The context window and its cost, as the agent reports them.

FieldTypeMeaning
usageobjectWhat the agent reported.
usage.usednumberTokens in the context window.
usage.sizenumberThe context window’s size.
usage.costobject or null, ACP’sThe cost, as the agent gave it ({amount, currency}); null if it gave none.
{
  "event": "usage",
  "session": "sess-1",
  "usage": {
    "used": 12345,
    "size": 200000,
    "cost": {
      "amount": 0.42,
      "currency": "USD"
    }
  },
  "ts": "2026-10-23T15:02:31.808144Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 21
}

session_changed

The session’s title, mode, config options or commands changed.

FieldTypeMeaning
whatstringtitle, mode, config or commands.
valuestring or object, ACP’sA title’s or mode’s new value. For config and commands, a JSON merge patch by option id or command name: each one new or changed, with its value (an option’s currentValue, a command’s object), and null for one gone: {"review": {"name": "review", …}, "compact": null}.
{
  "event": "session_changed",
  "session": "sess-1",
  "what": "config",
  "value": {
    "model": "large"
  },
  "ts": "2026-10-23T15:02:31.816832Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 37
}

permission_request

An approval waiting: the agent’s session/request_permission, held for an answer. Its fields are those of permission show that don’t change.

FieldTypeMeaning
requeststringIts handle, p1.
ownerstringeditor or headless.
titlestring or nullThe tool call’s title, as the agent gave it.
kindstring or nullThe tool call’s kind, as the agent gave it.
tool_callobject, ACP’sThe agent’s tool call, whole.
optionslist of objects, ACP’sThe agent’s options, {optionId, name, kind}.
{
  "event": "permission_request",
  "session": "sess-1",
  "request": "p1",
  "owner": "headless",
  "title": "Edit src/lib.rs",
  "kind": "edit",
  "tool_call": {
    "toolCallId": "perm-1",
    "title": "Edit src/lib.rs",
    "kind": "edit",
    "locations": [
      {
        "path": "src/lib.rs",
        "line": 2
      }
    ],
    "rawInput": {
      "file_path": "src/lib.rs"
    },
    "content": [
      {
        "type": "diff",
        "path": "src/lib.rs",
        "oldText": "one\nold line\nthree\n",
        "newText": "one\nnew line\nthree\n"
      }
    ]
  },
  "options": [
    {
      "optionId": "allow",
      "name": "Allow",
      "kind": "allow_once"
    },
    {
      "optionId": "reject",
      "name": "Reject",
      "kind": "reject_once"
    }
  ],
  "ts": "2026-10-23T15:07:45.069842Z",
  "host_id": "20261023T150744-4466",
  "pid": 4466,
  "seq": 12
}

permission_resolved

An approval answered.

FieldTypeMeaning
requeststringIts handle.
answerstring or nullallowed, rejected or cancelled; null for an editor’s answer with an option of a kind brnr doesn’t know.
option_kindstring or nullThe chosen option’s kind; null when none was chosen.
outcomeobject, ACP’sACP’s outcome, as sent: {"outcome": "selected", "optionId": …} or {"outcome": "cancelled"}.
bystringcontrol, editor, or agent: the agent gave the request up with $/cancel_request.
peerstring or nullThe connection that answered (socket#7, a bridge’s name); null where there is none.
reasonstring or nullWhy brnr answered by itself: timeout (the response timeout) or cancel (its turn was cancelled); null when someone answered.

by: agent is on a request the agent gave up with $/cancel_request (ADR 4.5): headless, brnr answered it cancelled (an elicitation, cancel); an editor answers its own. It is no longer waiting, and an allow, reject or elicitation for it fails.

{
  "event": "permission_resolved",
  "session": "sess-1",
  "request": "p1",
  "answer": "allowed",
  "option_kind": "allow_once",
  "outcome": {
    "outcome": "selected",
    "optionId": "allow"
  },
  "by": "control",
  "peer": "socket#7",
  "reason": null,
  "ts": "2026-10-23T15:07:45.078788Z",
  "host_id": "20261023T150744-4466",
  "pid": 4466,
  "seq": 14
}

elicitation_request

An elicitation waiting: the agent’s elicitation/create, held for an answer. Its fields are those of elicitation show that don’t change.

FieldTypeMeaning
sessionstring or nullIts session; null for one outside any session.
requeststringIts handle, e1.
ownerstringeditor or headless.
modestring or nullform, url, or a mode brnr doesn’t know.
textstring or nullThe agent’s message.
scopestringsession, tool_call or request.
tool_call_idstring or nullThe tool call, for scope tool_call.
scope_request_idstring, number or nullThe request, for scope request.
schemaobject or nullA form’s requestedSchema; null for a URL.
urlstring or nullA URL’s address; null for a form.
elicitation_idstring or nullA URL’s elicitationId; null for a form.
{
  "event": "elicitation_request",
  "session": "sess-1",
  "request": "e1",
  "owner": "headless",
  "mode": "url",
  "text": "Log in to the fake",
  "scope": "session",
  "tool_call_id": null,
  "scope_request_id": null,
  "schema": null,
  "url": "https://login.example/a?b=1",
  "elicitation_id": "el-1",
  "ts": "2026-10-23T15:07:57.998001Z",
  "host_id": "20261023T150757-4466",
  "pid": 4466,
  "seq": 12
}

elicitation_resolved

An elicitation answered.

FieldTypeMeaning
sessionstring or nullIts session; null for one outside any session.
requeststringIts handle.
actionstring or nullACP’s action: accept, decline or cancel, or what an editor sent.
contentobject or null, ACP’sAn accept’s form values; null otherwise.
bystringcontrol, editor or agent, as for permission_resolved.
peerstring or nullThe connection that answered; null where there is none.
reasonstring or nulltimeout or cancel when brnr answered by itself; null otherwise.
{
  "event": "elicitation_resolved",
  "session": "sess-1",
  "request": "e1",
  "action": "accept",
  "content": {
    "color": "green",
    "name": "Ada"
  },
  "by": "control",
  "peer": "socket#7",
  "reason": null,
  "ts": "2026-10-23T15:07:49.039746Z",
  "host_id": "20261023T150748-4466",
  "pid": 4466,
  "seq": 14
}

elicitation_completed

The agent says a URL elicitation’s flow is done (elicitation/complete).

FieldTypeMeaning
sessionstring or nullThe elicitation’s session; null if brnr doesn’t know it.
requeststring or nullIts handle; null if brnr doesn’t know it.
elicitation_idstringThe agent’s elicitationId.
{
  "event": "elicitation_completed",
  "session": "sess-1",
  "request": "e1",
  "elicitation_id": "el-1",
  "ts": "2026-10-23T15:07:58.006073Z",
  "host_id": "20261023T150757-4466",
  "pid": 4466,
  "seq": 16
}

turn_ended

A turn ended: the agent answered its session/prompt.

FieldTypeMeaning
bystringcontrol for a turn brnr started, editor for the editor’s.
promptstringThe turn’s key, as its user_message has it.
messageslist of stringsThe messages it carried: the prompt’s, and those steered into it.
stop_reasonstring or nullACP’s stop reason: end_turn, cancelled, max_tokens, …; null if the turn failed.
errorobject or nullThe turn’s failure: {code, message}, agent_failed with the agent’s JSON-RPC error as rpc_error (errors); null if it didn’t fail.
tokensobject or nullThe counts the agent put in its answer (usage, unstable in ACP); null when the answer has no usage object.
tokens.totalnumber or nulltotalTokens.
tokens.inputnumber or nullinputTokens.
tokens.outputnumber or nulloutputTokens.
tokens.thoughtnumber or nullthoughtTokens.
tokens.cached_readnumber or nullcachedReadTokens.
tokens.cached_writenumber or nullcachedWriteTokens.

Each count is the agent’s number, or null where it gave none that is a count (a JSON integer that fits a u64; not 1e3). brnr adds nothing up and doesn’t say what they cover: whether subagents or earlier model calls are in them is the agent’s to say (ADR 4.4).

{
  "event": "turn_ended",
  "session": "sess-1",
  "by": "control",
  "prompt": "\"brnr-3\"",
  "messages": [
    "m1"
  ],
  "stop_reason": "end_turn",
  "error": null,
  "tokens": {
    "total": 1234,
    "input": 1000,
    "output": 234,
    "thought": null,
    "cached_read": null,
    "cached_write": null
  },
  "ts": "2026-10-23T15:02:31.808172Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 26
}

message_dropped

A message that never went to the agent.

FieldTypeMeaning
messagestringIts id.
textstringIts text.
reasonstringcancel (prompt cancel), queue (queue drop, queue clear), close (its session closed), exit (the agent exited) or steer (the agent refused it as a steer).
{
  "event": "message_dropped",
  "session": "sess-1",
  "message": "m2",
  "text": "later",
  "reason": "cancel",
  "ts": "2026-10-23T15:15:01.068955Z",
  "host_id": "20261023T151500-4466",
  "pid": 4466,
  "seq": 11
}

context_dropped

Context that never joined a prompt.

FieldTypeMeaning
textstringIts text.
reasonstringqueue (queue clear), close or exit.
{
  "event": "context_dropped",
  "session": "sess-1",
  "text": "the API key is in .env.local",
  "reason": "queue",
  "ts": "2026-10-23T15:15:01.074214Z",
  "host_id": "20261023T151500-4466",
  "pid": 4466,
  "seq": 15
}

session_closed

A session closed. What it held is dropped first, each with its event. The last session of a process that stops when idle isn’t closed: the process stops, and process_exited says so in place of this (ADR 3.8).

FieldTypeMeaning
bystringcontrol or editor.
reasonstringBy control: close (session close, --take-over) or idle (stop_when_idle). By editor: close.
{
  "event": "session_closed",
  "session": "sess-1",
  "by": "control",
  "reason": "close",
  "ts": "2026-10-23T15:15:01.084882Z",
  "host_id": "20261023T151500-4466",
  "pid": 4466,
  "seq": 18
}

session_reopened

An editor’s load of a session that the agent answered with success after it answered the session’s close: the session is open again, and the load’s history follows. None if another process took the session meanwhile, which the editor’s process then doesn’t serve (ADR 3.9).

FieldTypeMeaning
bystringeditor.
{
  "event": "session_reopened",
  "session": "sess-1",
  "by": "editor",
  "ts": "2026-10-23T15:20:11.120412Z",
  "host_id": "20261023T152005-4466",
  "pid": 4466,
  "seq": 31
}

session_deleted

The agent deleted the session (session/delete). brnr’s transcript stays.

FieldTypeMeaning
bystringcontrol (session delete) or editor.

session delete records it in the session’s transcript with host_id and pid null, and no seq: no process has the session open. An editor’s deletion, through its process, goes into every file of the session.

{
  "event": "session_deleted",
  "session": "sess-1",
  "by": "control",
  "ts": "2026-10-23T15:15:01.648337Z",
  "host_id": null,
  "pid": null
}

history

A load’s replay ended (session/load): the history the agent sent again.

FieldTypeMeaning
updatesnumberHow many updates it replayed.
recordedbooleanWhether the replay was taken into the transcript at all, as events with replayed.
recorded_updatesnumberHow many of the updates are in it: all when recorded, none when not, fewer when the session closed while its load was unanswered, as what came meanwhile had no file to go to.
loadsnumberHow many loads it answers. An editor’s loads of a session that overlap share one replay and one history event, so this can be more than 1, and a recorded history is then in the transcript once for each load.
{
  "event": "history",
  "session": "old-1",
  "updates": 3,
  "recorded": true,
  "recorded_updates": 3,
  "loads": 1,
  "ts": "2026-10-23T15:14:52.389129Z",
  "host_id": "20261023T151452-4466",
  "pid": 4466,
  "seq": 11
}

line_too_long

A line past the limit (32 MiB), not read and not recorded. With an editor it goes on to the other side; headless, it is dropped.

FieldTypeMeaning
fromstringagent or editor.
limitnumberThe limit, in bytes.
relayedbooleanWhether it went on to the other side.
{
  "event": "line_too_long",
  "from": "agent",
  "limit": 33554432,
  "relayed": false,
  "ts": "2026-10-23T15:14:47.066039Z",
  "host_id": "20261023T151446-4466",
  "pid": 4466,
  "seq": 22
}

line_too_deep

A line nested past the depth brnr reads (128 levels; [[1]] is 2), not read and not recorded. With an editor it goes on to the other side; headless, it is dropped. brnr tracks nothing of it: a permission request that deep isn’t listed or answerable from outside.

FieldTypeMeaning
fromstringagent or editor.
max_depthnumberThe depth brnr reads.
relayedbooleanWhether it went on to the other side.
{
  "event": "line_too_deep",
  "from": "agent",
  "max_depth": 128,
  "relayed": false,
  "ts": "2026-10-23T15:14:47.046629Z",
  "host_id": "20261023T151446-4466",
  "pid": 4466,
  "seq": 17
}

peer_cut_off

A peer (a watcher, a bridge) cut off for falling behind (ADR 10.2), told to the other peers.

FieldTypeMeaning
peerstringThe connection cut off (socket#7, a bridge’s name).
last_queued_seqnumberThe last event’s position it was sent.
{
  "event": "peer_cut_off",
  "peer": "socket#7",
  "last_queued_seq": 4120,
  "ts": "2026-10-23T15:21:40.501930Z",
  "host_id": "20261023T152005-4466",
  "pid": 4466,
  "seq": 4121
}

process_exited

The agent exited, and the process with it.

FieldTypeMeaning
exit_statusobject or null{"code": n}, or {"signal": n} for one a signal ended; null where it isn’t known.
exit_status.codenumber, optionalThe exit code. Not there when a signal ended it.
exit_status.signalnumber, optionalThe signal that ended it. Not there otherwise.
errorobject, optionalWhy, {code, message}, when brnr itself failed (process_panicked). Not there otherwise.
{
  "event": "process_exited",
  "exit_status": {
    "code": 0
  },
  "ts": "2026-10-23T15:14:53.637024Z",
  "host_id": "20261023T151452-4466",
  "pid": 4466,
  "seq": 13
}

acp

An ACP message, with its direction: every message between the agent and the editor or brnr. Only to a peer that asks for it by name, and in event log read from the raw ACP file; never in the events file.

FieldTypeMeaning
dirstringeditor->agent, agent->editor, control->agent (brnr’s: a prompt, a cancel, an answer as the client), control->editor (a message sent through brnr, shown to the editor), agent->control (an answer for brnr), or agent_stderr.
sessionstring or nullThe session it is of; null for one of none.
msgobject or string, ACP’sThe message, as brnr read it; a line that isn’t JSON as a string.
{
  "event": "acp",
  "dir": "control->agent",
  "session": "sess-1",
  "msg": {
    "jsonrpc": "2.0",
    "id": "brnr-3",
    "method": "session/prompt",
    "params": {
      "sessionId": "sess-1",
      "prompt": [
        {
          "type": "text",
          "text": "reply hi"
        }
      ]
    }
  },
  "ts": "2026-10-23T15:02:31.807726Z",
  "host_id": "20261023T150231-4466",
  "pid": 4466,
  "seq": 6
}

Notes

Notes are what brnr adds to a stream of events. No process sends one: subscribe and a bridge’s events refuse their names (event_unknown). --events takes them, and shows them whatever it chose.

records_skipped

A gap in a transcript: records brnr couldn’t write (a disk too slow or full), in event log.

FieldTypeMeaning
countnumberEvent records skipped.
acp_countnumberRaw ACP records skipped.
sincestringWhen the first was made.
untilstringWhen the last was made.
first_seqnumber, optionalThe first’s position. Not there when none had one.
last_seqnumber, optionalThe last’s position. Not there when none had one.
errorobject, optionalWhy, {code, message}. Not there when brnr knows none.

It has ts, host_id and pid, and session in a session’s file.

{
  "event": "records_skipped",
  "count": 120,
  "acp_count": 4,
  "since": "2026-10-23T15:30:00.104512Z",
  "until": "2026-10-23T15:30:02.881002Z",
  "first_seq": 981,
  "last_seq": 1104,
  "ts": "2026-10-23T15:30:02.881140Z",
  "host_id": "20261023T152005-4466",
  "pid": 4466,
  "session": "sess-1"
}

events_missed

What a command cut off for falling behind couldn’t catch up on from the transcript (ADR 10.2). event watch prints it on stdout as its last event; event notify, event wait and the --waits say it on stderr. They exit 3.

FieldTypeMeaning
peerstringThe command’s connection, as subscribe named it.
after_seqnumberThe last event it got.
until_seqnumber or nullWhere it subscribed again, or, if that failed each time, where the process said it cut the command off. Null only for a process gone, or one that said no position, as error then says.
errorobjectWhy it couldn’t catch up, {code, message}.

It has ts, host_id and pid.

{
  "event": "events_missed",
  "ts": "2026-10-23T15:31:09.004211Z",
  "host_id": "20261023T152005-4466",
  "pid": 4466,
  "peer": "socket#12",
  "after_seq": 4120,
  "until_seq": 4502,
  "error": {
    "code": "transcript_not_kept",
    "message": "the process keeps no transcript to read (log = \"off\")"
  }
}

Bridge protocol

A bridge is a program a brnr process starts from its profile’s bridges (configuration): it writes requests to its stdout, and reads the replies and the events from its stdin. Its stderr goes to the host log. An external client can instead connect to the control socket, $BRNR_DIR/<pid>.sock, and speak the same protocol. Access is limited by the private runtime directory: this is a local control interface, not an HTTP service, nor a sandbox boundary against other programs of the same user.

Covered from 1.0.0: the protocol as a bridge brnr starts from a profile speaks it, on its stdout and stdin: each cmd, its fields and its reply, the events, and how long the bridge lasts; and BRNR_PID in its environment. Not covered: the control socket, which is in the private runtime directory and is not an interface: its path, how processes and their metadata files are found, and a client that connects to it itself, which speaks this protocol today but has no promise and can change in any release; BRNR_SOCKET; and the wording of an error’s message.

Requests and replies

A request is one UTF-8 JSON object, then a newline. A reply is one too, matched to its request by req_id: replies to requests the agent answers can come later, and events come between replies. A line that isn’t JSON gets an error reply; a request of more than 32 MiB is answered with an error, and the peer is cut off. Handle EOF and a closed connection, rather than wait for ever. The examples below show a long reply across lines; on the wire each is one line.

FieldTypeMeaning
cmdstringThe request: one of the sections below.
req_idanyOptional. Echoed, as given, in the reply. Use a unique one.
okbooleanIn every reply: true for success.
errorobject, optionalIn a failed reply, ok false: {code, message}, an error. Not there otherwise.
error.codestringThe error code.
error.messagestringWhat failed, for people. Not covered.

A cmd the process doesn’t have, or a field the section doesn’t list for it, is refused with command_unknown, and nothing is done: a process can be an older brnr than the one that wrote the request (an editor’s lives as long as the editor’s session), and does a request as asked or not at all. A field of the wrong type, or one missing, is command_invalid. CLI --json results leave out ok and req_id.

{"cmd":"cancel","session":"sess-9","req_id":"r2"}
{
  "ok": false,
  "error": {
    "code": "session_not_found",
    "message": "no session sess-9"
  },
  "req_id": "r2"
}

A request about a session needs the exact id of a session this process serves; one that is closing or opening takes none (session_closing, session_opening). What the agent can’t do, what strict mode refuses, and an action an editor’s profile doesn’t enable are errors (capability_missing, strict_mode_refused, experimental_disabled). On an editor’s session, every request that acts on it (send, cancel, queue’s clear_context, allow, reject, elicitation, set_config and close) is experimental: refused unless the profile enables it (ADR 7.1). Bridges observe it freely. stop is process management, not an experimental action.

Versions

A process says what it is in status (and its metadata file): brnr, its version as brnr --version prints it, and protocol, the version of what the socket speaks. protocol grows by one with each release that adds a request, a field or an event, and only grows within a major version. The CLI compares it with its own, and an error that may come of a difference says which brnr the process is, and how to restart it: a headless one with brnr process stop <pid> and brnr session resume <session>, an editor’s from the editor (ADR 8.8).

Events and how long a bridge lasts

  • A started bridge is subscribed from the start, to every event but acp unless its profile’s events chooses. A socket client gets events once it sends subscribe. Bridge events take event names, not --events’s default.
  • Read continuously. A peer 16 MiB behind is cut off: a connection is closed, a started bridge is sent SIGTERM. The host log’s peer_dropped says so, with last_queued_seq, and the other peers get peer_cut_off. A socket client catches up: it connects again, asks was_cut_off, sends subscribe again (its seq is where live events start), sends logged, and reads the process’s records between its last event’s seq and that one from the transcript (the host log names each session’s files), as brnr’s own commands do. A started bridge can’t.
  • When its process stops, a started bridge gets the last events, then EOF on its stdin. It should exit on EOF: it is sent SIGTERM if it still runs 2 s later.
  • A started bridge’s stdout closing ends its requests, not its events.
  • When a reader falls behind has the 16 MiB queue, long lines and the foreground’s skipped events.

status

The process’s full report: its metadata, its state, and each session’s.

Request: no fields.

Reply:

FieldTypeMeaning
idstringThe process’s pid, as text.
host_idstringIts run, <started>-<pid>.
brnrstringbrnr’s version, as brnr --version prints it.
protocolnumberThe protocol’s version.
profilestring or nullThe profile it started with; null for none.
host_pidnumberThe process.
proxy_pidnumber or nullAn editor’s brnr acp; null headless.
agent_pidnumber or nullThe agent’s process.
agentlist of stringsThe agent’s command, as the profile’s agent has it.
cwdstringWhere it started.
host_logstringIts host log.
socketstringIts control socket. Not covered.
startedstringWhen it started.
capabilitiesobjectWhat the agent advertised, as booleans.
capabilities.resumebooleansession/resume.
capabilities.loadbooleansession/load.
capabilities.listbooleansession/list.
capabilities.forkbooleansession/fork.
capabilities.closebooleansession/close.
capabilities.imagebooleanImages in a prompt.
capabilities.steeringboolean_session/steering.
capabilities.mcp_httpbooleanMCP servers over HTTP.
capabilities.mcp_ssebooleanMCP servers over SSE.
agent_infoobject or null, ACP’sThe agent’s agentInfo from initialize, as it sent it; null without one.
ownerstringeditor or headless.
pending_countnumberApprovals waiting, in all its sessions.
elicitation_countnumberElicitations waiting, outside a session too.
uptimenumberSeconds since it started.
stop_when_idlenumber or nullIts idle timeout in seconds; null for none.
startingbooleanUntil its first session commits.
stoppingbooleanWhether it is stopping.
closinglist of stringsThe sessions it has closed, or failed to open, and holds the locks of until their records are written (ADR 5.5).
bridgeslist of stringsIts started bridges’ names.
sessionslist of objectsIts sessions.
sessions[].sessionstringThe session’s id.
sessions[].statestringidle, busy or waiting.
sessions[].busybooleanWhether a turn runs.
sessions[].titlestring or nullIts title.
sessions[].modestring or nullIts current mode.
sessions[].modesobject or null, ACP’sACP’s v1 modes, as the agent gave them.
sessions[].modelstring or nullIts current model.
sessions[].configlist or null, ACP’sACP’s config options, as the agent gave them.
sessions[].commandslist or null, ACP’sACP’s available commands, as the agent gave them.
sessions[].planlist or null, ACP’sThe last plan’s entries.
sessions[].usageobject or nullThe last usage, as usage has it.
sessions[].toolslist of objectsThe running tool calls, as tool_call has them.
sessions[].last_messagestring or nullThe agent’s last message, at most 4000 characters of it.
sessions[].last_activestringWhen it last had an event.
sessions[].cwdstringIts working directory.
sessions[].forked_fromstring or nullThe session it was forked from, where this process knows it.
sessions[].turn_elapsednumber or nullSeconds the running turn has run.
sessions[].promptsnumberPrompts the agent hasn’t answered.
sessions[].held_countnumberMessages held.
sessions[].context_countnumberContext entries held.
sessions[].pending_countnumberApprovals waiting.
sessions[].elicitation_countnumberElicitations waiting.
sessions[].sharedbooleanWhether it serves the session without its lock.
sessions[].lock_errorstring or nullWhy it has no lock on it.
sessions[].last_turnobject or nullHow its last turn ended, as session status has it.
sessions[].last_turn.stop_reasonstring or nullAs turn_ended has it.
sessions[].last_turn.errorobject or nullAs turn_ended has it.
sessions[].last_turn.tokensobject or nullAs turn_ended has it.
sessions[].events_logstring or nullIts events file; null when not kept (log = "off").
sessions[].acp_logstring or nullIts raw ACP file; null when not kept.
{"cmd":"status","req_id":"r1"}
{
  "id": "4466",
  "host_id": "20261023T150820-4466",
  "brnr": "0.10.0",
  "protocol": 1,
  "profile": null,
  "host_pid": 4466,
  "proxy_pid": null,
  "agent_pid": 4468,
  "agent": [
    "brnr-claude-adapter"
  ],
  "cwd": "/home/me/project",
  "host_log": "/home/me/.brnr/hosts/20261023T150820-4466.jsonl",
  "socket": "/run/user/1000/brnr/4466.sock",
  "started": "2026-10-23T15:08:20.323457Z",
  "capabilities": {
    "resume": true,
    "load": true,
    "list": true,
    "fork": true,
    "close": true,
    "image": true,
    "steering": true,
    "mcp_http": true,
    "mcp_sse": false
  },
  "agent_info": {
    "name": "fake-agent",
    "version": "1.2.3"
  },
  "ok": true,
  "owner": "headless",
  "pending_count": 0,
  "elicitation_count": 0,
  "uptime": 0,
  "stop_when_idle": null,
  "starting": false,
  "stopping": false,
  "closing": [],
  "bridges": [
    "slack-bridge#0"
  ],
  "sessions": [
    {
      "title": "Fake session",
      "mode": "default",
      "modes": {
        "currentModeId": "default",
        "availableModes": [
          {
            "id": "default",
            "name": "Default",
            "description": "Asks before edits"
          },
          {
            "id": "plan",
            "name": "Plan",
            "description": "Plans, doesn't edit"
          }
        ]
      },
      "model": "small",
      "config": [
        {
          "id": "model",
          "name": "Model",
          "type": "select",
          "currentValue": "small",
          "options": [
            {
              "value": "small",
              "name": "Small"
            },
            {
              "value": "large",
              "name": "Large"
            }
          ],
          "category": "model"
        }
      ],
      "commands": [
        {
          "name": "compact",
          "description": "Compact the conversation"
        }
      ],
      "plan": null,
      "usage": null,
      "tools": [],
      "last_message": "hi",
      "session": "sess-1",
      "state": "idle",
      "last_active": "2026-10-23T15:08:20.532866Z",
      "cwd": "/home/me/project",
      "forked_from": null,
      "busy": false,
      "turn_elapsed": null,
      "prompts": 0,
      "held_count": 0,
      "context_count": 0,
      "pending_count": 0,
      "elicitation_count": 0,
      "shared": false,
      "lock_error": null,
      "last_turn": {
        "stop_reason": "end_turn",
        "error": null,
        "tokens": null
      },
      "events_log": "/home/me/.brnr/projects/-home-me-project-abd1481c/sess-1.jsonl",
      "acp_log": "/home/me/.brnr/projects/-home-me-project-abd1481c/sess-1.acp.jsonl"
    }
  ],
  "req_id": "r1"
}

start_request

The request the process was started with, as its host log’s process_started record has it, secrets redacted, without the prompt and foreground: what profile show --pid prints (ADR 6.5).

Request: no fields.

Reply:

FieldTypeMeaning
start_requestobjectWhat the process was started with, as its host log’s process_started record has it, without the prompt and foreground.
start_request.profilestring or nullThe profile’s name; null where none was given.
start_request.agentlist of stringsThe agent’s command as it was run.
start_request.cwdstringThe directory the process started in.
start_request.strictbooleanStable ACP only.
start_request.logstringWhat it records.
start_request.bridgeslist of objectsThe bridges, each command as it was run.
start_request.bridges[].commandstringThe program.
start_request.bridges[].argslist of stringsIts arguments.
start_request.bridges[].eventslist of strings or nullThe events it gets; null: every event but acp.
start_request.retentionnumber or nullThe config’s retention.
start_request.roleobjectheadless or editor, with what that role was started with.
start_request.role.headlessobject, optionalA headless process’s.
start_request.role.headless.resumestring or nullThe session it resumed.
start_request.role.headless.transcriptbooleanWhether brnr had the resumed session’s transcript.
start_request.role.headless.settingsobjectWhat the start’s flags set: mode, model, thought_level, options.
start_request.role.headless.settings.modestring or null--mode.
start_request.role.headless.settings.modelstring or null--model.
start_request.role.headless.settings.thought_levelstring or null--thought-level.
start_request.role.headless.settings.optionsobject--option, by id.
start_request.role.headless.defaultsobjectWhat the profile set, the same fields: the flags win over it.
start_request.role.headless.defaults.modestring or nullThe profile’s mode.
start_request.role.headless.defaults.modelstring or nullThe profile’s model.
start_request.role.headless.defaults.thought_levelstring or nullThe profile’s thought_level.
start_request.role.headless.defaults.optionsobjectThe profile’s options.
start_request.role.headless.mcp_serverslist of objects, ACP’sThe MCP servers as session/new sends them, the values of env and headers <redacted>.
start_request.role.headless.authstring or nullThe login method.
start_request.role.headless.eventslist of stringsThe events the start followed its first turn by (--wait).
start_request.role.headless.start_timeoutnumberSeconds the start had.
start_request.role.headless.stop_when_idlenumber or nullSeconds until an idle session is closed.
start_request.role.headless.response_timeoutnumber or nullSeconds an approval or elicitation waits.
start_request.role.editorobject, optionalAn editor’s process’s.
start_request.role.editor.proxy_pidnumberThe brnr acp process.
start_request.role.editor.sigmasklist of numbersThe editor’s signal mask, which the agent got.
start_request.role.editor.experimentallist of stringsThe experimental actions enabled.
start_request.role.editor.client_capabilitieslist of stringsThe editor’s capabilities that reach the agent.
start_request.role.editor.echo_asstringHow a message sent through brnr is shown to the editor.
start_request.role.editor.featureslist of stringsThe process-management features enabled.
{"cmd":"start_request","req_id":"r1"}
{
  "ok": true,
  "req_id": "r1",
  "start_request": {
    "profile": null,
    "agent": [
      "/opt/homebrew/bin/brnr-claude-adapter"
    ],
    "cwd": "/home/me/project",
    "strict": false,
    "log": "all",
    "bridges": [],
    "retention": null,
    "role": {
      "headless": {
        "resume": null,
        "transcript": false,
        "settings": {
          "mode": null,
          "model": null,
          "thought_level": null,
          "options": {}
        },
        "defaults": {
          "mode": null,
          "model": null,
          "thought_level": null,
          "options": {}
        },
        "mcp_servers": [],
        "auth": null,
        "events": [
          "agent_message",
          "turn_ended"
        ],
        "start_timeout": 120,
        "stop_when_idle": null,
        "response_timeout": null
      }
    }
  }
}

logged

Answered once what the process recorded before it was asked is in its transcript, which another thread writes.

Request: no fields.

Reply:

FieldTypeMeaning
lostbooleantrue when a file has lost records it hasn’t noted yet (a full disk): look for the gaps and errors recorded.
{"cmd":"logged","req_id":"r1"}
{"ok":true,"req_id":"r1","lost":false}

send

Sends a message to a session, as prompt send does. An accepted send is not a turn that has ended: subscribe, and match its message with turn_ended’s messages or message_dropped’s message.

Request:

FieldTypeMeaning
sessionstringThe session.
textstringThe text. It or blocks is needed.
blockslist of objects, ACP’sACP content blocks to add: text, resource_link (uri), image (data, mimeType).
modestringprompt (the default), steer, interrupt or context. context is text only.
replacebooleanWith context: replace the last entry.

Reply:

FieldTypeMeaning
statusstringdelivered, held, steered or interrupting; held for context.
sessionstringThe session.
messagestring, optionalThe message’s id. Not there for context, which has none.
{"cmd":"send","session":"sess-1","text":"also update the changelog","req_id":"r1"}
{"ok":true,"status":"held","session":"sess-1","message":"m2","req_id":"r1"}

cancel

Cancels the running turn, as prompt cancel does.

Request:

FieldTypeMeaning
sessionstringThe session.
keep_heldbooleanKeep the held messages.

Reply:

FieldTypeMeaning
statusstringcancelling or idle.
sessionstringThe session.
droppedlist of objectsThe messages dropped, {message, text, reason}.
{"cmd":"cancel","session":"sess-1","req_id":"r1"}
{"ok":true,"status":"cancelling","session":"sess-1","dropped":[],"req_id":"r1"}

queue

The held messages and context, after what was asked was dropped, as the queue commands print them; or, with show, one held message in full, as queue show prints it.

Request:

FieldTypeMeaning
sessionstringThe session.
dropstringA held message’s id, to drop.
clearbooleanDrop every held message.
clear_contextbooleanDrop the held context.
showstringA held message’s id, to show; alone. One that isn’t an id is refused.

Reply: without show, session, held, context and dropped, as queue has them; with show, session, message, text, interrupt, attachments and blocks, as queue show has them.

FieldTypeMeaning
sessionstringThe session.
heldlist of objectsThe held messages, {message, text, interrupt, attachments}.
contextlist of stringsThe held context.
droppedlist of objectsThe messages dropped, {message, text, reason}.

With show:

FieldTypeMeaning
sessionstringThe session.
messagestringThe message’s id.
textstringIts text.
interruptbooleanWhether it is an interrupt.
attachmentsnumberHow many attachments it has.
blockslist of objects, ACP’sIts attachments, as the ACP content blocks that go with the prompt, as queue show has them.
{"cmd":"queue","session":"sess-1","req_id":"r1"}
{"ok":true,"session":"sess-1","held":[],"context":[],"dropped":[],"req_id":"r1"}

subscribe

Events follow on this connection. Selection is the process’s: filter sessions on the client.

Request:

FieldTypeMeaning
eventslist of strings, "all" or null, optionalThe events. Not there, or null: every event but acp; "all": every event; an empty list: none. A note’s name is refused (event_unknown).

Reply:

FieldTypeMeaning
eventslist of stringsThe events subscribed to.
unknown_eventslist of stringsThe names asked for that this process doesn’t have (a newer brnr’s), left out of the subscription.
peerstringThis connection’s name, socket#7.
host_idstringThe process’s run.
pidnumberThe process.
seqnumberThe last event’s position before the subscription.
{"cmd":"subscribe","events":["turn_ended","tool_dance"],"req_id":"r1"}
{
  "ok": true,
  "events": [
    "turn_ended"
  ],
  "unknown_events": [
    "tool_dance"
  ],
  "peer": "socket#2",
  "host_id": "20261023T150820-4466",
  "pid": 4466,
  "seq": 14,
  "req_id": "r1"
}

was_cut_off

Whether the process cut a connection off for falling behind, of its last 64 cut-offs: a position only, never an event. Catch up from the transcript (ADR 10.2).

Request:

FieldTypeMeaning
peerstringA connection’s name, as subscribe gave it.

Reply:

FieldTypeMeaning
peerstringThe connection.
cut_offbooleanWhether it was cut off.
last_queued_seqnumber or nullThe last position queued for it then; null if it wasn’t.
{"cmd":"was_cut_off","peer":"socket#7","req_id":"r1"}
{"ok":true,"peer":"socket#7","cut_off":false,"last_queued_seq":null,"req_id":"r1"}

pending

The approvals and elicitations waiting in this process, in full.

Request: no fields.

Reply:

FieldTypeMeaning
pendinglist of objectsThe approvals, as permission show --json prints them.
pending[].requeststringAs permission show has it.
pending[].sessionstringAs permission show has it.
pending[].ownerstringAs permission show has it.
pending[].answerablebooleanAs permission show has it.
pending[].why_notstring or nullAs permission show has it.
pending[].titlestring or nullAs permission show has it.
pending[].kindstring or nullAs permission show has it.
pending[].tool_callobject, ACP’sAs permission show has it.
pending[].optionslist of objects, ACP’sAs permission show has it.
pending[].timeout_leftnumber or nullAs permission show has it.
elicitationslist of objectsThe elicitations, as elicitation show --json prints them, each with the process’s pid.
{"cmd":"pending","req_id":"r1"}
{
  "ok": true,
  "pending": [
    {
      "request": "p1",
      "session": "sess-1",
      "owner": "headless",
      "answerable": true,
      "why_not": null,
      "title": "Edit src/lib.rs",
      "kind": "edit",
      "tool_call": {
        "toolCallId": "perm-1",
        "title": "Edit src/lib.rs",
        "kind": "edit",
        "locations": [
          {
            "path": "src/lib.rs",
            "line": 2
          }
        ],
        "rawInput": {
          "file_path": "src/lib.rs"
        },
        "content": [
          {
            "type": "diff",
            "path": "src/lib.rs",
            "oldText": "one\nold line\nthree\n",
            "newText": "one\nnew line\nthree\n"
          }
        ]
      },
      "options": [
        {
          "optionId": "allow",
          "name": "Allow",
          "kind": "allow_once"
        },
        {
          "optionId": "reject",
          "name": "Reject",
          "kind": "reject_once"
        }
      ],
      "timeout_left": null
    }
  ],
  "elicitations": [],
  "req_id": "r1"
}

allow, reject

Answers an approval, as permission allow and reject do.

Request:

FieldTypeMeaning
sessionstringThe session.
requeststringThe handle, p1.
alwaysbooleanThe always kind.
option_idstringThe option’s optionId, in place of a kind. Anything but a string, null too, is refused (command_invalid). Its old name, option, is a field allow doesn’t take (command_unknown).

Reply:

FieldTypeMeaning
sessionstringThe session.
requeststringThe handle.
outcomeobject, ACP’sACP’s outcome, as sent.
{"cmd":"allow","session":"sess-1","request":"p1","req_id":"r1"}
{
  "ok": true,
  "session": "sess-1",
  "request": "p1",
  "outcome": {
    "outcome": "selected",
    "optionId": "allow"
  },
  "req_id": "r1"
}

elicitation

Answers an elicitation with ACP’s action, as elicitation accept and the others do.

Request:

FieldTypeMeaning
sessionstring or nullThe session; null for one outside any session.
requeststringThe handle, e1.
actionstringaccept, decline or cancel.
contentobjectFor a form’s accept: its fields, checked against its schema before anything is sent.

Reply:

FieldTypeMeaning
sessionstring or nullThe session.
requeststringThe handle.
resultobject, ACP’sThe response sent to the agent: action, and an accept’s content.
{"cmd":"elicitation","session":"sess-1","request":"e1","action":"decline","req_id":"r1"}
{"ok":true,"session":"sess-1","request":"e1","result":{"action":"decline"},"req_id":"r1"}

set_config

Sets a session’s settings, as config set does: resolved and sent the same way, and answered once all are set, or with the first failure, which names what was already set.

Request:

FieldTypeMeaning
sessionstringThe session.
modestringThe mode.
modelstringThe model.
thought_levelstringThe thought level.
optionsobjectOption ids to values, strings.

At least one of mode, model, thought_level and options is needed.

Reply:

FieldTypeMeaning
sessionstringThe session.
setlist of objectsEach setting sent, {option, category, value}, as config set has them.
set[].optionstring or nullAs config set has it.
set[].categorystring or nullAs config set has it.
set[].valuestringAs config set has it.
modestring or nullThe current mode.
configlist or null, ACP’sThe agent’s config options now, as ACP has them.
{"cmd":"set_config","session":"sess-1","model":"large","req_id":"r1"}
{
  "ok": true,
  "session": "sess-1",
  "set": [
    {
      "option": "model",
      "category": "model",
      "value": "large"
    }
  ],
  "mode": "default",
  "config": [
    {
      "id": "model",
      "name": "Model",
      "type": "select",
      "currentValue": "large",
      "options": [
        {
          "value": "small",
          "name": "Small"
        },
        {
          "value": "large",
          "name": "Large"
        }
      ],
      "category": "model"
    }
  ],
  "req_id": "r1"
}

fork

Forks a session into a new one in this process, as session fork does. Never in an editor’s process.

Request:

FieldTypeMeaning
sessionstringThe session.

Reply:

FieldTypeMeaning
sessionstringThe new session’s id.
{"cmd":"fork","session":"sess-1","req_id":"r1"}
{"ok":true,"session":"sess-2","req_id":"r1"}

new

Opens a session in this process (session/new, with the process’s MCP servers), sets its settings over the profile’s, then sends the prompt, if there is one: session new --pid. Refused by an editor’s process, and with stop_when_idle when the agent can’t close sessions.

Request:

FieldTypeMeaning
cwdstringIts working directory, absolute; the process’s by default.
mode, model, thought_level, optionsAs for set_config.
textstringThe first prompt’s text.
blockslist of objects, ACP’sThe first prompt’s content blocks, as for send.
timeoutnumberSeconds it may take; past it, the opening is abandoned.

Reply: answered once the session is open and its settings set, before the prompt goes.

FieldTypeMeaning
pidnumberThe process.
sessionstringThe new session’s id.
messagestring or nullThe prompt’s message id; null without a prompt.

A failure after the agent opened the session (a setting, timeout passing, the process stopping) fails the request, and the prompt isn’t sent. The session is closed again (or ends with a stopping process), and the error says so, or names it, left open, when the agent can’t close sessions.

{"cmd":"new","text":"review the diff","req_id":"r1"}
{"ok":true,"pid":4466,"session":"sess-2","message":"m2","req_id":"r1"}

resume

Opens an existing session in this process: session/resume, or session/load where the agent has only that. session resume --pid. The session’s lock is taken first, so one another process holds, or this one serves, is refused.

Request: session, and the fields of new, cwd being the session’s.

FieldTypeMeaning
sessionstringThe session’s id.

Reply: as new.

FieldTypeMeaning
pidnumberThe process.
sessionstringThe session’s id, the one resumed.
messagestring or nullThe prompt’s message id; null without a prompt.
{"cmd":"resume","session":"old-1","req_id":"r1"}
{"ok":true,"pid":4466,"session":"old-1","message":null,"req_id":"r1"}

close

Cancels a running turn, then closes the session (session/close), as session close does. Answered once the agent has closed it. A headless process whose last session closes stops.

Request:

FieldTypeMeaning
sessionstringThe session.
take_overnumberThe pid of the process that session resume --take-over resumes it in.

Reply:

FieldTypeMeaning
sessionstringThe session closed.
{"cmd":"close","session":"sess-1","req_id":"r1"}
{"ok":true,"session":"sess-1","req_id":"r1"}

stop

Stops the process: it closes the agent’s stdin, then sends SIGTERM, then SIGKILL, to the agent’s process group. It doesn’t wait for the process to exit.

Request: no fields.

Reply:

FieldTypeMeaning
statusstringstopping.
{"cmd":"stop","req_id":"r1"}
{"ok":true,"status":"stopping","req_id":"r1"}

Exit codes

Covered from 1.0.0: the code of each situation below. A minor release can give a situation that has none a code of its own.

CodeWhen
0Success. --help or -h, the usage on stdout.
1An operation failed: a session, process or profile that isn’t there, an agent’s error, a file that can’t be read. Every error code exits 1.
2A usage error: what the command line alone shows wrong, with nothing done and the usage on stderr.
3A command cut off for falling behind that couldn’t catch up from the transcript.
124A wait’s --timeout passed, as timeout(1) exits.
255SSH connection, authentication or trust failure during remote execution. SSH diagnostics go to stderr; brnr JSON is not guaranteed. A remote command that itself exits 255 is indistinguishable by status alone.

By command

CommandResult
Every command2 for a usage error. 0 for --help or -h.
An ordinary command0 on success; 1 for an operation failure.
event wait, session new --wait, session resume --wait, prompt send --wait124 when the wait’s timeout passes. For a turn: 0 for end_turn, otherwise 1; a dropped message and the session closing or the agent exiting first fail too, 1. event wait --for permission, elicitation and exit exit 0 when the condition is met; --for exit fails, 1, when the connection fails and brnr can’t see the process exit.
event wait --for idleA session idle already, or one that closes while it waits, exits as its last turn ended. Idle is no turn running, nothing held, and no approval or elicitation waiting.
event watch, event notify, event wait, session new --wait, session resume --wait, prompt send --wait3 when the process cut the command off for falling behind and it couldn’t catch up from the transcript: what it missed is an events_missed note (ADR 10.2). event watch prints it as its last event; the others say it on stderr.
brnr acp2 for a usage error; 1 for a config error or a process that fails to start; after the start, as the agent exited, or its signal; 1 if its process dies first (SIGKILL), with lost the connection to its process on stderr.
session new --foreground, session resume --foregroundThe agent’s exit status; a failed start is nonzero.
session delete1 if the agent didn’t delete the session (its error, or no answer), with --purge too, but for an agent that doesn’t have it (resource_not_found): then 0, brnr’s transcript deleted. 1 too if a file couldn’t be deleted or recorded in.
session prune1 if a file couldn’t be deleted, or a session’s lock couldn’t be taken; the others are deleted all the same.
event notifyNon-zero when its connection ends otherwise than with the process, or a signal stops it.
doctor1 if a check failed: read its checks for the cause.

A failed command doesn’t mean that the process or the agent stopped. A wait’s timeout doesn’t cancel its turn. The detailed wait rules are in ADR 8.3.

Errors

Wherever brnr reports an error as data, it is "error": {"code", "message"} (ADR 8.7):

  • a bridge or socket reply that fails: {"ok": false, "error": {…}} (bridge protocol);
  • an event or note that reports a failure: turn_ended, process_exited, events_missed, records_skipped;
  • the error of --wait’s turn, of last_turn and of session delete;
  • a failed command with --json: its stdout is {"error": {code, message}} (output), unless it printed its JSON before it failed: a stream’s events, or a wait’s turn, which a failed turn’s wait prints too (exit 1), its error in it.

On stderr a failure is brnr: <message> [<code>], in text and with --json alike. A usage error (exit 2), a wait’s timeout (124) and a cut-off (3) have their exit status instead, and no code; doctor exits 1 with its checks. The library’s facade returns a usage error as usage_invalid.

FieldTypeMeaning
errorobjectThe failure, where a command or a reply has one.
error.codestringOne of the codes below.
error.messagestringWhat failed, for people. Not covered.
error.rpc_errorobject, optional, ACP’sWith agent_failed only: the agent’s JSON-RPC error, whole, as it sent it ({code, message, data}).

Where the agent’s answer failed, the code is agent_failed, and rpc_error is the agent’s error, whole. Its numeric code is ACP’s; brnr’s codes are words. A script that needs ACP’s reads rpc_error.code.

{
  "error": {
    "code": "agent_failed",
    "message": "session/new failed: Authentication required",
    "rpc_error": {
      "code": -32000,
      "message": "Authentication required"
    }
  }
}

Covered from 1.0.0: each code below and what it means. A minor release can add a code, for a new failure or for one that was unclassified. Not covered: message, and unclassified, which promises nothing.

A running session

A command on a running session, <session>, finds it first. These are the errors of that, whatever the command:

  • session_not_found: brnr knows no session of that id.
  • session_inactive: it isn’t open in any process; resume it.
  • session_active: it is open where the command needs it not to be.
  • session_closing: it is closing; it is free once its records are written, 2 s at most.
  • session_opening: it is opening, and takes no requests until it has.
  • process_unreachable: the process that holds it doesn’t answer, or can’t be reached from here.

Every command that asks a process can also get command_unknown, from a process of another brnr (ADR 8.8), and unclassified.

Codes

CodeThe failure
acp_version_unsupportedThe agent speaks an ACP version brnr doesn’t.
agent_exitedThe agent exited, and its process with it, before the command was done: a start, a wait, a request.
agent_failedThe agent answered with a JSON-RPC error; rpc_error is that error, as the agent sent it.
agent_not_startedNo agent to start: none given or recorded, or its program can’t be run.
answer_invalidAn answer that doesn’t fit its permission request or elicitation: no such option, a kind missing or doubled, the other side’s option, content that doesn’t fit the form, an action that isn’t one.
capability_missingThe agent doesn’t advertise what was asked: forking, closing, resuming, listing or deleting sessions, steering, images, an MCP server’s transport.
command_invalidA socket request that isn’t one: not JSON, no cmd, a field missing or of the wrong type, fields that don’t go together.
command_unknownA cmd the process doesn’t have, or a field of one it doesn’t take: a newer brnr’s request to an older brnr’s process; or a status answer without a field this brnr reads, an older brnr’s.
config_invalidThe config file can’t be read, isn’t private, or doesn’t load.
event_unknownA note’s name in subscribe’s events: no process sends one. An event brnr doesn’t have, or a note, in a profile’s bridge events. In subscribe, an event the process doesn’t have isn’t an error: it is named in unknown_events.
experimental_disabledAn action on an editor’s session its profile doesn’t enable.
input_invalidWhat the command reads besides its command line won’t do: an empty prompt on stdin, stdin that isn’t the form’s fields, a file or image that can’t be read or sent, a --cwd that isn’t a directory.
message_not_foundNo held message has that id.
process_not_foundNo brnr process has that pid.
process_owned_by_editorAn editor’s process: no session is opened or forked in it.
process_panickedbrnr itself failed, and its process ended: a bug to report.
process_startingThe process hasn’t committed its start.
process_stoppingThe process is stopping, or its agent takes no more input.
process_unreachableThe process doesn’t answer, or can’t be reached from here (another BRNR_DIR).
profile_not_foundThe config has no profile of that name.
remote_brnr_not_found--remote: no brnr on the destination shell’s PATH; set it in ~/.zshenv or ~/.bashrc there (ADR 12.2).
remote_version_mismatch--remote: the destination’s brnr is another version, or has no remote support (ADR 12.1).
request_not_foundNo permission request or elicitation of that handle is waiting.
session_activeThe session is open in a process, where the command needs it not to be: close it first, or take it over.
session_closedThe session closed before the command was done.
session_closingThe session is closing; it is free once its records are written (2 s at most).
session_inactiveThe session isn’t open in any process; it can be resumed.
session_not_foundbrnr knows no session of that id.
session_openingThe session is opening, and takes no requests until it has.
setting_invalidA mode, model, thought level, config option or login method the agent doesn’t offer, or a value it doesn’t take.
start_timed_outThe session didn’t open in the time its start had.
strict_mode_refusedStrict mode refuses what isn’t stable ACP.
transcript_not_keptThe process keeps no transcript to read, or no raw ACP (log).
transcript_unsupportedThe transcript is in a format this brnr doesn’t read.
turn_owned_by_editorThe editor’s session’s turns are the editor’s: a steer, an interrupt, or a prompt while its turn runs.
unclassifiedAnything else. It promises nothing: don’t match it.
usage_invalidThe arguments don’t make a command. Only the library’s facade returns it: the command line exits 2 for it, with its usage and no code.

Configuration

The config file is TOML: $BRNR_CONFIG, else $XDG_CONFIG_HOME/brnr/config.toml, else ~/.config/brnr/config.toml. Profiles has a complete example. A missing file is no configuration.

  • Unknown keys, keys in the wrong section, and unknown names in experimental, client_capabilities and features fail to load. doctor checks every profile.
  • The file loads only if it is the user’s own and neither the group nor others can read or write it, and its folder is the user’s own and neither can write it. A symlink is followed, and the file it resolves to and that file’s folder are checked. Otherwise every command that reads it fails, naming the path, the owner or mode, and the chmod or chown that fixes it (config_invalid), and doctor fails its config check the same way. brnr never changes the file’s mode (ADR 9.4).
  • Without --profile, the default profile applies, if there is one.
  • A profile is read on the machine that runs the command, and holds no routing: a remote key is unknown. --remote on the command line is the one way to another machine, whose config is its own (remote hosts).
  • brnr profile shows what a profile holds and every key it can have, without the file (profile).
  • Beside the profiles, the file has one key of its own, retention.

Covered from 1.0.0: the TOML below, its sections, keys, values and names; the environment variables below, BRNR_DIR as where the runtime directory is, not what is in it; the BRNR_* variables event notify gives its command; and BRNR_PID in a started bridge’s environment, but not BRNR_SOCKET. A configuration that uses a key added in a later 1.x release doesn’t load in an earlier one.

retention

At the top of the file, outside the profiles: what every process uses, whatever its profile.

retention = 2592000   # 30 days
KeyTypeMeaning
retentionintegerSeconds, 1 or more. Each process, as it starts, deletes brnr’s transcripts of the sessions last active longer ago, and the host logs of processes that have gone and were, as session prune does, and records what it deleted in its host log (transcripts_pruned). Unset, nothing is deleted. 0, or a value that isn’t a whole number ("30d"), fails to load (ADR 9.5).

[profiles.<name>]

What every process of the profile uses.

KeyTypeMeaning
agentlist of stringsThe agent’s command and its arguments, used when none is given after --.
logstringWhat the process records (transcripts): "all" (the default), "events" (no raw ACP) or "off". A string only.
strictbooleanStable ACP only (ADR 2.1). Default false.
bridgesarray of tablesThe bridges the process starts.

[profiles.<name>.headless]

What only session new and session resume use.

KeyTypeMeaning
cwdstringThe sessions’ working directory.
modestringThe mode, set before the first prompt.
modelstringThe model.
thought_levelstringThe thought level.
optionstable of stringsConfig options, by id, to values.
authstringThe agent’s login method, run first (ADR 4.7).
response_timeoutintegerSeconds an approval or elicitation waits for an answer, 0 or more. Then an approval is answered with its reject_once option, else its turn is cancelled; an elicitation is answered cancel.
stop_when_idleintegerClose a session idle this many seconds, 0 or more.
mcp_serversarray of tablesThe MCP servers of the sessions it opens.

A timeout that isn’t set imposes no deadline, and neither has a default: an unattended run must set response_timeout, or a request nobody answers waits as long as the process runs. --mode, --model, --thought-level, --option, --stop-when-idle and --response-timeout win over these.

[profiles.<name>.editor]

What only brnr acp uses.

KeyTypeMeaning
experimentallist of stringsThe actions on the editor’s session from outside that are enabled: send, context, cancel, permission, elicitation, config, close. Default empty.
client_capabilitieslist of stringsThe editor’s capabilities that reach the agent outside strict mode: fs, terminal (ADR 2.7). Default empty.
featureslist of stringsshared_sessions, if enabled (ADR 3.10). Default empty.
echo_asstringHow a message or context sent through brnr is shown to the editor: "tool_call" (the default) or "user_message_chunk" (ADR 7.2).

Bridges

[[profiles.<name>.bridges]]: a program the process starts, which speaks the bridge protocol.

KeyTypeMeaning
commandstringThe program, not empty. A list fails to load.
argslist of stringsIts arguments, as an MCP server’s. Optional.
eventslist of stringsThe events it gets: event names, not notes. Optional; the default is every event but acp.

MCP servers

[[profiles.<name>.headless.mcp_servers]]: an MCP server for the sessions the process opens, local or remote (ADR 6.3).

KeyTypeMeaning
namestringIts name.
commandstringA local (stdio) server’s program.
argslist of stringsIts arguments.
envtable of stringsIts environment.
urlstringA remote server’s URL, in place of command.
typestringA remote server’s transport: "http" (the default) or "sse".
headerstable of stringsA remote server’s HTTP headers.

A server has command or url, not both. type and headers are for a url server, args and env for a command one. The values of env and headers are redacted from the transcripts.

Environment variables

VariableMeaning
BRNR_HOMEThe state directory: transcripts, host logs and session locks. Default ~/.brnr.
BRNR_CONFIGThe config file. Default $XDG_CONFIG_HOME/brnr/config.toml, else ~/.config/brnr/config.toml.
BRNR_DIRThe private runtime directory: sockets and metadata. Default $XDG_RUNTIME_DIR/brnr, else $TMPDIR/brnr-<uid>. brnr refuses one others can use.
BRNR_START_TIMEOUTSeconds a start has to commit. Default 120.

How BRNR_HOME and BRNR_DIR are found, and the state directory’s layout, are fixed for 1.x (ADR 3.9); what host logs and lock files contain isn’t. See environment.

Agents and bridges inherit the environment brnr was started in; the variables an agent logs in with are its own. A started bridge also gets BRNR_PID, its process, and BRNR_SOCKET, the control socket. event notify gives its command BRNR_EVENT, BRNR_TEXT, BRNR_TITLE, BRNR_MESSAGE, BRNR_SESSION, BRNR_REQUEST and BRNR_PID (event notify).

Files and compatibility

Files

PathWhat it is
$BRNR_HOME/projects/<folder>/<session id>.jsonlA session’s events file, its transcript. <folder> is the session’s cwd, every character that isn’t a letter or a digit as -, and a hash of the cwd.
$BRNR_HOME/projects/<folder>/<session id>.acp.jsonlThe session’s raw ACP, beside it.
$BRNR_HOME/hosts/<run id>.jsonlA process’s host log: what belongs to no session.
$BRNR_HOME/sessions/<session id>.lockA session’s lock (ADR 3.9).
$BRNR_DIR/<pid>.sock, $BRNR_DIR/<pid>.jsonA process’s control socket and metadata.

Transcripts has the paths, the records’ process and session fields, the logging modes, redaction and the records_skipped gap notes. Read history through event log where you can.

  • Every record starts with its format, 1 for all of 1.x. A record in another format, an older brnr’s without one or a newer one’s, isn’t read, and event log and doctor say so (ADR 5.10).
  • Nothing is appended to a file in the way: a session opened where one is sets it aside, renamed <name>.older.jsonl (its raw ACP <name>.older.acp.jsonl), and starts a file of its own. A session_log_moved host-log record (path, to) says so.
  • brnr keeps every file here until it is deleted: session delete --purge deletes a session’s, and session prune and the config’s retention what was last active longer ago, a session’s transcript and the host log of a process that has gone (ADR 9.5).
  • A transcript is not a promise of complete history: a disk’s backlog or errors, logging turned off, and a process that dies at once can lose records.

Covered from 1.0.0: each session’s events and raw ACP files, where they are under $BRNR_HOME, and their records, in format 1; a 1.x brnr reads what an earlier 1.x wrote (ADR 5.10); and where each other file under $BRNR_HOME is. Not covered: what host logs and session lock files contain, and what is in the runtime directory: sockets and metadata files.

Output safety

  • Text output escapes the agent’s control characters. JSON keeps the agent’s text as it is: escape it before you show it in a terminal or a UI.
  • MCP servers’ env and headers values are redacted from the recorded ACP, but transcripts can contain prompts and tool output.
  • brnr writes a transcript or host log only where the state directory, each directory below it and the file are the user’s own, with no group or other access. What others can reach is made private before the next record (a path_made_private host-log record says so, or, from session delete, a line on stderr). A symlink, another user’s path, a file that isn’t a regular file, or one with other hard links is refused, with no override (ADR 9.3). A refused host log fails the start; a refused session file is a session_log_failed host-log record.
  • doctor --report is for review before you share it; it uploads nothing.

See the threat model for the trust boundaries and the documented cleanup limit when a process is killed with SIGKILL.

Compatibility

Before 1.0.0 every interface here can change outright, with no aliases or shims (P9). From 1.0.0, what these pages mark Covered is kept compatible within a major version, and anything they don’t name is not covered (ADR 8.4). The library on crates.io is covered as part of the command line: its public API is a facade that mirrors it (#147, ADR 8.5); its internals, behind a feature that is off by default, are not. Error codes are covered.

  • A minor release can add a command, flag, JSON field, event, event field, bridge request, config key, or an exit code for a situation that had none.
  • Only a major release removes or renames any of those, changes a field’s type or what it means, or changes the exit code of a situation that has one.
  • Ignore the fields and events you don’t know.
  • A deprecated form keeps working until the next major version; the changelog says what to use instead.

Security fixes are made on the latest major version; see SECURITY.md. Before 1.0.0-rc.1, the names and shapes of --json output (#150) are still being settled.

1. Critical success factors and principles

Draft 2026-10-07, consolidated 2026-10-19.

What brnr must get right, its critical success factors, and the rules the other decisions are measured against, its principles, which serve the factors. The principles were drawn out of the former decision log when every entry was reviewed (October 2026), and sharpened where earlier decisions pulled against them. The factors were set over them after the architectural review of October 2026, which found decisions that traded one principle for another with nothing to rank them. Decisions cite the factor at stake, then the principles (P1 to P15); one that gives up a factor or breaks a principle says which, and why.

brnr plays two roles (P12): with an editor attached it is a proxy between the editor and the agent; headless, it is the agent’s ACP client. Several principles apply differently to the two.

Critical success factors

What brnr is for

F1. ACP, faithfully

ACP is the protocol brnr implements; doing it faithfully and correctly is the goal. Faithful means one thing in each role (P12): with an editor attached, brnr is invisible, and what passes between editor and agent passes unchanged (P1); headless, brnr is a correct ACP client, and behaves the same with every agent (P2). In strict mode, only ACP’s stable parts are there (ADR 2.1). brnr doesn’t compensate for an agent that doesn’t follow ACP or JSON-RPC: what the agent does wrong shows, as it would without brnr. Principles: P1, P2, P12.

F2. Conventions ahead of the spec

brnr also follows conventions before ACP makes them stable, so that it stays useful while the protocol moves: a pragmatic implementation is often more useful than a strict one. The test is P1’s: agents and editors implement the convention alike. One adapter’s behaviour is not a convention (P2). Strict mode leaves them out. Principles: P1, P2.

F3. What ACP leaves out

brnr is useful for what ACP doesn’t specify: headless sessions, session locks, watchers, transcripts, bridges, notifications. These are outside ACP’s scope, and they are the value brnr adds. The limit is P1’s test: what brnr adds can’t change what a party that follows ACP sees, so it needs no flag. Its defaults protect the user, and feature flags change them (ADR 3.10). Principles: P1, P10, P11, P12.

F4. Actions on an editor’s session, opted into

Some useful features act on an editor’s session, as messages sent through the side channel do, and need compensating behaviour that is not faithful to ACP. brnr has them, each enabled by name as experimental (ADR 7.1). They are kept apart from F3’s feature flags: those change brnr’s own process management, not what the editor sees. Principles: P1, P12.

F5. A focused command line

brnr is a Unix command-line utility: a focused set of operations, each doing one thing, that composes with other tools through arguments, standard streams, exit statuses and JSON. Scripts and agents can rely on it: nothing is lost silently (P3), it never guesses (P4), text and JSON carry the same data (P5), a request that can’t be met fails (P7), and from 1.0.0 what ADR 8.4 covers stays compatible (P9). What another tool can do (a bridge, an event notify command, jq) stays out of brnr. Principles: P3, P4, P5, P7, P9.

How brnr must run

N1. Security

Security comes first. brnr has few crates, each audited by a person or listed as an exemption until one is (cargo vet); an audit is a person’s claim to have read the code. The agent’s text is untrusted (P8); only the user can reach brnr’s files and sockets (P13), and that includes what brnr reads as well as what it writes; brnr calls no one (P15). The threat model (docs/threat-model.md) says what enforces each claim, and its gaps. Principles: P8, P13, P15.

N2. Reliability

brnr runs where reliability is required. Its processes respect the system they run on: memory, threads, files and processes stay bounded whatever a peer, the agent or the editor sends (P6); a start is atomic (P10); no process is left without an owner (P14); a failure is reported and cleaned up, and doesn’t take down more than it must. This is the goal, not a claim about brnr today: what ADR 10.3 lists as not bounded by a count of bytes (a message the agent is still sending, what a session keeps, a line on the control socket) is a gap measured against it. Principles: P6, P10, P14.

N3. Performance

brnr is light: one small process per agent, that adds little latency between editor and agent and little load to the machine. Principles: P6.

What it adds is measured on every pull request (#35): cargo bench --bench acp (benches/acp.rs), which .github/workflows/bench.yml runs on Linux and macOS, fails when a measure passes its budget in benches/budgets.toml, and one comment on the pull request has the numbers. The measures, and their budgets:

  • Latency: a prompt’s round trip through brnr acp, the median, over the same agent’s on a direct pipe: at most 25 times.
  • Throughput: the time a turn that streams 20 MB takes through brnr acp (1 KiB chunks, 16 to a message), over the direct pipe’s: at most 20 times.
  • Memory at rest: the resident memory of brnr acp, 8 MiB at most, and of its process, 16 MiB, initialized with a session open; and of the process after the streams, 64 MiB (a busy machine queues more of the stream, up to ADR 10.1’s caps, and the allocator keeps some of it).
  • Threads: brnr acp 3; its process at rest, with an editor attached, 12; each control connection adds 2, and each bridge 4.

The agent is a fake that answers at once, so the numbers are brnr’s own: with a real agent, brnr adds the same time, and the ratio is smaller. Shared CI runners are noisy, so latency and throughput are ratios to the direct pipe, measured at the same time on the same machine, with wide margins, and the job doesn’t fail on a slow runner. Threads don’t vary, so their budgets are today’s counts: a new thread is a change its pull request chooses, raising the budget and saying why. A message assembled whole from its chunks is ADR 10.3’s gap, not measured here: the stream is many messages. The README and the book’s introduction give one run’s numbers, with the machine and the version.

N4. Simplicity

brnr has few concepts, each with one owner in the code, as a focused utility should (F5). A layer of its own is thin, named and visible (P2). A change that adds a concept says why an existing one doesn’t do. Principles: P2, P9.

When they pull apart

Security (N1) first, then reliability (N2), then faithfulness to ACP (F1). The other factors give way to these three. A record that gives up one factor for another says which, and why.

F1 and F2 meet by mode, not by rank: by default brnr follows the conventions ahead of the spec (F2), and strict mode is ACP’s stable parts to the letter (F1). A convention followed by default is not a conflict with F1, as long as strict mode leaves it out.

Principles

P1. Follow ACP faithfully

brnr does what ACP specifies, as it specifies it. The test for anything it does beyond that: can a client or an agent that follows the protocol be affected by it, now or as the protocol moves on? Three kinds of “beyond” are kept apart:

  • The protocol itself. By default brnr speaks stable ACP plus the conventions current agents and editors implement alike, ahead of the spec (_session/steering, session/fork while it is unstable, dropping fs and terminal as ACP v2 does, but those a profile names). Strict mode, chosen per process, is stable ACP to the letter and nothing else (ADR 2.1).
  • Actions brnr adds to an editor’s session through the side channel: experimental, each enabled by name (ADR 7.1).
  • brnr’s own process management, such as which sessions a process may serve: defaults that protect the user, and feature flags to change them (ADR 3.10). It isn’t protocol, so strict mode doesn’t change it.

What is outside ACP’s scope and can’t affect a party that follows it is none of these, and needs no mark: headless operation (brnr is an ordinary client), observing a session (event watch, event log, event notify, bridges), brnr’s own CLI.

With an editor attached, a faithful intermediary is invisible: brnr acp must not change how the editor and the agent interact. Bytes, signals, stderr, stdin EOF and the exit status pass through unchanged. What brnr does through the side channel aims to keep the editor’s view in step with the agent’s state; where that can’t be done, the gap is a caveat, stated in the documentation. The deliberate changes to the stream are few, and each is named: requests reach the agent with the host’s ids (ADR 2.4); by default the editor’s fs and terminal capabilities are dropped, unless the profile names them (ADR 2.7); an editor’s load of a session another process owns is refused unless a feature flag allows it (ADR 3.9); and the experimental actions, where enabled, add to and answer for the editor’s session (ADR 7.1, ADR 2.5).

P2. ACP as ACP has it

Sessions, modes, config options, approvals and login are the agent’s. brnr adds a layer of its own only where ACP has nothing (message ids, held messages, waiting, idle stops, response timeouts, events, transcripts), and keeps it thin, named and visible. A convention agents and editors implement alike can be followed (P1); one adapter’s undocumented behaviour can’t be relied on, even where ACP has nothing: to brnr the adapter is the agent, and adapters differ (what a prompt sent mid-turn means, ADR 4.2).

P3. Nothing is lost silently

Whatever brnr drops, refuses, cuts off or ends is told to whoever relied on it, in their own channel: an event for bridges and watchers, an error and an exit status for the CLI, a session/update for the editor (P1). The host log is the record, not the telling.

P4. brnr never picks or guesses

An argument means one thing: exact ids, no prefixes, never “the only one”. Defaults are fixed rules, documented, that don’t depend on what happens to be running. When brnr can’t be sure (a process that doesn’t answer, a line it can’t parse), it refuses in the client role and passes the thing through untouched in the proxy role, and says so.

P5. One interpretation, one stream

The host interprets ACP once, into events. Everything brnr shows is made of them: event watch, event log, session status, the foreground, bridges, event notify, live or read back from the transcript. Text and JSON carry the same events: an event chosen is shown in both, and what is too noisy for the default is left out of the default in both. Beside the events, brnr keeps the raw ACP by default (ADR 5.1), so the interpretation can be checked against what was said; values brnr knows are secrets are recorded redacted (ADR 9.1). The events are a summary, not the conversation, which is the agent’s: what each stream keeps and leaves out is ADR 5.10’s.

P6. Memory stays bounded

When a reader falls behind, who gives way depends on what it is. Observers (bridges, watchers, the foreground display) are cut off or skip, and are told (P3); they never slow the session. The session’s own pipes (the editor link, the agent’s stdin and stdout) get backpressure, as a direct pipe would give them (P1): nothing buffered past a cap, and no timeout of brnr’s own (ADR 10.1).

P7. An explicit request that can’t be met fails

With the reason, up front where it can be known (at start, against the agent’s capabilities); never quietly ignored or approximated.

P8. The agent’s text is untrusted

It never reaches a command line or a path unsanitized: values go in the environment (ADR 5.8), and session ids become file names (transcripts, and ADR 3.9’s lock files) only escaped, as paths::file_name does (ADR 9.2): lowercase ASCII letters, digits, - and _ stay, and every other byte is % and two hex digits, so the name stays in its folder and distinct ids never share one. Wherever brnr shows it, control characters and bidi overrides are escaped (render::clean); JSON carries it as sent.

P9. No backwards compatibility before 1.0

Until 1.0.0 a change of name, flag, format or behaviour is made outright: no aliases for old names, no shims for old formats. Release notes say what changed. The records are drafts until then too: a decision is rewritten, renumbered, merged or removed where it is written (docs/adr/README.md). From 1.0.0 on, compatibility is kept within a major version, of what ADR 8.4 lists as covered, and of nothing else, not of every flag’s spelling beyond it. What brnr keeps on disk says its format, so that a brnr that can’t read it says so rather than misread it or pass it over without a word (ADR 5.10).

P10. A start is atomic

Whoever starts a brnr process hands it everything at launch, and the start commits at the ready report (ADR 3.4, ADR 3.3).

P11. One owner per session

A session’s owner is the editor, or headless (later perhaps a web client). Ownership changes only by closing the session under one owner and resuming it under the other, when someone asks for it in so many words (ADR 3.9); never as a side effect. A feature flag can let an editor’s process serve a session another process owns (ADR 3.10); the agent then splits the conversation, and the process holding the session’s lock stays its owner of record.

P12. Two roles

With an editor attached, brnr is a proxy: thin and transparent (P1). The side channel is for observing and for notifying other services; any action through it on the editor’s session is experimental and enabled one by one (ADR 7.1). Headless, brnr is the ACP client, and its CLI is a contract that behaves the same with every agent (P2).

P13. Only you

A runtime directory and sockets only the user can open, transcripts only the user can read; brnr refuses a runtime directory others can use, and listens on no network. A transcript is written only where the state directory, each directory below it and the file are the user’s own and private, whether brnr created them or found them: what others can reach is made private before anything is written, and a symlink, or what isn’t the user’s, is refused (ADR 9.3). The config file is read only if it and its folder are the user’s own and nobody else can write them, nor read the file (ADR 9.4). Reach beyond the machine is what a bridge the user configures adds.

P14. No orphans

Every agent process has an owner that knows it exists: the editor, or a headless start that was told its session. When the owner goes before that, the process goes too (ADR 3.1, ADR 3.4).

P15. brnr never phones home

brnr makes no network requests of its own. It collects and sends no telemetry, usage data, error reports or update checks. What reaches the network does so because the user configured it: the agent’s (and its adapter’s) traffic, a bridge’s, an event notify command’s, an MCP server’s.

  • A feature that needs the network is a command the user runs or configures, never a default and never in the background.
  • What brnr knows about a session it keeps on the machine, readable only by the user (P13).
  • An adapter brnr packages (ADR 11.1) is checked against P15 when its version moves: it may reach the agent’s provider, not anyone of brnr’s.
  • The principle is about brnr, the program. The project’s website and repository are outside it; what they count is said where they say it (#40).

Why: whatever brnr sent, even a harmless counter, would ask the user to trust that it sends nothing else. Saying it never sends anything is worth more than what it could learn. Opt-in telemetry was considered and not taken: it needs a server and someone to run it, and its counters would be one more thing to trust in a tool whose point is that it is trusted. Opt-out telemetry would send the user’s data before they knew to stop it.

Tests

The principles aren’t proved by a finite suite: the decisions that apply them have the tests. N3’s measures are checked by cargo bench --bench acp on every pull request (.github/workflows/bench.yml), not by a Rust test: their numbers depend on the machine.

Architecture decision records

What brnr decided, why, and what else was considered, measured against the critical success factors and the principles in ADR 1. One record per topic; each decision is a numbered section of it, cited as ADR T.k (ADR 3.9 is topic 3’s ninth decision).

Writing one

  • A decision goes in the topic it belongs to, as the next section, ## T.k What is decided, a sentence that says what is true. A new topic is a new file, NNNN-short-title.md, the next number, titled # N. Topic.
  • Under a topic’s title, a status line: Draft and the date (Accepted from 1.0.0), whether its decisions are implemented (and if only partly, which aren’t), and the factors it serves. When a decision’s implementation lands, the status line says so.
  • A section states the decision as it stands, and the issues it resolves, then **Why.** (what made it necessary, citing factors and principles), **Consequences.** where any are worth saying, and **Considered.** (the options not taken, and why).
  • A topic ends with its ## Tests.

Changing one

  • Until 1.0.0 every record is a draft (P9). A decision is changed where it is written: a record is rewritten, renumbered, merged into another or removed, so that the records say what is decided now. No Amended by or Superseded by lines are needed. A decision renumbered or removed takes its references with it: ADR T.k in the code and the docs, and adr_NNNN_ in test names. The pull request says what changed, and git keeps what was.
  • At 1.0.0 the records are accepted, and their status lines say so. From then a decision is changed by a new section in its topic, the next T.k. The old section gets a line under its heading, Superseded by T.m or Amended by T.m: …, in the order of the sections’ numbers, and is otherwise left as it was.

Records

TopicDecisionsImplemented
1Critical success factors and principlesP1 to P15, F1 to F5, N1 to N4—
2ACP, faithfully2.1 Strict mode, and the conventions brnr follows by default; 2.2 brnr speaks ACP version 1; 2.3 ACP’s types come from the official schema crate; 2.4 Every request to the agent has an id of the host’s; 2.5 Lines brnr can’t parse, and how deep a line may nest; 2.6 The editor’s stdout ends when the agent’s does, and its stderr comes as written; 2.7 The editor’s file system and terminal reach the agent in strict mode, or when its profile names themyes
3Processes, sessions and ownership3.1 The editor’s process: brnr acp relays, the host owns the agent; 3.2 Sessions are the agent’s ids, processes are pids; 3.3 A process is started with one resolved request; 3.4 A start is atomic and commits at ready; 3.5 A headless session in the foreground; 3.6 The agent’s stderr; 3.7 A process’s own death is recorded; 3.8 Stopping when idle; 3.9 Ownership is a per-session lock; 3.10 Feature flags for process management; 3.11 Resuming; 3.12 Fork and closeyes
4Turns, messages and the agent’s requests4.1 Message ids, and when a turn ends; 4.2 What sending a message does; 4.3 What cancelling does with held messages; 4.4 A turn’s tokens are what the agent reported; 4.5 Approvals and elicitations: the agent’s mode is the policy; 4.6 Requests the agent answers; 4.7 Authenticationyes
5Events, transcripts and observers5.1 The host’s events are the story, and transcripts are two files; 5.2 Dropped messages and closed sessions are events; 5.3 Choosing events, and what text shows; 5.4 event log --last <n>; 5.5 The log of a running session waits for its transcript; 5.6 A load’s history is recorded once; 5.7 Bridges; 5.8 event notify; 5.9 Events, records and their fields follow one naming scheme; 5.10 What a transcript promises, and how its format is markedyes
6Settings and profiles6.1 Profiles, and a start’s flags over them; 6.2 Mode, model and config options; 6.3 MCP servers for headless sessions; 6.4 Files and images in a message; 6.5 brnr profile reads the profiles and never writesyes
7Experimental actions on an editor’s session7.1 Side-channel actions on an editor’s session are experimental, for all of 1.x; 7.2 How a message sent through brnr is shown to the editoryes; 7.1’s real-editor checks aren’t run yet
8The command line and compatibility8.1 Commands are grouped by what they act on, with ACP’s verbs; 8.2 Same data in text and JSON; 8.3 Waiting, and exit status; 8.4 What the compatibility promise covers; 8.5 The library is private, and its facade mirrors the command line; 8.6 A skill for agents that use brnr; 8.7 An error is a stable code and a message; 8.8 A process and the commands can be different brnrspartly: 8.4 applies from 1.0.0; 8.6’s evals with a real agent aren’t done
9Security and privacy9.1 Secrets are redacted in what brnr records; 9.2 One file name per session id, one folder per cwd; 9.3 Transcripts are written only where only you can read them; 9.4 The config file is read only if only you can change or read it; 9.5 Transcripts are kept until they are prunedyes
10Bounded resources10.1 How far behind a reader may fall; 10.2 A peer cut off catches up from the transcript; 10.3 Lines too long to read; 10.4 Connections and waitsyes
11Building, releasing and support11.1 Adapters through Homebrew; 11.2 The adapters’ names, and finding them next to brnr; 11.3 Which adapter version is built; 11.4 release.sh; 11.5 Bug reports; 11.6 brnr on crates.io; 11.7 Reproducible builds and an SBOM; 11.8 The documentation is a book on the site, and the README is short; 11.9 Agents with ACP of their own are checked by hand, with a smoke checkyes
12Remote execution12.1 Public commands through system SSH; 12.2 --remote is the only transport, and a profile is read where the command runsyes

Where the former records went

Until 2026-10-19 each decision was a record of its own, numbered 1 to 71; the released CHANGELOG entries, issues and commits cite those numbers. Each former record, and the section it is now (old→new):

1→1, 2→3.1, 3→3.9, 4→7.1, 5→7.2, 6→10.1, 7→3.4, 8→3.3, 9→3.5, 10→3.6, 11→3.7, 12→3.8, 13→3.2, 14→3.11, 15→8.1, 16→3.12, 17→4.1, 18→4.2, 19→4.3, 20→5.2, 21→8.3, 22→5.1, 23→5.3, 24→5.4, 25→9.1, 26→2.5, 27→4.5, 28→6.2, 29→4.6, 30→4.7, 31→6.3, 32→6.4, 33→6.1, 34→8.2, 35→5.7, 36→5.8, 37→11.1, 38→11.2, 39→11.3, 40→11.4, 41→2.1, 42→3.10, 43→2.3, 44→P15, 45→11.5, 46→8.6, 47→11.6, 48→5.5, 49→10.1, 50→3.9, 51→10.3, 52→11.7, 53→9.2, 54→2.2, 55→5.1, 56→4.1, 57→5.6, 58→6.1, 59→9.3, 60→10.1, 61→2.4, 62→2.6, 63→8.1, 64→8.4, 65→3.9, 66→8.5, 67→2.7, 68→4.5, 69→10.2, 70→7.2, 71→4.4.

Before them, the decision log (docs/decisions.md) and the questions the code review left open (docs/to-resolve.md) are in git history up to commit 5b585a3.

Tests that name their claims

Runtime regression tests use adr_NNNN_<claim> names, NNNN the topic. Each topic’s Tests section links the assertions, by section; cargo test --release adr_0007_ runs one topic’s claims. A test can establish a specific claim without proving every sentence in a decision, especially real-editor rendering, external releases, and operational guarantees. The names state the scope of the evidence.

CI first runs the suite, then .github/scripts/adr-tests.py lists the tests registered by Cargo (including unit and integration tests). It prints every topic, its claim tests, and topics without Rust tests. An implemented topic without a registered test or an explicit Test exemption: line fails CI, as does an ignored claim test or a test naming a nonexistent topic. A topic with tests has no Test exemption: line; a decision in it that no Rust test covers says so (Not covered by a Rust test: …), with the external check or the remaining gap. ADR 1’s principles are reported too, without pretending that a passing finite suite proves universal design principles.

When changing a claim, update its test and its topic’s Tests section. Name a new decision’s tests by its topic’s number; don’t satisfy the inventory with a test that merely searches source code or repeats the ADR text.

2. ACP, faithfully

Draft 2026-10-19. Implemented, but the real-editor checks for 2.7’s fs and terminal (in ADR 7.1) are not run yet. Factor: F1, F2 (ADR 1). Brings together former ADRs 41, 54, 43, 61, 26, 62 and 67 (docs/adr/README.md maps them).

How brnr speaks ACP: which version, which types, which conventions ahead of the spec, and what strict mode leaves out; how it keeps the editor’s stream byte for byte where it can, and names each change it makes. By default brnr follows the conventions agents and editors implement alike (F2); strict mode is stable ACP to the letter (F1).

2.1 Strict mode, and the conventions brnr follows by default

  • By default brnr speaks stable ACP plus the conventions current agents and editors implement alike. Each is listed here, with what brnr does with it:

    • _session/steering, advertised as _meta.steering.supported in initialize, with _meta.steering.idleBehavior: "promptRequired" (both adapters): prompt send --steer (ADR 4.2).
    • session/fork, unstable in ACP v1 (both adapters): session fork (ADR 3.12).
    • Dropping the editor’s fs and terminal capabilities, as ACP v2 does, but those the profile names (ADR 2.7).

    A convention is added to brnr by adding it to this list.

  • Strict mode, per process (strict = true in a profile, --strict on acp, session new and session resume), is stable ACP to the letter and nothing else: no extension methods, no unstable methods, no _meta field acted on, the editor’s capabilities passed through, and none of ADR 7.1’s experimental actions, whatever the profile enables. What strict mode refuses says why (“--steer uses _session/steering, an ACP extension, which strict mode doesn’t”).

  • Strict mode is about the protocol only. Headless operation, observing a session, brnr’s CLI and its process management (process stop, which isn’t one of ADR 7.1’s actions; the feature flags, ADR 3.10) are the same with it and without.

  • Stable means what the ACP schema doesn’t mark unstable, as agent-client-protocol-schema builds it without its unstable features (ADR 2.3).

Why. ACP to the letter (P1) leaves out what agents and editors already implement ahead of the spec, and what people use: steering a running turn, forking a session (F2). The practical setup leans on conventions a stricter one may not want: an extension method, a _meta field, a method the schema marks unstable. F1 and F2 meet by mode (ADR 1). As of @agentclientprotocol/sdk 1.6.0 the schema marks, in v1, session/list, resume, close and delete stable, session/fork unstable, and fs and terminal stable client capabilities; v2 drops fs, terminal, session/load and session/set_mode. $/cancel_request is stable in both. Extension methods start with _.

Considered.

  • Stable ACP only, always: it leaves out steering and forking, which both adapters implement and people use.
  • Each convention as an experimental action, enabled by name like ADR 7.1’s: conventions don’t act on an editor’s session behind its back; a switch per process is enough.
  • Strict mode also deciding process management (whether an editor may share a session another process owns): that isn’t protocol (ADR 3.10).

2.2 brnr speaks ACP version 1

  • brnr speaks ACP version 1 (schema::PROTOCOL_VERSION, the schema crate’s ProtocolVersion::V1), and asks for it in initialize.
  • An answer to its initialize that chooses another version, or none brnr can read as one (missing, a string, not a whole number up to 65535), ends there: nothing else of the answer is read, and nothing more is sent. A start fails before it commits (ADR 3.4), as any start does: session new or session resume exits with status 1 and says “the agent speaks ACP version 999; brnr speaks only version 1”, or “the agent’s answer to initialize has no ACP version brnr can read (protocolVersion: …)”, and the process stops, and with it the agent. session list with an agent named fails with the same, and stops its agent.
  • Strict mode and the default are the same here: version 1 is what brnr implements, so it is the only one either accepts. A version is added when it is implemented, by a decision that says how.
  • An editor’s process isn’t the client: the editor’s initialize and the agent’s answer are passed through (P1), and the version they agree on is theirs to judge.

Why. In ACP’s initialization the client asks for the latest version it speaks; an agent that speaks it answers with the same one, and one that doesn’t answers with the latest it does. A client that doesn’t speak the version chosen is to close the connection and tell the user. brnr’s schema types are version 1 (ADR 2.3): to read another version’s messages as version 1 is a guess (P4). Resolves #66.

Considered.

  • Going on with a version brnr doesn’t speak, and reading what it can (P4 read as “as far as brnr can”): what brnr reads and sends would be a guess at what another version means, and ACP says the client stops.
  • Accepting a lower version (0, the pre-release one) as close enough: brnr doesn’t implement it, and the schema crate calls it unsupported.
  • Checking the editor’s negotiated version too, and refusing for it: the editor is the client there, and brnr in the proxy role doesn’t refuse what it can pass through (P4, as in ADR 3.9).

2.3 ACP’s types come from the official schema crate

  • brnr keeps its byte relay and its threads, and interprets its copy of each message with agent-client-protocol-schema’s types (1.10.2, without schemars and without its unstable features; src/schema.rs), where they take what it reads. Each part is read as its type, in place of hand-written lookups.
  • Read with its types: session updates, the capabilities and login methods in initialize’s answer, the session session/new or session/fork opened, permission option kinds, JSON-RPC errors, and the session/list of session list with an agent named. Written with its types: session/set_config_option’s params (ADR 6.2).
  • Left to serde_json::Value, read as far as brnr can, as the types don’t take them or brnr passes them on as they were said: the JSON-RPC envelope and the editor’s requests, extension methods and _meta, the unstable fork capability, a session/prompt answer’s unstable usage (read for the turn’s tokens, ADR 4.4), update kinds the schema lacks, what brnr rewrites, and what events and the status carry as it was said (a prompt’s content, a permission request’s tool call and options, locations, plan entries, config options, commands, modes, stop reasons).
  • The crate’s stable types are what P1 and strict mode (ADR 2.1) mean by stable ACP; strict mode’s stable methods are the crate’s. Its unstable features stay off.
  • The crate parses with serde_json too, so reading lone surrogates, and nesting past serde_json’s 127 levels up to brnr’s limit, stays brnr’s own work (ADR 2.5).
  • A message the types don’t know (an extension method, a newer field) is still forwarded untouched, and interpreted as far as brnr can (P4).

Why. brnr forwards the original bytes and interprets a copy of each message (P1). With hand-written lookups (msg["params"]["sessionId"]), nothing tells brnr what is stable ACP and what isn’t. The official Rust libraries, as of October 2026: agent-client-protocol (3.1.0, built on Symposium’s sacp), with Client, Agent, Proxy and Conductor roles, async, whose proxies follow the proxy-chains RFD, still a prototype (a conductor starts a proxy with proxy/initialize and talks to it through proxy/successor envelopes); and agent-client-protocol-schema (1.10.2), the protocol’s types with serde, ACP v2’s draft behind unstable_protocol_v2, and no runtime.

Considered.

  • The full SDK’s Proxy and Conductor: a rewrite onto async; every message decoded and encoded again, so byte fidelity would depend on routing everything through its raw paths; and brnr isn’t a proxy in the RFD’s sense, since the editor runs no conductor.
  • A spike of an SDK-based proxy first, to measure that.
  • Keeping hand-written access to serde_json::Value: nothing tells brnr what is stable ACP and what isn’t.
  • Later, perhaps: brnr as a component in someone else’s conductor chain, an experimental feature once the proxy-chains RFD is stable.

2.4 Every request to the agent has an id of the host’s

  • Every request to the agent has an id the host gives it, brnr-<n>, from one counter: the editor’s too. Ids on the agent’s side are the host’s alone, so no two requests waiting for an answer have the same one, whatever ids the editor writes.
  • The host keeps, for each request waiting for its answer, who sent it: the editor, the host itself (a start’s or a bridge’s request), or a message it sent as a prompt. The answer goes to that one only. The editor’s goes back to it with the id as the editor wrote it, byte for byte: 7 and "7" are two requests, and 1e3 comes back as 1e3.
  • In a line, only the id changes: the host finds the request’s top-level id members in the line (an escaped name, and one given twice, too) and writes its own id there, and the editor’s back into the answer. The rest goes on byte for byte, as ADR 3.1 has it.
  • The editor’s $/cancel_request names one of its own requests by its id: it goes to the agent with that request’s id there. One naming an id the host gave a request, which the editor was never told, doesn’t go, and the host log says so (editor_cancel_dropped): it can’t be the editor’s to cancel. One naming neither goes as it came, for a request in a line the host couldn’t read (ADR 2.5).
  • What brnr records of a request and its answer is as the agent had them, with the host’s id; the prompt of user_message and turn_ended is that id too.
  • The agent’s own requests to the editor keep the agent’s ids: only the agent sends those, and the editor answers them.

Why. The host sends the agent requests of its own (a headless start’s, a bridge’s, a message sent as a prompt or a steer), and the editor may choose any id, the host’s included. The agent’s answer carries only the id, so to know whose answer it is, the id must say so. With one shared namespace, an editor’s prompt could end with the answer to a host request, or the other way round, and a $/cancel_request could cancel the other’s request (GHSA-84pw-hh9c-w2m8).

Consequences.

  • A request in a line the host doesn’t read (one that isn’t JSON, nested past 128 or past 32 MiB, ADR 2.5 and 10.3, or what the editor wrote after its last newline) reaches the agent with the editor’s id, untracked. Should that id be one the host has given a request still waiting, the answer is taken for that request’s: the editor can only bring that about with an id it wasn’t told, and with a line nobody can read.
  • An answer the host can’t read reaches the editor as the agent wrote it, with the host’s id, so the editor can’t place it (ADR 2.5).
  • Only the agent’s ids are on the editor’s side, so an agent that reuses an id after the host answered a request with it (a cancel, an allow) can have the editor’s late answer to the first taken for the second’s. No agent brnr knows reuses ids; the editor’s side isn’t rewritten for it.

Considered.

  • A prefix of the host’s (brnr-), with the editor asked not to use it, or its ids that have it refused or rewritten: the editor may use any id, and any prefix is one it may choose.
  • Rewriting only the editor’s ids that look like the host’s: whether two ids collide then turns on how each side reads them (1 and 1.0, an escaped string), which a separate namespace doesn’t.
  • Re-encoding the whole line with the new id: simpler, but every other byte of the editor’s requests and the agent’s answers would change too (number forms, escapes, key order and spacing), which ADR 3.1 promises they don’t.
  • Random host ids: no better than a prefix for the lines the host reads, and unneeded for them.

2.5 Lines brnr can’t parse, and how deep a line may nest

  • The host reads every RFC 8259 text nested up to 128 levels (an array or object is one level, as [[1]] is two). In the copy it interprets, a lone surrogate becomes U+FFFD. The line itself is forwarded byte for byte, as always. This stays brnr’s own work with the official schema types (ADR 2.3): they parse with serde_json, which reads 127 levels, and no lone surrogate.

  • A line nested deeper than 128 isn’t read, as a line past 32 MiB isn’t (ADR 10.3):

    • with an editor it goes on as it came, to the agent or the editor (P1). The host treats it as a line it can’t parse (below): nothing of it is tracked;
    • headless, from the agent, it is dropped: brnr is the client, and refuses what it can’t read (P4).

    Either way it isn’t recorded as raw ACP (what ADR 9.1 redacts in it can’t be found), and a line_too_deep event (from: agent or editor; max_depth: 128, in levels; relayed: whether it went on) says so: in every session’s events file, to watchers and bridges, and in the foreground (P3). As line_too_long, it belongs to no session. So is what the editor sends after its last newline as it closes its stdin: a line too, it goes to the agent, and past 128 isn’t recorded.

  • A line the host read is recorded as JSON (msg), as it came: at 128 levels too, past serde_json’s 127, and with a lone surrogate. Only what isn’t JSON is a string in raw (ADR 5.1).

  • What the host keeps of a line nests no deeper than 128, and what it writes (events, answers, records) wraps that in a few levels of its own. The CLI reads what brnr wrote up to 256 levels, twice the limit: the host’s answers and events (permission requests and show, elicitation requests and show, status for discover, prompt send --wait, event wait, event watch, event notify, from the socket or --stdin), and transcripts (event log, the catch-up of ADR 10.2, and what a transcript is for session list, session resume and doctor, ADR 5.1). A line deeper than that is none this brnr wrote: a command that reads it as an answer or an event says so (“its answer nests 300 deep, past the 256 brnr reads”) and exits non-zero (P3); a record that deep is passed over as one brnr can’t read, as a broken one is, and event log and doctor --report say so.

  • session list with an agent named (ADR 3.2) is the agent’s client too: a line from it nested past 128 fails the command, which says so.

  • Both limits are fixed numbers, the same everywhere, and every thread’s stack takes a value that deep, to read it and to copy, show or let go of it. No thread is made, or sized, for a line.

  • A line past 32 MiB isn’t read either: with an editor it goes on as it comes; headless it is dropped, and a line_too_long event says so (ADR 10.3).

  • An editor’s request the host reads goes with an id of the host’s (ADR 2.4), so an answer to it the host can’t read reaches the editor with that id.

  • For a line that isn’t JSON at all, or nests too deep, nothing is tracked. The host keeps the ids of agent requests it answered itself (permission requests cancelled, or answered from outside, ADR 7.1), and drops only the editor’s late answers to those, telling the editor in the session that its late answer was dropped, and who answered first (ADR 7.1). An answer from the editor with any other unknown id goes to the agent, which ignores an answer to something it never asked.

  • Lines aren’t scanned for ids (P4), and nothing is withheld from the editor (P1). An editor ignores a response to a request it never sent. A host request whose answer can’t be read goes unanswered: a start fails at its timeout (ADR 3.4), and for a bridge’s request brnr stops waiting after 120 s (ADR 4.6; the host itself never gives up).

  • An editor prompt the host doesn’t read isn’t counted as a turn; nothing hangs on it.

Why. A line the host can’t read goes untracked: an agent’s request in it gets an editor’s answer the host doesn’t know, and a turn can hang. So the host reads what RFC 8259 allows and serde_json doesn’t. A lone surrogate ("\ud83d", what JSON.stringify makes of a title cut in the middle of an emoji) is allowed by RFC 8259’s grammar, which only calls its meaning unpredictable: the case that happens. Nesting has no limit in RFC 8259 either, but reading a value takes stack in proportion to its depth, and so do copying, showing and letting go of it. Until #268, brnr read any depth on a thread whose stack was sized to the line (depth × 4 KiB): a 32 MiB line of [ asked for 128 GiB of stack, and while the host held a deep value each event and each timer ran on a thread of its own. That put faithfulness (F1) over reliability (N2), which ADR 1 ranks first: what the agent or the editor sends chose the host’s threads and their stacks (P6). A fixed limit keeps them bounded, and is documented, so brnr doesn’t guess (P4): in the proxy role a line past it passes through untouched, as one brnr can’t parse does (P1); in the client role it is refused; either way it is said (P3).

Why 128: it is what serde_json reads by default, so ACP’s Rust SDK and the editors and agents built on serde_json already refuse a line deeper. A line past it is one such a client couldn’t read without brnr. ACP’s own messages nest a few levels, and what an agent puts inside them (a tool call’s input, an elicitation’s schema) nests about as deep as what made it.

Why the CLI has a limit of its own: brnr’s lines wrap what the host read (an acp event in one level, pending’s request in three, status’s last_turn.error in four). With one limit for both, the CLI would refuse what the host wrote about a line at the limit, or the host would read less than 128. Twice the limit leaves room for that many times over, and any stack still takes it. The CLI still needs a limit: a transcript an older brnr wrote, or a process that isn’t this brnr, can nest deeper.

Consequences.

  • An agent that nests a line past 128 works with an editor, which gets every byte, but brnr tracks nothing of the line: a permission request that deep isn’t listed, can’t be answered from outside and doesn’t time out, and a prompt’s answer that deep doesn’t end the turn for watchers. Headless, its request reaches no one, and the turn waits until it is cancelled (prompt cancel). Agents and editors built on serde_json fail on such a line anyway.
  • What --json prints indented (event wait --json, permission show --json) is small: indenting grows as the square of the depth, about 35 KB of spaces at 128 levels, where a line a million deep was about 2 TB (#259).
  • No thread of brnr’s is sized to what it reads, and the stack a value takes is known: about 1 KiB a level to read an object, so 256 KiB at 256 levels, an eighth of a spawned thread’s 2 MiB.

Considered.

  • Any depth, on a stack sized to the line (brnr until #268): faithful to what RFC 8259 allows (F1), but the agent or the editor chooses how much stack the host takes, and how many threads (N2, P6).
  • A deeper limit (1000, or 10,000): a value that deep needs a stack sized for it again, or a parser that doesn’t recurse, and serde’s derive, clone, show and drop all recurse; nothing ACP sends needs it.
  • serde_json’s limit as it is (127): the number would be serde_json’s to change, not documented by brnr, and brnr’s own lines, which wrap the agent’s, nest deeper.
  • One limit for the host and the CLI: see Why.
  • Reading without recursion, with a parser of brnr’s own: no stack to size, but every use of the value recurses as well, and it is one more thing to keep (N4).
  • Cutting a deep line, or putting a marker in place of what is too deep: it changes the editor’s bytes (P1), and headless it is a guess at what the rest meant (P4).
  • Pulling the id and method out of a broken or deep line leniently: a guess that would have to be right about every way JSON can break.
  • Also keeping agent lines that contain "id":"brnr- from the editor: a heuristic, which withholds the editor’s bytes.
  • Leaving serde_json’s limits and only forwarding unknown ids: the lone surrogate, the case that happens, would still go untracked.

2.6 The editor’s stdin and stdout end when the agent’s do, and its stderr comes as written

These pipe and signal claims describe the local proxy. With remote execution (ADR 12.1), the proxy remains local to its host and agent, but the editor observes it through SSH. ACP bytes are relayed as standard streams; SSH does not promise identical individual-pipe closure, signal delivery or signal exit status at the editor.

  • The editor’s stdout ends when the agent’s does, after the last of what the agent wrote, whether the agent runs on or not. The host sends the proxy EOF on the link after the last DATA frame (frame.rs), and the proxy ends its stdout. Its fd 1 is left open on /dev/null, so no file opened later can take its place. The same happens when the editor stopped reading and the host closed the agent’s stdout for it (ADR 3.1). The host log records agent_stdout_ended.
  • The editor’s stdout is the agent’s (ADR 3.1). Once it has ended, brnr writes nothing more there of its own. A line it would have written (a message’s tool call, ADR 7.2; a refusal of a load, ADR 3.9; the $/cancel_request that withdraws a request answered from outside, ADR 7.1) isn’t sent, and the host log says so with editor_message_dropped, its reason (agent_stdout_ended), session, method and rpc_id (P3). What the line was about still happens: a message sent from outside still reaches the agent’s stdin, which is open. Only the editor’s copy is lost, as the agent’s answer to it would be.
  • The editor’s stdin ends when the agent’s does, while the editor is attached and hasn’t ended it itself: when a stop closes it (brnr process stop, a signal), when the agent closes it, and when the agent exits. The host sends the proxy STDIN_CLOSED on the link (frame.rs), and the proxy ends its stdin, fd 0 left open on /dev/null as fd 1 is, so the editor’s next write fails (EPIPE), as on the agent’s pipe. The host log records agent_stdin_closed.
  • What the editor wrote that reached the host after the agent’s stdin closed, before the proxy closed its own, goes nowhere: it isn’t sent, nor recorded in the raw ACP, nor a request waiting for an answer, nor answered by brnr. Nor is the start of a line the editor hadn’t finished. The host log records editor_bytes_dropped, with how many bytes (P3). What the proxy hadn’t read goes with its stdin, as what the agent hadn’t read would go with its pipe.
  • The agent’s stderr goes on as it is read, newline or not. Each read (up to 64 KiB) goes to the editor’s stderr through the proxy, and in the foreground to its stderr (ADR 3.6), unchanged: every byte once and in order, before the exit status.
  • What keeps stderr as lines does so alongside, without holding anything back. The host log has a record for each line, or for each 64 KiB of a longer one (ADR 10.3). The line still coming at the end (when the agent’s stderr ends, or the host exits) gets one too. A failed start’s tail (ADR 3.6) ends with the line the agent is in the middle of: a prompt’s text, without its answer.
  • The editor’s stderr ends when brnr acp exits, not when the agent closes its stderr. It is also where brnr acp reports its own failures (losing its process, a panic’s link: ADR 3.7 and 11.5), which ending it early would lose (P3).

Why. Run directly, an agent’s stdout and stderr are two pipes of the editor’s. Each ends when the agent closes it, and each delivers what is written as soon as it is written (P1). An editor that reads stdout to EOF must see an agent that closes its stdout and runs on as gone, and a prompt that waits for an answer (login required: ) ends no line. Once the agent’s stdout has ended, lines of brnr’s own there would be answers and updates that no agent stands behind. The agent’s stdin is the editor’s pipe too: once the agent has closed it, or gone, the editor’s next write fails. Taken and thrown away, the editor’s lines would be written without an error, waiting for answers that never come, and recorded as sent to an agent that never got them (P1, P3, P5).

Consequences.

  • An editor that reads stdout to EOF to see the agent go sees EOF when the agent closes stdout. It gets the exit status when the agent exits, as it would directly.
  • The proxy gets a STDERR frame for each read rather than each line: 5 bytes of header each.
  • What the editor still sees differently. Run directly, each stream has the kernel’s buffer (up to 64 KiB on Linux and macOS), and only its own reader holds it back. Through brnr both go on one link, in the order the host read them, under one cap (16 MiB, ADR 10.1):
    • An editor that stops reading one stream eventually stops the other. The proxy writes frames in order, so stderr waits behind a stdout write that blocks, and the other way round. Past the cap the host stops reading both of the agent’s pipes, and the agent blocks writing to either. Run directly, an agent blocked on stdout could still write to stderr. Editors read both streams, and an ACP agent waits on its stdout’s reader anyway.
    • Until the cap is reached, the agent’s writes complete without the editor having read them: up to 16 MiB, rather than a pipe’s 64 KiB. Nothing is lost or reordered within a stream.
    • An editor that closes its end of stderr gives the agent no EPIPE. The proxy’s writes there fail and are dropped, and the agent’s stderr still goes to the host log. (Closing stdout does give EPIPE, ADR 3.1.)
    • The editor’s write fails later than on a pipe. The host hears that the agent closed its stdin only when a write to it fails, so the line that finds it closed is recorded, and its request waits, as if it had been sent; a write after it fails. STDIN_CLOSED goes to the proxy behind what the host sent before it, so an editor that isn’t reading its stdout gets it as late as that. Until the proxy has closed its stdin, writes go through, and the host log counts what of them it dropped. A stdin macOS can’t poll (some devices) closes once the read waiting on it returns: one write later.

Considered.

  • Keeping the editor’s stdout open for brnr’s own lines after the agent’s has ended: the editor wouldn’t see the agent’s stdout end, and the lines would be answers and updates that no agent stands behind.
  • Closing fd 1 outright in the proxy: the next file it opened would get fd 1, and a stray write to stdout would go there. Fd 0 likewise.
  • Closing the proxy’s stdin from the thread that reads the link: the thread relaying stdin, blocked reading it, holds the pipe open until its read returns (Linux), so the editor’s next write would still go through. That thread waits in poll(2) instead, on stdin and on a pipe that the link’s thread closes for STDIN_CLOSED, and closes stdin itself.
  • Going on reading the editor’s stdin, and answering its requests with an error once the agent’s stdin has closed: run directly, the agent answers nothing, and the editor’s write fails (P1).
  • Ending the editor’s stderr with the agent’s: brnr acp’s own failures would go nowhere (P3).
  • A link of its own for stderr (a third socketpair, with its own cap and a thread on each side): independent backpressure, as with two pipes, at a cost every editor’s process pays, for a difference no editor is known to depend on. Still open, if one turns out to.
  • Sending stderr a line at a time, with a timeout for a line that doesn’t end: still late, by a delay brnr chooses, and a timeout of brnr’s own, which ADR 10.1 rules out.

2.7 The editor’s file system and terminal reach the agent in strict mode, or when its profile names them

  • By default, brnr acp removes fs and terminal from the editor’s initialize, as ACP v2 does (F2). The host log notes capabilities_dropped, with what it dropped. The agent answers as to a client that has neither.
  • A profile passes them by name, in its editor part (ADR 6.1): client_capabilities = ["fs", "terminal"], or one of them. Each passes as the editor sent it. An unknown name fails to load (P7).
  • In strict mode both pass, whatever the profile says, as stable ACP v1 has them (F1, ADR 2.1).
  • When the agent was offered them and sends fs/* or terminal/*, the requests go to the editor as the agent wrote them, and the editor’s answers, results or errors, go back to the agent. It is the same path every request of the agent’s takes to the editor (ADR 3.1); only the editor’s own requests get the host’s ids (ADR 2.4).
  • When ACP v2 is stable, brnr follows it, and this section is rewritten from what editors and agents speaking v2 do.
  • A headless process offers the agent neither: its initialize has empty clientCapabilities, as no editor is there to serve them. That covers a session started headless, one forked in a headless process, and one taken over from an editor (session resume --take-over), which goes on in a new headless process with an agent of its own. A request for them there is answered “method not found”. No headless session runs in an editor’s process, where the agent may have been offered them: session fork, session new --pid and session resume --pid are refused there (ADR 7.1).
  • What transparent means for the editor’s process:
    • Observing (event watch, event log, session status, event notify, bridges) never changes the stream.
    • The named changes to the stream are: requests reach the agent with the host’s ids (ADR 2.4); the editor’s fs and terminal capabilities are dropped unless named or in strict mode (above); an editor’s load of a session another process holds is refused unless a feature flag allows it (ADR 3.9, ADR 3.10); and the experimental actions a profile enables (ADR 7.1).
    • Headless operation is brnr as an ordinary ACP client (P1, P12).
  • The real-editor checks for fs and terminal (the default, a profile that names them, strict mode, and a take-over) are in ADR 7.1. None has been run yet.

Why. ACP v1 has two client capabilities that v2 drops: fs (readTextFile, writeTextFile) and terminal. With them, an agent reads the editor’s state of a file, unsaved changes included, has its writes applied by the editor, and runs commands in the editor’s terminals (https://agentclientprotocol.com/protocol/v1/file-system). Without them, it reads and writes the files on disk and runs commands in processes of its own. F2 is the conventions brnr follows ahead of the spec, by default; F1 is stable ACP to the letter, in strict mode; they meet by mode, not by rank (ADR 1, #272). Agents that rely on fs and terminal rely on what v2 takes away, and brnr discourages that, while strict mode stays faithful to v1, the version brnr speaks (ADR 2.2). Resolves the decision part of #69.

Consequences.

  • By default, an agent run through brnr acp doesn’t see the editor’s unsaved buffers, its writes aren’t applied by the editor, and it runs commands in processes of its own, where run directly it might do all three through the editor. That is the cost of following v2 ahead of it; a profile’s client_capabilities, or strict mode, gives them back. The documentation says so.
  • With them passed, the editor serves those requests (docs/threat-model.md, B3). What it answers them with (files as its buffers have them, unsaved changes and a .env included, and the commands’ output) is in the session’s raw ACP as it passed, not redacted. That is accepted: the threat model lists it as a gap brnr takes, not one to close.
  • A session taken over from an editor, or resumed headless after it, goes on without them: the agent reads the files on disk, and what was unsaved in the editor isn’t there.
  • When the editor goes, its agent goes with it (ADR 3.1), so an agent never waits on an fs or terminal request no editor will answer. A request that comes while the process is ending gets “method not found” from the host.
  • An initialize longer than 32 MiB goes to the agent as it is, with them (ADR 10.3). Editors don’t send one that long.

Considered.

  • Passing them in every mode: faithful to v1 (F1), but agents then build on what v2 drops, and following the conventions ahead of the spec is what the default is for (F2). Strict mode keeps the v1 behaviour for whoever wants it.
  • Dropping them in strict mode too: strict mode is stable ACP to the letter, and v1 has them.
  • Dropping them by default with no setting: strict mode would be the only way to get them, and it also turns off steering and fork (ADR 2.1).
  • Dropping terminal only, keeping fs: both are stable v1 client capabilities that v2 drops, and the argument is the same for each; the profile names them one by one.
  • Redacting file and terminal data in transcripts: redaction is by field (ADR 9.1), and a file’s or a command’s contents have no field a secret is known to be in, so it would be a guess at what is secret (P4), or the data dropped from the record of what passed (ADR 5.1). The transcripts are only the user’s to read (P13).
  • Serving fs and terminal from the host for headless sessions: brnr would read, write and run commands for the agent, a boundary of its own (docs/threat-model.md), where the agent does all three itself when not offered them.

Tests

Run cargo test --release adr_0002_. Named claims, by section:

  • 2.1: tests/headless.rs: adr_0002_strict_mode_refuses_steering_and_fork, adr_0002_strict_mode_has_no_experimental_actions.
  • 2.2: tests/cli.rs: adr_0002_a_start_in_an_acp_version_brnr_doesnt_speak_fails: a start whose agent answers with version 999, 0, "1", 1.5, 70000 or none, strict or not, exits 1 with the cause, sends nothing after initialize, and leaves no process or agent running; session list stops at initialize too; version 1 starts.
  • 2.3: tests/cli.rs: adr_0002_an_update_the_schema_doesnt_know_changes_nothing; tests/headless.rs: adr_0002_muse_metadata_and_extensions_pass_through; src/schema.rs: adr_0002_what_the_adapters_send_is_read_as_the_schemas_types, adr_0002_a_part_of_a_line_at_the_limit_reads_as_its_type, adr_0002_what_the_types_dont_take_is_left_to_value, adr_0002_stable_is_what_the_schema_has_without_its_unstable_features.
  • 2.4: tests/headless.rs: adr_0002_an_editors_prompt_ends_only_with_its_own_answer, adr_0002_an_editors_request_with_a_host_requests_id_is_the_editors, adr_0002_ids_come_back_as_the_editor_wrote_them, adr_0002_the_editors_cancel_request_is_for_its_own_request; src/json.rs: adr_0002_an_id_is_found_where_it_is_and_nowhere_else; src/host/outbound.rs: adr_0002_ids_are_never_given_twice, adr_0002_an_answer_is_its_requests_once, adr_0002_a_second_answer_reaches_nobody, adr_0002_an_answer_for_a_closed_session_goes_to_whoever_asked. Also tests/security.rs: adr_0003_acp_passes_bytes_unchanged (ADR 3.1’s), which checks that only the ids change.
  • 2.5: src/json.rs: adr_0002_a_line_is_read_to_its_limit_and_no_deeper, adr_0002_any_stack_takes_a_value_at_the_limit; src/host/fuzz.rs: adr_0002_the_host_holds_nothing_of_a_line_past_the_limit; src/log.rs: adr_0002_a_message_at_the_limit_is_recorded_as_json; src/ctl/client.rs: adr_0002_an_answer_is_read_to_the_limit_and_no_deeper, adr_0002_a_status_with_an_error_at_the_limit_is_an_answer; tests/headless.rs: adr_0002_a_lone_surrogate_is_read, adr_0002_a_line_at_the_limit_is_read, adr_0002_a_line_past_the_limit_passes_through_unread, adr_0002_an_editors_rest_past_the_limit_passes_through_unread, adr_0002_headless_a_line_past_the_limit_is_dropped_and_said, adr_0002_an_answer_the_host_cant_place_reaches_the_agent, adr_0002_a_late_answer_to_a_cancelled_request_is_dropped, adr_0002_a_deep_request_is_listed, adr_0002_a_deep_request_is_shown, adr_0002_a_deep_request_is_followed, adr_0002_a_deep_request_is_notified, adr_0002_a_deep_event_is_caught_up, adr_0002_a_deep_request_is_logged; src/host/outbound.rs: adr_0002_an_answer_to_an_unknown_id_goes_on_as_it_came; src/host/approvals.rs: adr_0002_a_late_answer_from_the_editor_is_dropped; src/transcript.rs: adr_0002_a_record_is_read_to_the_limit_and_no_deeper.
  • 2.6: tests/security.rs: adr_0002_the_editors_stdout_ends_with_the_agents, adr_0002_stderr_comes_as_it_is_written, adr_0002_stdout_and_stderr_end_on_their_own; tests/headless.rs: adr_0002_a_timed_out_start_shows_the_line_stderr_is_in, adr_0002_the_editors_write_fails_once_the_agents_stdin_closes; src/host/fuzz.rs: adr_0002_brnrs_own_lines_end_with_the_agents_stdout, adr_0002_stderr_goes_on_before_its_line_ends, adr_0002_the_editors_stdin_ends_with_the_agents. Not covered by a Rust test: the editor’s stdin closing when the agent exits on its own, which takes a stop’s path (close_agent_stdin).
  • 2.7: tests/headless.rs: adr_0002_fs_and_terminal_reach_the_agent_in_strict_mode_or_when_named, adr_0002_the_agents_file_and_terminal_requests_reach_the_editor, adr_0002_headless_sessions_offer_neither. The real-editor checks (ADR 7.1) have no automated test.

3. Processes, sessions and ownership

Draft 2026-10-20. Implemented, but the cause of the deaths 3.7 records is still to be found. Factor: F3; N2 for how a process starts and dies (ADR 1). Brings together former ADRs 2, 13, 8, 7, 9, 10, 11, 12, 3, 50, 65, 42, 14 and 16 (docs/adr/README.md maps them).

How brnr runs agents: the process that owns each agent, how it is started, how it ends, and which process may serve a session. This is what ACP leaves out (F3); a start that commits once, and no process left without an owner, are what N2 asks of it.

3.1 The editor’s process: brnr acp relays, the host owns the agent

With --remote (ADR 12), the local process becomes SSH; the ordinary proxy and host below run on the destination. They retain editor ownership. SSH disconnect/EOF detection, signals and pipe closure have the transport limitations in ADR 12.1; remote execution does not add attachment or reconnect semantics.

  • brnr acp [--profile <p>] [--strict] [-- <agent> [args...]] is what an editor runs as its ACP agent (brnr acp -- brnr-claude-adapter). Inside brnr it is the proxy (proxy.rs, proxy_pid in metadata and transcripts).
  • It starts a brnr process, the host, detached (a new session, double fork, reparented to init or launchd), with one end of each of two socketpairs, and from then on only relays:
    • On the link: stdin and stdout as frames, the agent’s stderr to its stderr, stdin EOF after what came before it, and the agent’s stdin closing, for the proxy to close its own (ADR 2.6).
    • On the signal link, which the host never stops reading, so that nothing on it waits behind the editor’s input (ADR 10.1): the signals the proxy catches (HUP, INT, QUIT, TERM, USR1, USR2, but those the editor ignores, which the agent inherits ignored), and its stdout failing.
    • At the end it exits with the agent’s exact wait status, re-raising the signal that killed it.
  • The host starts the agent in a process group of its own, with the editor’s signal mask. The editor’s requests reach the agent with ids of the host’s (ADR 2.4); the editor’s stdout ends when the agent’s does (ADR 2.6).
  • The editor’s agent goes with the editor, as if the editor had run it. When the proxy’s stdin ends, the agent’s stdin is closed. When writing to the proxy’s stdout fails, the agent’s stdout is closed (its next write fails, EPIPE). When the proxy goes, the agent’s stdin is closed and its process group SIGKILLed (link_gone). A turn still running when the editor closes is lost; the agent keeps its sessions, and brnr session resume <session> carries one on headless. A process’s owner is set when it starts (P11, P14).
  • By default the editor’s initialize loses the fs and terminal client capabilities, one of the few deliberate changes to the stream (P1). A profile passes those it names, and in strict mode they pass through (ADR 2.1, ADR 2.7).

Consequences. What the editor sees differently, stated in the documentation:

  • A SIGKILL sent to the proxy can’t be passed on as such. The host sees its links go without the editor’s stdin ending first, closes the agent’s stdin and SIGKILLs its process group itself (link_gone): the same end, a moment later.
  • A host that dies without a word (SIGKILL) closes the link: the proxy says brnr acp: lost the connection to its process on stderr and exits 1, and the editor sees its agent go. A flooding agent exits on its broken pipe; one that isn’t reading outlives the host (ADR 3.7, #391).
  • The editor’s child is the proxy, not the agent, so its pid and process tree differ. That separation is what lets the side channel exist.
  • Side-channel actions, where a profile enables them: ADR 7.1.

Why. Other commands must reach the editor’s sessions, so the agent runs in a process the editor doesn’t own, while the editor notices nothing different (P1). fs and terminal are dropped because ACP v2 drops them (its ClientCapabilities has neither), and without them no agent comes to rely on them.

Considered.

  • --on-disconnect direct|headless, and a profile’s on_disconnect: the agent carrying on headless when the editor goes, the host taking over the editor’s pending agent requests. One owner per session (P11), and a directly run agent goes with its editor (P1).
  • Passing fs and terminal through always: by P1’s test the agent is affected, as it can’t use the editor’s buffers or terminal. Kept for strict mode and for a profile that names them (ADR 2.7).

3.2 Sessions are the agent’s ids, processes are pids

  • <session> is a session’s exact id, as the agent gave it, running or not, for everything about a session. --pid <pid>, or a <pid> argument, is a brnr process as brnr process list shows it, for what is about the process. No prefixes, no --session, no picking (P4). event watch and event notify take one or the other and have no default; event notify --stdin, as a bridge, takes the events its process gives it instead (ADR 5.8).
  • Sessions have no names. session new --json prints the session for a script to keep (s=$(brnr session new --json … | jq -r .session)); shorter handles are the shell’s. The agent’s own title for a session (session_info_update) is shown in session list and session status to tell sessions apart, and is never something to type.
  • brnr process list lists brnr’s processes: pid, state (starting, running, stopping, or unreachable for one that doesn’t answer, whose sessions are those it holds the locks of, ADR 3.9), owner (editor or headless, unknown for one that doesn’t answer), agent, uptime and sessions (ADR 8.2).
  • brnr process stop <pid> stops a process and its agent: the agent’s stdin is closed, then SIGTERM goes to its process group after 5 s, then SIGKILL after 5 s more. Ending one session is brnr session close (ADR 3.12). session commands are about sessions, process commands about processes.
  • “Host” isn’t in the CLI or its help. It is the name of the process inside brnr.

Why. An argument means one thing (P4). Settings and messages belong to a session, and picking one for the user hid that.

Considered.

  • A <target> that is a pid, a process name, a session id or a unique prefix of one, with --session or brnr picking a session inside: too many meanings.
  • Session names (--name, one running session per name, a name meaning the latest session that had it): brnr’s own layer over ACP’s sessions, and a policy to learn rather than a description of the agent’s sessions (P2).

3.3 A process is started with one resolved request

  • Whoever starts a process (session new, session resume, brnr acp) resolves everything first: profile, agent, cwd, role (editor or headless), strict mode (ADR 2.1), experimental actions and feature flags (ADR 7.1, ADR 3.10), mode, model, config options, MCP servers, auth method, prompt and attachments, timeouts, stop_when_idle, what to log (ADR 5.1), bridges, the signal mask, and the agent’s and the bridges’ commands as they are run (a bare name installed next to brnr is that path, ADR 11.2).
  • It writes one JSON request on the process’s stdin. File descriptors carry only the editor link and its signal link (fds 3 and 4, ADR 3.1) or the start channel (fd 3, ADR 3.4).
  • The process reads no config and takes no flags. brnr host is internal, not run by hand; session new --foreground runs a session in a terminal (ADR 3.5).
  • The host log’s process_started record holds the request (start_request), secrets redacted (ADR 9.1): every process records what it was asked to do.
  • A config error under brnr acp is reported on the editor’s stderr as brnr acp: …, as the process’s own failures are, and exits 1 (ADR 8.3).

Consequences. There is one way to get a prompt to a process. The agent’s command isn’t in the process’s argv, so killing processes by the adapter’s name (pkill -f brnr-claude-adapter) doesn’t take the host with it (ADR 3.7).

Why. Config is resolved in one place, and the process gets everything at launch (P10).

Considered.

  • One request that names the profile, the process loading it: config would be resolved in two places.
  • brnr host run by hand, with flags of its own: a second interface, whose flags lagged the start’s.

3.4 A start is atomic and commits at ready

  • session new and session resume read all of their input before they launch the process: --prompt (from their own stdin with -), --file, --image; and they resolve the rest of the start (ADR 3.3).
  • The process is launched with a pipe as its stdin and the start channel, a socketpair, as fd 3. The command writes one start request on the pipe and closes it. The process reads its stdin to EOF before it does anything else; cut short (the command died mid-write), it refuses to start.
  • The host reads the start channel on a thread, as every other source. EOF on it before the commit means the command has gone: the process stops at once, whatever it was doing (start_abandoned).
  • The commit is the ready report, {pid, session, message}, written on the start channel once the session is open and its mode and config options are set, and before the agent gets the prompt (message is the prompt’s m<n>, ADR 4.1). Until then anything failing (a setup step, the timeout, the command going away) stops the process, and the prompt is never sent; nor is the next step when the agent answers one after that. After it the process sends the prompt, and the session runs on its own whatever the command does (P14).
  • The commit is the report’s write succeeding. Nothing else is written on the channel before it, so the event loop writes the report itself, in one write that doesn’t wait. A write that fails (the command has gone, its EOF perhaps not read yet) abandons the start as EOF does. A write that succeeds is all the process can know: the command may still go before it reads the report, and the session then runs on, in session list and its logs.
  • Committed, the start channel becomes a peer, subscribed (with --wait) to the turn’s events before the prompt goes, so it misses none.
  • Without --wait, the command prints the session and its process and exits after the report (--json: {session, pid, message}, message null without a prompt). With --wait, it reads the turn’s events on the same channel until the turn_ended that carries its message (ADR 8.3). There is no reconnect and no race.
  • The start timeout (BRNR_START_TIMEOUT, 120 s) goes in the request and is the process’s: it fails the start when the time passes. The command keeps only a fallback timer, the timeout plus 10 s, for a process stuck too badly to report.
  • A session opened in a running process (--pid, ADR 3.12) commits the same way: the commit is the process’s answer on the control socket, queued while the command is still connected. The command going before it, a setting failing, or the start timeout passing closes the session again (for an agent that can’t close sessions, the error names it), and the prompt is never sent. The process stopping meanwhile fails the opening too, and the session ends with the process. The timeout goes in the socket request and is the process’s; the command’s fallback is 10 s later.
 session new                        brnr process                     agent
  read prompt, files, images
  launch: stdin = request,
  fd 3 = start channel ────────────▶ read request to EOF
                                     bind socket, spawn agent ─────────▶
                                     initialize, session/new,
                                     set_mode, set_config_option ───────▶
  read ready ◀────────────────────── ready {pid, session, message} ← commit
  (no --wait: exit)                  session/prompt ────────────────────▶
  --wait: read events ◀───────────── … turn_ended

Consequences. The documentation’s promise holds for the whole start: if the command gives up, or is interrupted, before the commit, the process stops too and the prompt is never sent. No idle clock waits for a prompt (ADR 3.8).

Why. A start made of two conversations, a ready pipe and then the control socket for the prompt, had a gap: a command killed there left a session with no prompt, which ran forever. One conversation that commits at ready closes it (P10, P14).

Considered.

  • The prompt on the control socket, with the start deadline running until it arrives: a session nobody used for up to 120 s. Keeping the ready channel open until the prompt arrives: still two conversations.
  • Idle time counting from the session opening: it helps only with --stop-when-idle, and closes at once a session whose prompt is slow.
  • The prompt on the process’s command line: Linux caps one argument at 128 KiB and macOS all of them at 1 MiB, and any user can read arguments with ps (P13).
  • Committing at launch: a killed command would leave a running session whose id nobody was told, and Ctrl-C couldn’t cancel a start.

3.5 A headless session in the foreground

  • session new --foreground [--quiet] [--json], and session resume’s, runs the same process a start does, as its child, in a process group of its own, and passes it the signals it gets: Ctrl-C once stops the session, twice kills the agent.
  • It shows the session’s events on stdout as they come (--json: as JSON lines; --quiet: not at all).
  • It exits as the agent did (128 + the signal that killed it), but never 0 if the start failed: 1 where the agent then exited 0 (setting --mode failed, say), 127 or 126 where the agent couldn’t be run, as a shell has it.
  • --wait and --foreground don’t go together: the foreground shows the whole session.
  • stdout closed (brnr session new --foreground … | head -1): the display stops, with a note in the host log, and the session carries on. A supervisor that means “stop” stops the process.
  • A slow reader: the display runs on a thread of its own, with a bounded buffer, then skips events, saying how many (ADR 10.1). It never blocks the host.
  • stderr carries brnr’s own messages and the agent’s stderr (ADR 3.6).

Why. A foreground session is for a supervisor (systemd, a container) or a terminal, with the same flags as a detached start. The transcript has everything; a failed display shouldn’t cost the session.

Considered.

  • stdout closing stopping the session, as SIGPIPE ends the writer of a pipeline.
  • An unbounded buffer, or printing on the event loop: a broken pipe there panicked the host and left no process_exited record, and stale .sock and .json files.

3.6 The agent’s stderr

  • Always: in the host log, a record for each line, or for each 64 KiB of a longer one (ADR 10.3). The line still coming at the end (the agent’s stderr ends, or the host exits) gets one too.
  • With an editor: through the proxy to the editor’s stderr, unchanged (P1).
  • In the foreground: to the foreground’s stderr, unchanged, as running the agent directly would; stdout stays the events.
  • To the editor and the foreground it goes as it is read, newline or not: each read, up to 64 KiB, every byte once and in order (ADR 2.6). What keeps it as lines does so alongside, without holding anything back.
  • A failed headless start, detached or in the foreground, ends its error with the agent’s last stderr lines, from a ring buffer of 20, ending with the line the agent is in the middle of (P3). A long line keeps its first 2000 bytes (ADR 10.3).

Why. “claude CLI not found” has to reach the user who started the session, not only the host log. A supervisor’s log collects the agent’s diagnostics; at a terminal 2>/dev/null hides them. The adapters are chatty (claude-agent-acp writes [session/create] … phase=… lines for every session).

Considered.

  • The foreground showing it only when the start fails: a supervisor’s log would lose the agent’s diagnostics.
  • Behind a flag.

3.7 A process’s own death is recorded

  • On any agent exit, including a crash during setup or a turn, the host SIGKILLs what remains in the agent’s process group before it reaps the agent (P14). Until then its pid and group id can’t be reused. Cleanup doesn’t depend on a stop request having come first.
  • A detached process’s stderr goes to its host log (process_stderr), a line or a piece of 64 KiB at a time (ADR 10.3). With log = "off" there is no host log, and it goes to /dev/null.
  • A panic, on any thread, is recorded. The hook notes it and wakes the event loop, which records the panic in the host log (process_panicked), writes process_exited (with the error) there and in every session’s file, sends it to the peers it can still reach, removes the .sock and .json files (P3), and SIGKILLs the agent’s process group (P14). Bridges get the time to act on process_exited they get on any exit (ADR 5.7).
  • A panic once the agent is spawned and before the event loop runs is recorded, and ends the agent the same way, as far as what the start has made allows (its log, bridges, the display; no sessions yet). Whoever started the process is told on fd 3, as of any start that fails: session new fails with the reason; an editor’s brnr acp says it on stderr and exits 101.
  • A panic prints a link to report it (ADR 11.5): in the foreground from the hook, and from session new or brnr acp when it fails a start.
  • A start that fails as it opens the start channel or its bridges records process_exited too. The logger never skips process_exited (ADR 10.1), so a host log without it is a death nothing recorded. What can’t be recorded: a panic on the logger’s own thread, and an abort (a stack overflow), which runs no hook.
  • brnr doctor lists host logs without process_exited whose process isn’t running (how many, and the latest three), with when each last wrote and the sessions it had open.
  • Whether metadata in the runtime directory is a gone process’s is told by its socket, not its pid, which may be another process’s by then (a reboot, pids wrapping around). It is gone if its pid isn’t a live process of the user’s (one that has exited, a zombie nothing has reaped yet included, as in ADR 10.2), or its socket refuses a connection twice (nobody listens, or it isn’t there). macOS also refuses a stopped process’s socket once its backlog is full, so there a refusal counts only if the process with that pid started after the file was written.
  • doctor --fix removes what gone processes left behind. session list, process list, session status, session resume and every other command that looks processes up drop them, removing their metadata and socket.
  • The agent’s command isn’t in the process’s argv (ADR 3.3).

Consequences.

  • A killed host can’t write process_exited: doctor reports its incomplete log and repairs stale runtime files, and the session’s lock can be taken again (ADR 3.9). A host killed during a start fails the start, and the prompt is never sent (ADR 3.4). A killed proxy, in setup or a turn, leaves the host alive to record its death and stop even a blocked agent. A killed bridge leaves the session and its ownership intact (ADR 5.7). Setup faults never commit the prompt (ADR 3.4). tests/chaos.rs injects these at a seeded point, and says the seed of a run that fails, to replay it.
  • The host is the only supervisor. SIGKILL closes its pipes but can’t make it signal its children: a blocked agent, a bridge that ignores EOF, or their descendants can outlive it. The host-SIGKILL test checks a flooding agent that exits on its broken pipe, not cleanup in every case. That stronger promise needs a separate supervisor, and a decision about its own lifetime (#391; killed_host_leaves_no_agent_or_child_behind in tests/chaos.rs shows it, ignored until then). doctor doesn’t kill processes inferred from stale pids.

Why. In October 2026 an editor’s host, agent and proxy died together three times, with no exited, no editor-disconnected and no signal record (the names of then): SIGKILLed, or a panic, which a detached host’s /dev/null stderr hid. One unconfirmed explanation fits all three: something killing processes by command line (pkill -9 -f brnr-claude-adapter), which matched the host’s argv. Still to find out: reproduce with IntelliJ restarting its agents (the first of ADR 7.1’s editor trials), watching with ps who sends SIGKILL; whether the proxy was killed by a signal or lost its process (exit 1); and whether it happens without another run alongside.

3.8 Stopping when idle

  • stop_when_idle = <seconds> in a profile’s headless part, or --stop-when-idle <s> on session new and session resume (with --foreground too): a session idle that long closes (session/close), and the process stops with its last session. The last one isn’t closed first; the process just stops.
  • A session is idle while no turn is running, nothing is held and no approval is waiting. A message or a prompt starts the count again. It counts from the start too, so a start without a prompt doesn’t run forever; a start with a prompt sends it at the commit (ADR 3.4), so the session is busy at once. 0 is as soon as it is idle.
  • Never while an editor is attached.
  • Closing emits session_closed with by: control and reason: idle (ADR 5.2). The last session, stopping the process, gets process_exited instead, which isn’t also session_closed.
  • With stop_when_idle set and an agent that can’t close sessions, session fork, session new --pid and session resume --pid are refused (P7): a second session could never close when idle, and the process would never stop.
  • A session being opened in the process counts as one of its sessions: the process doesn’t stop as its last other session closes or goes idle meanwhile; that one is closed instead.

Why. A headless session started for one task should end when the task is done, without anyone having to stop it.

Considered.

  • A switch (stop_when_idle = true): seconds replace it, and 0 is what it did.
  • Not counting before the first turn: a start whose prompt never came ran forever.
  • Keeping, silently, a session that ran out while the process has others, when the agent can’t close sessions: lost without a word (P3).

3.9 Ownership is a per-session lock

The lock:

  • Every process holds an exclusive flock on sessions/<file_name>.lock in the state directory for each session it serves. file_name is the id escaped as paths::file_name does (ADR 9.2), so distinct sessions never share a lock. Inside are the holder’s pid, the session’s id and the holder’s runtime directory, absolute. Taking a session is taking its lock; whether a lock is held is the kernel’s answer, not the file’s.
  • A process that dies releases its locks, with nothing to clean up: the file it leaves, held by nobody, is taken as it is. doctor lists such files under session locks, and --fix removes them. A process that closes a session removes the file as it lets go.
  • log = "off" writes no transcripts, but its sessions are locked all the same: the lock is ownership, not logging.
  • sessions/ is held to the runtime directory’s terms (P13): created 0700, refused with the cause when it isn’t the user’s own private directory or is a symlink, or, on macOS, has an access control list (below). Each lock is 0600 and opened O_NOFOLLOW. It isn’t repaired as transcripts are (ADR 9.3).
  • Those terms, for the runtime directory and sessions/ alike: each is opened without following a symlink and checked through what was opened (fstat), and is refused unless it is a directory of the user’s with no group or other bits. On macOS one with an access control list (ls -le), which can let others in whatever the mode says, is refused too, with the chmod -N that removes it: <dir>: has an access control list (ls -le), which can let others reach what is in it whatever its mode (chmod -N <dir> removes it). brnr doesn’t remove it (P4), and doctor --fix doesn’t either. Any ACL is refused, a deny one too, as for the config (ADR 9.4). On Linux an ACL’s grants show in the mode’s group bits, its mask, which are checked. The directory is the boundary: the sockets, metadata and locks in it are reached only through it, and one others can’t search keeps them out whatever each file’s mode or ACL, so those aren’t checked one by one.
  • session list, process list and doctor read the locks to say which process serves a session without asking it.

A session another process holds:

  • session resume <session> refuses it, saying where it is in the words every command uses for it: sess-1 is running in process 4466, with , which is not answering for a holder that doesn’t answer and , which brnr doesn't list for one not listed here, or sess-1 is opening in process 4466 for one that hasn’t opened it yet. A process that doesn’t answer but holds the lock is alive and serving the session; nothing is guessed. The lock is taken before the agent is asked.
  • --take-over is offered only where it can work: for a session open in the process holding its lock, whose refusal adds (--take-over closes it there and resumes it here), or … resumes it in process 4470 with --pid. A holder that doesn’t answer, is opening the session or isn’t listed here can’t be asked to close it, and a session a process serves without its lock isn’t taken over: their refusals don’t offer it, and with --take-over they are refused in the same words.
  • With --pid, a session that process serves or holds already is refused (sess-1 is already open in process 4466), --take-over or not; one closing there is closing (ADR 5.5).
  • --take-over releases the session from its owner first: the owner cancels a running turn and closes that one session (session/close), never stopping a whole process. Sessions forked beside it keep running; a headless process left with none stops (ADR 3.12). With --pid, it is refused before anything is closed if that process would refuse the resume (ADR 8.1).
  • When the owner is an editor, --take-over is the experimental close action, refused unless the editor’s profile enables it, and compensated for (ADR 7.1). session resume first launches the process that is to resume the session, so the owner can tell the editor which one has it.
  • An editor’s session/load, session/resume or session/prompt of a session another process holds, and not open in the editor’s process, is answered by the host, by default, with a JSON-RPC error naming the process and how to release it (brnr session close <session>; for a session another editor has open, closing it there). It doesn’t reach the agent. A prompt opens a session as a load does (ADR 5.6), so it is held to the same lock (#331). A caveat under P1: the editor can’t pass --take-over, so its explicit step is releasing the session first.
  • A load or resume the agent answers with success after the session closed in the editor’s process (the editor’s session/close, or brnr’s close or take-over under it, while the request was unanswered) is checked again as the answer comes: another process can take the lock between the close and the answer (#357). One it took isn’t served there: the session doesn’t open, has no transcript there and no replay kept, and its lock isn’t held; the agent is asked to close it (session/close); the editor gets the agent’s answer, and is told in the session, as of a take-over (“Session held by brnr process 4466”, with how to release it, as above), its later requests for it answered as ADR 7.1 has them. The host log has open_failed, saying too if the agent can’t close sessions, and another if the agent fails the close: the session is left open in the agent (P3).
  • The feature flag shared_sessions in the editor’s profile (ADR 3.10) lets the load, or the prompt, through, and one answered after a close as above opens shared. The agent then serves the session to both processes and splits the conversation. The process holding the lock stays the only writer of the session’s transcript; the editor’s process records the session in its host log only, and says so (P3). Strict mode (ADR 2.1) doesn’t decide this.

A session that can’t be locked (the lock is neither held nor free: sessions/ isn’t a private directory, something other than a file is where the lock goes, the process is out of file descriptors, the file is locked by a process that doesn’t say which, the file system has no working flock):

  • A headless process never serves it. A start whose session (new, resumed, loaded) can’t be locked fails before it commits (ADR 3.4): the command exits 1 with the cause, naming the lock file and the system’s error (“the agent opened sess-1, which can’t be locked: …/sessions/sess-1.lock: Is a directory”), no prompt reaches the agent, and the process and its agent stop. A resume’s lock is taken before the agent is asked, so the agent never hears of it. A fork the agent opens into a session that can’t be locked is refused as one another process holds, and its source goes on. In a running process (--pid), a new session that can’t be locked is closed again, and a resume of one isn’t sent.
  • An editor’s process passes an editor’s session it couldn’t lock through: session/new, session/load and session/resume reach the agent and are answered as without brnr, and the process keeps the session’s transcript.
  • It is said where it can be seen: session status has lock_error, the cause, and its text says “not locked: …; nothing stops another process serving it too”; the host log has lock_failed. session resume of it still refuses, as the process serving it says so when asked.
  • brnr doctor fails a sessions/ that isn’t a private directory (one with an ACL included), and anything but a file where a lock goes, saying that the session can’t be locked or started headless and what to remove. It doesn’t take such a thing for a lock a gone process left; --fix leaves it to the user.

A holder in another runtime directory:

  • A command whose runtime directory isn’t the lock holder’s can’t reach the holder, and says so rather than guess (P4) or say nothing (P3). session resume is refused with sess-1 is running in process 4466 with runtime directory /run/user/1000/brnr (BRNR_DIR=/run/user/1000/brnr reaches it), with --take-over as without: it can’t ask a process it can’t reach to close. session list shows the session unreachable, with that pid, its agent and cwd unknown here, not inactive. Commands on the session (session close, session delete, prompt send, …) say the same.
  • An editor’s load of such a session is answered with the process and BRNR_DIR=… brnr session close <id> to release it, or, if an editor’s process holds it there, with that process and its runtime directory, to close it in that editor.
  • The directory after BRNR_DIR= is one shell word: in single quotes when it has a space, a quote or another character a shell reads, each quote in it as '\'', so that what is shown runs as it is shown.

Where things live, fixed for 1.x and kept within the major version from 1.0.0 (P9, ADR 8.4):

  • the runtime directory: $BRNR_DIR, else $XDG_RUNTIME_DIR/brnr, else $TMPDIR/brnr-<uid>. It holds each process’s control socket and metadata;
  • the state directory: $BRNR_HOME, else ~/.brnr, laid out as projects/<project_key>/<file_name>.jsonl and <file_name>.acp.jsonl, hosts/<host id>.jsonl and sessions/<file_name>.lock;
  • file_name (ADR 9.2): lowercase ASCII letters, digits, - and _ stay; every other byte of the id’s UTF-8 is % and two lowercase hex digits; the empty id is %;
  • project_key (ADR 9.2): <claude>-<hash>, <claude> the session’s cwd with every character but ASCII letters and digits replaced by -, as ~/.claude/projects has it, and <hash> the low 32 bits of FNV-1a 64 over the cwd’s bytes, as 8 lowercase hex digits; the cwd as given, its trailing / removed.

What host logs and lock files contain, and what is in the runtime directory, aren’t covered: a lock’s fields are for brnr’s own commands and can change in any release. What a transcript’s records contain, and how a reader tells formats apart, is ADR 5.10’s.

Consequences.

  • A lock left in $BRNR_DIR/sessions/ by an earlier version is read by nothing: remove the directory. No shim (P9).
  • A lock file outlives a reboot: a file nobody holds, taken as it is.
  • On a file system where flock doesn’t work (some network file systems) the lock can’t be taken, and a start is refused with the cause, not served as if free.
  • A state directory two machines share: they contend for one lock only where the file system carries flock between them, and a holder’s pid means nothing on the other machine. A gap in the threat model.
  • An editor’s session that can’t be locked can be served by a headless process whose lock succeeds (a transient error, or the editor’s process not answering when session resume asks): a caveat of the proxy role, which session status and doctor make visible.

Why. A session must be served by one process at a time (P11): two processes on one session append to one transcript and answer one agent session twice. ACP has no opinion on two clients resuming one session; the agent copes, but the conversation splits. Claude Code chains a session’s messages by parentUuid in one file, so two processes that resume it each go on from their own last message: two branches under one id, nothing linking them, and a later resume continues one of them. Asking the running processes can’t settle it, since one that doesn’t answer can’t say (P4); the kernel releases a lock when its holder dies. A lock that can’t be taken leaves brnr unsure, so by P4 it refuses in the client role and passes the session through in the proxy role, and says so; a session/new can’t be refused anyway, as the agent has opened the session by the time brnr knows its id. The lock guards the transcript, so it lives beside the transcripts: a lock in the runtime directory guarded it only for processes that found the same one, which an interactive shell (with XDG_RUNTIME_DIR) and a cron job or an ssh command (without) don’t. It is found from the session id alone, which a resume has before it knows the cwd. Sockets and metadata are a process’s and go with the machine’s run, so they stay in the runtime directory. sessions/ isn’t repaired: nothing of the user’s is in it, and in a directory others can write to, another user can put a file where a lock goes.

Considered.

  • Refusing whenever any process doesn’t answer: one hung process would block every resume.
  • Refusing only if the transcript was last written by the silent process, or by a process not listed here: an inference, wrong for log = "off".
  • Each process listing its sessions in its <pid>.json: rewritten on every change, and trusting a file a dead process left behind.
  • The editor’s load taking over automatically: a click in the editor’s history list would end a headless turn. A change of owner is always asked for in so many words (P11).
  • --take-over stopping the owning process: it would take sessions forked beside it down too.
  • Always letting the editor’s load through, as two editors running the agent directly would: the conversation splits silently, and approvals could be answered from either side. It is what shared_sessions turns on.
  • Refusing in the default mode and passing through in strict mode: this isn’t a question of following the protocol.
  • Serving a session that can’t be locked and saying so in the host log: the host log is the record, not the telling (P3), and the session could have two owners (P11).
  • Refusing an editor’s session/load and session/resume of a session that can’t be locked: brnr can’t be sure another process holds it, and in the proxy role it doesn’t refuse on a guess (P4). It would also treat a load unlike a new session, which can’t be refused.
  • doctor --fix removing what is in a lock’s place: a directory may hold the user’s files, and a symlink’s target is the user’s to judge.
  • A lock in both directories: two locks are the problem.
  • The lock next to the transcript, in the project folder: the lock is taken before the cwd is known (a resume of a session only the agent knows has none), and one id resumed in several folders has a transcript in each (ADR 9.2) and is one session.
  • One directory for everything: the runtime directory exists for the socket’s path length (sun_path), and because what is in it is a run’s.
  • Repairing an open sessions/ as ADR 9.3 repairs transcripts: see Why.

3.10 Feature flags for process management

  • features = [...] in a profile part names the process-management behaviours it turns on. Each is off by default; an unknown name fails to load (P7). There is one:
    • shared_sessions, in [profiles.<p>.editor]: an editor may load or resume a session another brnr process owns (ADR 3.9).
  • Strict mode doesn’t change them.

Why. Some choices aren’t protocol but how brnr’s processes share sessions. They need a default that protects the user and a way to choose otherwise, kept apart from strict mode, which is about the protocol (ADR 2.1), and from experimental actions, which act on an editor’s session (ADR 7.1).

Considered.

  • Deciding them by strict mode: they aren’t protocol.
  • Making them experimental actions: they don’t add to an editor’s session; they decide what brnr’s own processes may do.

3.11 Resuming

  • brnr session resume <session>, with the session’s exact id (ADR 3.2). --take-over is on session resume only.
  • brnr sends session/resume when the agent offers it (no history replay), else session/load. session/load is ACP v1’s; v2 drops it.
  • While a load replays history the transcript has, the host neither records nor emits the replayed updates. What they say the session is now (its title, mode, config options and commands) is kept. A load of a session brnr has no transcript of records the replay, marked replayed, and a history event says which it was (ADR 5.6).
  • An id brnr has a transcript of brings its cwd, agent and profile from it, the session’s own record (P4): the session_opened of the process that last served it, never the host log (ADR 5.10). The flags override them. --cwd overrides the cwd. --profile p overrides the profile, and the agent too when p names one: a profile’s agent is the agent of each process of that profile (ADR 6.1, #341). -- <agent> overrides the agent, also p’s. Of an id with files in more than one project folder, that opening is the newest session_opened of them all, in whichever file it is: one process serves a session at a time (ADR 3.9), and the newest record of them all, where the session was last served, may be in another file (ADR 5.1, #121). An id brnr doesn’t know (one session list with an agent named shows) goes to the agent as given, in --cwd (or the profile’s cwd, or here), with the agent after -- (or the profile’s).
  • A session another process holds is refused, unless --take-over (ADR 3.9).
  • With --pid, the session is resumed in that running process, in its recorded cwd (ADR 3.12).
  • It appends to the session’s file in its cwd’s folder: the same file, unless --cwd names another cwd, where it starts one. Either way it is one session’s transcript (ADR 5.1).

Why. Sessions are the agent’s (P2): any id the agent knows can be resumed, and brnr’s own record of one is used where it has one, as a fixed rule rather than a guess (P4).

Considered.

  • Refusing an id brnr has no transcript of: session list would show sessions that session resume then refused.
  • For an id with files in two folders, the cwd of the file in the folder the command runs in: a rule that depends on where it runs (P4). The options are in ADR 5.1.
  • With --profile p, keeping the recorded agent and saying on stderr which agent runs: p’s settings, MCP servers and bridges are written for p’s agent, and may not suit another (ADR 6.1, F3).
  • Refusing --profile p when p’s agent isn’t the recorded one, unless -- <agent> is given: it refuses what the user said plainly. A profile that names an agent is the user naming that agent (P4).

3.12 Fork and close

  • brnr session fork <session> forks the session (session/fork) into a new one in the same process and prints its id. It is refused on an editor’s process (ADR 7.1). session/fork is unstable in ACP v1: a convention both adapters implement, used by default and refused in strict mode (ADR 2.1).
  • session new --pid <pid> and session resume --pid <pid> open a session in a running process. They are refused where session fork is (an editor’s process; stop_when_idle with an agent that can’t close sessions, ADR 3.8), but not in strict mode: session/new and session/resume are stable ACP.
  • brnr session close <session> cancels a running turn and closes that one session (session/close); the sessions beside it in the process keep running. A headless process with no session left stops, unless one is being opened. On an editor’s session it is the experimental close (ADR 7.1). session resume --take-over closes the same way (ADR 3.9).
  • Messages still held in a closed session are reported dropped, then session_closed (ADR 5.2).
  • Both are refused when the agent can’t do them (no fork or close session capability) (P7), and session fork when stop_when_idle is set and the agent can’t close sessions (ADR 3.8).
  • A fork’s source is recorded and shown. The session_opened record that starts the fork’s transcript, and the host log’s, name the session it was forked from, forked_from (ADR 5.1). session list (a FORKED FROM column) and session status (forked_from) say it, in text and --json alike (P5), null where there is none. For a session open in a process, the process says it if it opened the session as a fork, else the transcript’s first record does (a fork resumed since); for one that has ended, the transcript’s first record.
  • A fork an editor makes through brnr acp (session/fork) opens in its process as session fork’s does: as the agent answers, in the cwd the request names, with forked_from, and the request in its source’s transcript and the fork’s.

Why. A process serves several sessions of one agent, and ending one must not end the others (P11).

Considered.

  • session fork and session close refused outright while an editor is attached: closing is possible with compensation (ADR 7.1); forking stays refused.
  • Closing by stopping the whole process: it would take sibling sessions with it.

Tests

Run cargo test --release adr_0003_. Named claims, by section:

  • 3.1:
    • tests/security.rs: adr_0003_acp_passes_bytes_unchanged, adr_0003_acp_passes_stderr_and_the_exit_status.
    • tests/headless.rs: adr_0003_acp_is_what_an_editor_runs, adr_0003_editor_gone_takes_the_agents_children, adr_0003_a_signal_doesnt_wait_behind_a_stalled_agents_stdin, adr_0003_an_editors_process_needs_its_signal_link, adr_0003_non_blocking_stdin_is_waited_on, adr_0003_acp_with_sigchld_ignored.
    • tests/chaos.rs: adr_0003_killed_host_mid_turn_ends_the_editors_proxy.
  • 3.2: tests/cli.rs: adr_0003_ps_lists_the_processes, adr_0003_session_targets_are_exact_ids_not_prefixes_or_pids.
  • 3.3: tests/headless.rs: adr_0003_start_hands_over_one_request, adr_0003_host_is_not_run_by_hand, adr_0003_a_bad_request_is_refused, adr_0003_prompt_is_not_on_the_command_line, adr_0003_a_start_with_sigchld_ignored, adr_0003_acp_reports_a_config_error, adr_0003_acp_hands_over_one_request.
  • 3.4:
    • tests/headless.rs: adr_0003_abandoned_start_sends_no_prompt, adr_0003_start_gone_as_ready_is_written_sends_no_prompt, adr_0003_start_gone_after_ready_leaves_the_session_running, adr_0003_start_timeout_stops_the_host, adr_0003_empty_prompt_is_refused, adr_0003_large_prompt_from_stdin.
    • tests/chaos.rs: adr_0003_seeded_setup_failure_never_commits_a_prompt, adr_0003_killed_host_mid_start_commits_nothing.
    • src/host/fuzz.rs: adr_0003_a_step_answered_after_the_start_failed_goes_no_further.
  • 3.5:
    • tests/headless.rs: adr_0003_foreground_start_failure_is_reported, adr_0003_foreground_close_of_the_last_session, adr_0003_foreground_outlives_its_stdout, adr_0003_slow_foreground_reader_is_told_what_it_missed, adr_0003_foreground_with_sigchld_ignored.
    • tests/cli.rs: adr_0003_foreground_start_shows_the_session.
  • 3.6: tests/headless.rs: adr_0003_foreground_passes_the_agents_stderr, adr_0003_failed_start_shows_the_agents_stderr.
  • 3.7:
    • tests/headless.rs: adr_0003_a_panic_is_recorded, adr_0003_a_panic_while_starting_is_recorded.
    • src/log.rs: adr_0003_how_the_process_ended_is_never_skipped.
    • src/ctl/client.rs: adr_0003_a_zombie_process_is_gone.
    • tests/chaos.rs: adr_0003_seeded_agent_crash_records_death_and_releases_session, adr_0003_killed_proxy_mid_fault_stops_host_and_agent, adr_0003_killed_proxy_mid_setup_stops_host_and_agent.
  • 3.8: tests/cli.rs: adr_0003_fork_is_refused_when_it_could_never_close, adr_0003_stop_when_idle, adr_0003_a_closing_session_doesnt_wake_the_host.
  • 3.9:
    • tests/security.rs: adr_0003_session_locks_are_private_and_never_followed, adr_0003_a_runtime_dir_with_an_acl_is_refused (macOS): the process starts no agent and writes nothing there, session list fails, each with the chmod -N, and doctor --fix fails it and leaves the ACL, adr_0003_session_locks_with_an_acl_are_refused (macOS): a new headless session isn’t locked, so isn’t started, and the ACL stays; and, not named for a claim, what_brnr_makes_is_private_whatever_the_umask.
    • tests/headless.rs: adr_0003_an_editors_load_of_a_held_session_is_refused, adr_0003_an_editors_prompt_of_a_held_session_is_refused, adr_0003_an_editors_session_that_cant_be_locked_is_passed_through, adr_0003_an_editors_load_held_from_another_runtime_dir_is_refused, adr_0003_the_release_command_runs_as_shown, adr_0003_an_editors_load_held_by_an_editor_elsewhere_names_its_runtime_dir, adr_0003_a_load_answered_after_another_process_took_its_session_isnt_served, adr_0003_a_resume_answered_after_another_process_took_its_session_isnt_served.
    • tests/cli.rs: adr_0003_resume_of_a_held_session_is_refused, adr_0003_take_over_moves_a_session, adr_0003_a_silent_process_keeps_its_session, adr_0003_a_dead_process_lets_go, adr_0003_a_new_session_that_cant_be_locked_isnt_started, adr_0003_a_resume_that_cant_be_locked_isnt_started, adr_0003_a_fork_that_cant_be_owned_is_refused, adr_0003_a_second_owner_of_a_new_session_isnt_started, adr_0003_a_session_is_owned_once_however_the_runtime_dir_is_found, adr_0003_the_brnr_dir_said_is_one_shell_word.
    • tests/doctor.rs: adr_0003_what_keeps_a_session_from_being_locked_fails; and, not named for a claim, stale_session_locks_are_removed.
    • tests/chaos.rs: adr_0003_killed_host_mid_flood_is_diagnosed_and_releases_session.
    • src/paths.rs: adr_0003_brnr_dir_is_one_shell_word, adr_0003_a_private_directory_is_checked_through_what_was_opened: one that isn’t there is NotFound; a symlink to a private one, a file and one others can search are refused, and, on macOS, one with an ACL, which stays.
    • src/ctl/ownership.rs: adr_0003_each_place_is_refused_in_the_same_words, adr_0003_the_lock_decides_and_closing_comes_before_opening, adr_0003_a_resume_into_its_own_process_is_refused.
    • src/host/sessions.rs: adr_0003_a_claim_is_known_until_the_agent_opens_it_or_not, adr_0003_a_session_another_process_holds_fails_a_headless_start.
  • 3.10: tests/headless.rs: adr_0003_shared_sessions_let_an_editor_load_a_held_session, adr_0003_shared_sessions_serve_a_load_answered_after_another_process_took_it.
  • 3.11: tests/cli.rs: adr_0003_resume_a_session_only_the_agent_knows, adr_0003_resume_continues_a_session, adr_0003_resume_by_loading_keeps_the_replay_out_of_the_transcript, adr_0003_resume_takes_the_newest_records_cwd_agent_and_profile (an id with files in two folders, #121), adr_0003_resume_takes_the_newest_opening_of_every_folder (resumed in the first folder again, with another agent), adr_0003_resume_with_a_profile_runs_its_agent (#341); ADR 8.1’s adr_0008_an_editors_deletion_in_every_folder_isnt_activity shows the newest opening with an editor’s deletion, the newest record, in both files. That a resume in another cwd starts a file in that folder is shown, for a bridge’s resume, by ADR 5.6’s adr_0005_a_bridges_load_finds_the_transcript_in_another_folder, and for a start’s by ADR 5.1’s adr_0005_log_reads_a_sessions_files_in_every_folder_as_one (tests/cli.rs).
  • 3.12:
    • tests/cli.rs: adr_0003_fork_and_close, adr_0003_close_cancels_the_turn_first, adr_0003_a_fork_keeps_its_source.
    • tests/headless.rs: adr_0003_an_editors_fork_keeps_its_source.

4. Turns, messages and the agent’s requests

Draft 2026-10-20. Implemented. Factor: F3 (ADR 1). Brings together former ADRs 17, 56, 18, 19, 71, 27, 68, 29 and 30 (docs/adr/README.md maps them).

How a headless session carries the user’s messages into turns, and how the agent’s requests to the user reach someone who can answer them: message ids, held and steered messages, cancelling, a turn’s tokens, approvals and elicitations, the requests brnr sends the agent, and logging in. ACP has none of message ids, held messages or waiting; they are the thin layer brnr adds where ACP has nothing (F3, P2), and the agent’s own mode, requests and login stay the agent’s.

4.1 Message ids, and when a turn ends

  • Every message the host accepts gets an id, m<n>. prompt send --context gets none: context has no turn of its own.
  • The id is in prompt send’s response, in session new --json and session resume --json for the start’s prompt, in user_message when the message is actually sent, and in the turn_ended of the turn that carried it.
  • A turn can carry more than one message: a steered one has no turn of its own (ADR 4.2). turn_ended lists them, messages: [m1, m3].
  • A steer is a request of its own, _session/steering, answered apart from the session/prompt of the turn it goes into, in either order. A turn that ends while steers sent into it are unanswered has its turn_ended held back until the agent has answered them all, or they are dropped: until then, which messages it carried isn’t known.
  • An injected answer puts the message in that turn: its user_message names the turn’s prompt, and the turn_ended, when it goes, lists it. A promptRequired answer holds the message as ADR 4.2 says, ahead of what is held. An error, or any other answer, is a message_dropped, its reason steer (ADR 5.2). Then the held turn_ended goes, and then the next held message.
  • While a turn’s turn_ended waits, no other turn starts. prompt send and prompt send --interrupt are held, the interrupt ahead of what is held as ADR 4.2 has it, but with no turn to cancel (status held, no session/cancel). prompt send --steer is steered into that turn.
  • prompt cancel, closing the session and the agent exiting drop unanswered steers (message_dropped, its reason cancel, close or exit), and then the held turn_ended goes. Every accepted message ends in one turn_ended that lists it, or in one message_dropped, whatever the order of the answers.
  • prompt send --steer --wait for a message answered injected after its turn’s own answer exits as that turn does. What the agent said before it answered isn’t shown as the message’s reply: --wait prints what follows the message’s user_message. The transcript has it.
  • steer_after_turn in the host log is for an injected answer with no turn at all. A steer brnr sends only while a turn runs or waits, so it can’t get one; if it does, the message is dropped, reason steer, never left without an end. The editor’s own steers (ADR 7.1) have no message id; one answered with no turn is logged steer_after_turn.

Why. prompt send --wait must know which turn answers its message, even when the message is held, steered into a running turn, or sent after an interrupt. A steer’s answer and its turn’s can come in either order. If turn_ended went at once, a late injected answer would find no turn, and a waiter would wait on an idle session until its timeout (P3).

Consequences. An agent that never answers a steer keeps the turn’s turn_ended, and what is held behind it, waiting, as held messages wait for a turn; prompt cancel or session close ends it.

Considered.

  • Matching a message to its turn by its text: fragile.
  • Emitting turn_ended at once, and a second event for the late steer: two endings for one turn, or a new event for waiters and bridges to learn, for what is one turn’s list of messages.
  • Dropping a late injected steer as message_dropped: it would say a message the agent took never went (P3 the other way).

4.2 What sending a message does

For headless sessions:

IdleA turn is running
prompt sendsent as a promptheld; sent as its own turn when the running one ends, in order
prompt send --steersent as a prompt, not steered (as promptRequired would have it)injected into the running turn; refused if the agent doesn’t advertise steering (P7), or in strict mode
prompt send --interruptsent as a prompt; held, ahead of what is held, while the last turn’s steers are unanswered (ADR 4.1)session/cancel, then sent ahead of what is held
prompt send --contextappended to the next promptappended to the next prompt
  • Each held message is its own prompt and turn, in the order sent. Interrupts go ahead of held messages, and keep their own order.
  • A second session/prompt is never sent while one runs.
  • _session/steering is an ACP extension, a convention both adapters implement alike: used by default, refused in strict mode (ADR 2.1).
  • The response’s status is delivered, held, steered or interrupting.
  • On an editor’s session the editor controls its turns. prompt send is ADR 7.1’s experimental action there: refused while a turn runs, and never held, steered or interrupting.

Why. ACP doesn’t say what a prompt sent mid-turn means, and the adapters differ: claude-agent-acp 0.85.1 queues it as a turn of its own (_meta.claudeCode.promptQueueing); codex-acp 2.1.1 replaces the active prompt with it and stops following the first one’s turn (read from the code, not run). The CLI of a headless session is a contract (P12) and can’t depend on either (P2). Both adapters implement steering, _session/steering, advertised as _meta.steering.supported in initialize. With _meta.steering.idleBehavior: "promptRequired", a steer answers injected while a turn runs, its output streaming within that turn, and promptRequired when the session is idle, leaving the client to send it as a normal prompt.

Considered.

  • Passing a mid-turn prompt through and saying per agent what it does: the CLI couldn’t promise one behaviour, and an adapter release could change what prompt send does.
  • Steering by default where the agent offers it, holding elsewhere: the default’s meaning would vary by agent.
  • Sending everything held during a turn as one prompt when it ends: closer to how Claude Code batches queued messages, but --wait would no longer map one message to one turn.

4.3 What cancelling does with held messages

prompt cancel cancels the running turn (session/cancel, answering the agent’s pending permission requests cancelled, as ACP requires, and its elicitations cancel, ADR 4.5). It drops the session’s held messages, each with a message_dropped event (by: cancel) and listed in its response. --keep-held keeps them, to go out as usual.

Why. A user who cancels wants the session to stop. Held messages that went out as usual would start the next turn at once.

Considered.

  • Cancelling the turn and letting held messages go out as usual: surprising, since “stop” would start the next held message.
  • Cancelling the turn and pausing the queue: a paused state to explain.

4.4 A turn’s tokens are what the agent reported

  • The host reads result.usage of a session/prompt answer as a serde_json::Value, as ADR 2.3 does for the unstable fork capability. The schema crate’s unstable feature unstable_end_turn_token_usage stays off.
  • turn_ended and the session’s last_turn have a field tokens, after error:
    • null when the answer has no usage, or its usage isn’t an object: the tokens are unknown.
    • Otherwise {"total", "input", "output", "thought", "cached_read", "cached_write"}, from totalTokens, inputTokens, outputTokens, thoughtTokens, cachedReadTokens and cachedWriteTokens. Each is the agent’s number when it is a whole number that isn’t negative (a u64), and null otherwise: left out, null, a string, negative, a fraction, or written with an exponent.
  • No count is calculated: no total from the parts, nothing from usage_update’s used or size, and no sum over turns.
  • brnr says nothing of what the counts cover. They are the counts the agent reported for the turn, as the agent counts them: brnr doesn’t say whether subagents or earlier model calls are in them.
  • The answer goes to the editor as it came, usage included (P1). Only brnr’s copy is read.
  • session status has last_turn, in --json and in text. prompt send --wait --json and session new --wait --json have tokens beside stop_reason and error, from the turn’s turn_ended.
  • Text (P5): turn ended: end_turn (control); tokens: 1.2k total, 1.0k input, 234 output, 50 thought, 500 cached read, 20 cached write, and the status has last turn ended: end_turn; tokens: …. Each count the agent gave is shown, and one it didn’t give is left out, as the usage line leaves out a cost it doesn’t have (ADR 5.3). With none given, the line ends after (control). The numbers are shown as the usage line shows them (950, 12.3k, 1.2M); --json has them exact.
  • Strict mode doesn’t change it: to read what the agent said is to observe, which affects no party (P1, ADR 2.1). An agent that keeps to stable ACP sends no usage, and its turns have tokens: null.

Why. An agent can say in its answer to session/prompt how many tokens the turn used. ACP’s schema 1.10.2 has this as PromptResponse.usage, only behind an unstable feature: totalTokens, inputTokens and outputTokens required, thoughtTokens, cachedReadTokens and cachedWriteTokens optional, and _meta. brnr builds the crate without unstable features (ADR 2.3), so the counts were only in the raw ACP (ADR 5.1). What brnr shows is what the agent said, read once (P5), with nothing worked out or guessed (P4). What a count covers is the agent’s to say: research of October 2026 (research#7) found that the Codex adapter reports its last model call, and that Claude’s ACP counts leave out subagents. Neither is in the protocol.

Consequences.

  • Every turn_ended and last_turn has one field more, null for agents that don’t send usage.
  • If ACP changes the field (a name, a type, where it is) or stabilizes it, brnr sees the changed form as unknown counts or no usage until it is read again here; it doesn’t fail. A stabilized usage can then be read with the schema’s type.
  • tokens is named as ADR 5.9 has it (#151), and shaped as ADR 8.2 has it (#150), as ADR 10.2’s names are.

Considered.

  • Enabling unstable_end_turn_token_usage: against ADR 2.3. The feature can change or go before it is stable, and with it the crate’s types would no longer be what strict mode means by stable ACP (ADR 2.1).
  • Calling the field usage: it would clash with the usage event and the status’s usage, which are the context window and the cost (ADR 5.3).
  • Taking a turn’s tokens from usage_update, or a total from its used: that is how full the context window is, not what a turn used.
  • Passing the agent’s usage object on as it is, camelCase: brnr’s events are snake_case, and a copy would pass on any value, of any type. Each count read on its own is the agent’s number or unknown.
  • A total from input and output where the agent gives no total: a guess (P4). What a total includes is the agent’s to say.

4.5 Approvals and elicitations: the agent’s mode is the policy

A permission request (session/request_permission) and an elicitation (elicitation/create, the agent asking for a form’s values or for a URL to be opened) go through one mechanism, with ACP’s own words for each (P1, P2).

The policy:

  • How much the agent asks is its mode (P2), set at start (session new --mode, or mode in the profile’s headless part, applied before the first prompt) or later (config set --mode). brnr has no approval policy of its own: a config with a permissions key fails to load, and brnr doctor says so.
  • brnr always asks when the agent does. Headless, a permission request is held with a handle p<n>, and an elicitation with a handle e<n>, until someone answers it: a command below, or a bridge. brnr never answers one for the user (P4), and never declines an elicitation for the user, but by the response_timeout the user set (below).
  • With no editor attached, brnr is the agent’s client: permission requests and elicitations as here, anything else answered “method not found”.
  • Headless, initialize carries clientCapabilities.elicitation: {form: {}, url: {}}, built with the schema’s types (ADR 2.3): a mode is advertised with an object, not a boolean, and the schema reads false as not advertised.

Events:

  • permission_request, and permission_resolved, which says allowed or rejected, and which kind (ADR 8.1).
  • elicitation_request carries the request’s text (ACP’s message), mode (form, url, or another the agent names), scope (session, tool_call or request) with the tool_call_id or scope_request_id it names, the form’s schema (the requestedSchema as sent), and a URL mode’s url and elicitation_id; owner says headless or editor.
  • elicitation_resolved carries the action sent (accept, decline, cancel, or an editor’s other action), the content an accept carried, and who and why, as permission_resolved has them (ADR 5.9): by editor, or control with the connection or bridge that answered (peer) or reason cancel or timeout.
  • elicitation_completed is the agent’s elicitation/complete, the URL’s flow done, with the elicitation_id and the handle it belonged to.
  • event wait --for permission and --for elicitation wait for one (ADR 8.3). event notify runs its command for permission_request and elicitation_request by default (ADR 5.8). prompt send --wait announces one on stderr, with how to see it and answer it.
  • The events’ names follow ADR 5.9 (snake_case, the agent’s values as sent), and their shapes ADR 8.2 (#150); when #149 lands, they follow its decision too.

Listing and showing:

  • permission requests [<session>] and elicitation requests [<session>] are tables. With no session, they list the requests of each process that answers; one that doesn’t is passed over, as process list and session list pass it over (ADR 3.9), and said on stderr (P3). elicitation requests has SESSION, REQUEST, OWNER, MODE, MESSAGE.
  • permission show <session> <request> shows one in full: the tool, its kind, paths, the command or input, and for edits a diff made from the tool call’s oldText/newText with a small line diff (a very large one shows the new text, saying so). It warns about a command with control characters in it (P8).
  • elicitation show <session> <request> shows one in full: the message, mode and scope, a form’s fields with their types, constraints and choices, and a URL as the agent sent it. brnr never opens the URL (P8): the user opens it, and then accepts.
  • Each show says what the timeout will send before it happens, and, of an editor’s request, that it is waiting in the editor and whether it can be answered here (answerable, why_not).

Answering a permission request:

  • permission allow and reject take <session> <request>: brnr doesn’t pick the only request waiting (P4).
  • Each answers with the option of one ACP kind: allow with allow_once, allow --always with allow_always, reject with reject_once, reject --always with reject_always, whatever their order in the request. No other kind stands in for it, and reject never answers cancelled: a request without that kind, or with two options of it, fails, listing the options, and nothing is answered (P4, P7).
  • --option-id <id> names the option instead, for a kind brnr doesn’t know or two options of one kind. One of an ACP kind must be on the verb’s side (allow_* for allow), and with --always of the always kind; one of a kind brnr doesn’t know goes with either verb.
  • prompt cancel is how a request is answered cancelled, as ACP has it (ADR 4.3).

Answering an elicitation, with ACP’s response actions as verbs (ADR 8.1):

brnr elicitation requests [<session>] | show <session> <request>
                | accept <session> <request> [--field <k>=<v>]... | -
                | decline <session> <request> | cancel <session> <request>
  • accept takes the form’s values as --field name=value (repeated for a multi-select) or as one JSON object on stdin (-).
  • The host checks them against the request’s schema before anything is sent (P4, P7): every field named in the schema, the required ones given, each value of its type (a --field string is read as the type asks: 42 for an integer, true for a boolean), within minimum/maximum, minLength/maxLength and minItems/maxItems, and one of enum, oneOf or the items’ choices where there are any. A value that doesn’t fit fails the command, naming the field, and nothing is sent.
  • pattern and format are passed on as given: checking them takes a regex engine brnr doesn’t have (a crate needs a reason), and the agent checks them itself.
  • The response is written with the schema’s types (CreateElicitationResponse), so an accept’s content has ACP’s value types.
  • accept of a URL elicitation takes no fields. One of a mode brnr doesn’t know can only be declined or cancelled.
  • A request-scoped elicitation (a login, outside any session) is listed with no session (--pid <pid> in the SESSION column), and named by its process, --pid <pid> in place of <session>, as event watch names one.

Socket and bridges (ADR 5.7):

  • pending answers with elicitations beside pending, each in full, with answerable and why_not, and an elicitation with its process’s pid, which names one outside any session.
  • allow and reject, with always and option_id, answer a permission request (ADR 8.1). elicitation {session, request, action: accept|decline|cancel, content?} answers an elicitation, session null for a request-scoped one. The turn’s cancel keeps its name.

One timeout:

  • response_timeout in the profile’s headless part, and --response-timeout <s>, is the one timeout for the user’s responses: permission requests and elicitations alike. It has no default: without it, a request waits for as long as nobody answers. An unattended run must set it.
  • A permission request nobody answered in time is answered with its reject_once option. One without it has its turn cancelled (session/cancel), so it and every request pending in the session are answered cancelled, as ACP requires. Never reject_always, and never an allow.
  • An elicitation nobody answered in time is answered cancel, by control, reason timeout: never decline, which says the user said no, nor accept.
  • prompt cancel answers the session’s pending elicitations cancel, by control, reason cancel, as it answers its permission requests cancelled: the turn they were asked in is gone, and nothing is left waiting unsaid (P3).

A request the agent gives up on (#162):

  • The agent’s $/cancel_request for a permission request or an elicitation it sent ends the request, in brnr’s role either way. It is no longer waiting: not in permission requests, elicitation requests or a bridge’s pending, and not counted in the session’s waiting. Its permission_resolved (answer: cancelled) or elicitation_resolved (action: cancel) says by: agent. An answer to it after that, from a command or a bridge, fails as one to a request that isn’t waiting, and nothing is sent.
  • Headless, brnr is the receiver ACP names, and answers the request the agent cancelled, as ACP requires: a permission request with the outcome cancelled, an elicitation with the action cancel, the answers a cancelled request has.
  • In an editor’s session the notification reaches the editor unchanged (P1), and the editor’s answer reaches the agent unchanged. The event says by: agent once; the editor’s answer makes none.
  • A $/cancel_request for a request already answered, or for an id brnr holds no request of, ends nothing: there is nothing waiting to end.
  • A turn that ends while a request of it is still waiting is the agent’s fault: ACP has the agent cancel what it no longer waits for. brnr doesn’t end the request for it (F1, ADR 4.6). The request waits, as any request does, until it is answered, response_timeout passes or prompt cancel cancels it; meanwhile the session is waiting, and stop_when_idle doesn’t count (ADR 3.8). What the agent does wrong shows, as it would without brnr.
  • A request brnr doesn’t hold (an editor’s fs or terminal request) is the editor’s: the agent’s $/cancel_request for it reaches the editor, and brnr ends nothing.

Editor sessions (ADR 7.1):

  • A permission request or an elicitation passes through to the editor unchanged. elicitation_request is emitted with owner: editor, so watchers and bridges see it; the editor’s answer is elicitation_resolved, by editor.
  • Answering from the side channel is the experimental action permission or elicitation, refused unless the editor’s profile enables it. elicitation is refused in strict mode too. When it is taken, the request is withdrawn from the editor with $/cancel_request and the editor is told in the session (“Accepted via brnr”, “Declined via brnr”); the editor’s late answer is dropped while the host keeps the request (ADR 10.3), and it is told who answered first, as permission does.

Status: session status counts them, elicitation_count beside pending_count (ADR 8.2), and a session with one waiting is waiting.

Why. A policy of brnr’s own for headless approvals (ask, auto-allow or auto-deny, by ACP tool kind) overlapped the agent’s own mode, which already says when to ask at all (Claude’s acceptEdits or bypassPermissions), and the two composed confusingly: mode default with auto-allow approved everything one round trip at a time, plan with auto-allow approved leaving plan mode, and neither setting knew of the other. Elicitations are the same question, the agent waiting on the user mid-turn. Declined at once, a user on a bridge could answer “may I edit this file?” but never “which option do you want?”. In agent-client-protocol-schema 1.10.2 neither elicitation/create nor elicitation/complete is behind an unstable feature, so by ADR 2.1 and ADR 2.3 both are stable v1. A timeout never allows: it would approve whatever an unattended agent asked for. What a timeout sends differs because ACP’s answers differ: a permission request has no outcome for “nobody chose”; an elicitation has cancel for exactly that. One number covers both: a second would be one more setting to get wrong for the same question.

$/cancel_request is stable ACP (no unstable feature gates it in agent-client-protocol-schema 1.10.2), and ACP has its receiver answer the request it names. Passed over, as brnr does now, a request the agent gave up on stays listed: the session is waiting and never idle, and permission allow answers an agent that no longer asks (#162). A correct client acts on it (F1). A turn that ends with a request unanswered is another case: nothing in ACP ends the request, and ending it would be brnr making up for the agent (F1), as answering a request the agent never answers would be (ADR 4.6).

Consequences.

  • claude-agent-acp turns AskUserQuestion on for headless sessions once it sees elicitation.form, and MCP servers’ elicitations and URL logins reach the user. Not covered by a Rust test: it needs the real adapter with credentials, past what adapters/check.py can run; adr_0004_headless_advertises_elicitation checks what brnr advertises.
  • A headless turn waits on an elicitation. response_timeout has no default (P4: brnr doesn’t pick a deadline for the user), so an unattended run must set it, and the documentation, the interface reference and the skill say so.
  • Bridges that list pending see an elicitations key; one that answers elicitations sends elicitation.
  • Both adapters can send $/cancel_request for a request of their own: as their code reads (claude-agent-acp 0.85.1, codex-acp 2.1.1), Claude’s permission requests and elicitations go with the abort signal of Claude Code’s tool call, and Codex’s approvals with the turn’s cancellation signal, and the ACP SDK sends $/cancel_request when one aborts. Neither has been seen to end a turn with a request open. adapters/check.py drives no turn that asks (that needs the real agents, with credentials), so neither is run there.

Considered.

  • Keeping brnr’s own policy beside the mode: agent-agnostic rules by tool kind and auditable auto-answers in the transcript, but two policies for one question.
  • permission requests -v for the details: requests stays a table, show is one request in full.
  • Allowing on timeout: see above.
  • Advertising form only: URL mode is how MCP servers log in (OAuth), and showing a URL without opening it is as safe as showing a command.
  • A timeout of its own for elicitations (elicitation_timeout): two settings for one question; nothing found that needs them to differ.
  • Naming the one timeout permission_timeout: it would name one of the two things it times out.
  • A timed-out elicitation answered decline: that is the user’s “no”, and nobody said it.
  • Checking the values in the CLI: the host holds the schema and the bridges answer too, so the check is the host’s, once.
  • Opening a URL (open, xdg-open): the agent’s text on a command line (P8), and a URL the user hasn’t seen.
  • brnr elicitation answer <action>: ADR 8.1’s rule is ACP’s verbs.
  • Holding an elicitation of a mode brnr doesn’t know as nothing: it would wait unseen; held, it can be shown, declined or cancelled.
  • Passing the agent’s $/cancel_request over, as ACP lets a receiver of a $/ notification do: brnr can act on it, and a request left listed misleads whoever answers it (P3).
  • Answering the cancelled request with the error -32800: ACP allows it, but a permission request and an elicitation each have an answer for a cancelled request, and brnr already sends those for prompt cancel.
  • Ending the requests of a turn that ended, answered cancelled: it makes up for an agent that doesn’t follow ACP (F1), and hides that it doesn’t.
  • Waiting until either adapter is shown to cancel a request or end a turn with one open: the rule is ACP’s, whichever agent does it.

4.6 Requests the agent answers

Setting the mode or a config option (config set), forking (session fork) and closing (session close) are answered when the agent answers, on the same connection (matched by req_id); the host doesn’t block meanwhile. brnr waits up to 120 seconds for them, since switching model or forking can take a while.

Why. These are the agent’s to do (P2), and some take a while; the host serves its other sessions and peers meanwhile.

The host has no timeout of its own for them, and never answers one in the agent’s place. A request the agent never answers (or answers in a line brnr can’t read, ADR 2.5) stays waiting: only the caller gives up, brnr after its 120 seconds, saying so (P3), and a bridge when it chooses to.

Consequences. A bridge whose request the agent never answers waits as long as it keeps waiting, and so does the session/close of a --take-over (ADR 3.9) once brnr has stopped waiting.

Considered.

  • The host answering such a request with an error after a time of its own: an agent that never answers doesn’t follow ACP and JSON-RPC, and it isn’t brnr’s to compensate for that (F1). What the agent does wrong shows, as it would without brnr.

4.7 Authentication

  • By default the host doesn’t run authenticate. A start that fails because the agent needs a login fails with the agent’s methods, each by name and by the id --auth takes, and a hint: log in with the agent’s own CLI first, or name a method that needs no terminal with --auth <id> (auth_hint in src/host/requests.rs).
  • auth = "<method id>" in a profile’s headless part, or session new --auth <id> (and session resume), runs authenticate with that method after initialize, before the session opens. The user names a method they know works without a terminal; brnr never picks one (P4), and needs to know nothing about any adapter (P2).
  • A method the agent doesn’t offer fails the start before authenticate, naming the ones it does (P7). A method that tries a browser anyway runs into the start’s timeout.
  • With an editor, logging in is the editor’s business.

Why. ACP’s authenticate runs one of the login methods the agent offers in initialize. Most log in through a terminal or a browser, which a headless process has neither of. Not all: codex-acp’s api-key reads OPENAI_API_KEY from the environment. Nothing in ACP tells the two kinds apart for the adapters brnr ships (neither uses ACP’s typed methods), and codex-acp’s other method, chat-gpt, opens a browser.

Considered.

  • Never authenticating: headless codex with an API key, in CI say, would need an interactive login first.
  • brnr choosing a method that looks non-interactive: it can’t tell, and a guess could open a browser on a server.

Tests

Run cargo test --release adr_0004_. Named claims, by section:

  • 4.1: tests/headless.rs: adr_0004_steer_goes_into_the_running_turn, adr_0004_steer_answered_after_its_turn_is_in_that_turn, adr_0004_steer_refused_after_its_turn_is_dropped, adr_0004_steer_never_answered_is_dropped_by_close, adr_0004_interrupt_waits_for_the_steers_into_the_turn_before; tests/cli.rs: adr_0004_start_json_gives_the_prompts_message; src/host/turns.rs: adr_0004_a_turn_ended_waits_for_its_steers_and_so_does_what_is_held, adr_0004_a_steer_injected_while_its_turn_runs_is_in_that_turn, adr_0004_a_steer_turned_back_goes_next_ahead_of_what_is_held, adr_0004_a_refused_steer_is_dropped_before_its_turn_ends, adr_0004_an_interrupt_while_steers_wait_is_held_with_no_turn_to_cancel, adr_0004_a_dropped_steer_lets_its_turn_end, adr_0004_the_editors_turns_are_its_own.
  • 4.2: tests/headless.rs: adr_0004_interrupts_keep_their_order, adr_0004_send_while_a_turn_runs_is_held, adr_0004_steer_without_a_turn_is_a_prompt, adr_0004_steer_needs_the_agents_steering; src/host/turns.rs: adr_0004_interrupts_go_ahead_of_held_messages_in_their_order, adr_0004_context_goes_with_the_next_prompt, adr_0004_queue_drops_held_messages_and_interrupts; src/host/fuzz.rs: adr_0004_a_bridge_sends_through_the_sessions_turns.
  • 4.3: tests/cli.rs: adr_0004_cancel_drops_held_messages_and_says_so, adr_0004_cancel_can_keep_held_messages; src/host/turns.rs: adr_0004_cancel_drops_what_is_held_and_unanswered_steers.
  • 4.4: tests/cli.rs: adr_0004_a_turns_tokens_are_what_the_agent_reported, adr_0004_a_count_the_agent_didnt_give_is_null, adr_0004_a_turn_without_usage_has_its_tokens_unknown; tests/security.rs: adr_0004_the_editor_gets_the_answers_usage_as_the_agent_sent_it; src/render.rs: adr_0004_text_shows_the_counts_the_agent_gave.
  • 4.5: tests/security.rs: adr_0004_an_unanswered_request_waits, adr_0004_a_timeout_never_allows, adr_0004_a_request_is_answered_only_in_its_session, adr_0004_a_timeout_cancels_never_accepts; tests/headless.rs: adr_0004_allow_during_stop_fails, adr_0004_an_editors_elicitation_is_seen_and_reaches_the_editor; tests/cli.rs: adr_0004_show_explains_a_permission_request, adr_0004_show_escapes_a_spoofed_command, adr_0004_requests_passes_over_a_silent_process, adr_0004_headless_advertises_elicitation, adr_0004_requests_and_show_list_an_elicitation, adr_0004_accept_checks_fields_against_the_schema, adr_0004_decline_and_cancel, adr_0004_url_accept_is_followed_by_complete, adr_0004_wait_for_elicitation, adr_0004_send_wait_reports_an_elicitation, adr_0004_a_bridge_sees_the_elicitation, adr_0004_a_request_scoped_elicitation_is_answered_by_pid, adr_0004_prompt_cancel_cancels_the_sessions_elicitations; src/render.rs: adr_0004_elicitation_events_have_lines; src/host/approvals.rs: adr_0004_handles_are_never_used_again, adr_0004_every_way_a_request_ends_leaves_nothing_behind, adr_0004_an_answer_that_cant_be_sent_leaves_the_request_waiting, adr_0004_a_timeout_rejects_once_or_cancels_the_turn, adr_0004_the_agents_cancel_ends_only_what_waits. A request the agent cancels with $/cancel_request: tests/cli.rs: adr_0004_a_request_the_agent_cancels_ends_by_the_agent, adr_0004_a_turn_that_ends_leaves_its_request_waiting, adr_0004_the_agent_cancels_each_request_it_has_open; tests/headless.rs: adr_0004_an_editor_gets_the_agents_cancel_and_answers_it.
  • 4.6: tests/cli.rs: adr_0004_agent_requests_wait_for_their_answer_without_blocking_the_host.
  • 4.7: tests/cli.rs: adr_0004_login_needed_is_explained, adr_0004_auth_runs_the_login_method_named.

5. Events, transcripts and observers

Draft 2026-10-20. Implemented. Factor: F3, F5 (ADR 1). Brings together former ADRs 22, 55, 20, 23, 24, 48, 57, 35 and 36 (docs/adr/README.md maps them).

What a brnr process says about its sessions, and what it keeps: the events the host emits, the transcripts it writes, and what observes them, event log, event watch, event notify and bridges. ACP has none of these; they are what brnr adds beyond it (F3). They behave as a Unix utility’s output should: an event chosen is shown, in text and JSON alike, and nothing goes without a word (F5).

5.1 The host’s events are the story, and transcripts are two files

Events:

  • Every event the host emits to bridges (user_message, agent_message, tool_call, permission_request, turn_ended, …; EVENTS in src/host/control.rs) is also a record in the session’s events file. event log, event watch and the foreground (ADR 3.5) render the same events, and a transcript read back is the stream a bridge saw live (P5).
  • process_exited, the one event that belongs to the process, is written into every session’s events file too, so event log keeps to one session’s files.
  • session_changed records what changed, not the whole list again. Of the config options and the commands it has a JSON merge patch (RFC 7396) by id and name: an option’s new value ({"model": "opus"}), a command added ({"review": {…}}), null for what is gone. An answer to set_config_option that changes a value makes one too, as an agent needn’t send an update for it.
  • The session_opened record of a session the process opened as a fork (session fork’s, or an editor’s session/fork through brnr acp), in its events file and in the host log, has forked_from, the session it was forked from (ADR 3.12). A session opened any other way has none: the process doesn’t know whether it was a fork, and the first session_opened in the file says.
  • session delete writes session_deleted into the session’s events file itself, a record of no process’s (host_id and pid null, and no seq: it has no position in any process), and with --purge deletes both files (ADR 8.1).
  • Every record starts with its format (ADR 5.10), then carries ts, host_id, pid (the brnr process), proxy_pid, agent_pid and, in a session’s files, session, for joining. Every event, and every raw ACP record, has seq, its position in its process (ADR 10.2), and every event pid too (ADR 5.9), but for two records: the copy of a session/new or session/fork in the new session’s raw file, which has no seq, as the request keeps its position where it was first recorded (the host log for a session/new, the forked session’s raw file for a session/fork), so that a position names one record (ADR 10.2); and session_deleted, a record of no process’s.
  • A session’s events file starts with session_opened, the same record as the host log’s: session, cwd, profile and agent (the process’s, ADR 3.11), events_log, acp_log (null with log = "events"), host_log, and forked_from for a fork. The host log names each session’s files there.

Files:

  • Each session has two files, keyed by project folder like the agents’ own: ~/.brnr/projects/<folder>/<session id>.jsonl, its events, and <session id>.acp.jsonl beside it, the raw ACP. <folder> is the cwd with every non-alphanumeric character replaced by - (as in ~/.claude/projects), then - and a hash of the cwd, so each cwd has a folder of its own. The session id in the names is escaped, one name per id, so distinct sessions never share a transcript (ADR 9.2).
  • One session id is one session, whatever folders its files are in (#121). A session resumed in another cwd (session resume --cwd) has files in each folder, and its transcript is all of them: brnr reads them as one (below), and a load finds it in any folder (ADR 5.6).
  • Each process also has a host log, ~/.brnr/hosts/<run id>.jsonl, for what belongs to no session (ACP before a session exists, the agent’s stderr).
  • The events file is always written: event log, session list and session resume read it. The raw file is written by default; a profile’s log = "events" leaves it out, and log = "off" writes neither (ADR 6.1).
  • A transcript is written only where only the user can read it: what others can reach is made private first, and a symlink is refused (ADR 9.3, P13).
  • Transcripts and host logs are kept until the user deletes them: session delete --purge one session’s, session prune --older-than <s> what was last active longer ago, and with retention set every process prunes so as it starts (ADR 9.5).
  • A process holds a session’s two files only while it serves the session. A close closes them once its last record, session_closed, is written; a session opened again appends to them, after another session_opened.
  • Records the logger skips behind a slow disk (ADR 10.1) leave a gap that a records_skipped note counts, in the session’s events file and the host log. So do records a write fails to put in a file: the note goes in the file that lost them once it takes records again (for the raw file, in its events file).
  • A load of a session brnr has no transcript of records the replay (ADR 5.6).

Reading:

  • event log reads a record as the event event watch would have shown. With acp chosen it reads the raw file too, merged in order, each ACP message an acp event, and says so when there is none. --events and --json mean the same as for event watch (ADR 5.3), and event log --json is what a watcher got live. It shows a records_skipped gap whatever --events chose.
  • A record in a format this brnr doesn’t read, an older brnr’s or a newer one’s, isn’t read (ADR 5.10, P9). A file of them is no transcript: session list and session resume pass it over, and a load records the history (ADR 5.6). Nothing goes without a word (P3): event log of it says <file>: records an older brnr wrote, before transcripts had a format, not read (ADR 5.10), and doctor lists every such file, transcripts and host logs, as info.
  • event log of a running session first waits for what its process has recorded (ADR 5.5).
  • event log reads every file of the session, in every project folder, merged by their records’ ts (#121), each file’s records in the order it has them. One process owns a session at a time (ADR 3.9), and a record’s ts is when its process recorded it, not when it was written, so the records of two files don’t overlap in time. A closing process’s last records can be written after the next process’s, past ADR 5.5’s 2 s; merged by ts, they still come before them. --last counts in what is merged; --follow follows the files the serving process writes. With acp chosen, each folder’s raw file is merged with its events file, and a folder without one is said (no raw ACP for <session> beside <file>). A file of the session in another format, in any folder, is said and not read (above). Of a session open in a process that logs nothing (log = "off"), what the other folders hold is shown, and event log says the process keeps no transcript of it.
  • What a transcript is for session list, session resume and doctor comes from the first and last records brnr can read in it. A line that isn’t a JSON object, cut short or not, is passed over. The last record is read backwards, so a long transcript costs no more than its last records. Of a session with files in more than one folder, the first record is the oldest file’s and the last is the newest record of them all: session resume takes where it was last served from that newest record (ADR 3.11), and session list its row, one per id (#121). That record is the newest a process recorded that isn’t a deletion: a deletion isn’t activity (ADR 8.1), neither session delete’s, which is no process’s, nor an editor’s, which its process records into every file of the session, opened there or not. Its cwd, profile and agent are those the newest session_opened of them all names (ADR 5.10), in whichever file it is. One process serves the session at a time (ADR 3.9), so that is the opening of the process that last served it; the newest record may be in another file, as an editor’s deletion is recorded in every file of the session by a process that may never have opened it (ADR 8.1). A file whose newest record is in a format brnr doesn’t read is passed over (ADR 5.10). A line cut short is never taken for a record: a JSON object ends only at its last byte. So, for a transcript:
    • ending in a newline, as written: its last line is the last record;
    • ending partway through a line: its last whole record;
    • with a whole line that isn’t a record, last or anywhere: the line is passed over;
    • empty, or with no line brnr can read: no session, as nothing says which, where or when (event log says no session).
  • event log shows every record it can read, and says on stderr each line it can’t (brnr: <file>:<line> isn't a record brnr can read, not shown). Once the transcript won’t grow (its process has gone), it also says when the file ends partway through a line (brnr: <file> ends partway through a record (<n> bytes), not shown). Of a running session, what follows the last newline is a line still being written, and isn’t mentioned. The exit status is still 0: the transcript asked for is shown (P3).
  • A process that opens a transcript to append to it, and finds it ending partway through a line, starts its first record on a line of its own. The line cut short stays as it was.
  • Nothing that reads a transcript writes to it: brnr never repairs, truncates or rewrites one (P3). Nor does it read one where the logger couldn’t have written it: through a symlink, in a symlinked project folder, or what isn’t a regular file (ADR 9.3).

Why. The raw ACP needs the host’s interpretation to read as a history (agent messages assembled, permission requests paired with their answers, a turn’s end named), and the CLI can’t know the host’s names for things (permission handles like p1, message ids). Recording the events the host already emits gives one story, live and read back (P5). The raw file is what checks that interpretation. On the maintainer’s machine in October 2026, 44 session files held 31 MB: 74% raw ACP, almost all of it the agent’s session/updates; session_changed was 5.5 MB in 176 records, each repeating whole lists, hence the patch. A process killed mid-write (SIGKILL, a power cut, a full disk) leaves its last line cut short, and the logger ends a line its own failed write cut short before it writes again, so a broken line can be anywhere in a file. Reading past it keeps the session listed, logged and resumed, as every record before the cut is there (#61).

A session’s files in two folders are one session read as half of one: event log and session resume take the most recent file, and say nothing of the other (#121). An id is one session (ADR 9.2), so its transcript is every file of it. Their records don’t interleave in time, since one process owns the session at a time (ADR 3.9), and ts, the time a record was recorded, orders them, even those a closing process writes late (ADR 5.5). The newest record is where the session was last served, a fixed rule that doesn’t depend on where the command runs (P4).

Consequences.

  • Turning the raw file off saves most of the space, and leaves secrets (ADR 9.1) nothing to be redacted from but the host log.
  • brnr doesn’t replay a session to an editor. An editor that resumes a session with session/resume, which replays nothing (and ACP v2 has no session/load), shows what the agent gives it. Resending the agent’s old session/updates from the raw file would make up for what the agent doesn’t do (F1), and is beyond what a focused tool does (F5, N4). The raw file is for checking the interpretation.
  • A process that forks and closes session after session keeps the files of each session it has open.
  • A session killed mid-write is listed, logged and resumed as of its last whole record. The bytes of the cut record stay in the file, and event log points at them. A file whose lines are all cut short or broken is not a session; its bytes are still there to read.

Considered.

  • One file with raw ACP and events together.
  • Events only, raw ACP on request: a quarter of the space, but checking the interpretation, and any replay, would need it turned on in advance.
  • Raw ACP only, the events derived when read: a second interpretation in the CLI, without the host’s names.
  • event log also reading the host log for the session’s time span: two files to merge and to follow, and the host log has ACP and stderr that aren’t the session’s.
  • Keeping a record dump for event log, with --events over the records: --raw would have kept two meanings, one for event log and another for event watch.
  • Host-wide events copied into every session’s file: the case that prompted it, owner_changed, went with ADR 3.1; process_exited is what remains.
  • Truncating a file to its last newline when it is read or reopened: repairs it, but destroys what was there, and a reader would write.
  • Failing event log on a line it can’t read: the records around it are what the user asked for, and stay readable.
  • Taking the session’s id from the file name when no record can be read: the name is an escaped id (ADR 9.2), not the id, and there would be no cwd, agent or profile to resume it with.
  • For one id with files in two folders (#121): keeping “the most recent file wins”, which shows half a session and says nothing (P3); preferring the file in the current cwd, which makes the answer depend on where the command runs (P4); refusing and listing the folders, with --cwd to choose one, which treats one session as two.

5.2 Dropped messages and closed sessions are events

  • message_dropped {session, message, text, reason}, reason one of cancel, queue (queue drop, queue clear), close, exit and steer (a steer the agent neither took nor sent back, ADR 4.2): every way a message brnr accepted can go unsent (P3). Unanswered steers are dropped with held messages by prompt cancel, a close and the exit. process_exited has no list of messages not delivered (P5, P9).
  • context_dropped {session, text, reason}, reason one of queue (queue clear --context), close and exit: context held for a next prompt that won’t come, one event per item (context has no message id, ADR 4.1). Context held when its session closes (stop_when_idle included) or the process exits is dropped so. prompt cancel keeps context: it is for the next prompt, whenever that comes.
  • session_closed {session, by, reason}: by control with reason close (session close, session resume --take-over) or idle (stop_when_idle, ADR 3.8), or by editor with reason close (the editor’s own session/close). Messages and context still held in the session are dropped first. A session whose load the agent failed (ADR 5.6), or one the agent opened that isn’t the process’s to serve (ADR 3.9), drops what it holds the same way, reason close, with no session_closed after: it never opened here. A process exiting is process_exited, which is in every session’s file already, and isn’t also session_closed.
  • prompt send --wait and session new --wait whose message is dropped exit 1, saying m3 was dropped (cancel) on stderr and dropped: "cancel" in --json. event wait ends as ADR 8.3 says; event watch and event notify on a session end when it closes.
  • All three are in EVENTS and the documentation’s list for bridges, and in the default events of event watch, event log and bridges (ADR 5.3). event notify’s default is its own (ADR 5.8).

Why. A message brnr accepted and never sent, or a session that closed, must be said where observers look (P3). Without these events a prompt send --wait for a dropped message waited until the process exited, and event watch, event notify and event wait on a closed session waited for the whole process.

Considered.

  • turn_ended with a dropped stop reason: misleading, since no turn ran.
  • Only the response to the command that dropped them saying so.
  • A distinct exit status for “never ran”: one more code for scripts to learn; the difference is in stderr and --json.
  • An undelivered list in process_exited: two kinds of record for one thing.

5.3 Choosing events, and what text shows

  • --events alone chooses, for event watch, event log and event notify alike: event names, all, and default. An event chosen is shown, in text and JSON alike (P5). Unknown names fail in the CLI, before connecting, with the same message everywhere.
  • Without --events, event watch and event log show every event but the quiet ones, acp, agent_thought, usage and tool_progress (QUIET), in text, JSON and the foreground alike. default names that set, so --events default,agent_thought adds thoughts. There is no --raw and no --thoughts.
  • Whatever --events chose, event log also shows a gap in the transcript (records_skipped, ADR 5.1), and a command cut off what it missed (events_missed, ADR 10.2): notes, not events (ADR 5.9). --events takes their names too, so --events records_skipped alone shows a transcript’s gaps.
  • Bridges and the host’s subscribe have their own default: every event but acp. event notify’s default is its own (ADR 5.8).
  • Tool calls: tool_call when a call starts (started: true) and when it ends (completed or failed), shown as tool: … (kind), tool done: …, tool failed: …; tool_progress for each change of status in between (in_progress), quiet, shown as tool: … in_progress when chosen. Progress that doesn’t change the status (streamed output) is not an event. A tool_call again with the id of a call that is running is that call, not a second one (#164): it updates it, as a tool_call_update would, with no second start.
  • usage (one per usage_update the agent sends; session status has the latest) is quiet. It has the context window and the cost, not tokens in and out, and its line, when chosen, is usage: 12.3k of 200.0k tokens, cost 0.42 USD.
  • turn_ended has tokens, the tokens the agent reported for the turn (ADR 4.4), and its line shows each count given: turn ended: end_turn (control); tokens: 1.2k total, 1.0k input, 234 output.
  • session_changed is shown for everything it reports: title, mode, config (config: model=opus) and commands (commands: +review -compact, those added or changed and those gone, as ADR 5.1’s patch has them).

Why. One raw line per streamed chunk is not readable. A flag with two meanings (--raw for log and for watch), and a second way to choose an event that is already chosen (--thoughts), are two answers to one question. Text that leaves out events JSON has breaks P5: --events usage printed nothing in text while --json had them.

Considered.

  • event watch showing everything by default, acp included: the firehose should be one flag away, not the default.
  • A text line for every tool status change: noise.
  • No event for status changes between start and end: bridges would lose in_progress.
  • Text quietly leaving out events that JSON has: what --events chose wouldn’t be what was shown.

5.4 event log --last <n>

--last <n> counts messages sent to the agent (user_message events), and shows from the n-th last one on. --last 0 shows nothing (with --follow, only what comes next).

Why. What is wanted is the latest exchanges, and a turn still running is the one most likely wanted.

Considered.

  • Counting turns (turn_ended): it leaves out a turn still running.

5.5 The log of a running session waits for its transcript

  • A request, logged, is answered once the process’s logger has written everything the process recorded before it was asked, with the note of a gap of skipped records (ADR 10.1) that ends there. It says lost when a file has lost records it hasn’t noted yet (ADR 10.2). The answer comes from the logger’s thread; the event loop doesn’t wait for it (P1). With log = "off" it is answered at once.
  • event log of a running session sends it first, and reads the files once it is answered: what session new --wait, prompt send --wait or event wait has reported is in what it shows. A process that doesn’t answer within 5 s (a stalled disk) is shown as far as it has written, and event log says so on its stderr (P3). --follow waits the same way before its first read.
  • A process that exits waits, before brnr stops listing it and it lets go of its sessions, until its logger has written what it recorded, process_exited last, for 2 s at most. Once it is gone, event log, session list and session resume read its sessions’ transcripts whole, and a resume doesn’t start appending to one before its process_exited. A panic lets go of the process’s sessions as an exit does, before it waits.
  • Then, unlisted and holding no session, it waits for the rest without a time limit, as for the display’s reader in the foreground (ADR 3.5), and exits once it is written. A signal to it (Ctrl-C, kill) gives up on it: the process says on its stderr how much it didn’t write (brnr: process 4466: 1234 bytes of records not written: the disk didn't take them), and exits as it would have.
  • A process that closes a session (session close, session resume --take-over, its idle time running out, the editor) holds its lock, and answers the close, until its logger has written what it recorded of the session, session_closed last, for 2 s at most, as on exit. So a resume in another process appends after it, and a load there finds its transcript (ADR 5.6). The event loop doesn’t wait for it (P1). Past 2 s (a stalled disk) the session is let go of all the same, and its last records can come after the next process’s, as they can after an exit. Opened in the same process again meanwhile, it keeps its lock there, and the close is still answered once its records are written.
  • A session whose open the agent fails, after the process recorded something of it, is held the same way until that is written: a load’s replay (ADR 5.6), or the close’s records, when the open took back the lock of a session closing there. A bridge’s open (session resume --pid) is answered with its error once they are; a start that fails lets go of the session with its exit’s records, at the latest. A fork into a session the process couldn’t lock has nothing to let go of: it took no lock, and opened no transcript.
  • Until then the process’s status lists the session in closing, so that brnr can tell it from one the process is opening. event log of it sends logged to that process and reads the transcript once it is answered, session_closed in it, as for a running session. session resume and session delete of it fail, saying it is closing in that process and free once its records are written, 2 s at most.
  • What a process killed with SIGKILL hadn’t written is lost: session list can lack the session, and session resume of it without an agent fails with no agent: give one after -- or set agent in the profile (ADR 3.11). That can’t be helped without writing on the session’s own thread.

Why. A process’s records are written by a thread of their own (src/log.rs), so the session never waits for the disk (P1, ADR 10.1). Read as the files were, a transcript could lack what a command had just seen: session new --wait printed the turn’s reply, and event log right after didn’t have the turn, or failed because the events file wasn’t there yet, and nothing said so (P3). On CI’s Linux runners about 1 in 15 such waits returned before the turn was written. A process that exited also stopped being listed, and let go of its sessions, before process_exited was written.

Consequences.

  • event log of a running session costs a round trip to its process, and up to 5 s when the disk is stalled.
  • Tests that read a transcript, or kill a process whose transcript they need, wait for it the same way, by running brnr event log.
  • A headless process whose disk stalls stays after it stopped being listed, holding no session and no agent, only its queue (64 MiB at most, ADR 10.1), until the disk takes it or a signal ends it (kill). Ended so, its host log can lack process_exited, and brnr doctor lists it as a death nothing recorded (ADR 3.7).

Considered.

  • Answering session new --wait and prompt send --wait only once their turn is written: every waiting command would wait for the disk, and a stalled one would stall them, which ADR 10.1 rules out for observers.
  • Writing records on the event loop: the session would wait for the disk (P1, ADR 10.1).
  • Waiting in the tests only (for a record to appear in the file): every user’s script that runs event log after --wait would have the same race.
  • A time limit on exit (10 s, 30 s): a headless process would drop records with nobody told, its stderr unwatched and its host log, the record, on the stalled disk (P3), to free a process that by then holds nothing. A limit the user can’t see is a guess (P4); the user’s signal is the explicit choice.

5.6 A load’s history is recorded once

  • session resume tells the process whether brnr has a transcript of the session: one brnr’s index lists as inactive, or one another process is serving (--take-over). That is the one thing brnr knows about the history it has; it doesn’t compare the replay with the transcript to guess what is missing (P4).
  • “brnr has a transcript of the session” means in any project folder, whatever cwd the session is resumed in, for a start’s load as for an editor’s and a bridge’s (below): an id is one session, and its files in every folder are its transcript (ADR 5.1, #121).
  • A transcript is an events file holding a record of the session beyond its openings. One holding only session_opened records, as a failed load leaves, isn’t one: the next load, a start’s, a bridge’s or an editor’s, records the history. brnr reads its own file for this when the load is asked for, and deletes nothing; session list still lists the file, which names the session’s cwd and agent.
  • With a transcript, the replay is neither recorded, raw or as events, nor shown; what it says the session is now (title, mode, config options, commands) is kept. Loading the session again and again adds nothing to the transcript but each load’s history event.
  • Without one, the replay is taken in as live updates would be: recorded in the raw file, and made into events (agent_message, tool_call, session_changed, …), each with "replayed": true. The user’s messages, which live are the prompts brnr sent, come only from the replay here, as user_message events with replayed and without by or a message id. Text shows them as (replayed) user: …. A tool call the history left unfinished isn’t counted as running (session status). The next load finds the transcript, and doesn’t record the history again.
  • Either way, once the agent answers the load, a history event says how many updates the agent replayed and whether they were recorded: history: 3 updates replayed by the agent, recorded, or …, not recorded: brnr's transcript has the session. Its loads is 1, but for an editor’s loads that overlap (below). recorded says whether the replay was taken into the transcript at all; recorded_updates, always there, how many of the updates are in it: all of them when recorded, none when not, but for a session closed while its load was unanswered (below), where text says history: 4 updates replayed by the agent, 3 recorded.
  • session/resume replays nothing, and makes no history event.
  • An editor’s session/load through brnr acp follows the same rule: its replay is recorded only when brnr has no transcript of the session, in any folder, and a history event says either way. The editor gets the replay as the agent sent it (ADR 3.1): only what brnr records and emits follows the rule.
  • A bridge’s load (session resume --pid, ADR 8.1) follows it too, and looks in any folder, whatever the cwd it is resumed in.
  • An editor’s session/prompt of a session not open in its process (one it never loaded or created there, a mistyped id) opens the session pending: its turn is tracked, but its transcript isn’t opened, and what is recorded of it goes to the host log, until the agent says anything of the session (a notification or a request naming it, or a success answer to the prompt, a load or a resume); then the transcript opens, before that line is recorded. An editor’s load of a pending session opens its transcript too, so that its replay is recorded as a load of a session not open here is, but the session stays pending. A pending session closes again once the agent has failed everything the editor asked of it, its prompts, loads and resumes, having said nothing of it: the last failure closes it, as one a failed load opened closes, with no session_closed, as it never opened, and its lock goes (#331).
  • A session a process has served, open or closed since, has its transcript in that process, for an editor’s load and a bridge’s alike, whether or not the logger, which writes behind (ADR 5.5), has written it yet, unless the process logs nothing (log = "off"). The process remembers each session it has handed the logger a record of beyond its openings, for its events file, as the disk has it once that is written. So loading it again there records nothing of the replay again.
  • A load that failed after the agent replayed so leaves a transcript of what it recorded, which is all the replay, the agent message it ended with too (P3). One that failed before the agent replayed, or a session closed with all its records, its close’s too, skipped by a disk too slow for them (ADR 10.1), leaves only openings, and the next load, in that process too, records the history.
  • The editor’s loads of a session that overlap (one sent before the agent has answered the one before) all reach the agent, and share one replay, as which load an update is for can’t be told (P4). Until the last of them is answered, every update either replays is taken as the replay is: recorded and marked replayed, or not, as the first load found the transcript. Then one history event says how many updates they replayed between them, whether they were recorded, and how many loads it covers: history: 10 updates replayed by the agent in 2 loads, recorded. A recorded replay can so hold the history once per load, each copy marked; nothing is left out (P3). A load that fails counts as answered. If none of them succeeds, there is no history event, as for a single load that fails, and a session they opened closes again, unless a session/resume of it succeeded meanwhile.
  • The editor’s session/close of a session whose load is unanswered closes it once the agent answers the close, with its session_closed, as any close does. If the agent then answers the load with success, its last answer wins: the session is open in the editor’s process again, and a session_reopened, by editor, says so (session reopened (editor): its load was answered after its close). brnr takes the agent’s last answer as how the session is, and doesn’t guess otherwise (P4). Unless another process took the session between the close and the answer: then it isn’t served here (ADR 3.9), with no session_reopened and no history, as for a load that fails.
  • The load’s replay is kept through the close: what the agent replays meanwhile is counted, and goes to the host log, as the session’s files are closed. Once the load succeeds, the replay goes on in the reopened session, and its history, after the session_reopened, has all the updates and, in recorded_updates, those the transcript has. A load that fails after the close leaves the session closed, with no history, as any failed load. Of loads that overlap, one that succeeded before the close has its history once the last is answered, with the session still closed, in the host log. A load of the session sent after the close, while one before it is unanswered, joins that replay, as overlapping loads do.

Why. An agent without session/resume resumes a session with session/load, replaying its history as session/updates before it answers. Leaving the whole replay out assumes brnr’s transcript has the history. That fails for a session brnr has never seen (session list with an agent named lists the agent’s own, and session resume takes any of them, ADR 3.11), and for one whose transcript is gone: event log then has the load’s request and answer, none of the conversation, and nothing says it is missing (P3, #60).

Consequences.

  • The transcript of a session first loaded by brnr starts with its history, as the agent replayed it. Those records are as new as the load, and carry this process’s ids.
  • An agent that serves a session it was never asked to create or load has that session’s first prompt, the user_message and the request, in the host log, not the transcript, which starts with what the agent said. A conforming agent fails such a prompt: opening the transcript at once would leave a file of the session’s turn, so that a load of it later, as an editor that prompts before it loads does, records nothing of its history; and a mistyped id would be an open session, holding its lock, until the process exits (#331).
  • brnr’s transcript is complete only for what happened through brnr: turns taken in the agent’s own client, or while a profile had log = "off" (ADR 6.1), or records a slow disk skipped (ADR 5.1), aren’t in it, and a load of a session brnr has a transcript of doesn’t add them. The history event’s recorded: false says that the replay was left out, so that what is missing is known to be missing.
  • A session resumed in another cwd (session resume --cwd) starts a file in that folder, and its load records nothing of the replay there: the history is in the file in the first folder. event log reads both (ADR 5.1), so it shows the history, and the history event says the replay wasn’t recorded.
  • Deleting a session’s transcript makes its next load record the history again, except in a process that served the session before the delete: that process remembers what it recorded of the session until it exits.
  • A record the logger was handed and the disk then failed to take (a full disk) still counts in its process, which can’t tell: until it exits, a load there records nothing of the history, where another process’s would. The failed write is noted in the file (P3).

Considered.

  • Always recording the replay, marked: every load of a session would add its whole history to the transcript again.
  • Recording only what the transcript lacks, matching the replay against it: ACP’s message ids are optional, and brnr’s own records of a turn (an injected message’s echo, a steer) aren’t what an agent replays. A match would be a guess (P4).
  • Recording the raw replay only, without events: event log reads events, so the history still wouldn’t be in it.
  • Not creating the events file until the load succeeds (#191): the agent replays before it answers, so the load’s raw ACP and its replay would be held in memory until then (P6), or written elsewhere and moved; and the files failed loads have left already would still keep their history out.
  • Removing, or marking, the file a failed load leaves: removing it deletes the raw record of the failed load (P5), and either way the files already left stay as they are.

5.7 Bridges

  • A bridge is any process that speaks brnr’s JSON-lines protocol. Requests (command in src/host/control.rs): status, send, cancel, queue (with show), subscribe, pending (answered with pending and elicitations, ADR 4.5), allow and reject {session, request, always?, option_id?}, elicitation {session, request, action, content?} (ADR 4.5), set_config (taking mode, model, thought_level and options, ADR 6.2), new and resume (a session in the running process, as session new --pid and session resume --pid), fork, close, stop, logged (ADR 5.5) and was_cut_off (ADR 10.2). Those about a session name it by its exact id. A cmd the process doesn’t have, or a field of one, is refused, command_unknown (ADR 8.8). Events: as ADR 5.1, 5.2 and 5.3 list them, each naming its session; process_exited is the process’s. subscribe and a profile bridge’s events take events only: a note’s name is refused, and fails the profile (ADR 5.9). subscribe leaves out an event the process doesn’t have, and names it in unknown_events, so that a newer brnr’s bridge gets the events an older process has; a profile that names one fails (ADR 8.8).
  • A request line that isn’t valid UTF-8 is answered with an error, and the bridge stays (#15).
  • A started bridge’s stderr goes to the host log (bridge_stderr, its peer the bridge’s label, as bridge_started and bridge_exited name it), a line at a time, decoded lossily: a line that isn’t valid UTF-8 doesn’t stop the reading, which would leave the bridge’s next write to die of SIGPIPE (#160). A line longer than 64 KiB goes in pieces of that size, as the agent’s stderr does (ADR 10.3).
  • Two transports: a connection to the process’s control socket ($BRNR_DIR/<pid>.sock, which only the user can open, P13), or a child the process starts from the profile’s bridges, whose stdout carries its requests and whose stdin carries events.
  • A started bridge is subscribed from birth (every event but acp, or the bridge’s events in the profile), so it sees everything from the process’s start. Its environment has BRNR_PID and BRNR_SOCKET: a process’s sessions come and go, and it has none when its bridges start.
  • A started bridge ends when its process exits. Its stdout closing only means it has no more requests; it keeps getting events. When the brnr process stops, the bridge gets the last events (process_exited), its stdin closes (it should exit then), and one still running 2 s later (BRIDGE_EXIT) gets SIGTERM: time for a bridge to act on process_exited, as event notify does.
  • A bridge has to keep reading: one 16 MiB behind is cut off (ADR 10.1).
  • On an editor’s session, a bridge’s actions are experimental, as the CLI’s are (ADR 7.1). stop isn’t one: stopping the process is process management, never experimental and not refused in strict mode.
  • From 1.0.0 the compatibility promise covers the protocol as a started bridge speaks it, on its stdin and stdout. The control socket is private, in the runtime directory, and not an interface: a client that connects to it directly has no promise (ADR 8.4).

Why. A bridge connects brnr’s sessions to something else: Slack, push notifications, a phone (F3). What another tool can do stays out of brnr (F5), so brnr gives a protocol, not integrations. A bridge that only listens must keep getting events: one that ran exec cat > file, and so closed its stdout, was dropped in 4 ms.

Considered.

  • A started bridge ending when its stdout closes: one that only listens would have to keep its stdout open.
  • Started bridges getting no events on stdin until they subscribe: a change to the protocol, and they would miss the process’s start.

5.8 event notify

  • brnr event notify (<session> | --pid <pid>) [--events …] -- <command> [args...] runs the command once per event. The default events are permission_request, elicitation_request, turn_ended and process_exited; --events works as for event watch (ADR 5.3), where default means these four.
  • The event is in the command’s environment (BRNR_EVENT, BRNR_TEXT, BRNR_TITLE, BRNR_MESSAGE with the session’s last agent message, BRNR_SESSION, BRNR_REQUEST, a permission request’s or an elicitation’s handle, BRNR_PID) and, whole, as JSON on its stdin. Nothing goes on its command line, so the agent’s text can’t become arguments (P8). The text, title and message are escaped as event watch shows them and cut at 32 KiB, so the command always starts.
  • Commands run one at a time, in order, each waited for, in a process group of its own, with their stdout sent to stderr (as a bridge, event notify’s stdout is read by the process as requests). No event is read while one runs, so a command that hangs makes event notify fall behind, and the process cuts it off like any slow peer (ADR 10.1): a started bridge gets SIGTERM, a connection is closed. It exits when the process does, and on a session also when that session closes (session_closed).
  • On the socket, cut off while its command runs, it lets the command finish, then catches up from the transcript and runs the command for each event it missed; one that can’t catch up says what it missed and exits 3 (ADR 10.2).
  • Cut off as a started bridge (SIGTERM, or its stdin ending before process_exited), its connection ending before process_exited otherwise (the process killed), or stopped by SIGHUP, SIGINT or SIGQUIT, event notify stops the command it is running (SIGTERM to its process group, then SIGKILL once it has exited, or 2 s later). It says on its stderr that it was cut off and that no more notifications come (brnr: cut off (SIGTERM); stopped sh (turn_ended); no more notifications), and exits non-zero (P3); --stdin cut off exits 1. A started bridge’s stderr is in the host log (bridge_stderr). On the socket it watches for the connection closing while a command runs, and reads what was sent before it closed, no more than the socket held, to tell the process’s end (process_exited among it) from being cut off.
  • brnr event notify --stdin [--events …] -- <command> reads its events from its stdin, a started bridge’s transport (ADR 5.7), instead of connecting. That is how it runs as a bridge: command = "brnr", args = ["event", "notify", "--stdin", "--", …] in the profile, with no sh -c and no $BRNR_PID, and one subscription. A started bridge isn’t caught up when cut off; one that must not miss events runs brnr event notify <session> -- … on the socket instead (ADR 10.2).

Why. Notifications are what most people want from a bridge: a message when an approval is waiting or a turn has ended. One command that runs any command serves every service, and keeps them out of brnr (F5). Run as sh -c 'exec brnr event notify --pid "$BRNR_PID" -- …', it subscribed on the socket and never read its own stdin, where the process writes the same events from birth: after 16 MiB the process cut it off, and the notifications stopped without a word (P3).

Considered.

  • Shipping scripts for a few services: one command that runs any command covers them all.
  • Running commands concurrently: it would reorder notifications.
  • event notify draining its stdin while subscribed on the socket: two subscriptions for one bridge.
  • event notify reading stdin when it detects it’s a bridge: a guess (P4); the flag says it.
  • Never reading events from stdin, so that event notify behaves the same as a bridge and by hand: with an explicit --stdin the difference is asked for, not hidden, and it is the only option with one subscription per bridge.
  • The process writing to a started bridge’s stdin only once it subscribes: ADR 5.7.

5.9 Events, records and their fields follow one naming scheme

Resolves #151; implemented by #314. #150’s --json shapes, #205’s error codes and #70’s transcript contract take their names from it.

Names:

  • Every name brnr makes in its JSON is snake_case, lowercase ASCII words joined by _: the names of events and records (their event), their fields, the values of a field with a fixed list (by, reason, state, status, owner), and #205’s error codes. Kebab-case is the command line’s, for commands and flags. A handle’s value is the handle (m3, socket#7).

  • Config is TOML, and its names are ADR 6.1’s, which follow ADR 8.1 for #154: snake_case keys, log’s words all, events and off, and a command as command and args, a bridge’s as an MCP server’s.

  • What brnr passes on from ACP keeps ACP’s spelling (P1): the message in an acp event (sessionId), the ACP objects an event carries whole (tool_call in permission_request, options, outcome, schema), and ACP’s values (end_turn, allow_once, in_progress). An acp event’s dir is two parties joined by -> (editor->agent); the agent’s stderr, which has no second party, is agent_stderr.

  • An event or a record is named subject first:

    • for what was said or asked, by the thing: agent_message, tool_call, plan, usage, permission_request, history, acp;
    • for what happened, or became true, by its subject and a past participle or a predicate: turn_ended, session_closed, peer_cut_off, line_too_long; a failure is <subject>_failed, with an error.

    Never a bare verb (exited, send) or the present tense (stopping). The subject is the noun the command line and the ADRs use for the thing, one noun for one thing: process for the brnr process (host stays only in host_id and host_log, its run and its file), session, turn, message, context, peer, bridge, editor, agent, … It is plural only where one record stands for several (records_skipped, events_missed, capabilities_dropped).

Kinds:

  • Every name in an event field is in one namespace, of three kinds, told apart by the list a name is in, not by how it is spelled:
    • events (EVENTS in src/host/control.rs): what the host emits to bridges and records in transcripts (ADR 5.1);
    • notes (NOTES beside it): what brnr adds to a stream of events and the host never emits: records_skipped, the logger’s, in transcripts, and events_missed, a command’s, on its stdout (ADR 10.2);
    • records: the other lines of the events files and the host log, for brnr’s own reading (session_opened, process_started, …).
  • --events takes events and notes, so every name event log --json or event watch --json can print is one it takes, and --events records_skipped alone lists a transcript’s gaps. A note is still shown whatever --events chose (P3). subscribe and a bridge’s events take events only, and refuse a note (P7): the host never sends one. An event the process doesn’t have, subscribe leaves out and names (ADR 8.8).
  • Every line event log --json and event watch --json print has event, ts, host_id and pid; a session’s also has session, and an event its seq. The logger writes them into its notes, as the host does into its events. pid is new on events: the brnr process’s, as --pid, BRNR_PID and every --json have it; host_id stays, to tell runs apart, as pids are reused.
  • Host-log records follow the scheme too, though ADR 8.4 doesn’t cover them: the host log holds events as well, and doctor and the catch-up (ADR 10.2) read it.

Fields:

  • A field means one thing, and has one type, wherever it is: a word isn’t an object somewhere else, an id isn’t an object, text isn’t a word. A name is a count or a list, never both: a count of what is listed elsewhere is <what>_count (acp_count, held_count), and dropped is a list everywhere (ADR 8.2, #150).
  • A thing the commands take as an argument is named by the bare noun, and holds its handle: session, message, request, pid (the brnr process’s) and peer (a connection’s label, a started bridge’s too). Any other id is <thing>_id: host_id (the run), tool_call_id, elicitation_id, option_id (a permission option’s, as the socket’s allow and reject take it, ADR 8.1), scope_request_id, rpc_id (a JSON-RPC message’s id). Any other process’s pid is <whose>_pid (agent_pid, proxy_pid, bridge_pid).
  • by is who acted: editor, agent or control (brnr’s commands, its bridges, and its own timers). Beside it, peer is the connection that asked, where brnr knows one. reason is why, a word from the event’s own list. Text for people is an error’s message (ADR 8.7), never reason. by: agent says the agent ended its own request with $/cancel_request: its permission_resolved or elicitation_resolved has peer and reason null (ADR 4.5, #308).
  • A position is seq, or ends in _seq (first_seq, last_queued_seq). A time is an RFC 3339 time in UTC to the microsecond: ts is the record’s own, any other is named for its moment (since, until, last_active). A duration is in whole seconds, its name with no unit, as ADR 8.1 decides for #154: uptime, turn_elapsed, timeout_left, stop_when_idle. A size is in bytes by the same rule (line_too_long’s limit). A depth is in levels of nesting, and its name says so (line_too_deep’s max_depth), as it is no size.
  • A file brnr writes is <which>_log (events_log, acp_log, host_log); any other file or directory is path. log alone is the profile’s setting (ADR 6.1), never a file.
  • A boolean is an adjective or a past participle (recorded, relayed, answerable), with no is_.

What takes its names from this:

  • #205: an error code is snake_case, subject first, as a record’s name is: session_not_found, session_closing, config_invalid. Its kebab-case examples followed the records’ names, which this replaces. An agent’s JSON-RPC error is ACP’s, its code a number (F1); ADR 8.7 has it whole as rpc_error, beside brnr’s code, agent_failed.
  • #150: --json fields follow these rules: session, never session_id; ids, by, reason, positions, times and files as above. ADR 8.2 settles each concept’s shape.
  • #70: the record heads and the records named here are the names its transcript contract holds to; ADR 5.10 decides what each record promises, and how a format is marked.
  • A name added later, of an event, a note, a record, a field or a value, is made by these rules: #229’s subagent fields, #308’s by: agent.

The renames below are all of them, so that #314 is mechanical: each is made outright, with no alias (P9), and is Breaking: in the changelog. Where ADR 8.1 or 6.1 (#154) names a thing, this follows it, and its renames are #311’s, not in these tables: the durations in --json and the socket’s replies (uptime_seconds, turn_seconds, timeout_seconds), allow’s and reject’s option, and config’s log and command.

Renames

Events (EVENTS). The other 24 keep their names.

OldNew
exitedprocess_exitedthe one bare verb; it is the process’s (ADR 5.1)

Notes (NOTES), new to --events:

OldNew
records-skippedrecords_skipped
events-missedevents_missed

Records in a session’s events file (and, for some, the host log):

OldNew
session-openedsession_opened
send (mode prompt, steer, interrupt)message_accepted
send (mode context)context_accepted
cancelcancel_requested
open-abandonedopen_abandoned
idle-timeoutidle_timed_out
context-attachedcontext_attached
editor-response-droppededitor_response_dropped
steer-refusedsteer_refused
steer-after-turnsteer_after_turn

Records in the host log only (not covered, ADR 8.4):

OldNew
startedprocess_started
stoppingstop_requested
signalsignal_relayed
host-signalsignal_received
panicprocess_panicked
exited (a start abandoned)process_exited
host-stderrprocess_stderr
start-abandonedstart_abandoned
start-failedstart_failed
test-ready-heldtest_ready_held
drop-held-faileddrop_held_failed
display-stoppeddisplay_stopped
bridge-startedbridge_started
bridge-stderrbridge_stderr
bridge-exitedbridge_exited
editor-closed-stdineditor_stdin_closed
editor-stopped-readingeditor_stopped_reading
editor-disconnectededitor_disconnected
editor-cancel-droppededitor_cancel_dropped
editor-request-refusededitor_request_refused
not-sent-to-editoreditor_message_dropped
agent-stdout-endedagent_stdout_ended
capabilities-droppedcapabilities_dropped
lock-failedlock_failed
session-sharedsession_shared
open-failedopen_failed
session-log-failedsession_log_failed
made-privatepath_made_private
peer-droppedpeer_dropped
timeout-failedtimeout_failed

Fields and values, by the new names:

WhereOldNew
every record’s headsession_id, host_pidsession, pid
every event—pid
message_dropped, context_droppedbyreason, its values as they were
session_closedby: close, idle, editorby: control, reason: close; by: control, reason: idle; by: editor, reason: close
session_deletedby: deleteby: control
permission_resolved, elicitation_resolvedby: a peer’s label, timeout, cancelby: control, peer: <label>; by: control, reason: timeout; by: control, reason: cancel; peer and reason null where none
process_exitedstatus, reasonexit_status, error
peer_cut_off, peer_dropped, the was_cut_off replylast_queuedlast_queued_seq
elicitation_request, pending’s elicitations, elicitation show and elicitation requests --jsonmessage, tool_call (an id), scope_requesttext, tool_call_id, scope_request_id
records_skippedacpacp_count; it gains ts, host_id, pid, and session in a session’s file
events_missedafter, untilafter_seq, until_seq; it gains pid
session_openedin the events file cwd, host_log, acp_log; in the host log session_id, file, acp_filein both: session, cwd, events_log, acp_log, host_log, and forked_from for a fork
cancel_requested (a timeout’s)by: timeoutby: control, reason: timeout
context_attachedto: editor-promptto: editor_prompt
steer_refusedanswer (the agent’s response)response
editor_response_dropped, editor_request_refused, editor_message_droppedidrpc_id
editor_cancel_droppedrequest_idrpc_id
editor_request_refused, editor_message_dropped, lock_failed, session_shared, open_failed, session_log_failedsession_idsession
editor_message_droppedreason: "the agent's stdout has ended"reason: agent_stdout_ended
peer_droppedreason: "fell behind"reason: fell_behind
capabilities_droppeddroppedcapabilities
session_log_failedfilepath
process_startedrequest (the start’s)start_request
bridge_started, bridge_stderr, bridge_exitedbridgepeer
bridge_startedpidbridge_pid
bridge_exitedstatus (a code or null)exit_status, as process_exited’s: {code}, {signal} or null
acp’s dir, a raw record’s diragent-stderragent_stderr
the bridge status reply’s sessionssession_id, logsession, events_log
event notify’s environmentBRNR_SESSION_IDBRNR_SESSION
permission requests --json’s options{option, kind}ACP’s options whole, {optionId, name, kind}, as permission show has them (ADR 8.2)

BRNR_EVENT, --events, a bridge’s events, and event wait’s and event notify’s endings use the new names.

Why. At b41a8c5 the 24 events are snake_case, and 35 record names are kebab-case and 6 are one bare word, in the same event field and often the same file. So:

  • event log --json prints records-skipped, which --events refuses, and event watch --json ends with events-missed.
  • Events name the session session; the record heads, the host-log records, the bridge status reply and event notify (BRNR_SESSION_ID) say session_id. Events carry host_id but no pid, which every other --json names the process by.
  • by is a party in user_message and turn_ended (editor, control), a cause in message_dropped (cancel, queue, steer), both in session_closed (idle, editor), and a peer’s label or a timer in permission_resolved (socket#7, timeout).
  • until is a time in records-skipped and a position in events-missed; tool_call is ACP’s object in permission_request and an id in elicitation_request; message is a handle (m3) in message_dropped and the agent’s text in elicitation_request; status is a word in replies and an object in exited; reason is text in exited and peer-dropped and a word nowhere.
  • session-opened names a session’s files host_log and acp_log in the events file, file and acp_file in the host log, and the status reply names one log.

A script that reads event log --json, or a bridge, has to know two spellings, and which field means what in which event (F5, P4). One stream is one vocabulary (P5), and a rule a reader can learn once is fewer concepts (N4). From 1.0.0 events, transcripts and --json are covered (ADR 8.4), and every one of these would wait for 2.0; before it, a rename is made outright (P9). snake_case, because the events, every field and ACP’s values already are, and because jq, Python and Rust read it as a name without quoting (in jq .records-skipped is a subtraction).

Consequences.

  • Every bridge, event notify command and script that reads events changes once, before 1.0.0. The changelog says how, entry by entry.
  • A transcript an older brnr wrote keeps its names, and brnr doesn’t read them (P9), so session list and session resume pass it over. Nothing is lost silently (P3): doctor lists it, and event log of it says an older brnr wrote it. ADR 5.10 marks a transcript’s format, so that is a check of the format, not of a field:
    • A record is an older brnr’s by its head: it has no format (transcript::readable), whatever its fields. Such a record isn’t read anywhere, so a file of them is no transcript to a load either, which records the history (ADR 5.6). A file is listed as one by its first record, or its newest.
    • doctor lists them as info under file formats, transcripts and host logs alike, and passes such a host log over where it looks for a death nothing recorded (ADR 3.7) or for the report’s logs (ADR 11.5): read in this brnr’s names, every one would lack process_exited. A line of one in the report would be (a record in a format this brnr doesn't read, not shown): what an older brnr didn’t redact isn’t shown either.
    • A process doesn’t append to an older brnr’s transcript, nor to any file in a format it doesn’t read (ADR 5.10): ADR 9.2’s rule that went on in a file of the folder before the hash goes, as every such file is an older brnr’s, and what was appended would be read without what came before it. No writer does (log::appends_to, the one test of it, is the check doctor’s file formats makes: a file whose first or newest record is in another format): a session opened where such a file is in the way (one in its cwd’s folder, written there before #314, or a resume of a session brnr has no transcript of) renames that file beside it, <name>.older.jsonl (older-2, … if taken; the raw file <name>.older.acp.jsonl), and starts a file of its own, and the host log’s session_log_moved (session, path, to) says so (P3); doctor still lists the renamed file. An event for a session no process has open (session delete, an editor’s deletion) passes such a file over. A newer brnr’s file is set aside the same, under the same name: older says it is no file of this brnr’s to go on with. Renamed rather than left with the session’s records in the host log, as a refused file is (ADR 9.3): the session then has a transcript, which its next resume finds, and a load records its history in it (ADR 5.6). session delete --purge deletes the files set aside too, as every file of the session’s id (ADR 8.1, N1).
  • The CLI reads the bridge status reply’s sessions in the new names, and session list’s rows of a transcript the same (session, events_log).
  • subscribe’s answer has the process’s pid, beside host_id, so that a command’s events_missed has it as every line does.
  • Text shows who acted as before: the peer if there is one, else by if it isn’t control, else the reason (permission p1 allowed …, by socket#7, session closed (idle), session closed (editor)).
  • A bridge’s events naming a note, which a profile may have now as records-skipped, fails to load.

Considered.

  • kebab-case for everything, as the records and #205’s proposal have it: the events, which bridges use and ADR 8.4 covers, and every field are snake_case already, and kebab-case names aren’t names to jq, Python or Rust.
  • Two spellings on purpose, snake_case for events and kebab-case for notes and records, to tell the kinds apart: the reader would have to know what the spelling means (P4), and a name that moves between kinds, as records_skipped does into --events, would be renamed. The lists say the kind.
  • camelCase, as ACP: brnr’s events have been snake_case from the start (ADR 4.4 kept them so), ACP’s own values are snake_case, and ACP’s names stay inside the ACP objects brnr passes on, so the two never meet in one object.
  • session_id everywhere, as the records and ACP’s sessionId: the events, every --json and the commands’ <session> say session, and more readers know those than the record heads.
  • A kind field, or a prefix (note.records_skipped, host.started): one more field for every reader, when the file and the lists say it.
  • Verb first (end_turn, close_session): reads as a command, and end_turn is ACP’s stop reason. Present tense (turn_end): a noun, read as a thing.
  • agent_exited for exited: its exit_status is the agent’s, but the event is the process’s (ADR 5.1), comes after a panic with no status, and the command line names processes (process list, --pid).
  • Keeping by for both who and why, documented per event: by == "editor" and by == "idle" are answers to two questions, and #308 adds agent.
  • Leaving the host-log names as they are, as ADR 8.4 doesn’t cover them: two rules in one file, which holds events too and is read by doctor and the catch-up.
  • acp_message for acp, history_replayed for history: a thing is named by a noun, and these are short and in every example.
  • One record for peer_dropped and peer_cut_off: the record is written when the peer is cut off, the event once the others have the line that cut it off, which an exit can prevent, and the catch-up reads the record. Two records at two times keep two names.
  • A unit in the names of durations and sizes (_seconds, _bytes): ADR 8.1 decided against it for #154, one rule said once, and this follows it.

5.10 What a transcript promises, and how its format is marked

Resolves #70. ADR 5.1 to 5.6 decide what is recorded and how it is read; this section says what of it 1.x promises (ADR 8.4), and how a reader tells a format it reads from one it doesn’t.

What each stream is for, and what it leaves out:

  • Events (ADR 5.1 to 5.3) are the host’s interpretation of ACP, the one story (P5): what a bridge gets live, what event watch --json and event log --json print, and, as the event of a record, what the events file keeps. They are what scripts and bridges read. They are summaries, not the conversation: agent_message and agent_thought carry the text of the agent’s chunks, whole, and nothing of a chunk that isn’t text (an image, audio, a resource); user_message carries a prompt’s text, other blocks as [image] or [resource <uri>]; tool_call and tool_progress carry a call’s id, title, kind, status and locations, not its content (a diff, a terminal’s output) nor its raw input and output, and streamed output is no event (ADR 5.3). permission_request carries ACP’s tool_call and options whole. No event carries what ADR 9.1 redacts; the agent’s own text is as the agent sent it, a secret in it included.
  • Text (event watch, event log, the foreground) is the events shown for people, one line each, escaped (src/render.rs). It has nothing the events don’t (P5), and its wording isn’t covered (ADR 8.4).
  • Raw ACP (<id>.acp.jsonl, acp events) is every ACP message of the session, as it went, in order: each line embedded as it was (raw, a string, for one that wasn’t JSON), but for what ADR 9.1 redacts and a line too long to read (ADR 10.3). It is what checks the interpretation, and has what the events leave out. log = "events" leaves it out.
  • The conversation is the agent’s (P2): what a resume or a load gives back is what the agent keeps. brnr’s transcript is a record of what happened through brnr, not a history to restore: it isn’t replayed to an agent or an editor (ADR 5.1). What brnr reads back from it to resume a session is the session’s id, cwd, profile and agent (ADR 3.11).
  • The host log is the process’s own record (ADR 5.1), for doctor and the catch-up (ADR 10.2), and isn’t covered (ADR 8.4). Nothing a covered command reads of a session comes from it: session_opened names the profile and agent in the events file too.

What is known to be missing, and how:

  • Records a slow disk skipped, or a failed write lost: a records_skipped note where they would have been (ADR 5.1, ADR 10.1).
  • A replay a load left out, as the transcript had the history: the history event’s recorded: false; one recorded is replayed (ADR 5.6).
  • Turns taken in the agent’s own client, or under log = "off": not known, as brnr didn’t see them (ADR 5.6). event log of a session open in a process that logs nothing says so.
  • Records a process killed with SIGKILL hadn’t written: not known (ADR 5.5); the file ends where its writes ended, partway through a line or not, and is read to its last whole record (ADR 5.1).

The format:

  • Every record’s head starts with format, a number: {"format":1,"ts":…, "host_id":…,"pid":…,"proxy_pid":…,"agent_pid":…[,"session":…],…}, in the events files, the raw ACP files and the host logs alike, and in the record session delete writes (ADR 8.1). It is the format of that record, not of its file: a file is appended to by every process that serves the session, of whatever brnr, and is read a record at a time, backwards too (ADR 5.1).
  • Format 1 is ADR 5.1’s and 5.9’s: a record a JSON object on a line of its own; its head as above, ts an RFC 3339 time in UTC to the microsecond, always that wide, so that records are merged by comparing it as a string (ADR 5.1); then event, an event as a bridge got it, a note or a record (ADR 5.9), or, for an ACP message, seq where it has one, dir and msg (or raw). session_opened names session, cwd, profile, agent (the command the process ran, as a profile’s agent and the socket’s status have it, ADR 6.1, ADR 8.2), events_log, acp_log, host_log and forked_from for a fork. Where the files are is ADR 3.9’s and 9.2’s.
  • The format stays 1 for all of 1.x. What a 1.x release may add to it, as ADR 8.4 allows (a field, an event, a record), is still format 1, and a reader passes over what it doesn’t know. What a format-1 reader couldn’t read (a field renamed, removed or of another type, another head, another ts) is a new format, and waits for a major release.
  • A 1.x brnr reads format 1, whichever 1.x wrote it: event log, session list, session resume and a load’s “brnr has a transcript of the session” (ADR 5.6), as a file mixing records of several 1.x releases. doctor and the catch-up read the host logs by the same rule.
  • A record in a format brnr doesn’t read, without format (an older brnr’s, before 1.0) or with another (a newer brnr’s), isn’t read, and nothing goes without a word (P3):
    • event log shows the records of the file it can read and says, once per file, <file>: records in format 2; this brnr reads format 1, not shown (ADR 5.10), or records an older brnr wrote, before transcripts had a format. Of a session none of whose files it can read, it fails, saying so.
    • session list passes over a file without a record it can read, and a file whose newest record is in another format: where the session was last served is in a record it can’t read, and it doesn’t guess from an older one (P4). session resume of such a session says which files it doesn’t read, on stderr, and resumes the id as one brnr doesn’t know (ADR 3.11).
    • A load counts only records it can read as a transcript (ADR 5.6): a file of none records the history.
    • doctor lists, as info under file formats, every transcript and host log whose first or newest record is in another format.
    • The catch-up of a process writing another format fails, saying so, and the command says what it missed (ADR 10.2).
  • Whether a file has records in another format, for session list, session resume, doctor and whether brnr appends to it (ADR 5.9’s log::appends_to), is told by its first and newest records, not by reading every record. brnr appends only to a file whose first and newest records it reads, and one process serves a session at a time (ADR 3.9): a file a 1.x brnr wrote changes format only at its end, where a newer brnr went on with it, and is then set aside (below). A record in another format between records of this brnr’s is no record a brnr appended after them; a reader that reads every record (event log, the catch-up) says it all the same, and session list takes the file’s newest record, one it reads, guessing nothing (P4).
  • brnr doesn’t migrate or rewrite a file in another format (ADR 5.1, P3), nor keep a reader for one before 1.0 (P9). A major release that changes the format decides whether it reads format 1 too.

Identity: one session id is one session, whatever the agent, the folder, the process or the file (ADR 3.2, ADR 9.2): one lock (sessions/<name>.lock, ADR 3.9), its files in every project folder read as one (ADR 5.1), every record naming it in session, and every command taking it exact. A process is pid with host_id, its run, as pids are reused (ADR 5.9). An id is not scoped by the agent: two agents that gave one id would share a lock and a transcript, as ADR 9.2 says of any one id.

Bridges: a bridge gets events, not records, and the format is the files’. What a started bridge gets is held to ADR 8.4’s rule within a major (fields and events are added, never renamed or removed, and a bridge passes over what it doesn’t know); which brnr it talks to is #149’s to say.

Why. A record must say what it is to be read safely. Before this, a reader knew an older brnr’s record only by a field (session_id, ADR 5.9): that tells one format from one before it, needs a new rule for every change, and reads a newer brnr’s records as this brnr’s, a renamed field read as a missing one, a session resumed in the wrong cwd or with no agent, without a word (P3, P4). A number in every head is the one check, for any format, older or newer. In every record, as a file is appended to by every brnr that serves the session in its format (each 1.x, and a newer major that reads format 1), and read a record at a time: the last record backwards, the catch-up by position, a deletion’s record that no process wrote. session resume took the profile and agent from the host log, which ADR 8.4 doesn’t cover and which a user can prune: pruning ~/.brnr/hosts made a resume fail with no agent (#70). Named in session_opened, they are in the transcript, which is covered.

Consequences.

  • Each record is 11 bytes longer.
  • A file written before this has no format, and isn’t read (P9): doctor lists it; ADR 5.9’s check by field goes.
  • A session downgraded from a newer brnr, its newest records in a newer format, is no session to session list here; event log shows what of it this brnr can read. Opened here, it is set aside, <name>.older.jsonl, and starts a file of this brnr’s (ADR 5.9’s log::appends_to).
  • The fixtures in tests/fixtures/transcripts are format 1 as 1.0 writes it, frozen: every 1.x is tested against them.

Considered.

  • A marker per segment, on session_opened: fewer bytes, but a record read alone (the last, backwards; one the catch-up finds by position; a deletion’s) would need its segment’s opening found first.
  • A first line per file: a file is appended to by several processes and releases, and its first line says nothing of what came after.
  • brnr’s version in the head: a reader would need a table from versions to formats; which brnr a process is, is #149’s.
  • Keeping the field check (session_id) and adding one per change: a rule per format, and a newer brnr’s records read as this one’s.
  • Reading what can be read of a record in another format: a renamed field read as missing is a guess (P4).
  • session list taking the newest record it can read, in a file a newer brnr went on with: it would show, and resume, where the session was before the newer brnr served it, and say nothing.
  • The profile and agent from the host log, as before: a resume would depend on a file that isn’t covered and can be pruned.
  • A session id scoped by its agent: the agent’s command changes with its path and version, and the same session would become two (ADR 3.2).
  • Migrating older files to format 1: brnr doesn’t rewrite what it has written (ADR 5.1, P9).

Tests

Run cargo test --release adr_0005_, and the tests of other topics named under a section by their names. Named claims, by section:

  • 5.1: tests/headless.rs: adr_0005_transcripts_are_two_files, adr_0005_log_events_leaves_out_the_raw_acp, adr_0005_a_transcript_cut_short_is_still_its_sessions, adr_0010_a_copied_open_request_has_no_position (the copied request has no seq); tests/cli.rs: adr_0008_delete_keeps_the_transcript (session_deleted has a null host_id and pid, and no seq), adr_0005_log_shows_the_conversation, adr_0005_log_merges_the_raw_acp_in_time, adr_0005_log_reads_an_inactive_session, adr_0005_log_follows_until_the_host_exits, adr_0005_log_follows_the_raw_acp_too, adr_0005_session_changed_says_what_changed, adr_0005_closing_sessions_closes_their_files; src/log.rs: adr_0005_a_closed_session_has_its_records_and_then_no_file; src/ctl/ownership.rs: adr_0005_a_session_without_a_transcript_has_none_to_read; src/transcript.rs: adr_0005_the_first_and_last_records_are_ones_brnr_can_read, adr_0005_the_end_of_a_file_is_its_last_lines, adr_0005_a_record_is_the_event_watch_showed, adr_0005_a_sessions_files_are_read_merged_as_they_grow, adr_0005_a_sessions_files_in_every_folder_are_read_as_one; one session’s files in two folders read as one transcript (#121): tests/cli.rs: adr_0005_log_reads_a_sessions_files_in_every_folder_as_one (text, --json, --events acp, --last, and one session list row), and, for its session resume, ADR 3.11’s adr_0003_resume_takes_the_newest_records_cwd_agent_and_profile.
  • 5.2: tests/headless.rs: adr_0005_held_messages_are_reported_on_exit, adr_0005_editor_close_is_an_event, adr_0005_a_failed_load_drops_its_held_context; tests/cli.rs: adr_0005_send_wait_on_a_dropped_message, adr_0005_queue_lists_and_drops, adr_0005_close_ends_what_follows_the_session, adr_0005_idle_close_is_an_event, adr_0005_dropped_context_is_an_event.
  • 5.3: tests/cli.rs: adr_0005_every_event_chosen_is_shown_in_text, adr_0005_log_shows_only_the_events_asked_for, adr_0005_thoughts_are_shown_when_asked, adr_0005_watch_is_readable_by_default, adr_0005_a_tool_call_again_updates_the_one_running; src/render.rs: adr_0005_every_event_has_a_line, adr_0005_lines_of_the_quiet_and_new_events.
  • 5.4: tests/cli.rs: adr_0005_last_counts_user_messages_including_an_unfinished_turn.
  • 5.5: tests/headless.rs: adr_0005_an_exit_is_written_before_the_process_goes, adr_0005_a_signal_gives_up_on_a_stalled_disk_at_exit, adr_0005_a_foreground_exit_given_up_on_says_what_it_didnt_write, adr_0005_a_panic_lets_go_of_its_sessions_before_it_waits, adr_0005_a_close_is_written_before_the_session_is_resumed, adr_0005_a_take_over_is_written_before_the_session_is_resumed, adr_0005_a_last_session_closed_is_written_before_it_is_resumed, adr_0005_a_take_over_finds_the_transcript_it_continues, adr_0005_a_close_waits_for_a_stalled_disk_2_s_at_most, adr_0005_a_close_resumed_in_its_process_is_answered_once_written, adr_0005_a_closing_session_is_read_once_written_and_said_to_be_closing, adr_0005_a_failed_load_is_written_before_the_session_is_resumed, adr_0005_a_start_whose_load_failed_is_written_before_the_session_is_resumed, adr_0005_an_editors_failed_resume_holds_its_lock_until_written, adr_0005_an_editors_failed_load_holds_its_lock_until_written; tests/cli.rs: adr_0005_log_shows_what_the_process_has_recorded; src/host/sessions.rs: adr_0005_nothing_is_let_go_of_without_a_lock_or_an_answer. That a session closing in its process is said to be closing, not opening, by every command that refuses it is ADR 3.9’s adr_0003_the_lock_decides_and_closing_comes_before_opening and adr_0003_each_place_is_refused_in_the_same_words (src/ctl/ownership.rs).
  • 5.6: tests/cli.rs: adr_0005_a_first_load_records_the_replayed_history, adr_0005_a_load_without_the_transcript_records_the_history, adr_0005_a_load_of_an_empty_history_says_so, adr_0005_a_bridges_load_finds_the_transcript_in_another_folder, adr_0005_a_load_in_another_cwd_leaves_the_history_in_the_log (#121’s trace: session resume --cwd records none of the replay, and event log shows the history from the first folder), adr_0005_a_load_after_a_failed_load_records_the_history, adr_0005_a_bridges_load_after_a_failed_load_records_the_history; tests/headless.rs: adr_0005_an_editors_load_records_the_history_only_without_a_transcript, adr_0005_an_editors_load_of_a_session_open_here_records_nothing_again, adr_0005_overlapping_loads_in_an_editor_have_one_history, adr_0005_a_failed_load_leaves_a_resumed_session_open, adr_0005_a_load_answered_after_its_close_reopens_the_session, adr_0005_a_loads_history_is_counted_across_its_sessions_close, adr_0005_a_load_that_fails_after_its_sessions_close_has_no_history, adr_0005_overlapping_loads_closed_meanwhile_have_one_history, adr_0005_a_bridges_load_of_a_session_served_here_records_nothing_again, adr_0005_an_editors_load_of_a_session_served_here_records_nothing_again, adr_0005_an_editors_load_after_a_failed_load_records_the_history, adr_0005_a_load_that_replays_and_fails_counts_its_replay, adr_0005_an_editors_failed_load_records_its_last_replayed_message, adr_0005_a_bridges_failed_load_records_its_last_replayed_message, adr_0005_a_starts_failed_load_records_its_last_replayed_message, adr_0005_a_session_closed_with_nothing_recorded_is_no_transcript, adr_0005_an_editors_prompt_the_agent_has_no_session_for_opens_nothing, adr_0005_an_editors_prompt_the_agent_serves_opens_its_session; src/host/sessions.rs: adr_0005_a_prompted_session_outlasts_a_failed_load_while_its_turn_runs, adr_0005_a_prompted_session_is_held_until_its_resume_is_answered; src/transcript.rs: adr_0005_only_openings_are_no_transcript; src/log.rs: adr_0005_a_record_beyond_the_opening_counts_at_once; src/host/sessions.rs: adr_0005_an_editors_failed_load_closes_the_session_it_opened, adr_0005_a_replay_outlasts_its_sessions_close_until_its_last_load. That a session brnr has a transcript of keeps the replay out of it however often it loads, with a history event each time, is ADR 3.11’s adr_0003_resume_by_loading_keeps_the_replay_out_of_the_transcript (tests/cli.rs).
  • 5.7: tests/security.rs: adr_0005_a_bridge_gets_no_raw_acp_unless_it_asks; tests/headless.rs: adr_0005_bad_request_line_is_answered, adr_0005_a_bridge_whose_stderr_isnt_utf8_carries_on; tests/cli.rs: adr_0005_a_bridge_that_closes_its_stdout_gets_events; tests/chaos.rs: adr_0005_killed_bridge_mid_turn_leaves_owner_and_lock_intact.
  • 5.8: tests/cli.rs: adr_0005_notify_runs_a_command_per_event, adr_0005_notify_reads_events_as_watch_does, adr_0005_notify_works_as_a_bridge, adr_0005_notify_reads_stdin_as_a_bridge, adr_0005_notify_stdin_ends_with_its_input, adr_0005_notify_fails_when_cut_off, adr_0005_notify_cut_off_as_a_bridge_stops_its_command, adr_0005_notify_stopped_stops_its_command, adr_0005_notify_cuts_what_the_environment_cant_hold.
  • 5.9: tests/cli.rs: adr_0005_every_line_printed_is_named_and_placed_alike (event log --json and event watch --json print snake_case names, each one --events takes, and every line has ts, host_id and pid), adr_0005_a_note_is_taken_by_events_and_refused_by_subscribe, adr_0005_who_acted_and_why_are_by_peer_and_reason (session_closed, message_dropped, and permission_resolved answered by a peer, a cancel and the timeout), adr_0005_a_transcript_in_another_format_isnt_read (5.10’s), adr_0005_brnr_doesnt_append_to_an_older_brnrs_transcript (set aside by a resume, an older brnr’s and a newer one’s, passed over by session delete), and adr_0005_notify_reads_stdin_as_a_bridge (BRNR_SESSION, and BRNR_EVENT=process_exited at the end); tests/headless.rs: adr_0005_a_sessions_opening_is_the_same_in_both_files, adr_0005_an_editors_delete_passes_an_older_transcript_over, and adr_0010_a_stalled_disk_skips_records_and_says_so (--events records_skipped shows the one gap, with session, ts, host_id and pid); src/log.rs: adr_0005_a_gap_note_has_the_fields_of_an_event.
  • 5.10: the fixtures in tests/fixtures/transcripts, format 1 as 1.0 writes it, frozen; tests/cli.rs: adr_0005_every_record_brnr_writes_has_its_format (events, raw ACP, the host log and a deletion’s record; session_opened’s profile and agent), adr_0005_a_format_1_transcript_is_read_by_every_1x_brnr (session list, event log, its raw ACP, doctor, and session resume from the transcript alone, with no host log, its load’s replay not recorded), adr_0005_a_transcript_in_another_format_isnt_read (an older brnr’s without format, format 2, and a file a newer brnr went on with: session list, event log, session resume and doctor), adr_0005_a_record_in_another_format_amid_a_file_is_said (a format-2 record between format-1 ones: event log says it, session list lists the file), adr_0005_a_transcript_cut_short_is_read_to_its_last_whole_record (partial writes: a broken line and a cut end, and a resume appending on a line of its own), adr_0005_a_transcript_of_openings_only_gets_the_history (missing history: the next load records it); src/transcript.rs: adr_0005_a_record_is_read_by_its_format. The replay rules are 5.6’s tests.

6. Settings and profiles

Draft 2026-10-20, 6.5 2026-10-27. Implemented. Factor: F3 (ADR 1). Brings together former ADRs 33, 58, 28, 31 and 32 (docs/adr/README.md maps them).

How a brnr process is set up: the profiles in config.toml, a start’s flags over its profile, the agent’s mode, model and config options, MCP servers for headless sessions, files and images in a message, and reading the profiles without the file. These are what brnr adds around ACP so that a headless session can run without an editor (F3), with each setting’s role in the config itself.

6.1 Profiles, and a start’s flags over them

A profile has three parts, by role (P7, P12). It is read on the machine that runs the command, and holds no routing: --remote on the command line is the one way to another machine (ADR 12.2).

A profile looks like this:

[profiles.work]                     # every process of the profile
agent = ["brnr-claude-adapter"]
log = "all"                         # "events", or "off" (ADR 5.1)
strict = false                      # stable ACP only (ADR 2.1)

[[profiles.work.bridges]]
command = "brnr"
args = ["event", "notify", "--stdin", "--",
        "sh", "-c", "terminal-notifier -title \"$BRNR_TITLE\" -message \"$BRNR_TEXT\""]

[profiles.work.headless]            # brnr session new and session resume
cwd = "~/work/project"
mode = "plan"
model = "opus"
thought_level = "high"
options = { effort = "high" }       # config options by id
response_timeout = 600
stop_when_idle = 600
auth = "api-key"

[[profiles.work.headless.mcp_servers]]
name = "github"
command = "github-mcp-server"
args = ["stdio"]
env = { GITHUB_TOKEN = "…" }

[profiles.work.editor]              # brnr acp
experimental = ["send", "permission"] # actions on the editor's session (ADR 7.1)
client_capabilities = ["fs"]        # "fs", "terminal" (ADR 2.7)
echo_as = "tool_call"               # or "user_message_chunk" (ADR 7.2)
features = ["shared_sessions"]      # process management (ADR 3.10)
  • At the top, what every process of the profile uses: agent, log, strict, bridges.
  • Under headless, what only brnr session new and brnr session resume use: cwd, mode, model, thought_level, options, response_timeout, stop_when_idle, auth and mcp_servers (ADR 3.8, 4.5, 4.7, 6.2, 6.3). response_timeout is the one timeout for the user’s responses, approvals and elicitations alike (ADR 4.5).
  • Under editor, what only brnr acp uses: experimental (ADR 7.1), client_capabilities (ADR 2.7), echo_as (ADR 7.2) and features (ADR 3.10). The three lists default empty; echo_as defaults to "tool_call".
  • A key in the wrong part, an unknown key or name, a headless config key, and the flat layout fail to load (P7, P9). brnr doctor says which and where.
  • Outside the profiles, at the top of the file, what every process uses whatever its profile: retention = <s>, the age past which each process prunes transcripts and host logs as it starts (ADR 9.5). It is the state directory’s, which every profile shares.

One name, one meaning, one spelling in config too (#154, ADR 8.1):

  • log takes strings only: "all" (the default), "events" or "off". "off" replaces false, and true and false fail to load, as layout errors do: brnr doctor names the profile and the value.
  • A command in config is one shape, a program and its arguments: command, a string, and args, a list, with env where it takes one. An MCP server keeps this form, which is ACP’s McpServerStdio (F1, ADR 6.3), and a bridge takes it too, in place of its argv list: command = "brnr", args = ["event", "notify", "--stdin", "--", …]. A list command fails to load, saying that its arguments go in args. agent stays a list, the agent’s argument vector, as -- <agent> [args...] is on the command line: another name, with one meaning.
  • A duration is in whole seconds, with no unit in its name (response_timeout, stop_when_idle, retention), as on the command line and in --json (ADR 8.1).

A start (session new or session resume, with --pid too) has two sources of settings: its flags (--mode, --model, --thought-level, --option <o>=<v>) and its profile’s headless mode, model, thought_level and options.

  • They are resolved into one set of settings once the session is open, from the agent’s config options, before anything is set.
  • A config option whose category is mode is the mode, one whose category is model the model, and one whose category is thought_level the thought level, whatever their ids (ADR 6.2). So --model and --option <the model option's id>=… are one setting, as are the profile’s model and its options entry for the model option; the same holds for the mode and the thought level.
  • The flags win, setting by setting: whatever they set, the profile’s value for it is neither applied nor checked. What only the profile sets applies. --response-timeout wins over the profile’s response_timeout the same way.
  • Within one source, two different values for one setting fail the start before anything is set, naming both (P4, P7): --model large and --option llm=small both set the model, --option effort=low and --option effort=high disagree, the profile's mode plan and its options approvals=default both set the mode. The same value twice is one setting.
  • A v1 mode the agent doesn’t list fails before anything is set.
  • Each setting is sent once: the mode first, then the model, then the thought level, then the other options by id. session status has the values the agent reports after them; its mode, for an agent with no modes, is the mode option’s value.
  • config set is resolved the same way, its flags the only source.

Why. In a flat profile, brnr acp --profile work silently ignored the headless-only keys, and brnr can’t warn about it, since the proxy’s stderr is the agent’s (P1); the editor also has settings of its own. Putting the role in the config makes a misplaced key an error (P7). Which option is the model or the mode is known only once the agent has opened the session and listed its options, so the flags and the profile can only be merged then. Merging by id earlier let a profile’s model option override --model, and the start succeeded without saying so (P3). log mixes strings and a boolean, and command is a string in an MCP server and a list in a bridge, in one file (#154): a key with two types is one more thing to get wrong (F5, P5). ACP has the MCP server’s form, so brnr’s own takes it.

Consequences.

  • --option for one id given twice with different values fails.
  • A profile whose mode and options disagree about the mode fails every start that doesn’t set the mode with a flag.

Considered.

  • A flat profile, with the headless-only keys marked in the documentation and doctor: an editor’s profile would still carry settings it silently ignores.
  • Merging the flags into the profile’s options by id in the CLI, and applying the flags last: the CLI doesn’t know the agent’s option ids, and an option applied twice changes the agent’s state twice, with the profile’s value briefly current.
  • The last flag winning a conflict within the flags: a guess at what was meant (P4); the user can drop one.
  • log = false beside the strings, as a boolean for “nothing”: one key with two types. "none" for it: "off" says that logging is off, not that there are no records.
  • A bridge’s command and the MCP server’s both argv lists: the MCP form is ACP’s (F1), passed on in session/new as it is.
  • Keeping both shapes under one name (#154): a key whose type depends on where it is.

6.2 Mode, model and config options

  • brnr config get <session> lists every config option with its value and choices, and the agent’s v1 modes where it has them. --mode, --model, --thought-level and --option <o> narrow it (ADR 8.1).
  • brnr config set <session> sets options by category with --mode, --model and --thought-level (mode, model, thought_level), and by id with --option <o>=<v>, resolved as ADR 6.1 resolves a start’s.
  • The mode is the config option whose category is mode, even where the agent also has v1 modes. session/set_mode is sent only to an agent with v1 modes and no mode option. session/set_mode is ACP v1’s; v2 drops it, and a mode is then only the option of category mode.
  • The model is the config option whose category is model, matched by category only, not by id (P4). With no such option, config get --model fails, “the agent offers no model choice”, and a model set by config set or a start fails before anything is sent. session/set_model isn’t used. The thought level is matched by its category the same way.
  • A value is sent as the option’s advertised type has it. A boolean option takes true or false, sent as type: "boolean" and a JSON boolean; any other value for it fails before reaching the agent (P7). A select option, or one the agent hasn’t advertised, gets the value as a value id (a string), with no type.
  • A start’s --option and the profile’s options are sent the same way, once ADR 6.1 has merged them. A value one of them can’t take fails the start before any is sent.
  • An agent offers boolean options only to a client that advertises them (clientCapabilities.session.configOptions.boolean). An editor can, and then an editor’s session has them; brnr’s own headless client doesn’t.
  • A start’s settings are applied before the first prompt. Failing to apply one fails the start (P7).
  • On an editor’s session, config set is the experimental config action, and the host tells the editor itself: current_mode_update, or config_option_update from the response’s configOptions (ADR 7.1).
  • brnr prompt commands <session> lists the agent’s slash commands. They are invoked by sending them as text.

Why. Both adapters expose the mode through session/set_mode and everything else (model, effort, …) as config options with ACP’s categories. codex-acp also has session/set_model, its own legacy method, and exposes the model as a config option too. The agent doesn’t tell the editor of a change brnr makes: the new options come back in the response, which is the host’s, and ACP answers the requester. So the host tells the editor, or its model selector keeps showing the old model.

Considered.

  • Keeping session/set_model for older agents, refused on an editor’s session for want of an update to send: every agent brnr ships has the model as a config option.
  • Matching the option by id or by category: an option that happens to have the id model is a guess; the category is ACP’s.

6.3 MCP servers for headless sessions

  • [[profiles.<p>.headless.mcp_servers]], each with a name and either command, args and env (stdio), or a url with type = "http" or "sse" and optional headers. They are passed in the session/new, session/resume, session/load and session/fork requests the host sends.
  • HTTP and SSE servers are refused at start if the agent doesn’t advertise support for them (P7). codex-acp 2.1.1 has no SSE.
  • With an editor, the MCP servers are the editor’s: its own session/new carries them, and the profile adds none (P1).
  • Their env and headers values are redacted in what brnr records (ADR 9.1).

Why. A headless session has no editor to give the agent its MCP servers, so the profile does. An editor’s session already has them, and adding to them would change what the editor sent (P1).

6.4 Files and images in a message

  • --file <path>: a resource_link to the file; the agent reads it itself. ACP always allows it.
  • --image <path>: an image block, base64-encoded, refused unless the agent advertises image prompts (P7).
  • Both are taken by prompt send, session new and session resume, and read by the CLI; for a start, before the process is launched (ADR 3.4).

Why. A link costs nothing and needs no capability. An image can only be sent as content, and an agent without image prompts can’t take it, so the request fails up front (P7).

Considered.

  • Embedding the file’s contents (resource): it needs the agent’s embeddedContext capability (both adapters have it), and duplicates what the agent can read anyway.

6.5 brnr profile reads the profiles and never writes

Resolves #409, which replaces a draft that was never merged.

Profiles are only in the config file. The CLI never writes it (N1, ADR 12.2): if it could, an agent that uses the CLI could change its own configuration. But an agent must be able to read it, to set up a start, or to find out why a session behaves as it does (a mode, an MCP server that isn’t there). Two things can keep an agent from the file, though it can run brnr:

  • Its tool permissions, such as a deny rule on ~/.config. These don’t bind brnr, so brnr can read the file for it.
  • An OS sandbox (Seatbelt, Landlock). This binds brnr too when the agent runs it, so brnr can’t read the file either. A process started outside the sandbox can still answer on its socket, wherever the agent can reach the runtime directory.

brnr profile is a group of commands that read and never write:

brnr profile list [--json]
brnr profile show [<name> | --pid <pid>] [--json]
brnr profile keys [--json]
  • list prints the config file’s path, then each profile with doctor’s line for it (agent, bridges, MCP servers, strict, the editor part’s names). With no file, it says that defaults apply, and exits 0. A file that doesn’t load fails it, config_invalid, with each problem located, as doctor gives them (P7).
  • show <name> prints the profile as session new --profile <name> and acp --profile <name> would use it, from the file as it is now.
    • Without a name, it shows the profile used without --profile: default, or the empty profile when there is none. It says which (P4).
    • It fails where a start fails, with the same code: a name the file doesn’t have (profile_not_found), a file that doesn’t load, or a name with no file (config_invalid).
    • Every key of the three parts is shown, under its part’s table, which says who uses it (6.1). A key the file doesn’t set shows its default, or the rule that applies instead, marked as not from the file.
    • Text is TOML in the file’s layout, the marks as comments, so that it loads as the same profile. JSON is {config, name, found, profile, unset}: profile has the three parts, each key the file doesn’t set at its default, or null where a rule applies; unset has the paths of those keys (log, headless.cwd) (P5).
  • show --pid <pid> prints what that process was started with. It asks the process on its socket (start_request) and doesn’t read the file. The answer is the start request as the host log’s process_started record has it (ADR 3.3, 9.1), without prompt and foreground: the agent and bridges as run, cwd, strict, log and the role’s part, a headless start’s settings in two groups, the flags’ and the profile’s (6.1). It works where the file can’t be read, and stays true of that process after the file changes (P10). Observing an editor’s process isn’t an action on its session, so it isn’t experimental (P1). Text is the same as TOML, the null fields left out. JSON is {pid, start_request}.
  • keys prints every key a profile can have: its part, its type, its default or the rule without it, the names it takes (log’s values, the experimental actions, the features) and its ADR. It reads the one table of keys in profiles.rs that the layout check and show read too, so the three can’t disagree.
  • The values of MCP servers’ env and headers are <redacted>, their keys kept, in both forms of show (ADR 9.1). No flag shows them. Arguments are not redacted: a token in an agent’s, a bridge’s or an MCP server’s arguments shows, as it does in the process_started record. Secrets go in env.
  • With --remote <target> they read the destination’s profiles, through ADR 12.2’s routing: brnr profile show <name> --remote <target>.

Why. An agent that has to ask the user what the file says can’t set up a start or explain a session itself (F3). Reading through brnr helps an agent its tool permissions keep out; asking the process helps one in a sandbox, and is the one way to know what a process started before an edit runs with (P10). One key table keeps keys from drifting from the parser (P5). Redaction keeps the restriction a user set up from being undone by a command (N1); the user has the file anyway.

Consequences.

  • A process of the user’s that can run brnr can read the profiles, but the redacted values, even where its permissions keep it from the file. That is the point, and a hole made on purpose. A user who wants an agent kept from them denies it brnr profile as well (docs/threat-model.md).
  • A process that can reach a brnr process’s socket can read that process’s start request, without the prompt, secrets redacted. The host log already holds the same request.
  • --json of show --pid has the start request’s fields, which are then covered (ADR 8.4).

Considered.

  • profile check [<file> | -], which would check a draft config: it would open any path an agent names. A deny rule on, for example, ~/.ssh doesn’t bind brnr, and a parse error can quote a value. doctor checks the config file.
  • Calling it brnr config: that name is the agent’s config options’ (6.2), and one word would have two meanings (ADR 8.1).
  • A --reveal flag for the redacted values: it would hand the secrets to the agents the restriction keeps out.
  • Not redacting show <name>, since the user’s own processes are inside the boundary: the user set up the restriction on purpose, and a command that hands over its secrets would undo it.
  • Reading the file only, with no --pid: no help to an agent in a sandbox, and no way to say what a process started before an edit runs with.
  • The start request in session status: status is about a session, the request is the process’s, and every status answer would grow.
  • A hand-written key list in the skill instead of keys: it would drift from the parser.
  • Commands that write the config (set, edit, init): N1. The CLI never writes config.
  • retention, at the top of the file, in keys and show: it is no profile’s, and doctor shows it.

Tests

Run cargo test --release adr_0006_. Named claims, by section:

  • 6.1: tests/cli.rs: adr_0006_profile_layout_errors_say_where, adr_0006_start_flags_win_over_the_profile (--model over a profile’s model option, with the id model and with another; the mode likewise, either way round; each setting sent once; session status has the value that won), adr_0006_start_settings_that_disagree_fail (two values for one setting from the flags, or from the profile, fail before anything is set; a flag settles the profile’s; the same value twice is one), adr_0006_config_names_are_spelled_one_way (log = false and log = true fail to load, and doctor names them; log = "off" keeps no transcript; a bridge of command and args starts, and one with a list command fails to load).
  • 6.2: tests/cli.rs: adr_0006_mode_lists_and_switches, adr_0006_model_and_config, adr_0006_model_is_the_option_of_category_model, adr_0006_mode_as_a_config_option, adr_0006_start_applies_mode_and_model_before_the_prompt, adr_0006_commands_lists_the_agents_commands; tests/headless.rs: adr_0006_a_boolean_option_is_set_as_a_boolean; src/host/state.rs: adr_0006_a_config_value_is_sent_as_its_option_type_has_it; src/host/requests.rs: adr_0006_a_start_refuses_a_boolean_it_cant_send_before_sending_any.
  • 6.3: tests/cli.rs: adr_0006_mcp_servers_reach_the_agent.
  • 6.4: tests/cli.rs: adr_0006_files_and_images_go_with_the_prompt.
  • 6.5: tests/cli.rs: adr_0006_show_is_what_start_would_use (the default rule, with and without a default profile; unset keys marked in text and JSON; the text loads; it fails where a start fails, with its code), adr_0006_show_redacts_mcp_secrets (by name and by --pid, in text and JSON), adr_0006_show_pid_is_the_start_request (after the file is edited, and with it unreadable; no prompt, no foreground), adr_0006_keys_are_the_parsers (every key loads in its part and fails in the others; its default is what show gives it), adr_0006_list_fails_on_a_file_that_does_not_load; tests/remote.rs: adr_0006_profile_show_reaches_the_destination.

7. Experimental actions on an editor’s session

Draft 2026-10-19. Implemented, but 7.1’s real-editor checks are not run yet: every cell is untested. Factor: F4 (ADR 1). Brings together former ADRs 4, 5 and 70, and the second decision of 67 (docs/adr/README.md maps them).

What brnr may do, through the side channel, to a session an editor owns, and how the editor is shown it. These actions are useful, but ACP doesn’t define them and the editor doesn’t expect them, so each needs compensating behaviour that isn’t faithful to ACP. They are opted into one by one, by name, and stay experimental through 1.x (F4).

7.1 Side-channel actions on an editor’s session are experimental, for all of 1.x

Every action on an editor-owned session through the control socket, from the CLI or a bridge, is experimental. It is refused unless the editor’s part of the profile enables it by name (ADR 6.1):

[profiles.work.editor]
experimental = ["send", "permission"]
  • An unknown name fails to load (P7). A refusal says what to add: “permission on an editor’s session is experimental; enable it with experimental = ["permission"] under [profiles.work.editor]”. Without --profile, the profile named is default.
  • Observing is always allowed: event watch, event log, session status, permission requests, permission show, elicitation requests, elicitation show, event notify, bridges.
  • In strict mode none of these actions is available, whatever the profile enables (ADR 2.1).

The actions, their commands, and what the host does for the editor:

  • send (prompt send): sent as a prompt only while the session is idle (no prompt in flight, the editor’s or brnr’s), and refused while a turn runs. The editor controls its turns: whether a message mid-turn is queued, steered or interrupts is its call, so an editor’s session has no held messages, --steer or --interrupt (ADR 4.2). The editor is shown the message as ADR 7.2 has it.
  • context (prompt send --context; queue clear with --context or with neither flag): appended to the editor’s own next prompt, and shown as ADR 7.2 has it (“Context via brnr”).
  • cancel (prompt cancel): the host answers the agent’s pending permission requests cancelled, as ACP requires of whoever cancels, and its pending elicitations cancel (ADR 4.5), and withdraws them from the editor with $/cancel_request. Late answers are handled as for permission.
  • permission (permission allow, permission reject): the host withdraws the request from the editor with $/cancel_request (stable ACP: a notification that cancels a pending request), and sends a tool_call_update for the request’s tool call that sets only status, in_progress or failed, which the agent’s own updates carry on from. It tells the editor in the session that the request was allowed or rejected, and by whom (“Allowed via brnr”, “Rejected via brnr”). If the editor answers anyway, its answer is dropped (the agent must not get two), and the editor is told in the session that it was already allowed or rejected, and by whom (“Already allowed via brnr”, “Already rejected via brnr”).
  • elicitation (elicitation accept, elicitation decline, elicitation cancel): the request is withdrawn from the editor with $/cancel_request, and the editor is told in the session (“Accepted via brnr”, “Declined via brnr”). Its late answer is dropped, and it is told who answered first, as for permission (ADR 4.5).
  • config (config set): the host sends the editor current_mode_update, or config_option_update made from the response’s configOptions. The agent doesn’t: the change was the host’s request, and ACP answers the requester (ADR 6.2).
  • close (session close, session resume --take-over): the host cancels a running turn, tells the editor in the session (“Session closed via brnr”, or “Session taken over by brnr (process 4466)”), and sends session/close to the agent. Afterwards it answers the editor’s requests for that session with an error saying where the session continues, but for a load or resume, which opens it again where no other process holds it (ADR 3.9).

The editor’s acknowledgement of a $/cancel_request (an error) is dropped without telling it. Beside the actions:

  • permission show on an editor’s request says where it can be answered: in the editor, and here only where permission is enabled; otherwise it gives the refusal permission allow would (answerable, why_not in each pending entry). elicitation show does the same for elicitation (ADR 4.5).
  • process stop isn’t one of these actions: stopping a process is process management, the same as kill.
  • session fork, session new --pid and session resume --pid are refused on an editor’s process. A session opened there would be a headless session inside a process that ends with the editor, and ACP can’t tell the editor of a session it didn’t create.
  • When the editor itself queues prompts, steers (_session/steering) or cancels, brnr passes it through untouched and only reads it (P1), recording user_message with by: editor.
  • Refusing an editor’s load of a session another process owns isn’t one of these actions: it is process management, with its own feature flag (ADR 3.9, ADR 3.10).
  • Answering approvals from somewhere else is available for an editor’s session only by opt-in. It is the default for headless sessions.

Every action here is experimental for all of 1.x, opt-in by name. None becomes a default, or stops needing its opt-in, by a release alone. An action leaves experimental only by an ADR of its own, which brings evidence from real editors: the checks below for that action, run in each editor brnr supports, with each editor’s and adapter’s version, what was seen, and the cells left untested, said as such. The synthetic suite (tests/fake_agent.py) passing isn’t that evidence: it shows what brnr sends, not what an editor makes of it. The compensations are adjusted per editor from what is seen, and the documentation states what is known as caveats.

Why. ACP has one client per session. With an editor attached, the editor is that client and owns the session (P11). Observing it and notifying other services is what the side channel is for (P12). Acting on it is something ACP doesn’t define and the editor doesn’t expect: each action leaves the editor’s view behind the agent’s in some way, and only some of that can be made up for. These are what P1 calls experimental: actions brnr adds to an editor’s session. Whether a compensation works can only be seen in a real editor, and none has been tried yet.

Considered.

  • Allowed, and labelled experimental only: it would still be default behaviour, reachable by accident (a Slack bridge allowing what the user is looking at in the editor).
  • One switch for everything: the actions differ in how much of the editor they leave behind.
  • Opt-in per request (--experimental, a field in the request): every script and bridge would carry it, and the bridge protocol would change.
  • Refused until tested: no way to try the compensations at all.
  • A switch per command: some make no sense alone (permission allow without permission reject, config set --model without the other options).
  • send mid-turn on an editor’s session passed through as a second prompt: its meaning would be the agent’s and the editor’s, which brnr can’t promise (P2).
  • Promoting an action out of experimental in 1.x now: there is no real-editor evidence yet for any of them.

Real-editor checks

To be run by hand: an editor can’t be faked. Each cell is an editor (Zed; a JetBrains IDE through its ACP support, IntelliJ’s AIR plugin; others as they come) with an adapter (brnr-claude-adapter, brnr-codex-adapter), and records the editor’s, the adapter’s and brnr’s versions, the OS, and pass, fail or untested for each check. The raw ACP (brnr event log <session> --events acp) shows what crossed. Every check is also run with the agent configured directly, without brnr, as the baseline: a difference from it is the finding, not the behaviour alone. None has been run yet.

File system and terminal, which check ADR 2.7: with brnr acp and a profile’s client_capabilities = ["fs", "terminal"], and with brnr acp --strict; and, for the default, with brnr acp and no such setting:

  1. The default: the agent sends neither fs/* nor terminal/*, reads and writes the files on disk itself, and runs commands in processes of its own; the host log has capabilities_dropped.
  2. Unsaved buffers: edit a file in the editor without saving, and ask the agent what the edited lines say. It answers with the unsaved text, and the raw ACP has fs/read_text_file and the editor’s answer.
  3. Writes: ask the agent to edit an open file. The edit arrives through fs/write_text_file, the editor shows it in the buffer (or its diff view), and it is on disk as the editor saves.
  4. Terminal: ask the agent to run a command. The editor shows its terminal (terminal/create), the agent gets its output and exit status (terminal/output, terminal/wait_for_exit), and terminal/release follows. Cancelling the turn while the command runs kills it (terminal/kill, or release).
  5. Take-over: with close enabled, brnr session resume <session> --take-over; the session goes on headless, reading the files on disk, and the editor is told.

The editor’s path (#69):

  1. Prompts and cancel: a prompt, a long turn cancelled from the editor, and a prompt after it.
  2. Approvals: a permission request shown and answered in the editor, both allow and reject.
  3. Settings: the editor’s mode and model selectors change the agent’s, and the agent’s changes move them.
  4. Disconnect: closing the editor’s thread, window or the editor itself ends the agent and its children (ADR 3.1, ADR 3.7); restarting the agent from the editor leaves nothing behind.
  5. Resume: after the editor closes, brnr session resume <session> goes on headless; the editor loads the session again once that process has closed it (ADR 3.9).

Experimental actions, per action, with the action enabled. These are the cells an ADR promoting an action cites:

  • whether the editor acts on a $/cancel_request from the agent’s side (the request withdrawn from its view), and answers it with -32800, as ACP asks;
  • how it renders a tool_call_update with status in_progress or failed for a tool call whose permission request it is showing;
  • how it renders the echo form (a completed tool call, ADR 7.2) when it arrives between turns, not only within one, and, with echo_as = "user_message_chunk", whether it renders an out-of-turn user_message_chunk (#216);
  • how it shows a JSON-RPC error on its session/prompt after the session was closed or taken over from outside, and whether loading the session again then works;
  • whether an unsolicited current_mode_update or config_option_update moves its mode or model selector;
  • how it shows a turn it didn’t start (send while it was idle), and whether it lets the user prompt while that turn runs;
  • whether it sends _session/steering itself;
  • from ADR 3.7, the first case to try, IntelliJ restarting its agents: whether the old proxy, host and agent are SIGKILLed, and by whom.

7.2 How a message sent through brnr is shown to the editor

A message or context sent to an editor’s session through the side channel (prompt send, prompt send --context) is shown to the editor in the form echo_as in [profiles.<p>.editor] chooses, by the sessionUpdate it is sent as:

  • "tool_call", the default: one session/update with sessionUpdate: tool_call, toolCallId: brnr-echo-<n>, kind other, status completed, titled Message via brnr (or Context via brnr), with the message’s content blocks as its content. It is the one update editors render as a block of its own at any point in a turn.
  • "user_message_chunk": one session/update user_message_chunk per content block of the message, as the agent sends a user’s message when it replays a session; no title, no tool call. It carries no “via brnr”: the editor shows it as the user’s, which it is.

Either way:

  • Another value fails to load, naming the two (P7). brnr doctor shows the profile’s echo_as when it isn’t the default.
  • It is sent when the message is sent; when the agent takes it up is the agent’s business.
  • Only the editor sees it, in either form. Events, bridges and the transcript’s story keep user_message with by: control.
  • echo_as applies to messages and context only. brnr’s own notes to the editor are always tool calls in the same form: an approval or elicitation answered elsewhere (“Allowed via brnr”, “Rejected via brnr”, “Accepted via brnr”, “Declined via brnr”), the editor’s late answer to one (“Already allowed via brnr”, “Already rejected via brnr”), a session closed or taken over (“Session closed via brnr”, “Session taken over by brnr (process 4466)”), and a close that failed (ADR 7.1).
  • Both forms are stable ACP, so strict mode doesn’t change echo_as. There it is moot, as strict mode has no experimental actions (ADR 2.1).

Why. In ACP’s model, user messages are what the client sends. Some editors don’t render a user_message_chunk that arrives out of turn, mid-turn or between turns, and drop or misplace it; a completed tool call they all render, so it is the default. Other editors do render the chunk, and for them the tool call puts the user’s own words in a block that says a tool ran, where user_message_chunk is what ACP has for them (P1, P2). brnr can’t tell which editor it serves (P4), so the profile says. brnr’s notes are brnr’s words: a user chunk would make them the user’s, as an agent chunk would make them the agent’s.

Consequences. Which editors render an out-of-turn user_message_chunk, and how each shows the tool call, is checked in real editors (ADR 7.1, #216). Until then the default is the form every editor renders.

Considered.

  • user_message_chunk as the only form: honest about what it is, but not rendered by every editor.
  • agent_message_chunk or agent_thought_chunk: rendered, but the text appears as the agent’s own words.
  • A per-editor default, from the editor’s clientInfo: brnr would guess what an editor renders (P4), and be wrong for the next version of it.
  • user_message_chunk for brnr’s notes too: they would read as the user’s words.
  • echo_as as an experimental action, named in experimental: it doesn’t act on the session; it chooses how something an action does is shown.

Tests

Run cargo test --release adr_0007_. Named claims, by section:

  • 7.1: tests/headless.rs: adr_0007_take_over_from_an_editor_is_refused, adr_0007_experimental_actions_are_refused_without_opt_in, adr_0007_cancel_withdraws_the_editors_requests, adr_0007_approve_answers_in_the_editors_place, adr_0007_settings_are_told_to_the_editor, adr_0007_close_tells_the_editor, adr_0007_take_over_from_an_editor, adr_0007_the_editors_own_steer_is_recorded; src/host/sessions.rs: adr_0007_a_session_closed_under_the_editor_is_its_again_once_loaded. The real-editor checks have no automated test: they are what the matrix records.
  • 7.2: tests/headless.rs: adr_0007_send_to_an_editors_session_waits_for_no_turn, adr_0007_context_joins_the_editors_next_prompt, adr_0007_messages_can_be_shown_as_user_message_chunks.

8. The command line and compatibility

Draft 2026-10-24. Implemented, but 8.4 is a promise that applies from 1.0.0, and 8.6’s evals with a real agent aren’t done. Factor: F5 (ADR 1). Brings together former ADRs 63, 15, 34, 21, 64, 66 and 46 (docs/adr/README.md maps them).

brnr is a Unix command-line utility, and its command line is its interface (F5). This topic covers how commands are named and grouped, what they print in text and JSON, how waiting commands exit, what stays compatible from 1.0.0, why the Rust library is no second interface, and the skill that teaches agents to use brnr.

8.1 Commands are grouped by what they act on, with ACP’s verbs

Every public execution command also accepts --remote <target> before --, the one transport (ADR 12). With it, --profile is the destination’s; without it, no command but remote check connects to another machine through brnr’s transport. Transport selection respects flag values and the delimiter. Help stays local. remote check <target> checks a destination’s installation through SSH. It reads no local config and does not itself accept --remote.

A command is brnr <entity> <verb>: the entity it acts on, and ACP’s verb wherever ACP has one (P1). The entities are brnr’s model of a process:

process
├── event
└── session          also in the agent's store, open in at most one process
    ├── prompt       a turn: session/prompt until its stop reason
    ├── queue        brnr's held messages and context for the next prompt
    ├── permission   the agent's session/request_permission requests
    ├── elicitation  the agent's elicitation/create requests (ADR 4.5)
    └── config       the session's config options

A command’s group is its entity, not its depth: a nested entity takes its parent as an argument (brnr permission allow <session> <request>). Tools that act on no entity stay at the top level. Two groups act on what is outside the process: profile, the config file’s profiles (ADR 6.5), and remote, an SSH destination’s brnr (ADR 12.2). The commands:

brnr process     list | stop <pid>
brnr session     new [--pid <pid>] [<new flags>] [-- <agent> [args...]]
                 | resume [--pid <pid>] <session> [--take-over] [<new flags>]
                   [-- <agent> [args...]]
                 | list [--include active,inactive] [--profile <p>] [--cwd <dir>]
                   [-- <agent> [args...]]
                 | status <session> | fork <session> | close <session>
                 | delete <session> [--purge] [--profile <p>] [-- <agent> [args...]]
                 | prune --older-than <s> [--dry-run]
brnr prompt      send <session> [--steer | --interrupt | --context [--replace]]
                   [--prompt <text> | -] [--file <path>]... [--image <path>]...
                   [--wait [--timeout <s>]]
                 | cancel <session> [--keep-held] | commands <session>
brnr queue       list <session> | show <session> <message>
                 | drop <session> <message> | clear <session> [--messages] [--context]
brnr permission  requests [<session>] | show <session> <request>
                 | allow <session> <request> [--always] [--option-id <id>]
                 | reject <session> <request> [--always] [--option-id <id>]
brnr elicitation requests [<session>] | show <s> <request>
                 | accept <s> <request> [--field <k>=<v>]... [-]
                 | decline <s> <request> | cancel <s> <request>
                   (<s> is <session> | --pid <pid>)
brnr config      get <session> [--mode] [--model] [--thought-level] [--option <o>]...
                 | set <session> [--mode <m>] [--model <m>] [--thought-level <l>]
                   [--option <o>=<v>]...
brnr event       log <session> [--last <n>] [--follow] [--events <e>,...]
                 | watch (<session> | --pid <pid>) [--events <e>,...]
                 | notify (<session> | --pid <pid> | --stdin) [--events <e>,...]
                   -- <command> [args...]
                 | wait <session> [--for idle|turn|permission|elicitation|exit]
                   [--timeout <s>]
brnr profile     list | show [<name> | --pid <pid>] | keys       (ADR 6.5)
brnr remote      check <target>                                  (ADR 12.2)
brnr acp [--profile <p>] [--strict] [-- <agent> [args...]]
brnr doctor [--fix | --report] | skill [<reference> | install [--dir <dir>]...]
     | --version

<new flags>
  process: --profile <p> --auth <method> --strict --stop-when-idle <s>
           --response-timeout <s> --foreground [--quiet]
  session: --cwd <dir> --mode <m> --model <m> --thought-level <l>
           --option <o>=<v>
  prompt:  --prompt <text> | -   --file <path>   --image <path>
           --wait [--timeout <s>]

How words are read:

  • --json goes wherever a command prints data (ADR 8.2). -- always ends brnr’s options: what follows is the agent’s argument vector, or event notify’s command’s. --profile and -- <agent> combine the same way wherever a command takes both.
  • brnr --help has a section per group. brnr <group> --help, or a group without a verb, prints the group’s commands. An unknown verb is said, with the group’s usage; a command used wrongly shows its own usage. A verb’s --help or -h, before any --, prints its usage; after -- it is the command’s, and as a flag’s value it is that value (--prompt -h sends -h). Help goes to stdout and exits 0, and a usage error goes to stderr and exits 2, in every command (ADR 8.3).
  • A prompt is --prompt’s value, sent as given (--prompt --wait sends --wait), and --prompt - reads it from stdin, for prompt send as for a start. A word that is neither a flag, a flag’s value nor a positional the command takes, such as a prompt given as words, is a usage error.
  • An option a command doesn’t take fails as unknown, and nothing is done. It is never read as a <session> or <pid>: session status --json without a session is a usage error. Every command says an unknown option (session list, process list, doctor and skill too), before its usage. A word with one dash, such as -x, is an argument (event log has no -f).
  • Names that this tree replaced have no alias (P9), and the CHANGELOG lists them: such a command fails as unknown and does nothing; so do the socket’s approve, deny, set_mode and set_model. A profile with a headless config key, or the experimental actions approve or settings, fails to load.

session new and session resume:

  • Without --pid, each starts a process whose first session it opens, committed with its first prompt as one start (ADR 3.4, P10). resume is session/resume, or session/load where the agent has only that (ADR 3.11). --take-over is resume’s only; each command says its usage, with the flags they share.
  • With --pid, each opens a session in that running process, with its agent, profile and MCP servers, in --cwd (a resumed session’s recorded cwd, else here), in strict mode too; its --json is as without --pid. The process flags (--profile, --auth, --strict, --stop-when-idle, --response-timeout, --foreground, --quiet) and -- <agent> are an error there, and nothing is sent (P7). An editor’s process refuses, as it refuses session fork (ADR 7.1). With stop_when_idle and an agent that can’t close sessions, a second session is refused, as session fork is (ADR 3.8).
  • resume --pid of a session open in that process is refused, with --take-over or not. One that another process holds is refused; with --take-over it is closed there and resumed here. --take-over is refused before the session is closed where it runs if the process would refuse it (starting, stopping, or an agent with neither session/resume nor session/load), rather than leave it open in neither.
  • The session, its settings (over the profile’s) and its prompt commit as one, as a start’s do (ADR 3.4). The start timeout goes to the process, which abandons the opening once it passes, as it does when a setting fails, the process is stopping or the command has gone; the command waits 10 s longer. An abandoned opening closes the session again, the command says so and what was set, and no prompt is sent. An agent that can’t close sessions keeps it, and the error names it. A new session that can’t be locked is closed again; a resume of one isn’t sent (ADR 3.9).
  • A session being opened counts as one of the process’s: its others closing or going idle meanwhile don’t stop the process (ADR 3.8).
  • --response-timeout <s> is the profile’s headless response_timeout as a flag, and wins over it as a start’s flags do (ADR 6.1).
  • --thought-level and the profile’s thought_level set the option of category thought_level, after the model and before the prompt; the flag wins over the profile. Two values for it from one source, or an agent without such an option, fail the start before anything is set.

session list joins brnr’s index and the agent’s list:

  • Without an agent named, it is brnr’s index: the sessions open in brnr’s processes and those it has transcripts of, in every cwd, for every agent, with nothing started, not even the default profile’s agent. --cwd narrows it.
  • With --profile or -- <agent> (the cwd here unless --cwd), brnr’s rows are narrowed to that cwd. The agent is started just to ask it (initialize, session/list for every page, then it exits; no brnr process), and an agent that won’t go is killed with what it started. The two lists are joined on the session id, exactly, so brnr never guesses which recorded agent a command line is (P4). A session open in a process that the agent lists there is joined whatever cwd brnr recorded for it, its lock being one per id (ADR 9.2). An agent that can’t list fails the command (P7).
  • A cwd is the same however it is spelled: --cwd and a row’s cwd are compared as the directories they name (a trailing slash or a symlink makes no difference). An unreachable session’s cwd is unknown, so it is the cwd’s if the agent lists it there or brnr has its transcript there; its CWD stays null unless the agent gives one.
  • --include filters by state: active is open in a process (idle, busy, waiting, unreachable), inactive isn’t, whoever knows it; both by default. An unknown state fails.
  • Every table of sessions has the same columns, in the same order, formatted the same way: SESSION, TITLE, STATE, PID, AGENT, SOURCE, LAST ACTIVE, FORKED FROM, CWD (session, title, state, pid, agent, source, last_active, forked_from, cwd in --json, each row in {sessions}, AGENT the agent’s program, ADR 8.2). Rows are ordered most recently active first.
  • STATE is a running session’s live state (idle, busy, waiting for an approval or an elicitation), unreachable for one whose process holds its lock but doesn’t answer (ADR 3.9), with the holder’s pid, and inactive for the rest. A running session’s STATE and PID come from brnr’s index, with an agent named too.
  • SOURCE, brnr, agent or both, says who reported the row. A session only the agent knows is inactive, SOURCE agent, with no PID.
  • TITLE and LAST ACTIVE are the agent’s where it gives them, over brnr’s; LAST ACTIVE is brnr’s own where the agent gives none. FORKED FROM is the session a fork came from, or null (ADR 3.12).
  • LAST ACTIVE is in UTC, in --json and text alike: an agent’s updatedAt is read with its offset and written as brnr writes its own times (2026-10-11T08:00:00+02:00 is 2026-10-11T06:00:00.000000Z), and rows are ordered by the time each names, not by how it is written (#152). One that isn’t an RFC 3339 time is passed on as the agent gave it and said on stderr (P4), after the rows with a time and before those with none.
  • process list has no CWD column: sessions have cwds. The process’s cwd is in its JSON, often / for an editor’s.

session delete is session/delete:

  • It is refused for a session open in a process: sess-1 is running in process 4466: close it first (brnr session close sess-1). A session a process holds otherwise is refused in the words session resume uses (ADR 3.9), with nothing to do about it offered: a holder that doesn’t answer (sess-1 is running in process 4466, which is not answering), is opening it (sess-1 is opening in process 4466), is closing it (free once its records are written, ADR 5.5), or isn’t listed here (…, which brnr doesn't list, or the runtime directory and the BRNR_DIR=… that reaches it). A process that takes the session’s lock after the command found it free is said the same way. It is refused for an agent without sessionCapabilities.delete too, which isn’t asked (P7). The agent is the one brnr recorded for the session, or --profile or -- <agent> for one it hasn’t; a session brnr has no transcript of needs its agent named, and nothing is recorded for it.
  • It deletes the agent’s copy only, as an editor’s session/delete through brnr acp does. Both emit session_deleted, and the transcript stays, a brnr row in session list, its agent still found for it. A deletion isn’t activity: LAST ACTIVE stays when a process last served the session.
  • session_deleted is recorded in the session’s transcript: by the command, as a record of no process’s (host_id null), since no process has the session open; by the editor’s process, which closes the session if it had it open.
  • An agent whose session/delete fails (an error, or no answer) hasn’t deleted the session, and the command fails, but for --purge and an agent that doesn’t have the session (below).
  • --purge also deletes brnr’s transcript of the session (the events file and <id>.acp.jsonl, ADR 5.1) in every project folder, an older brnr’s too, and the older brnr’s files set aside beside them (<id>.older.jsonl, <id>.older.acp.jsonl, …, ADR 5.9): every file of the session’s id brnr finds, each said as it is deleted (N1, P3), the events file last, so a purge cut short leaves what finds the rest (ADR 9.5). Not the process logs, which are shared, whatever the agent answered. Nothing a symlink points at, nor an id that climbs out of its folder, is deleted. With --purge the command succeeds only if the agent deleted the session or doesn’t have it (ACP’s resource_not_found, -32002), which is said; any other error, or no answer, is said and fails the command, the transcript deleted all the same: the agent may still have the session (P3, P7).
  • A file that can’t be deleted, or have session_deleted recorded in it, is said and fails the command, the others done all the same (P3). What was and wasn’t deleted is said as it is, not as “no transcript” or “deleted all the same”. A symlinked project folder isn’t looked in. A transcript made private first (ADR 9.3) is said on stderr: the command has no host log for path_made_private.

session prune --older-than <s> [--dry-run] deletes brnr’s transcripts of the sessions no process has open that were last active more than <s> seconds ago, and the host logs of the processes that have gone and were, as --purge deletes, with nothing asked of an agent. ADR 9.5 has the rules and its output; the config’s retention does the same as each process starts.

prompt, queue and process:

  • prompt send sends a message (ADR 4.2); prompt cancel is the turn’s session/cancel (ADR 4.3), and how a permission request is answered cancelled, as ACP has it; prompt commands lists the agent’s slash commands.
  • queue show prints one held message in full: its text, whether it interrupts, and its attachments, in text and --json (the content blocks). It drops nothing; a message not held fails. The socket’s show goes alone, and one that isn’t a message id is refused.
  • queue clear with neither flag drops the held messages and the held context; --messages or --context drops only that one. Each drop is an event.
  • process list lists processes; process stop stops one, with all its sessions.

permission:

  • requests lists permission requests, show shows one (ADR 4.5).
  • allow and reject each answer with the option of one ACP kind: allow allow_once, allow --always allow_always, reject reject_once, reject --always reject_always, whatever the options’ order. No other kind stands in for it, and reject never answers cancelled: a request without that kind, or with two options of it, fails, listing the options, and nothing is answered (P4, P7).
  • --option-id <id> names the option instead, for a kind brnr doesn’t know (v2 allows _… kinds) or two options of one kind. One of an ACP kind must be on the verb’s side (allow_* for allow), and with --always the always kind; one of a kind brnr doesn’t know goes with either verb (ADR 4.5).
  • permission_resolved says allowed or rejected, and which kind.
  • The response timeout answers a permission request with its reject_once option. A request without one has its turn cancelled (session/cancel) first, so it and every request pending in the session are answered cancelled, as ACP requires, and the turn ends. Never reject_always: nobody made that choice.

config:

  • config set finds an option by category with --mode, --model and --thought-level (mode, model, thought_level, ADR 6.2), and by id with --option; the same flags as session new, resolved as a start’s are (ADR 6.1). Two values for one setting, or a mode, model or thought level the agent has no option for, fail before anything is sent. Each setting is sent once, the mode first. A mode on an agent with v1 modes and no mode option is session/set_mode; nothing else is sent but session/set_config_option. An option by id the agent hasn’t advertised is sent (ADR 6.2); when the agent refuses it, the error says what was set before it.
  • config get shows every option with its category, current value and choices (each with its name and description), and the v1 modes, where the agent has them, as a row with no option, the same in text and JSON. --mode, --model, --thought-level and --option <o> narrow it to those options, in its order, found as set finds them (config get <session> --mode lists the modes). It lists only options the agent advertised, so one the agent doesn’t have fails.

event is log, watch, notify and wait (ADR 5.3 to 5.8, ADR 8.3).

The same names reach brnr’s other interfaces, so one word means one thing (P5):

  • Socket and bridge commands (ADR 5.7): allow and reject, with always and option_id; one set_config taking mode, model, thought_level and options; new and resume for --pid, with the command’s timeout. send is the message, whatever its mode.
  • A profile’s headless part (ADR 6.1): mode, model, thought_level, options, response_timeout, stop_when_idle.
  • The editor’s experimental actions (ADR 7.1): permission, config and elicitation (ADR 4.5).
  • Events: permission_resolved and session_deleted, as above.
  • Errors, hints and the usage text name these commands.

One name, one meaning, one spelling (#154). Where a name had two, one wins, and the other form goes, with no alias (P9):

  • --option is a config option, and only that: an id in config get --option <o>, an <o>=<v> pair in config set, session new and session resume, its value form following the verb as --mode’s does. The option of a permission request is --option-id <id>, ACP’s optionId, a name ACP gives only to a permission option: permission allow <session> <request> [--always] [--option-id <id>], and reject the same; --option there is an unknown option (exit 2, ADR 8.3). The socket’s allow and reject take option_id in place of option, and refuse option, answering nothing: ignored, it would let a bridge that names an option get the kind’s option instead (P3, P7). option is refused as any field a request doesn’t take is, command_unknown (ADR 8.8). For the same reason an option_id that isn’t a string (null, a number) is refused, command_invalid, answering nothing, not read as absent; only an absent one picks by kind.
  • The prompt is --prompt <text> | - wherever a command takes one: session new, session resume and prompt send (prompt send <session> [flags] [--prompt <text> | -], with a prompt, a file or an image: none is nothing to send, a usage error). A prompt given as words is a word too many, a usage error (ADR 8.3), and the rule that prompt send’s options go before its prompt is gone.
  • A duration is in whole seconds, and its name has no unit: --timeout, --stop-when-idle, --response-timeout, --older-than (ADR 9.5), the config’s retention, and the profile’s stop_when_idle and response_timeout (ADR 6.1) are so already. In --json and the socket’s replies, uptime_seconds becomes uptime, turn_seconds turn_elapsed, and timeout_seconds (the time left before response_timeout answers a request) timeout_left.
  • Config’s names follow the same rule (ADR 6.1): log takes strings only, and a command in config is one shape.

Why. brnr knows sessions two ways: from its own transcripts and processes, in any cwd, with no agent to ask; and from an agent’s session/list, which knows sessions started outside brnr, but only that agent’s, in one folder. One command joins the two answers to one question. Commands that grew one at a time drift from ACP’s names for the same things, and cancelled is ACP’s answer for a cancelled turn, not a refusal. ACP’s draft v2 makes modes, models and thought levels config options told apart by category. Grouping by entity, with ACP’s verbs, gives one word for one thing (P1, P5); one row shape lets every table of sessions read alike. Names that still had two meanings or two spellings (#154) are what a script and a reader get wrong: --option meant a config option in one command and a permission option in another, the prompt was a flag in one and words in another, and a duration’s name said its unit in some places only (F5, P5).

Consequences.

  • An agent offering only allow_always can’t be allowed once: allow fails and says so.
  • Only an agent that answers resource_not_found doesn’t have a session, for session delete --purge. The Codex adapter (codex-acp 2.1.1) answers an unknown session as deleted, so --purge succeeds. The Claude adapter (claude-agent-acp 0.85.1) answers -32603, so --purge of a session it already deleted fails.
  • brnr session --help, and each group’s, lists its verbs; brnr --help lists the groups.

Considered.

  • Grouping by the kind of id a command takes (session, request, message, pid): event watch and event notify take a session or a pid and fit neither, and mode, model and config stayed apart.
  • Mirroring ACP’s tree: nearly everything is session/*, so a session prefix on every command would say nothing.
  • process start, opening a process with no session: a process stops with its last session (ADR 3.8), and a start without its prompt is the gap ADR 3.4 closed.
  • brnr’s index and the agent’s list as two commands: two answers to one question.
  • One command that asks every agent in every cwd: it would start an agent for each, and not every agent can list. The agent is asked only when named.
  • Asking the agent’s list through a running process’s control socket: it needs a running process in the right folder.
  • Each table of sessions with its own columns (UPDATED against LAST ACTIVE, one column folding state and pid, timestamps formatted two ways) and its own order.
  • permission respond <option> with ACP’s option ids alone: ids are the agent’s, so a script would work for one agent; kinds are ACP’s. --option-id keeps ids for what kinds can’t say.
  • permission dismiss: ACP has no outcome for it but cancelled, which is a cancelled turn’s.
  • --config for --option: it reads as a config file’s path.
  • permission list: what is listed are requests, not permissions.
  • For --option’s two meanings (#154): renaming the config side, which is in more places (config get, config set, a start, the profile’s options, the socket’s set_config); --config for it reads as a config file’s path (above). A positional option id for allow and reject: it would name the agent’s id with no word to say what it is.
  • The prompt as positional words everywhere: session new and session resume end their options with -- <agent>, which a prompt’s words can’t come before, and a positional word that starts with - must then be read as the prompt or as an option, a guess (P4). A flag’s value is taken as given.
  • A unit in every duration’s name (stop_when_idle_seconds): longer names, all in one unit; one rule said once does as well.

8.2 Same data in text and JSON

  • A command’s text and its --json carry the same data (P5). session list is an index, one row per session (ADR 8.1). process list follows the same rule.
  • session status <session> is one session’s detail, as a flat object: owner, title, mode, model, whether a turn is running and for how long, running tools, plan progress, held messages, pending approvals and elicitations, token usage, the last turn (last_turn: stop_reason, error, tokens, ADR 4.4, with a line for it in the text), the last agent message (at most 4000 characters of it; the events have all of it), the session it was forked from (forked_from, ADR 3.12), and the agent (agent: program, the command brnr ran, and name and version, what the agent says it is in initialize, ACP’s agentInfo). The control socket’s status stays the full report, which bridges use; brnr shapes what it prints from it.
  • Running tools are the running turn’s (#164). A tool call the agent left unfinished, in a turn that was cancelled or failed, isn’t running once the turn has ended; nor is one from a load’s replayed history that ended or failed, nor a replayed call with a finished call’s id. ACP has no status for such a call, so brnr gives it none.
  • Text shows values, not JSON.
  • Every command that prints data takes --json: one JSON value, or one event per line for event log, event watch and session new --foreground. A command that fails says so on stderr, with the same exit status, and with --json prints its error as its JSON, {"error": {code, message}} (ADR 8.7). process stop and session close take it too, though their answer is mostly their exit status: they print what they did, the process stopping ({pid, status}) and the session closed ({session}, as session fork names its session). event notify doesn’t: its stdout is its command’s.
  • The usage starts with acp, then has a section per group (process, session, prompt, queue, permission, elicitation, config, event), then brnr (doctor, skill, --version). It says once, at the end, what a <session>, a <request> and a <pid> are, and that --json is everywhere. brnr <group> --help prints a group’s part. A usage error prints that command’s lines, not all of it.

One concept has one name and one shape in every command’s --json, and in the socket’s replies where the commands print their fields as they are (#150). A field means one thing and has one type wherever it is, and is named as ADR 5.9 has it:

  • Lists. A command that lists prints an object, the list under the plural of what it lists: process list {processes}, session list {sessions}, permission requests and elicitation requests {requests}, doctor {checks}, as doctor --report --json, config get ({session, options}) and prompt commands ({session, commands}) have theirs. It has no version: brnr’s major version is the version of what it prints (ADR 8.4).
  • Rows. A row is the object its command’s detail prints, with fewer fields, none renamed or reshaped: session list’s are session status‘s (with source), permission requests’ are permission show‘s, elicitation requests’ are elicitation show’s, which has the process’s pid as its row does; a process list row’s sessions are session list rows with session and state only.
  • ACP’s objects whole (ADR 5.9). A permission request’s options are the agent’s, {optionId, name, kind}, in permission requests as in permission show and permission_request; --option-id takes an optionId (ADR 8.1).
  • A count or a list, never both. A count of what is listed elsewhere is <what>_count, as records_skipped’s acp_count is: session status, and the socket’s status, have held_count, context_count, pending_count and elicitation_count, where held and context are queue list’s lists, and pending and elicitations the socket’s pending answer’s.
  • dropped is the messages dropped, a list of {message, text, reason} as their message_dropped events have them: in prompt cancel, queue drop and queue clear, and in --wait’s turn, where it is empty, or the message whose drop ended the wait (ADR 8.3).
  • agent is {program, name, version} in process list, session list and session status: program the file name of the command brnr ran, name and version what the agent says it is in initialize (agentInfo); each null where brnr doesn’t know it. A process that doesn’t answer, an inactive session and a session only the agent lists have no agentInfo brnr kept. The socket’s status, the full report, keeps the command as agent, as a profile’s agent has it (ADR 6.1), and agentInfo as agent_info; the commands make agent of the two.
  • owner is who owns a process’s sessions, editor or headless, and null where it isn’t known: a process that doesn’t answer. Whether one answers is its state in process list, starting, running, stopping or unreachable, as a session in it is unreachable in session list.
  • Who and where. by is who acted (ADR 5.9), never a process: a session’s lock is held by lock_pid, and the processes serving it without it are shared_pids (ADR 3.9). session fork names the session it forked forked_from, as session status and session list do. session delete names the files session_deleted went into recorded_in: recorded is history’s boolean.
  • event wait prints one shape for each --for, whatever ended the wait and whether it held when the wait began (ADR 8.3).

Why. Scripts and agents read --json, people read text (F5). If the two carried different data, brnr would have two interpretations of one session where P5 allows one, and a script could not see what a person sees.

At f017499 one thing had several shapes (#150): dropped was a reason in --wait and a list of messages in prompt cancel and queue, so jq '.dropped | length' worked on one and not the other; a permission request was rewritten in permission requests (name dropped), ACP’s in permission show, and either that or its event in event wait, which also made up an idle event and a process_exited with no fields but its status; agent was a string in the lists and an object in session status; held and context were counts in one and lists in another; owner held reachability in process list; and every list was a bare array. A script written against one command broke on the next, and ADR 8.4 would hold each of these for 1.x (F5, P5). One shape learned once is fewer concepts (N4), and a filter written for a row works on the detail. An object can gain a field in a minor release (ADR 8.4) where a bare array can’t: what belongs beside a list, such as the processes that didn’t answer, which go to stderr now, has room. Within a major, what changes in an object is fields added, which readers ignore, so a version beside them would never change; a 2.0 can add one if it needs one.

Considered.

  • session list --json as every process’s whole status report, while the text showed six columns.
  • session status as a summary in text and the raw report in --json.
  • --json on a few commands only.
  • Bare arrays for lists, as they were: nothing can be added beside the rows without a break.
  • A version in each list’s object: within 1.x it could only stay 1.
  • JSON lines for lists, as event log prints: a list is one value, read whole; the event commands stream because events go on.
  • dropped as the drop’s reason in --wait: prompt cancel and queue drop several messages, so one name would keep two types.
  • Lists in session status for held and context: it counts what queue list lists, as it counts the approvals permission requests lists, each with its tool call.
  • A request in permission requests as brnr rewrote it, {option_id, kind}: it dropped the option’s name, and was a third shape of one request.
  • agent a string everywhere, with agent_name and agent_version in session status: three fields for one thing, and nowhere to add a fourth.
  • owner: unreachable, as it was: a field with two lists of values.

8.3 Waiting, and exit status

  • brnr event wait <session> [--for idle|turn|permission|elicitation|exit] [--timeout <s>]:

    • idle (the default): no turn running, nothing held, and no approval or elicitation waiting, also one whose turn has ended (ADR 3.8), as --stop-when-idle counts it. It returns at once if the session is idle already, so prompt send followed by event wait can’t race. A closed session counts as idle. A process whose status lacks a count this needs (an older brnr’s) fails the wait, saying which: a count that isn’t there isn’t 0 (P4).
    • turn: the next turn that ends.
    • permission: an approval is waiting (at once if one already is).
    • elicitation: an elicitation is waiting, as for permission (ADR 4.5).
    • exit: the process exits.
  • Exit status: 0 when the condition is met and, for idle and turn, the last turn ended normally (end_turn). 1 if that turn failed or stopped for another reason, if its message was dropped, if the agent exited first (but for exit), or (for turn, permission and elicitation) if the session closed first. 124 on --timeout, as timeout(1) does; a timeout doesn’t cancel the turn. 3 when the command was cut off for falling behind and couldn’t catch up from the transcript, saying what it missed (ADR 10.2). The same codes for prompt send --wait, session new --wait and session resume --wait. event wait on a session that is idle already exits as its last turn ended.

  • Usage errors and help, the same in every command (#153):

    • A usage error exits 2: an unknown command, verb or option, an argument missing or one too many, a value a flag can’t take, brnr or a group with no command. Nothing is done, and the command’s usage is printed on stderr, after what was wrong where brnr can say it (brnr: unknown option: --bogus); for a command brnr doesn’t have, brnr --help lists every command in place of all of it. brnr acp exits 2 so already. 1 stays an operation that failed, so a script tells a mistake in its own command line from a failure.
    • A usage error is what the command line alone shows wrong, checked before anything is read or done: flags that don’t go together (--timeout without --wait), a value not of the flag’s form or not one of its fixed choices (--for, --events, --include, --option <o>=<v>, brnr skill’s references), an empty --prompt. What depends on anything else is a failure, 1: a session, process or profile that isn’t there, a mode or option the agent doesn’t have, a file that can’t be read, a prompt on stdin that is empty. brnr acp too: a config error there exits 1, as in session new (#338).
    • --help and -h print the usage on stdout and exit 0, wherever they are taken (ADR 8.1): brnr, a group without a verb (brnr session --help), a verb, brnr acp, doctor and skill (skill install too).
    • The usage names a thing one way: brnr acp --help says <p> and <agent>, as brnr --help does, not <name> and <program>.
    • The adapters’ own --help (brnr-claude-adapter --help) is left as upstream has it. An adapter brnr packages is upstream’s program, unchanged but for finding the agent and --version (ADR 11.1), and not part of what ADR 8.4 covers.
  • A timeout too long to count is no timeout, not a crash. --timeout goes with --wait: without it, prompt send and session new fail, and nothing is sent.

  • While prompt send --wait, session new --wait and session resume --wait wait, approvals and elicitations are announced on stderr, with how to answer them.

  • session new --wait prints started … on stderr, so that stdout is the agent’s reply and nothing else (brnr session new --wait … > answer.md).

  • With --json, --wait prints the turn as one object at its end: {session, message, reply, stop_reason, error, tokens, dropped}, and for session new and session resume its pid. tokens is what the agent reported for the turn, or null (ADR 4.4). dropped is the messages dropped, as prompt cancel has them (ADR 8.2): empty, or the message, dropped before it was sent.

  • With --json, event wait prints what met its condition in one shape for each --for (ADR 8.2), whatever ended the wait, and whether it held when the wait began:

    • idle: the session’s state, {session, state, last_turn}: state idle, or inactive once it has closed, as session list has it, and last_turn as session status has it, null before the first turn.
    • turn: the turn’s turn_ended event, as event watch --json prints it.
    • permission and elicitation: the request waiting, as permission show --json and elicitation show --json print it. The event of one answered before brnr asks for it doesn’t end the wait: none is waiting.
    • exit: the process_exited event. A process gone without sending it (killed) gets the same event from the command, as far as it knows it: exit_status and seq null, ts when it saw the process go, and error saying so. Only once brnr has seen the process exit, as catching up decides (ADR 10.2): a connection that fails while it lives is a failure, 1, saying brnr can’t tell that it exited (P4).

    Text says the same: idle: end_turn, inactive: session closed (idle), turn ended: end_turn, approval p1: Edit src/lib.rs, exited.

Why. A script or a supervising agent needs to wait for a turn without polling, and to know from the exit status alone how it ended (F5, P3). The control commands exited 1 for a usage error, the code of a failed operation, while brnr acp exited 2; doctor --help and skill --help printed on stderr and exited 1, while a verb’s --help printed on stdout and exited 0 (#153). An exit code is part of the interface (ADR 8.4), so one situation gets one code in every command (F5, P5). 2 is what many utilities exit for a usage error (grep, ls, the shell’s builtins) and what brnr acp exits, and 0, 1, 3 and 124 already have their meanings. Help asked for is the answer, so stdout and 0, as a verb’s --help had it already. The line between a usage error and a failure is what the command line alone shows, so the same words get the same code whatever the machine holds (P5), and a script that gets 2 knows retrying can’t help. Saying what was wrong before the usage serves both of 8.1’s needs: the option named, and the command’s form to fix it by. A command brnr doesn’t have has no usage of its own, and all of brnr --help for a typo buries the one line that matters. An editor’s process reads the same config as session new, and nothing in what an editor does with the code needs it to differ: the editor shows stderr either way (ADR 3.3), so one situation keeps one code (P5).

Considered.

  • A command per condition (wait-idle, …): one command with --for is smaller.
  • A usage error exiting 1, as the control commands do: brnr acp would need changing instead, and a script couldn’t tell a mistake from a failure.
  • An exit code of its own for each kind of usage error: one code says the command line was wrong; stderr says how.
  • sysexits’ 64 (EX_USAGE): few utilities use it, and brnr acp has 2.
  • Help on stderr: help asked for is the output, and brnr --help | less should work.
  • A usage error only for what the parser catches, every other check a failure: --timeout without --wait would then exit 1 while --timeout soon exits 2, two codes for one kind of mistake.
  • brnr acp exiting 2 for a config error, as it did: the same config error would exit 2 there and 1 in session new.
  • Making the adapters’ --help print a usage without starting ACP (as a comment on #153 asked): it would change upstream’s program past what ADR 11.1 adds, for an interface ADR 8.4 doesn’t cover.

8.4 What the compatibility promise covers

From 1.0.0, P9’s “compatibility is kept within a major version” is of what is covered below, and of nothing else. Before 1.0.0, P9 has changes made outright, with no aliases or shims. Nothing is implemented: the promise starts at 1.0.0.

Covered:

  • The command line: its commands, their flags and positional arguments, and what each means. The library’s facade (ADR 8.5) is covered as part of it: it mirrors the command line, and changes as it does. Cargo’s semver binds every public item on crates.io anyway.
  • --json structures: what each command prints with --json, its fields, their types and what they mean. A field that is a message for people carries text whose wording isn’t covered.
  • Exit codes: what each command exits with, in each situation the interface reference lists (docs/reference/exit-codes.md).
  • Error codes: each error’s code (ADR 8.7), wherever brnr reports an error as data, and what it means; its message isn’t covered, nor is unclassified, which promises nothing. ACP’s error the agent answered with, rpc_error, is ACP’s.
  • Events for bridges: each event’s name and fields, wherever it goes: a bridge’s stdin, --json lines (event log, event watch, session new --foreground), event notify’s stdin and its BRNR_* variables.
  • The bridge protocol, as a bridge brnr starts sees it: a bridge started from the profile, its requests on its stdout and its replies and events on its stdin: each request’s cmd, its fields and its reply; how long a bridge lasts (events until its process exits, then stdin EOF, then SIGTERM); and BRNR_PID in its environment. Only bridges brnr starts are covered: a client that connects to the control socket itself has no promise, whatever it speaks.
  • Transcripts: the events file and the raw ACP file of each session under $BRNR_HOME (projects/<folder>/<session id>.jsonl and .acp.jsonl), and their records, in format 1. A 1.x brnr reads what an earlier 1.x wrote (event log, session list, session resume). What each record promises, and how a reader tells a format it doesn’t read, is ADR 5.10’s.
  • Where brnr’s files are: how the state directory ($BRNR_HOME, else ~/.brnr) and the runtime directory are found, and where each file brnr writes under $BRNR_HOME is, the session locks ($BRNR_HOME/sessions/<id>.lock, ADR 3.9) among them. Where a file is is covered; what it contains is covered only where this list says so (transcripts), not for host logs or lock files.
  • Config TOML: the file (BRNR_CONFIG, else its default path), its profiles and their sections, keys and values, and the names experimental and features take.
  • ACP, and what brnr acp passes through: brnr speaks ACP version 1 to agents, and to editors through brnr acp (ADR 2.2). brnr acp passes what is between the editor and the agent as P1 says: unchanged, but for the changes named there (ADR 3.1, 3.9, 7.1), with the defaults they have at 1.0.0.

The environment variables brnr reads are inputs, as flags are, and go with what they belong to: BRNR_CONFIG and BRNR_START_TIMEOUT with config, BRNR_HOME with where brnr’s files are. BRNR_DIR is covered as where the runtime directory is, not as what is in it. Error codes are covered (ADR 8.7): each code, and what it means, wherever an error is reported as data; unclassified promises nothing, and a failure under it may get a code of its own in a minor release.

Not covered: whatever isn’t listed above, and in particular:

  • Human-readable output: tables, summaries and events as text, their columns and layout; --help and usage text; doctor’s check lines and doctor --report; brnr skill. Scripts read --json.
  • The wording of error messages, wherever they are: on stderr, in a --json field, in a reply’s error.
  • What host logs ($BRNR_HOME/hosts/<run id>.jsonl) and session lock files contain: their records and fields.
  • The control socket. It is in the runtime directory, which is private (P13, ADR 3.9), and it is not an interface: it is how brnr’s own commands and the bridges brnr starts reach a process. Its path ($BRNR_DIR/<pid>.sock), how processes are found, their metadata files (<pid>.json, whose brnr and protocol are for brnr’s own commands, ADR 8.8), and connecting to it directly, by BRNR_SOCKET (which a started bridge has) or otherwise, have no promise. A client connected directly speaks the bridge protocol, but what it speaks, and whether it is answered, can change in any release.
  • What is in the runtime directory (BRNR_DIR), and its layout: sockets and metadata files. How it is found is covered, as above.
  • brnr host, which brnr starts itself, never a person.
  • The library’s internals, behind the feature that is off by default (ADR 8.5).

Compatible and breaking changes in 1.x:

  • Compatible, so in a minor release: a new command, flag, JSON field, event, event field, bridge request, config key, or an exit code for a situation that had none.
  • Breaking, so in a major release only: removing or renaming any of those; changing a field’s type or what it means; changing the exit code of a situation that has one.
  • Whoever reads what brnr writes ignores the fields and events it doesn’t know: bridges, scripts reading --json, event notify commands, readers of transcripts. A bridge subscribed to every event gets the new ones too.
  • A deprecated form keeps working until the next major version: the changelog says so under Deprecated, with what to use instead.

Security fixes are made on the latest major version, in a release of it; upgrading within that major is the fix, and breaks nothing covered. There is one major so far, so no support period for older majors is set; it will be, by a record that amends this one, once a second major exists.

The promise starts at 1.0.0. #150 (--json shapes) is decided and made (ADR 8.2), as are #151 (event and transcript record names: ADR 5.9, #314), #70 (what a transcript promises, its format marked: ADR 5.10), #153 (the exit code of a usage error, --help: ADR 8.3, #310), #154 (flags and config keys spelled two ways: ADR 8.1 and 6.1, #311), #205 (error codes: ADR 8.7), and #149 (a process and the commands of different releases: ADR 8.8). What they settle is what 1.0.0 promises.

Why. P9 alone says compatibility is kept within a major version, but not of what, and each of brnr’s interfaces is a different kind of promise (#148). Bridges and the control socket speak one protocol, but the socket is private (P13); leaving the protocol out with it would leave a bridge’s requests, such as answering a permission, with no promise.

Consequences.

  • The interface reference, docs/reference/ in the book, marks what is covered and what isn’t, with a table of each output’s fields and an example of it that a test runs (#375); SECURITY.md, CHANGELOG.md’s conventions, CONTRIBUTING.md and AGENTS.md say the 1.0 policy next to the pre-1.0 one.
  • From 1.0.0, a breaking change to what is covered waits for 2.0.0. A **Breaking:** entry in a 1.x release is wrong; a form that is replaced is deprecated instead, and the old form kept.
  • A bridge that needs the promise is started from a profile. One that connects to the socket itself works, with no promise.
  • brnr still refuses a config key it doesn’t know (P7, ADR 6.1): a profile using a key added in 1.3 doesn’t load in 1.2.
  • Scripts match exit codes, --json fields and error codes (ADR 8.7), not messages.
  • Text output can change in any release, for people: P5 has it carry the same data as --json, so nothing is in it that --json doesn’t have.

Considered.

  • Leaving the bridge protocol out with the socket: bridges’ requests, which go over the same protocol on a started bridge’s stdin and stdout, would have no promise.
  • Covering the socket too: it is in the private runtime directory, there for brnr’s own commands and the bridges it starts, and the runtime directory’s layout, how processes are found and their metadata would be held for 1.x. A started bridge has all a bridge needs.
  • Covering text output: two contracts for the same data (P5), and text is for people, who are served by changing it.
  • Covering the wording of errors: every better message would wait for a major. Error codes (ADR 8.7) let the wording change freely.
  • Covering what host logs contain: they are what a process records for itself and for doctor, not for others to read; the session’s story is in its events file (ADR 5.1).
  • A support period for older majors now: there is only one.
  • Keeping the library public: every internal change would be a semver change (ADR 8.5).

8.5 The library is private, and its facade mirrors the command line

Implemented: brnr::run and the typed facade (#215) are the library’s public items.

  • The library is private. Its modules are mod, not pub mod, and an item is pub(crate) unless something outside reaches it (below).
  • Its public API is a facade that mirrors the command line, and nothing else. From 1.0.0 the facade is covered by the compatibility promise (ADR 8.4); what isn’t in it is not. Only the facade is what the crate published on crates.io offers (ADR 11.6).
  • brnr::run(args) is the facade’s coarsest piece: brnr <args> as a function, args being the words after brnr, run to the exit status the binary would exit with. The dispatch (acp, host, the rest) is run, and the command modules (ctl.rs, ctl/) are the library’s; main.rs calls run with its arguments and does nothing else. run adds no surface the command line doesn’t have: its words and exit statuses are the command line’s. Remote dispatch (ADR 12) replaces the calling process with SSH; it returns only if routing or executing SSH fails.
  • The typed facade has this shape: one module per command group (process, session, prompt, queue, permission, elicitation, config, event, profile, ADR 8.1), and the tools at the top level (doctor, skill, and skill::install), with one function per verb (brnr::session::list, brnr::prompt::send), taking the command’s positional arguments as arguments and its flags as a struct (session::ListFlags), and returning the data its --json prints, with the same names and shapes. An error is brnr::Error, with the code the command’s error has (brnr::Code, ADR 8.7); its message, like the command’s, is not covered.
  • A function runs its command, in this process: it builds the command’s words from its arguments, runs them as run would with --json, and reads what the command printed into its type. What it returns is the command’s data by construction, one interpretation (P5), and a test for each verb compares the two (tests/facade.rs). What the command says on stderr, it says.
  • Its types are the --json shapes: a struct for each object brnr makes, each field named as in JSON; serde_json::Value for what is ACP’s, as the agent sent it (a tool call, options, a plan, a content block); and brnr::Event for an event, its name and its fields as JSON (docs/reference/events.md has them). Every struct, of data and of flags, and Code, is #[non_exhaustive], so that a minor release can add a field, a flag or a code (ADR 8.4); flags are set on their Default. Fixed values (state, owner) are strings: a minor release can add one.
  • Where the command’s exit status says more than that it failed, the function returns brnr::Exit: Success (0) and Failure (1) with what it printed, TimedOut (124) and Missed (3) with the events_missed note (ADR 8.3, 10.2). These are the waits (session new and resume, prompt send, event wait), event watch, session delete, session prune and doctor. A flag a command needs is an argument (session::prune(older_than, …)). A verb whose --json has a shape for each flag (--wait, --for) returns an enum of them (session::Started, event::Waited).
  • A stream, event log and event watch, gives each event to a closure as it comes, until the command ends or the closure breaks. The command runs on a thread of its own, its events passed one at a time, so a caller slow to take them is a reader slow to read, and a process cuts it off as it would the command (ADR 10.1). Broken off, the function stops the command: its connections to the process are shut, it catches up on nothing, and it has ended, its thread and connections gone, when the function returns, though no event comes after (ADR 10.4); so too when the closure panics. While it runs, it holds only the connections it has open: one that catching up replaces leaves what the facade shuts.
  • What is in the command line and not in the facade, and why: --foreground and --quiet attach the process to a terminal, and event notify runs a command for each event, with signals of its own: a program does both with event::watch. doctor --report is not covered (ADR 8.4). --help and --version are for people. --prompt - and elicitation accept - read stdin: the facade takes the prompt and the fields as arguments, a prompt that is - too. SSH routing and remote check are CLI-only: they replace the process and inherit its streams, while typed facade calls must return data to their caller.
  • A usage error, which the command line exits 2 for without a code (ADR 8.3), is usage_invalid: a function has no exit status to say it with. The flags’ types rule out what they can (prompt send’s modes are an enum); the rest the command checks, as it does its words. A positional argument the command would read as an option (--…, or -) is one too, checked before the command runs: --json as a session would make permission requests another call, every session’s. A flag’s value is the flag’s, whatever it is (ADR 8.1).
  • session new and session resume start the process from the running program, as <program> host, as brnr does from its own binary (ADR 3.3): the process is the same brnr as the facade that started it (ADR 8.8). A program that starts processes so hands its arguments to brnr::run when the first is host, before anything else, as brnr’s main does. Adapters are looked for next to that program (ADR 11.2).
  • The crate’s own tests and fuzz targets reach internals through brnr::internals, a #[doc(hidden)] module behind the internals Cargo feature, off by default. It re-exports what they use (frame’s reading and writing, json’s parsing and spans, schema‘s types, log::rfc3339, the error codes’ names (ADR 8.7) and host::fuzz’s harness), and nothing more. The integration tests turn it on with a dev-dependency of the crate on itself, so cargo test needs no flag; fuzz/Cargo.toml turns it on for the fuzz targets. host::fuzz is compiled only for unit tests and with the feature.
  • internals is not covered by any compatibility promise, before or after 1.0.0: its items change, move or go whenever the tests do. The crate’s documentation, Cargo.toml and this record say so. With the feature on, unreachable_pub warns of a pub item that nothing outside reaches, so pub keeps meaning reachable through the facade or internals.

That nothing else is public is the compiler’s to check: a private module can’t be named from outside the crate, and cargo doc without the feature lists the facade alone: run, the typed facade’s modules and functions, and their types. The fuzz targets building against internals is checked by the fuzz workflow’s build (.clusterfuzzlite/build.sh).

Why. cargo publish uploads the library at every release (ADR 11.6), and from 1.0.0 Cargo’s semver rules apply to every pub item in it, though none was meant for anyone but brnr. Holding them still would hold back changes users never see; letting them move would break P9’s promise for whoever used them. brnr’s interface is its command line, with --json as its data for programs (ADR 8.2). A library is useful only as that interface again, not a second one: P5’s one interpretation, reached two ways, with nothing the command line doesn’t say. The typed facade is that: each function is its command, and its types are the command’s --json.

Consequences.

  • cargo doc without the feature lists the facade alone. The command line, with --json, is the interface; the facade is it as functions.
  • A Cargo feature can’t be hidden from crates.io: internals is in the published manifest and anyone can turn it on. What it reaches is no promise, and is said to be none.
  • Cargo turns a feature on for the whole of one build: under cargo test the binary the tests drive is built with internals too, and so has the fuzz harness and its StartChannel variant, which nothing in the binary calls. cargo build and cargo install, what users run, build without.
  • A program that wants brnr’s data calls the facade’s function for the command, or runs the binary, or brnr::run, with --json: the same data each way.
  • A change to a command’s --json is a change to its facade type, in the same pull request: its test fails otherwise.
  • src/config.rs, the config file, is src/profiles.rs: the facade’s config module, the command group’s, is brnr::config.

Considered.

  • Keeping the library public, and treating every change to a pub item as a semver change from 1.0.0: the library would hold still for users it was never written for, and every refactor would be a major version or a break.
  • #[doc(hidden)] on public modules, with the documentation and ADR 11.6 saying the library isn’t covered: the items would still be reachable by path, and a promise kept only in prose is one a user can miss and a tool like cargo semver-checks doesn’t see. Private modules are the compiler’s promise.
  • Everything private, with the tests and fuzzers under a cfg instead of a feature: cfg(test) is set only for the crate’s own unit tests, not for tests/ or fuzz/, which are separate crates; a custom --cfg would have to be passed to every cargo test, by hand and in CI. A feature can be turned on in the manifests that need it.
  • Moving the integration tests and fuzz targets into the crate as unit tests: the integration tests drive the real binary against tests/fake_agent.py, and cargo-fuzz builds its targets as a crate of its own.
  • A second, unpublished crate holding the internals, which brnr and the tests both depend on: a published crate can’t depend on an unpublished one, so it would be published too, with the same promise problem, and a workspace for it.
  • Building the typed facade before #150: its return types would be --json shapes that #150 changes, so it would be built twice or would freeze them.
  • Functions that do the commands’ work themselves, the commands printing what they return: one interpretation too, but each command split in two, about thirty of them, and the commands’ output, errors and exit statuses checked again. Running the command is the command, and the test for each verb keeps the types to its JSON.
  • serde_json::Value for every result: no type to read, and nothing for the compiler to check. A struct for each object brnr makes is the --json reference’s tables as code.
  • A Rust enum for each event, by name: about thirty, each with the fields events.md lists. The events’ fields are the most numerous and the most added to; a follow-up can type them (#388).
  • A Rust enum for each fixed value (state, owner, level): a minor release can add a value, which a closed enum would make a break.
  • An iterator for a stream: the command pushes its events, so an iterator needs the same thread, and its errors come only once it ends.
  • A setting for the executable that session new starts: a second way to start a process, and a brnr whose version may not be the facade’s (ADR 8.8). The running program is the facade’s brnr.
  • Leaving out session new and resume without --pid, for the program having to hand host on: a program could open sessions only in a process the binary started.
  • Keeping the facade’s commands quiet on stderr: what they say there (a process not answering, an approval waiting) is in no --json, and would be lost (P3).

8.6 A skill for agents that use brnr

Agents use brnr to run other agents: start headless workers, send them follow-ups, wait for their turns, read what they did, and bring their approvals to the user. How one agent should manage another is part of brnr’s contract, so the skill states it as principles, S1 to S7, each checked against ADR 1:

  • S1. The CLI is the interface. The skill teaches brnr’s commands as they are, and adds nothing between them and the agent: no scripts, no MCP server, no wrapper. The headless CLI behaves the same with every agent (P12) and prints the same data in text and JSON (P5, ADR 8.2); a wrapper would be a second interpretation of it. Every command the skill shows is one brnr --help lists, with --json wherever it prints data, and runs as a test.
  • S2. Exact ids, never guesses. A session is the session that session new --json printed, or a row of session list --json; a request the request of permission requests --json or event wait --for permission --json; a message the message of prompt send --json. Never “the only session”, never an id read out of the text output, never one remembered from another conversation without finding it in session list --json (P4, ADR 3.2, ADR 4.1).
  • S3. Wait, don’t poll. prompt send --wait, session new --wait and event wait --for idle|turn|permission|exit, each with a --timeout, so that a stuck worker can’t hang its supervisor; never a loop of sleep and session status. The exit status is the result (ADR 8.3): 0 the turn ended normally, 1 it failed, stopped, or its message was dropped, 124 the timeout passed, which says nothing about the worker: its turn goes on, and waiting again, cancelling or asking the user is a choice to make.
  • S4. Approvals belong to the human. permission allow and permission reject are the user’s answers. An agent gives one only where the user delegated it, explicitly and for that scope: which sessions, and which kinds of request (edit in src/, execute of cargo test), for the task at hand. It never widens a delegation, and never changes a worker’s mode to one that asks less (acceptEdits, bypassPermissions) to avoid asking, unless the user asked for that mode: how much the agent asks is its mode (P2, ADR 4.5), and choosing it is the user’s. By default the agent shows the request (permission show), says what it is in a sentence, and waits for the user’s answer. A request on an editor’s session is answered in the editor (ADR 7.1).
  • S5. Clean up what you start; touch nothing else. Workers start with --stop-when-idle, so that a supervisor that dies or forgets leaves no orphan (P14, ADR 3.8), and are closed (session close) when their work is done; process stop <pid> only for a process the agent started. Sessions it didn’t start, an editor’s above all, are observed (session list, session status, event log, event watch), never acted on (P11, ADR 7.1), and never taken over (--take-over) unless the user asks for it in so many words (ADR 3.9).
  • S6. Nothing dropped silently. A turn that failed, a message dropped (dropped in --json, a message_dropped event), a timeout, an agent that exited: each is told to the user, with what brnr said, and not retried quietly. Retrying is the user’s decision, or one the user delegated (P3).
  • S7. A short core, details on demand. SKILL.md has when to use brnr, S1 to S6 as rules, and the dozen commands most uses need, short enough to load whole every time. The rest is in references, read when the task needs them.

The principles hold brnr’s user to what brnr holds itself to (P3, P4, P14), and leave to the user what brnr leaves to the agent or the user (P2, P11). None breaks a principle. The skill is documentation and a CLI command: outside ACP, and none of the kinds of “beyond” P1 marks.

What it covers:

  • skills/brnr/SKILL.md: frontmatter (name: brnr, a description saying to use it when asked to run, supervise or talk to coding-agent sessions through brnr); when to use brnr; the rules; the core commands.
  • references/orchestrate.md: a worker’s life (start, send, wait, read, close), several workers at once, the exit statuses, --stop-when-idle, steering and interrupting, held messages.
  • references/approvals.md: permission requests, show, allow, reject, and S4 in full: what a delegation is, what isn’t one, and what to show the user.
  • references/observe.md: session status, event log, event watch, event notify, choosing events, and the events’ JSON, as brnr prints it.
  • references/setup.md: installing brnr and the adapters, an editor’s agent command, profiles, doctor, installing the skill.

How it ships:

  • In the repository as skills/brnr/ (SKILL.md, references/*.md), and in the binary, embedded at build time (include_str!), so the skill an agent reads is the one for the brnr it runs.
  • brnr skill prints SKILL.md; brnr skill <reference> prints one reference (orchestrate, approvals, observe, setup), so that an agent that only has the binary can read them. Neither takes --json: they print a document, not data.
  • brnr skill install [--dir <dir>]... writes the skill to <dir>/brnr/, for each --dir, and by default to both ~/.claude/skills/brnr/ and ~/.agents/skills/brnr/: a fixed, documented rule that doesn’t depend on which agents are installed (P4). It replaces the files it writes, removes references a newer brnr doesn’t have, and prints each directory it wrote. A directory that can’t be written fails, saying which (P7). Installing again after upgrading brnr updates it.
  • The skill’s Markdown files are in DOCS in tests/docs.rs (#25), so every line of their sh blocks runs against the fake agent or is skipped with a reason, and every toml block loads as a config.

Left out: an MCP server or scripts (S1); a Claude Code plugin (skill install covers it for now, and a plugin can package the same files later); writing bridges (the bridge protocol is for programs, the documentation has it, and the skill points there); acting on an editor’s session (ADR 7.1’s experimental actions; the skill says not to, S5); doctor checking an installed skill against the binary’s.

Why. Without guidance, an agent drives brnr as a script would: it picks “the only session”, polls session status in a loop, approves what blocks it, retries what failed, and leaves workers running. Each breaks a principle brnr holds itself to (P3, P4, P14), done by brnr’s user. Agents learn a tool from a skill: a SKILL.md with a name and a description saying when to use it, loaded when the description matches, with further files read only when needed. Claude Code reads skills from ~/.claude/skills/<name>/ (and .claude/skills/ in a project); Codex from ~/.agents/skills/<name>/ (and .agents/skills/ from the working directory up to the repository’s root), as their documentation has it in October 2026.

Consequences.

  • Evals with a real agent are not done: checking that it used exact ids, waited rather than polled, didn’t approve without a delegation, and cleaned up. The examples’ tests check that the skill’s commands are right, not that an agent follows its rules.
  • A change to the CLI that breaks an example in the skill fails the tests, as one in the documentation does.

Considered.

  • A skill outside the repository (a separate repo, a plugin marketplace): it would drift from the CLI it describes.
  • brnr skill install only where the agent’s directory already exists: what is installed would depend on what happens to be there (P4).
  • Requiring --dir (or --claude, --codex): every install would name the obvious places; --dir stays for a project’s .claude/skills or .agents/skills.
  • One long SKILL.md: loaded whole on every use, most of it unneeded (S7).
  • Delegating approvals by default for “safe” kinds (read): what is safe is the user’s call, and the agent’s mode already says what it asks about (P2).

8.7 An error is a stable code and a message

Resolves #205.

Wherever brnr reports an error as data, it has one shape, "error": {"code": "<code>", "message": "<text>"}:

  • a socket or started bridge’s reply that fails: {"ok": false, "error": {code, message}};
  • an event, note or record that reports a failure: turn_ended, process_exited (when brnr itself died), events_missed, records_skipped, and the host log’s start_failed, open_failed, lock_failed, timeout_failed, display_stopped, process_panicked, session_log_failed and editor_request_refused. #70 marks these records’ format as it marks every record’s (ADR 5.10);
  • the --json fields that hold one: --wait’s turn’s and last_turn’s error (ADR 8.3, 8.2), session delete’s error;
  • a command that fails, with --json: its stdout is {"error": {code, message}}, its one JSON value, unless it had printed its JSON before it failed (a stream’s events); then stderr alone says so, and the stream stays one value per line. A wait whose turn failed exits 1 having printed the turn, whose error is the turn’s (ADR 8.3).

code is a word from the list below; message is for people. The rules:

  • A code is snake_case, subject first, as a record’s name is (ADR 5.9): session_not_found, process_unreachable, transcript_not_kept. Never a number: JSON-RPC’s numbers are ACP’s.
  • One code per failure a caller can act on, not per place brnr fails. A script that gets session_inactive resumes the session; one that gets session_closing tries again in 2 s (ADR 5.5); session_active closes it first, or takes it over. Failures a caller handles alike share a code: every malformed socket request is command_invalid.
  • unclassified is the catch-all, and promises nothing. A failure brnr gives no code of its own (an I/O error on brnr’s own files, an agent’s answer that isn’t ACP, what brnr didn’t foresee) is unclassified. Scripts must not match it: a failure under it may get a code of its own in a minor release. Every other code keeps its meaning through the major version (ADR 8.4).
  • The agent’s error stays the agent’s (F1, P1). Where what failed is the agent’s answer, a JSON-RPC error, the code is agent_failed, and the error has the agent’s beside it as rpc_error, whole and unchanged ({code, message, data}, ACP’s numeric code): {"code": "agent_failed", "message": "session/new failed: Authentication required", "rpc_error": {"code": -32000, "message": "Authentication required"}}. brnr’s code says whose failure it was, the agent’s what it was; brnr reads no ACP code into one of its own (P4), and a script that needs ACP’s reads rpc_error.code (session delete exits 0 for its -32002, ADR 8.1). A turn the agent failed is such an error in turn_ended, and so in last_turn and --wait’s turn.
  • ACP stays ACP. What brnr answers in the agent’s place, through brnr acp, is a JSON-RPC error as ACP has it (-32603, brnr’s message); the host log’s editor_request_refused has brnr’s code (P1).
  • Text says the code too (P5): a failed command prints brnr: <message> [<code>] on stderr, in text and with --json alike, and an error in an event shown as text has its code after its message: at the end of its first line, where lines follow that are the agent’s (its last lines on stderr, ADR 3.6). brnr acp says its errors to the editor’s log as it did, with no code: the editor gets none as data.
  • What isn’t an error as data has no code. A usage error (exit 2) is the command line’s mistake: the exit status says what it is, the usage how to fix it (ADR 8.3). A wait’s timeout (124) and a cut-off it couldn’t catch up on (3) have their exit codes, and the latter its events_missed, whose error says why. doctor’s failed checks are its data, {checks}: it exits 1 with how many on stderr.
  • The exit status stays coarse (ADR 8.3): every code above is a failure, exit 1, wherever a command exits with it.

The codes, by subject:

CodeThe failure
acp_version_unsupportedThe agent speaks an ACP version brnr doesn’t (ADR 2.2).
agent_exitedThe agent exited, and its process with it, before the command was done: a start, a wait, a request.
agent_failedThe agent answered with a JSON-RPC error, which rpc_error has.
agent_not_startedNo agent to start: none given or recorded, or its program can’t be run.
answer_invalidAn answer that doesn’t fit its permission request or elicitation: no such option, a kind missing or doubled, the other side’s option, content that doesn’t fit the form, an action that isn’t one (ADR 8.1, 4.5).
capability_missingThe agent doesn’t advertise what was asked: forking, closing, resuming, listing or deleting sessions, steering, images, an MCP server’s transport.
command_invalidA socket request that isn’t one: not JSON, no cmd, a field missing or of the wrong type, fields that don’t go together.
command_unknownA cmd the process doesn’t have, or a field of one it doesn’t take: a newer brnr’s request, which an older brnr’s process refuses (ADR 8.8); or a status answer without a field this brnr reads (a count, busy), as an older brnr’s has it (ADR 8.2, 8.8).
config_invalidThe config file can’t be read, isn’t private, or doesn’t load (ADR 6.1, 9.4).
event_unknownA note’s name in subscribe’s events: no process sends one (ADR 5.9). An event brnr doesn’t have, or a note, in a profile’s bridge events (ADR 6.1). subscribe leaves out an event the process doesn’t have, and names it (ADR 8.8).
experimental_disabledAn action on an editor’s session its profile doesn’t enable (ADR 7.1).
input_invalidWhat the command reads besides its command line won’t do: an empty prompt on stdin, stdin that isn’t the form’s fields, a file or image that can’t be read or sent, a --cwd that isn’t a directory.
message_not_foundNo held message has that id (ADR 4.2).
process_not_foundNo brnr process has that pid.
process_owned_by_editorAn editor’s process: no session is opened or forked in it (ADR 7.1).
process_panickedbrnr itself failed, and its process ended (ADR 3.7): a bug to report.
process_startingThe process hasn’t committed its start (ADR 3.4).
process_stoppingThe process is stopping, or its agent takes no more input.
process_unreachableThe process doesn’t answer, or can’t be reached from here (another BRNR_DIR, ADR 3.9).
profile_not_foundThe config has no profile of that name.
remote_brnr_not_found--remote: no brnr on the destination shell’s PATH; set it in ~/.zshenv or ~/.bashrc there (ADR 12.2).
remote_version_mismatch--remote: the destination’s brnr is another version, or has no remote support (ADR 12.1).
request_not_foundNo permission request or elicitation of that handle is waiting (ADR 4.1).
session_activeThe session is open in a process, where the command needs it not to be: close it first, or take it over (ADR 3.9).
session_closedThe session closed before the command was done.
session_closingThe session is closing; it is free once its records are written (ADR 5.5).
session_inactiveThe session isn’t open in any process; it can be resumed (ADR 3.11).
session_not_foundbrnr knows no session of that id.
session_openingThe session is opening, and takes no requests until it has (ADR 3.4).
setting_invalidA mode, model, thought level, config option or login method the agent doesn’t offer, or a value it doesn’t take (ADR 6.2, 4.7).
start_timed_outThe session didn’t open in the time its start had (ADR 3.4).
strict_mode_refusedStrict mode refuses what isn’t stable ACP (ADR 2.1).
transcript_not_keptThe process keeps no transcript to read, or no raw ACP (log, ADR 6.1).
transcript_unsupportedThe transcript is in a format this brnr doesn’t read (ADR 5.9, 5.10).
turn_owned_by_editorThe editor’s session’s turns are the editor’s: a steer, an interrupt, or a prompt while its turn runs (ADR 7.1).
unclassifiedAnything else. No promise: don’t match it.
usage_invalidThe arguments don’t make a command: what the command line exits 2 for, without a code (ADR 8.3). Only the library’s facade returns it (ADR 8.5).

src/error.rs has the list, docs/reference/errors.md lists it for users, and a test checks that the two agree and that a test reaches each code.

Why. At 8d4b1dd every error was text, at about 155 places: a reply was {"ok": false, "error": "<text>"}, a failure event had a text error, the CLI printed the text. A script or bridge that had to tell one failure from another could only match the wording, which ADR 8.4 leaves out of the promise so that it can get better (F5). A code inside the promise, beside a message outside it, lets both hold. One shape everywhere is one concept learned once (N4, ADR 8.2), and a field of one type (ADR 5.9): an error.code that was a number in turn_ended and a word in a reply would be two. A code for each failure a caller can act on keeps the list short enough to learn and handle, which a code per call site wouldn’t; the catch-all is what lets the list stay short without a promise brnr can’t keep: naming a new failure later breaks no script, since none may match unclassified. ACP’s error, whole beside brnr’s word, is what the agent said, unchanged (F1), and brnr’s word is what brnr knows: that the agent’s answer is what failed (P4). With --json, the code is in the JSON a script already reads; on stderr, a script would parse lines written for people.

Considered.

  • Kebab-case codes, as the issue had them, after the records’ names then: ADR 5.9 makes every name in brnr’s JSON snake_case.
  • Numeric codes: JSON-RPC’s are ACP’s, and a word says what it is.
  • One code per call site: about 155 codes, most of them handled alike.
  • The agent’s error as error itself, its code a number, beside brnr’s with a word: one field, two types (ADR 5.9).
  • Reading ACP’s codes into brnr’s (-32002 as session_not_found): a second interpretation of what the agent said, and a guess where the agent’s code is its own (P4, F1).
  • brnr’s code in the JSON-RPC errors it answers the editor with, in data: what the editor sees is ACP (P1), and the host log has the code.
  • The code first on stderr (brnr: session_not_found: no session s): a person reads the message; the code is for looking up, and a script reads --json.
  • No code in text: text and JSON would carry different data (P5).
  • The error object on stderr with --json: stderr has other lines for people (warnings, a process not answering), so it would not be one JSON value; stdout is where --json is.
  • An error object for usage errors too: exit 2 says it, and a usage error is found before --json is known to be one of the command’s flags. The facade has no exit status, so it has a code, usage_invalid (ADR 8.5).
  • internal for the catch-all: what falls under it isn’t only brnr’s bugs (a full disk, an agent’s malformed answer), and brnr’s bug has a code of its own, process_panicked.
  • A code for doctor’s failed checks: its checks are the data, and each says what failed.

Consequences.

  • Scripts match error.code, and ACP’s error.rpc_error.code where the agent failed; never message, nor unclassified.
  • A minor release can add a code, for a new failure or for one that was unclassified; removing or renaming one, or changing what it means, waits for a major (ADR 8.4).
  • A new failure is given an existing code where a caller would act on it the same way, else a new one; unclassified only where no caller could act on it.
  • The typed facade returns the code with its error (ADR 8.5), and usage_invalid where the command line exits 2.
  • ADR 8.8 answers a request, or a field of one, that an older process doesn’t have with command_unknown, and the CLI says how to restart it.

8.8 A process and the commands can be different brnrs

Resolves #149.

An editor’s process lives as long as the editor’s session, so after an upgrade (brew upgrade brnr) the new CLI routinely talks to an older process, and a bridge written for a newer brnr can be started by an older one. brnr acp starts its process from its own executable (ADR 3.1), so those two always match; the CLI and a process, and a bridge and its process, may not.

  • A process says what it is. <pid>.json, and so the socket’s status, which has the metadata, carry brnr, the version brnr --version prints ("1.0.0"), and protocol, a number: the version of what the socket speaks, its requests, their fields and replies, and its events. It is 1 until the first release after 1.0.0 that adds to that; each release that adds to it makes it one more. Within a major version nothing else changes it, as the protocol of a bridge brnr starts is covered (ADR 8.4): a process with a lower protocol has less than this brnr, never something else. A major version that changes it otherwise makes it one more too, and its brnr says it is another major.

  • A request the process doesn’t have is refused, command_unknown: a cmd it doesn’t have, or a field of one it doesn’t take (send doesn't take priority (it takes session, text, blocks, mode, replace)), and nothing is done: allow’s old option too (ADR 8.1). A field it takes but of the wrong type, as an option_id that isn’t a string, is command_invalid, as before (ADR 8.7): the request is malformed, not newer. A request is done as asked, or not at all (P7), as a config key brnr doesn’t know fails the config (ADR 6.1). A caller that can do without a newer field asks again without it.

  • subscribe leaves out an event the process doesn’t have, and names it, in its answer’s unknown_events; the subscription is to the rest. A note’s name is still refused, event_unknown (ADR 5.9): no brnr’s process sends one, so asking for it is a mistake whatever the versions. A profile’s bridge events are read by the brnr that starts the bridge, as the rest of the profile is, and an event it doesn’t have fails the profile (ADR 6.1).

  • The CLI says what it found, and how to restart the process. An error from a process whose protocol isn’t the CLI’s has, after its message, what the process is and what to do, where the error may come of the difference: command_unknown from an older or a newer process, and every error from a process with no protocol, a brnr from before this, whose errors are text that can’t be told apart (ADR 8.7). The code stays the process’s. A status answer without a field the CLI reads (a count, busy: an older brnr’s, which names it otherwise, ADR 8.2) is the CLI’s command_unknown, and said the same way. A headless process is stopped (brnr process stop <pid>) and its sessions resumed, which runs them in this brnr; an editor’s is restarted from its editor, whose brnr acp then is this brnr:

    brnr: unknown command: fork; process 4242 runs an older brnr (brnr 1.0.0, protocol 1) than this one (brnr 1.1.0, protocol 2): stop it (brnr process stop 4242) and resume its sessions (brnr session resume <session>) to run them in this brnr [command_unknown]
    

    Events a command subscribed to that the process doesn’t have are said on stderr, with the same, and the command goes on with the rest.

  • An older CLI and a newer process: within a major version, the newer process has every request, field and event the older CLI asks for, and its replies only add fields, which the older CLI ignores (ADR 8.4); there is nothing to tell. Across a major, the older CLI’s requests that the newer process doesn’t have are refused, command_unknown, and said as any error is; the CLI to use is the one installed.

  • The socket stays outside the promise (ADR 8.4). A client that connects to it directly has none, nor has <pid>.json: brnr and protocol are there for brnr’s own commands, which do meet processes of other releases. A bridge brnr starts has them in status’s reply, which is covered as the rest of its protocol is. What brnr’s commands read to find and reach a process (its metadata’s id, socket, host_pid, proxy_pid, started, brnr and protocol, and the socket’s path), brnr changes within a major version only by adding to: its own rule, so that the commands it ships keep reaching the processes it left running, not a promise to anyone else.

Why. Before this, nothing said which brnr was on either side (#149): an error was a bare string the CLI couldn’t tell from another, so after an upgrade a command failed with unknown command: X and nothing said why or what to do (F5); a field an older process didn’t know was ignored, because requests were read as untyped JSON, so a newer flag quietly did nothing (P3, P4); and subscribe refused a whole subscription for one name it didn’t know, so a bridge written for 1.1 got no events from 1.0. Refusing a request the process can’t do as asked keeps P7, and a request already done otherwise than asked can’t be undone, which telling of it after wouldn’t mend (N2). A subscription is a reader’s list of what it will read, and a reader ignores the events it doesn’t know (ADR 8.4): an event a process doesn’t have is one it never sends, so nothing is lost by subscribing to the rest, and the answer says what was left out (P3). The CLI knows both sides, so it can say which is older and how to restart it; the code stays the process’s, so a script’s match doesn’t change (ADR 8.7). brnr says which release a process is, for people and doctor; protocol says what it speaks, which most patch releases don’t change, as one number that only grows within a major, so that “has it what I ask” is one comparison, not a semver reading.

Considered.

  • brnr alone: a version string compared by semver rules, pre-releases and all, where most releases don’t change what the socket speaks.
  • A handshake on every connection, refused on a mismatch: one more round trip for every command, and a refusal of everything where most requests are the same in both.
  • Refusing every request from a CLI of another protocol: a 1.1 CLI can list, watch and answer a 1.0 process, which this would stop.
  • Ignoring a field the process doesn’t know and naming it in the reply (ignored): the request is done by then, otherwise than asked; a prompt sent can’t be unsent.
  • A code of its own for an unknown field (field_unknown): a caller acts on it as on an unknown command (the process is another brnr: restart it, or do without), and ADR 8.7 gives a code per failure a caller can act on.
  • Refusing a subscription that names an event the process doesn’t have, as before: a bridge for 1.1 got nothing from 1.0.
  • Taking such an event out without naming it: P3.
  • What to do after every error from a process of another protocol: most of its errors are its own (no such session, a setting the agent doesn’t offer), and the advice would be noise there.
  • Restarting the process for the user: it ends the editor’s session or a running turn; that is the user’s to choose (P4, P11).

Consequences.

  • A flag added in 1.x fails against a process of an earlier 1.x, saying so and how to restart it, instead of doing nothing.
  • event_unknown is only a note’s name in subscribe, and, in a profile’s bridge events, a note or an event that brnr doesn’t have.
  • A release that adds to what the socket speaks makes PROTOCOL (src/host/control.rs) one more, and says so under Added in the changelog; docs/reference/bridge.md lists each request’s fields.

Tests

Run cargo test --release adr_0008_. Named claims, by section:

  • 8.1: tests/cli.rs: adr_0008_old_commands_are_unknown, adr_0008_old_socket_commands_are_unknown, adr_0008_profile_keys_and_actions_have_the_new_names, adr_0008_help_lists_the_groups_and_their_commands, adr_0008_prompt_send_takes_its_prompt_as_a_flag, adr_0008_a_flag_is_never_a_session_or_pid, adr_0008_a_single_dash_word_is_an_argument, adr_0008_an_unknown_option_is_said, adr_0008_config_get_lists_options_choices_and_modes, adr_0008_config_get_narrows_by_category_and_id, adr_0008_config_set_by_category_and_by_id, adr_0008_new_and_resume_replace_start, adr_0008_thought_level_is_the_option_of_its_category, adr_0008_response_timeout_flag_wins_over_the_profile, adr_0008_allow_and_reject_pick_by_kind, adr_0008_a_missing_or_doubled_kind_fails, adr_0008_option_must_be_on_the_verbs_side, adr_0008_a_permissions_option_is_option_id, adr_0008_a_permissions_option_id_is_a_string, adr_0008_a_durations_name_has_no_unit, adr_0008_queue_show, adr_0008_queue_clear_flags, adr_0008_list_without_an_agent_is_brnrs_index, adr_0008_list_joins_the_agents_sessions_on_id, adr_0008_list_reads_the_agents_times_in_utc, adr_0008_list_finds_a_cwd_however_it_is_spelled, adr_0008_list_include_filters_by_state, adr_0008_list_stops_an_agent_that_wont_go, adr_0008_delete_keeps_the_transcript, adr_0008_delete_a_session_only_the_agent_knows, adr_0008_delete_purge, adr_0008_delete_purge_fails_when_the_agent_does, adr_0008_delete_purge_says_what_it_couldnt_delete, adr_0008_purge_deletes_an_older_brnrs_files_too, adr_0008_delete_records_in_each_transcript_it_can, adr_0008_an_editors_deletion_in_every_folder_isnt_activity, adr_0008_delete_refuses_an_open_session, adr_0008_delete_needs_an_agent_that_can_delete, adr_0008_new_in_a_running_process, adr_0008_resume_in_a_running_process, adr_0008_resume_in_a_running_process_by_loading, adr_0008_pid_refuses_process_flags, adr_0008_pid_refused_when_it_could_never_close, adr_0008_pid_settings_that_fail_close_the_session, adr_0008_pid_session_that_cant_be_locked_is_closed, adr_0008_pid_given_up_before_its_commit_sends_no_prompt, adr_0008_pid_timeout_abandons_the_opening, adr_0008_pid_opening_keeps_the_process_running, adr_0008_pid_opening_in_a_stopping_process_fails, adr_0008_pid_take_over_refused_before_closing; tests/headless.rs: adr_0008_an_editors_delete_is_recorded, adr_0008_pid_refused_in_an_editors_process; tests/security.rs: adr_0008_timeout_rejects_once_else_cancels_the_turn, adr_0008_purge_deletes_only_that_sessions_files; src/render.rs: adr_0008_a_deletion_is_shown_with_who_deleted; src/paths.rs: adr_0008_a_sessions_files_are_its_own_and_those_set_aside; src/log.rs: adr_0008_a_time_is_read_with_its_offset_and_written_in_utc, adr_0008_what_isnt_an_rfc3339_time_isnt_read; src/ctl/args.rs: adr_0008_a_flags_value_is_never_a_positional, adr_0008_every_flag_is_in_its_verbs_usage, adr_0008_positionals_and_unknown_options, adr_0008_a_prompt_is_a_flags_value.
  • 8.2: tests/cli.rs: adr_0008_status_summarizes_the_session, adr_0008_stop_and_close_take_json, adr_0008_a_cancelled_turns_tool_calls_are_not_running, adr_0008_a_failed_turns_tool_calls_are_not_running, adr_0008_a_list_is_an_object, adr_0008_a_row_is_its_details_object_with_fewer_fields, adr_0008_dropped_is_a_list_of_messages_everywhere, adr_0008_a_count_is_named_so (and, for process list’s state and owner, ADR 3’s adr_0003_ps_lists_the_processes and adr_0003_a_silent_process_keeps_its_session); tests/headless.rs: adr_0008_the_agent_is_what_it_says_it_is (#335), adr_0008_a_turn_ending_in_a_replay_leaves_no_tool_call_running, adr_0008_a_failed_loads_history_leaves_no_tool_call_running, adr_0008_a_replays_call_with_a_finished_calls_id_is_not_running; src/ctl.rs: adr_0008_status_says_the_sessions_state; src/render.rs: adr_0008_text_shows_values_not_json.
  • 8.3: tests/cli.rs: adr_0008_send_wait_prints_the_reply, adr_0008_start_wait_prints_the_reply_and_the_turns_result, adr_0008_send_wait_times_out, adr_0008_timeout_goes_with_wait, adr_0008_send_wait_reports_a_permission_request, adr_0008_wait_behind_exits_as_the_last_turn_ended, adr_0008_wait_returns_when_the_session_goes_idle, adr_0008_wait_on_an_idle_session_reports_the_last_turn, adr_0008_huge_timeouts_are_never, adr_0008_wait_for_permission, adr_0008_wait_for_exit, adr_0008_event_wait_prints_one_shape_for_each_condition, adr_0008_a_session_with_a_request_waiting_isnt_idle, adr_0008_a_usage_error_exits_2, adr_0008_help_exits_0_on_stdout, adr_0008_a_failed_operation_exits_1; src/ctl/talk.rs: adr_0008_wait_for_exit_says_exited_only_once_the_process_has, adr_0008_a_count_the_status_doesnt_have_isnt_0.
  • 8.4: the promise applies from 1.0.0; what it covers is documented with examples that can’t drift: tests/docs.rs: adr_0008_every_json_example_has_the_shape_brnr_prints.
  • 8.5: tests/cli.rs: adr_0008_run_is_the_command_line: brnr::run, called in the test’s process, ends with the exit status the binary exits with for the same words. tests/facade.rs, one for each command group, each verb’s function compared with its command’s --json and exit status: adr_0008_the_facade_has_process_list_and_stop, adr_0008_the_facade_has_session_new_and_resume (a process the facade starts, and usage_invalid), adr_0008_the_facade_has_session_status_list_fork_close_and_delete, adr_0008_the_facade_has_prompt_send_cancel_and_commands, adr_0008_the_facade_has_queue_list_show_drop_and_clear, adr_0008_the_facade_has_permission_requests_show_allow_and_reject, adr_0008_the_facade_has_the_elicitation_verbs, adr_0008_the_facade_has_config_get_and_set, adr_0008_the_facade_has_event_log_watch_and_wait (a stream broken off, its connection closed though no event follows, and when its closure panics, a timeout), adr_0008_the_facade_has_doctor_and_skill, adr_0008_the_facade_has_profile_list_show_and_keys, adr_0008_a_facade_error_has_the_commands_code, adr_0008_the_facade_has_session_prune. src/ctl.rs: adr_0008_a_streams_connection_leaves_what_the_facade_shuts_as_it_closes; src/ctl/client.rs: adr_0008_a_stream_stopped_after_catching_up_has_its_new_connection_shut. tests/docs.rs: adr_0008_every_rust_block_is_a_compiled_doc_example: the documents’ uses of the facade are src/lib.rs’s doc examples, which cargo test compiles.
  • 8.6: tests/docs.rs: adr_0008_every_example_is_run_or_skipped_and_runs, adr_0008_every_toml_block_loads; tests/cli.rs: adr_0008_skill_prints_the_skill_and_its_references, adr_0008_skill_install_writes_it_for_claude_code_and_codex.
  • 8.7: tests/cli.rs: adr_0008_a_failed_command_prints_its_error_as_json, adr_0008_no_error_is_reported_without_a_code, adr_0008_a_starting_process_refuses_another_session, adr_0008_a_failed_take_over_keeps_its_code, adr_0008_an_error_after_a_stream_is_on_stderr_alone; tests/docs.rs: adr_0008_every_error_code_is_listed_and_reached; src/error.rs: adr_0008_an_error_is_a_code_and_a_message; src/ctl/ownership.rs: adr_0008_a_refusal_has_its_places_code. tests/common’s coded checks every error in what each test’s commands print and each record their processes write. A test asserts a code with code_is (tests/common’s, on a command’s output, its stderr, a reply, an event or a record; error.rs’s on an Error in a unit test), and adr_0008_every_error_code_is_listed_and_reached counts a code as reached only where a test calls code_is with it written out: so each code is one some test has seen brnr report, or in its UNREACHED, with why. A code named only in a comment, a fixture or a request doesn’t count.
  • 8.8: tests/cli.rs: adr_0008_a_process_says_which_brnr_it_is, adr_0008_a_field_the_process_doesnt_have_is_refused, adr_0008_subscribe_leaves_out_an_event_the_process_doesnt_have, adr_0008_an_older_process_is_said_with_how_to_restart_it (an unknown command, from a process of another brnr), and adr_0008_old_socket_commands_are_unknown; src/ctl/client.rs: adr_0008_an_error_from_another_brnrs_process_says_how_to_restart_it; src/ctl/talk.rs: adr_0008_a_count_the_status_doesnt_have_isnt_0 (a status answer without a count, from a process of another brnr); and, on the connections made to catch up, ADR 10.2’s adr_0010_a_new_subscription_that_fails_is_one_more_cut_off (src/ctl/client.rs).

9. Security and privacy

Draft 2026-10-19. Implemented. Factor: N1 (ADR 1). Brings together former ADRs 25, 53 and 59 (docs/adr/README.md maps them).

What brnr records and where, and what it reads: secrets kept out of what it writes, session ids made safe file names and each cwd a folder of its own, transcripts written only where only the user can read them, the config file read only where only the user can change or read it, and how long transcripts are kept. Security comes first (N1). docs/threat-model.md says, for each trust boundary, what enforces each claim and what the gaps are: B6 for 9.1, B4 for 9.2, B2 for 9.3 and 9.5, B7 for 9.4.

9.1 Secrets are redacted in what brnr records

  • The values of MCP servers’ env and headers are replaced by "<redacted>" in everything brnr records: the host log, the raw ACP file (ADR 5.1) and the process_started record’s start_request (ADR 3.3), and in acp events. This holds whoever sent the request: the host (a profile’s servers in session/new, session/load, session/resume and session/fork) or the editor.
  • Events never carry these values.
  • The agent gets them unchanged, and the editor’s bytes pass unchanged (P1).
  • This is the one exception to P5’s raw ACP. The keys and the structure stay, so the interpretation can still be checked.

Why. A profile’s MCP servers go to the agent with their env and headers (GITHUB_TOKEN = "…", Authorization) in the requests that open a session, and an editor’s session/new carries its servers the same way. Recorded as sent, that is a token on disk once per session, and in every bridge that asks for acp, which may forward it anywhere (N1, P13).

Considered.

  • Keeping them, protected by file permissions only.
  • Not recording these requests at all: the record of the session’s opening would be lost.

9.2 One file name per session id, one folder per cwd

  • A session id becomes a file name by escaping, not replacing: lowercase ASCII letters, digits, - and _ stay as they are, and every other byte of the id’s UTF-8 is % and two lowercase hex digits (a/b is a%2fb, x.acp is x%2eacp, Sess-1 is %53ess-1). The empty id is %. paths::file_name does it (P8).
  • The escaping is one-to-one, also where the file system folds case or Unicode normalization, so distinct ids never share a name.
  • The name has no / and no .. It can’t leave its folder, is never . or .., and no events file can be named like another session’s raw ACP.
  • One namespace for lookup, locks and logs: a session is its agent’s id, exact (ADR 3.2, P4).
    • Its lock is sessions/<name>.lock, one per id whatever the agent or folder (ADR 3.9).
    • Its transcript is projects/<folder>/<name>.jsonl and <name>.acp.jsonl (ADR 5.1), one per id and folder. A session resumed in another cwd writes in that one’s folder.
    • session list, event log and session resume find a transcript by the id its records carry, not by its file name. The original id is in every record and in the lock file.
    • session list --cwd keeps brnr’s rows by the cwd their records name, not by their folder, so two cwds whose hashes collide (below) each list only their own. With an agent named, its rows are what its session/list returns for that cwd, joined on the id: a session open in a process that the agent lists there is kept whatever its recorded cwd. An unreachable one, whose cwd its process doesn’t say, is the cwd’s if the agent lists it there or its transcript began there.
  • A cwd’s folder is <claude>-<hash> (paths::project_key, #120):
    • <claude> is the cwd as ~/.claude/projects names it: every character but ASCII letters and digits is -. The folder sorts and reads next to Claude Code’s (-Users-me-src-3db3a304 beside -Users-me-src).
    • <hash> is the low 32 bits of FNV-1a 64 over the cwd’s bytes, as 8 lowercase hex digits. brnr computes it itself, so it can’t change with a crate or with Rust; it is fixed for 1.x (ADR 3.9, ADR 8.4).
    • The cwd is taken as given, its trailing / removed (/ stays /). No symlink is resolved and the file system isn’t asked, so a cwd’s folder is the same however the file system changes.
    • So /a-b and /a/b get two folders, and so do /A and /a, also where the file system ignores case. / is --860189fe.
    • Two cwds whose hashes collide share a folder. That is all a collision does: their sessions stay apart by id, and each record names its cwd.
  • An id whose name doesn’t fit in a file name (255 bytes with the .acp.jsonl; an escaped byte takes three) is not supported. Its transcript fails to open and the host log says so, and its lock can’t be taken (ADR 3.9).
  • Existing files are not migrated or renamed (P9). Ids of lowercase letters, digits, - and _ only, such as the UUIDs of Claude Code’s and Codex’s adapters, keep the names they had. A transcript under a name of the earlier rule (other bytes replaced by _), or in a folder of the earlier rule (<claude> alone), is an older brnr’s: it stays as it is, and isn’t read, as no record an older brnr wrote is (ADR 5.10). A session resumed writes its escaped name in its cwd’s <claude>-<hash> folder, as any session does. A file two sessions already share stays as it is.

Consequences.

  • A claude-agent-acp session’s events file has the same name as Claude Code’s own transcript, in a folder whose name starts with Claude Code’s and a -: a tool joins the two by that prefix, not by the exact name.
  • Names of ids with capitals or other characters are longer and less readable. The id itself is in the records.
  • The folder name alone doesn’t say the cwd: two cwds that differ only where Claude Code puts a - are told apart by the hash, and the records say which is which.
  • A session of before the hash, resumed, starts a transcript in its cwd’s folder, as any session does. The one it had is an older brnr’s, which doctor lists (ADR 5.10). Going on in the old file (#120 kept that rule until #314) would add records of this brnr’s after records it doesn’t read.

Why. A session id is the agent’s text (P8), and it names the session’s transcript and its lock. Replacing other bytes with _ kept a name inside its folder, but not the session’s identity: a/b and a_b were one file, so two sessions wrote one transcript and contended for one lock. On macOS, whose file systems ignore case and Unicode normalization by default, Sess-1 and sess-1 were one file too.

The folder, as ~/.claude/projects names it, was one for /a-b and /a/b, and on macOS for /A and /a: two projects’ transcripts in one folder, told apart only by reading them (#120). A hash of the exact cwd gives each its own, and keeps Claude Code’s name in front, so the folders still sort and read alike. A hash is rejected above for session ids because a collision there put two sessions in one file. Here a collision puts two cwds in one folder, which is all the earlier rule did for every such pair: the sessions in it are still apart by id. Not resolving the cwd keeps the name a function of what the agent was told, with no file system call that could fail or change its answer. Leaving old files where they are keeps P9.

Considered.

  • Replacing, with a suffix (a hash of the id) only for ids that change: the names of ids that don’t change stay readable, but a name then depends on a hash that can collide, and the rule is two rules.
  • A hash of the id for every name: it is then not the agent’s transcript’s name.
  • Keeping capitals: one name per id on Linux, two ids in one file on macOS.
  • The exact name ~/.claude/projects has (#120’s first fix): one folder for /a-b and /a/b, the cwds told apart only by the cwd each record names, which every reader then has to check.
  • Escaping every byte of the cwd, as session ids are: one folder per cwd with no collision, but not Claude Code’s name, nor next to it.
  • A suffix only on a collision: the name of a folder would depend on which cwd came first, and on what else is in projects, and the rule would be two rules.
  • Resolving symlinks, or folding case on a file system that ignores it: a file system call per name, whose answer changes as the file system does.
  • Moving old transcripts into the new folders: brnr doesn’t rewrite what it has written (P9).

9.3 Transcripts are written only where only you can read them

  • Before brnr writes a record into a session’s events file, its raw ACP file or a host log, these are the user’s own and private, with no group or other bits: the state directory ($BRNR_HOME, else ~/.brnr), each directory below it on the way, and the file. That is the boundary. The state directory’s parents aren’t brnr’s; the state directory’s mode keeps others out of everything below it.
  • All three files are opened in one place, log::open_append, so one policy covers them.
  • Each is opened with O_NOFOLLOW, each directory from the one above it (openat), and created 0700 (directories) or 0600 (files) if missing. A symlink is never followed, the state directory included. For a symlinked ~/.brnr, set BRNR_HOME to where it points.
  • Each is checked through the descriptor it was opened as (fstat), so what is checked is what is written to, and nothing can be swapped in between.
    • A directory or file of the user’s that others could read, write or search is made private through the same descriptor (fchmod), keeping the owner’s bits, before anything is written. The host log has a path_made_private event per path with the mode it had ("644"): what was there before could have been read. brnr session delete has no host log, so it says path_made_private, with the mode, on stderr (ADR 8.1).
    • A symlink, one that isn’t a directory (or a regular file), one owned by someone else, or a file with other hard links (another name, anywhere) is refused. Nothing is written there, and the error names the path and what is wrong with it. For the host log, the process doesn’t start (log: <path>: is a symlink, so brnr won't write a transcript there …). For a session’s file, the session is served without it and the host log has session_log_failed with the error (ADR 5.1).
    • On macOS, one with an access control list (ls -le), which can let others in whatever the mode says, is refused the same way, and the error says the chmod -N that removes it (<path>: has an access control list (ls -le), which can let others read or write it whatever its mode, so brnr won't write a transcript there (chmod -N <path> removes it)). brnr doesn’t remove it (P4). Any ACL is refused, a deny one too, as for the config (ADR 9.4). On Linux an ACL’s grants show in the mode’s group bits, its mask, which are made private with the rest.
    • A FIFO is opened without blocking, so it is refused, not waited on.
  • What reads a transcript reads it only where it could have been written, by the same rules for every part of the path: session list, event log, session resume, session delete, catching up (ADR 10.2) and doctor open the state directory a transcript or host log is in, each directory below it (projects and the project folder, or hosts) and the file, each from the one above it (openat, O_NOFOLLOW), and check each through what was opened (fstat). A symlink, one that isn’t a directory (or a regular file), one owned by someone else, one with an access control list (macOS), or a file with other hard links isn’t looked in or read, and a FIFO isn’t waited on. One read through a link would be whatever the link points at, taken for a session of the user’s; one with an ACL, what others may have written. Reading makes nothing private: doctor warns of what others can reach, of an ACL, with the chmod -N that removes it, of what it can’t open (which readers pass over), and of a state directory, hosts or projects that isn’t a directory, however private. It opens each path the same way, lists a directory through what it opened, and --fix makes private only what it opened, through it (fchmod): it doesn’t look below a symlink, nor change what is put at a name after it looked, nor remove an ACL. transcript.rs holds every read.
  • There is no override. log = "off" (ADR 5.1) is the way to write nothing, and a transcript to share is copied out.

Consequences.

  • A transcript that was readable by others is private again as soon as a process opens it, and from then on. What others read before is theirs.
  • brnr doctor warns of transcripts others can read, and brnr doctor --fix makes private the files that no process opens again.
  • A symlinked state directory or transcript is refused, with no shim (P9).
  • On macOS, a transcript or a directory on its way with an ACL leaves the session unrecorded, or the process not started for the state directory or hosts, until the user runs the chmod -N the error gives.
  • Each open is a few more system calls: per session opened, not per record.

Why. P13 has transcripts only the user can read. The modes brnr gives what it creates apply only to what it creates. A transcript restored from a backup, copied in, or chmod’ed, readable by others under directories they can search, would take the session’s prompts, replies and tool output for every local user to read, and a symlink would send them wherever it points (N1).

Considered.

  • Refusing what others can reach, rather than repairing it: the transcript would stay readable by others, and the session would go unrecorded, until the user ran brnr doctor --fix. Repairing through the descriptor is as safe, since only a file or directory already the user’s is changed, and it closes the exposure at once. What can’t be repaired safely is refused.
  • Removing an ACL, as the mode is made private: the mode brnr gave what it creates is brnr’s to restore, but an ACL is added on purpose, by the user, an administrator or a tool, and removing it is picking for them (P4). The error gives the one command that does it.
  • Checking by path (lstat, then chmod and open): a path can be swapped between the check and the open. A descriptor can’t.
  • Following a symlinked state directory when the link is the user’s: it is the user’s choice, but where it points is another check by path, and BRNR_HOME says the same thing without one.
  • Checking the state directory’s parents up to /: they aren’t brnr’s, a home directory others can search is common, and the state directory being private is what keeps others out.
  • A setting to allow group-readable transcripts: P13 is “only you”, and a copy shares as well.

9.4 The config file is read only if only you can change or read it

No command edits the config file (ADR 12.2): brnr profile reads it (ADR 6.5), and remote check reads none of it. Symlinked config files retain the normal read-only support below.

  • Before brnr reads the config file ($BRNR_CONFIG, else $XDG_CONFIG_HOME/brnr/config.toml, else ~/.config/brnr/config.toml), it checks the file and the folder it is in, and refuses:
    • a file or folder that isn’t the user’s own;
    • a file or folder that the group or others can write;
    • a file that the group or others can read, whatever it holds;
    • a file that isn’t a regular file (a FIFO is refused, not waited on);
    • on macOS, a file or folder with an access control list (ls -le), which can let others in whatever the mode says: chmod -N removes it. Any ACL is refused, a deny one too, as one rule (N4). On Linux an ACL’s grants show in the mode’s group bits, its mask, which are checked.
  • A symlink is followed, as dotfile setups have them: what is checked is the file it resolves to, and that file’s folder. The link’s own folder, and the folders above, aren’t checked.
  • Both are checked through what the file is read from: the folder is opened, the file is opened from it without following a symlink (openat, O_NOFOLLOW), and each is checked by fstat of what was opened. What is checked is what is read.
  • The error names the path, says why, with the owner or the mode it has, and gives the command that fixes it, one line for each problem: brnr: /home/u/.config/brnr/config.toml: it can be read by the group and others (mode 644), and may hold secrets, so brnr won't read the config: chmod go-rw /home/u/.config/brnr/config.toml. For a symlink it names the file it links to (…/config.toml: /home/u/dotfiles/brnr.toml, which it links to, can be …); for the folder, its folder … can be written by others (mode 757) …: chmod go-w …; for another user’s, it is owned by uid 0, not you (uid 501) …: sudo chown 501 ….
  • brnr never changes the file, its folder or their modes itself (P4), and brnr doctor --fix doesn’t either. brnr doctor fails its config check with the same problems.
  • Every config read goes through profiles::load_all and profiles::read_private: the same check covers launches, commands selecting a profile, brnr profile and doctor. --remote doesn’t read local config (ADR 12).
  • No config file (and no folder) is no config, as before: defaults apply.
  • There is no override.

Consequences.

  • A config file written with a common umask (0644) now fails every command that reads it until it is chmod go-rw’ed. This breaks setups that worked: the CHANGELOG says so.
  • A config kept in a shared dotfiles repository works through a symlink to a private file; a checkout others can read doesn’t.

Why. The config file names the commands brnr runs as the user: the agent, bridges, MCP servers’ commands. One others can write lets them run code as the user. Its MCP servers’ env and headers (ADR 6.3) hold tokens, which 9.1 keeps out of everything brnr records; one others can read gives them away anyway. N1 says only the user can reach brnr’s files, and that includes what brnr reads as well as what it writes (P13). ssh refuses its keys on the same terms.

Considered.

  • Refusing a file others can read only when it holds MCP env or headers: a secret can also be in an MCP server’s args or url, or a bridge’s command line, and two rules are harder to know than one (N4).
  • Making it private, as 9.3 does for transcripts: brnr writes transcripts, but the config is the user’s own file, which brnr only reads. Changing its mode is picking for the user (P4); the error gives the one command that does it.
  • A warning, and reading it anyway: the command would run what others could have written. Security comes first (N1), and an explicit check that fails, fails (P7).
  • Not following a symlink, as 9.3 doesn’t for transcripts: dotfile setups link the config, and what matters is the file read and who can change it, which are checked through what is read. A folder above that others can write can swap in only another folder, which is then checked.
  • Checking the folders up to /: they aren’t brnr’s, and a home directory others can search is common.
  • A setting to allow a config the group can read: P13 is “only you”.

9.5 Transcripts are kept until they are pruned

Resolves #373.

By default brnr keeps every transcript and host log until the user deletes it: nothing has an age limit, and nothing is deleted without being asked for. Two controls prune by age, by one rule:

  • brnr session prune --older-than <s> [--dry-run] [--json] prunes when it is run (ADR 8.1). --dry-run says what it would delete, and deletes nothing.
  • retention = <s>, at the top of the config file (ADR 6.1), outside the profiles: every brnr process prunes as it starts, whatever its profile. Unset, nothing is pruned. The command that starts the process reads it and puts it in the start request, as it does the profile (P10).

What is pruned:

  • A session’s transcript, every file session delete --purge deletes (ADR 8.1): its events and raw ACP files in every project folder, and those set aside beside them (ADR 5.10).
  • The host log of a process that has gone.

Age:

  • A session’s age is its last activity: the time of the newest record a process recorded in any of its files that isn’t a deletion, session list’s last_active (ADR 5.1). Not when it was created: a session in use for months is kept as long as it is used.
  • A host log’s age is its newest record’s time.
  • <s> is a whole number of seconds, as every duration is (ADR 8.1): what was last active more than <s> seconds ago is pruned. --older-than 0 prunes every session no process has open. retention = 0 fails to load (config_invalid): a process would delete every transcript as soon as its session closed, and other tools read 0 as “no limit” (P4). A value that isn’t a whole number of seconds ("30d", -1) fails to load too.

Never pruned:

  • A session open in a process, or whose lock a process holds (ADR 3.9), however old its last activity. A session’s lock is taken before its files are deleted, and its age read again under it: one opened, and closed, since it was listed is kept. A session whose lock is held is passed over, and one whose lock can’t be taken is said, in failed.
  • The session a headless start resumes, by the process that resumes it: it is in use from then on, though its lock is taken a moment later.
  • The host log of a running process: one process list lists, or one whose pid is alive and that doesn’t end with process_exited (a process with another runtime directory, ADR 3.9). A long-lived process keeps its host log whole until it exits; the next prune after that, once the log is old enough, deletes it.
  • What brnr can’t read the age of: a session with an events file whose newest record is in another format (ADR 5.10), a newer brnr’s, or whose files hold no record brnr can read, as nothing in them says when it was last active (P4), and a host log likewise. doctor lists the files in another format; they are deleted by hand. A session brnr does read the age of takes the files an older brnr’s set aside beside its own with it, as --purge does: they are the session’s, and older than the file that took their place (ADR 5.10). Its age is read again, from every file of it, under its lock, for --dry-run too.
  • The agent’s own copy of a session: that is session delete’s.

How:

  • Files are deleted as --purge deletes them (ADR 9.3, B2): the state directory, projects or hosts, and each project folder opened without following a symlink, each from the one before (openat, O_NOFOLLOW), and only the session’s own names, escaped (ADR 9.2), removed from what was opened (unlinkat). A symlinked folder isn’t looked in, and a symlink with a transcript’s name is removed, not what it points at. A host log that is a symlink isn’t listed.
  • A session’s events file goes last, so a prune cut short leaves the file the session is found by, and the next prune deletes the rest.
  • A process prunes on a thread of its own, beside its start, which doesn’t wait for it (N3). The thread finds what is open as the commands do: from the processes and the locks. A thread of the process that takes a lock waits while the prune holds one (lock::holding), so it never finds a session’s lock held by its own process.
  • A file that can’t be deleted is said, and the rest are deleted all the same. A project folder that can’t be listed is said, and nothing in it is deleted: what it holds of the session isn’t known.

What it says:

  • --json is {older_than, before, dry_run, sessions, host_logs, failed}: before the time the age gives, each session {session, last_active, files}, each host log {host_id, last_active, files}, files the paths deleted (or that would be, with --dry-run), and failed why a file wasn’t deleted or a lock taken, as session delete’s failed. Text says the same: what it pruned, each session and host log with its last activity and its files, or nothing was last active before ….
  • The command exits 1 if a file couldn’t be deleted, 0 otherwise. Which sessions are open must be known: a runtime directory that can’t be read fails it, with its error, and nothing is deleted.
  • A process records what it pruned in its host log, transcripts_pruned, with the fields of --json but dry_run, when it pruned something or something failed. It can say nothing else: an editor’s process has no terminal (P1), and a headless start isn’t waiting for it. With log = "off" there is no host log, and nothing records it.
  • doctor says what is kept: everything, or what each process prunes, with the age in days (more than 30 days ago (retention = 2592000)), so a value meant in days shows as seconds.
  • No error code is added (ADR 8.7): a value that isn’t one is a usage error (exit 2) or config_invalid, and a file that can’t be deleted is an I/O error on brnr’s own files, unclassified, in failed.

Why. A transcript holds prompts, replies, tool calls with their input and output, diffs of the user’s code and, where the profile or strict mode passes fs and terminal, unsaved buffers and command output (ADR 2.7). An enterprise’s policy, or a user’s, limits how long such data is kept, and --purge one session at a time can’t apply one; the host logs, shared, could not be removed at all (N1). Keeping everything by default is what brnr did, and deleting what a user didn’t ask to delete would lose it silently (P3): the default is said in the README and the docs instead. Age by last activity is session list’s, one notion of when a session was used (N4), and never deletes a session in use. Seconds are every duration’s unit in brnr (ADR 8.1); doctor turns them into days where a mistake would show. The same deletion as --purge, and the session’s lock held while it runs, keep the boundary B2 already has: nothing outside the state directory, and nothing a process uses.

Consequences.

  • retention deletes, at every start, what is older: setting it is choosing that. session prune --older-than <s> --dry-run shows what the same age would delete.
  • A session resumed after it was pruned starts a new transcript; what came before is gone from brnr, and the agent’s copy, if it kept one, is the agent’s.
  • An editor that loads a session in the moment a prune deletes it shares it (ADR 3.9) and may write into a file that is then deleted, as with session delete --purge. The prune holds the lock for the time its unlinks take.
  • Files in an older format stay until they are deleted by hand, but those set aside beside a session that is pruned.
  • A process that exits while its prune runs waits for it before its last records are written, as it waits for them (ADR 5.5): a few seconds at most, the status of every process. A signal gives up on it, and the exit stops it there; what was deleted by then isn’t recorded.

Considered.

  • Deleting after an age by default (30 or 90 days): data the user didn’t ask to delete would go, silently (P3).
  • A duration with a unit ("30d", --older-than 30d), as the issue had it: easier to read, but a second way to write a duration, in config and on the command line, beside every other in seconds (ADR 8.1, N4).
  • A floor (a day) on retention, against a value meant in days: one more rule; doctor shows the age in days instead.
  • Age by creation, or by the file’s modification time: a session in use for months would go; a file’s time changes with a backup or a copy, and session list has the record’s.
  • Rotating a long-lived process’s host log: the host log is one file that doctor and a catch-up read whole (ADR 10.2), and two would be one more thing to join. A process that runs for longer than the retention keeps its log until it exits.
  • Pruning from doctor --fix: doctor never deletes a log (P4), and the command already does it when asked.
  • Pruning by mtime what brnr doesn’t read: a guess at an age (P4), in files doctor already lists.
  • A per-profile retention: the state directory is one for every profile, and a session’s profile can change as it is resumed; one value for all is one rule.
  • brnr prune at the top level, or under event: the transcripts are sessions’, as session delete --purge deletes them, and the host logs go by the same age.
  • Pruning synchronously before the start: the start would wait for a walk of every transcript and a status from every process (N3).

Tests

Run cargo test --release adr_0009_. Named claims, by section:

  • 9.1:
    • tests/security.rs: adr_0009_a_resumed_sessions_secrets_are_redacted.
    • tests/headless.rs: adr_0009_a_profiles_mcp_secrets_are_redacted, adr_0009_an_editors_mcp_secrets_are_redacted.
    • src/log.rs: adr_0009_secrets_are_redacted_keys_and_structure_stay.
  • 9.2:
    • src/paths.rs:
      • adr_0009_distinct_ids_get_distinct_names.
      • adr_0009_a_cwd_has_a_folder_of_its_own: the names of /, /a-b, /a/b, /A, /a and /Users/me/src, written down once; a trailing / is the same cwd; /a-b and /a/b, /A and /a differ, also folded to lowercase.
    • tests/headless.rs: adr_0009_distinct_ids_never_share_a_transcript, adr_0009_distinct_ids_never_share_a_lock.
    • tests/cli.rs:
      • adr_0009_cwds_alike_are_listed_apart: <dir>/x-y and <dir>/x/y, named alike by ~/.claude/projects, have two folders, each with only its own sessions’ files, and each lists only its own sessions with --cwd, closed, open, and open in a process that doesn’t answer, with an agent named or not.
      • adr_0009_cwds_alike_are_resumed_apart: each one’s session has its own transcript, in its own folder, in event log, and session resume opens it in its own cwd.
      • adr_0009_a_transcript_under_the_old_rule_is_left_as_it_was: a session’s two files, in the folder of the earlier rule, stay as they were when it is resumed in its cwd, which writes in its own folder.
  • 9.3:
    • src/log.rs:
      • adr_0009_new_and_private_paths_are_opened_as_they_are: what is created is 0700 and 0600, and a private file is appended to as it is.
      • adr_0009_what_others_can_reach_is_made_private_before_a_write: a 0644 file beneath private parents, and beneath 0755 ones, is made private, parents too, before the next write.
      • adr_0009_a_symlink_is_never_followed: the file, its folder and the state directory as symlinks are refused, and their targets left as they were.
      • adr_0009_only_the_users_own_directories_and_files_are_written_to: a file with another hard link, a FIFO, a file where a directory goes and another user’s directory are refused.
    • src/transcript.rs:
      • adr_0009_a_transcript_is_read_only_where_it_could_be_written: a symlinked project folder isn’t looked in; a symlink, a FIFO and a directory aren’t read.
      • adr_0009_every_part_of_a_transcripts_path_is_the_users_own: a symlinked projects, hosts or state directory isn’t looked in or read through, nor is a file with another hard link or a directory of another user’s.
    • tests/security.rs:
      • adr_0009_a_transcript_others_can_read_is_made_private_before_it_is_written: a resumed session’s events and raw ACP files, made 0644 beneath private and beneath 0755 parents, are private when it writes to them, and the host log has a path_made_private for each path.
      • adr_0009_a_symlinked_transcript_is_never_followed: a symlinked events file is left alone and session_log_failed says why; a symlinked state directory fails the start before the agent is prompted.
      • adr_0009_a_symlinked_transcript_is_never_read: a session whose events file is a symlink, or in a symlinked project folder, isn’t listed or logged.
      • adr_0009_a_symlinked_hosts_or_projects_folder_is_never_read: with hosts a symlink, session list reads no host log and doctor reads, shows and makes private none; with projects one too, its session isn’t listed or logged.
      • adr_0009_a_transcript_with_an_acl_is_never_written (macOS): an events file with an ACL is session_log_failed, with the chmod -N, and isn’t written; a state directory with one fails the start before the agent is prompted; the ACL stays.
      • adr_0009_a_transcript_with_an_acl_is_never_read (macOS): a session whose events file, or project folder, has an ACL isn’t listed or logged; doctor warns of it with the chmod -N, and --fix leaves it.
    • tests/doctor.rs: adr_0009_doctor_says_what_it_cant_open_and_what_fix_left: a transcript of mode 000 is a warning, --fix leaves it, and the example it then gives is what is left, not what it made private.
    • src/ctl/doctor.rs: adr_0009_fix_changes_what_was_opened_not_its_name: a file --fix looked at, then swapped for a symlink, is made private as it was opened, and what the link points at is left as it was; looked at again, the symlink is a problem --fix doesn’t fix.
  • 9.4:
    • tests/security.rs:
      • adr_0009_a_config_others_can_read_or_write_is_refused: a config file the group or others can read or write, and one in a folder they can write, fail session new and brnr acp before an agent starts, saying the path, the mode and the chmod that fixes it; the modes stay as they were.
      • adr_0009_a_config_of_another_users_is_refused: root’s /etc/hosts as the config is refused for its owner and its folder’s, with the chown (can’t run as root: skip fails it in CI).
      • adr_0009_a_symlinked_config_is_checked_where_it_points: a link to a private file is read; to one others can read, refused, naming that file.
      • adr_0009_a_config_with_an_acl_is_refused (macOS): a config file, and its folder, with an access control list are refused with the chmod -N that removes it, and the ACL stays.
      • adr_0009_a_missing_config_is_no_config.
    • tests/doctor.rs: adr_0009_doctor_fails_a_config_others_can_reach: the file and the folder fail the config check with their fixes, --fix changes neither, and a missing config and a symlink to a private one are ok.
  • 9.5:
    • tests/cli.rs:
      • adr_0009_prune_deletes_what_was_last_active_before_the_age: a session last active long ago is pruned, its raw ACP before its events, and one opened long ago but active since is kept; a deletion isn’t activity; the host log of a process gone is pruned, and one whose pid is alive kept unless it ends with process_exited; --dry-run says the same and deletes nothing; a symlinked folder or host log isn’t followed; --older-than 0 prunes every session no process has open.
      • adr_0009_prune_never_touches_an_open_or_locked_session: an open session, a session whose lock another process holds, and a running process’s host log stay, with --older-than 0.
      • adr_0009_a_process_prunes_as_it_starts_when_retention_is_set: without retention nothing is pruned; with it, a start prunes an old session but the one it resumes, and the host log has transcripts_pruned.
      • adr_0009_prune_keeps_a_session_it_cant_read_the_age_of: a session with an old file and a file whose newest record is a newer brnr’s is kept, both files, with --dry-run and without; one whose older brnr’s file is set aside goes with that file.
      • adr_0009_a_process_records_its_prune_before_it_exits: a process that stops as soon as its turn is done has transcripts_pruned in its host log.
      • adr_0009_retention_is_a_number_of_seconds_not_0: 0, "30d" and -1 fail to load, config_invalid, before an agent starts; doctor says the age in days.

10. Bounded resources

Draft 2026-10-19. Implemented. Factor: N2 (ADR 1). Brings together former ADRs 6, 49, 51, 60 and 69 (docs/adr/README.md maps them).

How much memory a reader that falls behind, or a long line, can cost the process, and what a peer that is cut off does next; how many connections the process serves, and how long a command waits for it. Memory stays bounded whatever a peer, the agent or the editor sends (N2, P6): observers give way and are told (P3), and the session’s own pipes get backpressure (P1).

10.1 How far behind a reader may fall

Who gives way depends on who the reader is (P6).

Observers give way, and never slow the session:

  • A peer (a bridge, event watch, event notify, any control connection) may have 16 MiB queued that its writer hasn’t written yet, counted from when a line is queued until it is written.

  • Some lines are set aside and don’t count toward the 16 MiB:

    • the line that takes the peer past 16 MiB;
    • while the peer is past it, each line longer than 16 MiB on its own, up to 64 MiB of lines set aside (two of the longest lines the host reads, ADR 10.3: a message’s ACP line and its event).

    They stop being set aside once the queue is back under 16 MiB.

  • A peer is behind once what is queued for it, not counting what is set aside, is past 16 MiB. Until then it takes the next line, however big. So at most 16 MiB, the lines set aside (64 MiB of them, or the first however long), and one more line are queued for a peer.

  • A peer that is behind is cut off: a connection is shut down, a started bridge gets SIGTERM. The host log has peer_dropped, and the other peers get peer_cut_off (ADR 10.2).

  • The foreground’s display has a bounded buffer, then skips events, saying how many (… 120 events not shown). Its stdout closing ends the display, not the session (ADR 3.5).

The session’s own pipes get backpressure, as a direct pipe would give them (P1):

  • The editor link’s queue is capped at 16 MiB, as peers’ are. Past it the host stops reading the agent’s stdout and stderr, and the agent blocks on its stdout as it would writing to the editor directly.
  • The agent’s stdin queue is capped the same way. Past it the host stops reading the link, the proxy blocks, and the editor’s write blocks.
  • Stdin’s EOF waits behind what the editor wrote, as on a pipe. A signal to the proxy and its stdout failing don’t wait: they go on a socket of their own, the signal link, which the host never stops reading, and on which it hears the proxy go (ADR 3.1).
  • brnr has no timeout of its own. An editor that hangs stalls its agent for as long as it hangs, as a direct pipe would (P1). An editor that is gone needs no timeout: its pipe closes, the proxy’s write fails, and the host hears the editor has gone.
  • The host’s own channels are bounded too. A reader thread (the agent’s stdout, the link) blocks when the event loop is that far behind, so “stops reading” holds the bytes in the pipe, not in memory.
  • While the agent’s stdout is held back, observers see nothing of the agent either (no answers to injected prompts, no approvals): P1 ranks above them.

The logger’s queue is bounded, and gives way as an observer does:

  • Past 64 MiB not yet written (a slow or stalled disk), records are skipped and counted. A session’s opening is never skipped, nor process_exited or process_panicked, which say how the process ended (ADR 3.7).
  • Once the queue is down to half that, or the logger has caught up, a records_skipped note (count, acp_count, since, until, first_seq, last_seq, and ts, host_id, pid and in a session’s file session, as an event has them, ADR 5.9) says what was lost, in the host log and in each session’s events file that lost some (P3). first_seq and last_seq are the positions lost (ADR 10.2).
  • Records a write fails to put in a file (a full disk) are noted the same way, with the error, once the file takes records again.
  • event log always shows these notes, whatever --events chose.

Consequences.

  • A reply of up to about 30 MB reaches every kind of peer that keeps up, whatever events it asked for: session new --wait, prompt send --wait, event watch, event notify and bridges.
  • A peer that stopped reading is cut off soon after 16 MiB when the lines are short, and after 64 MiB of them when each is longer than 16 MiB.
  • A burst of more such lines than fit in 64 MiB (a turn’s thought and message, each over 16 MiB, to a peer that asked for acp) can still cut off a peer that keeps up. It then catches up from the transcript (ADR 10.2).
  • A long message costs its size again in memory for each peer that hasn’t written it yet.
  • session status quotes at most 4000 characters of the last message; the events have all of it.

Why. Every reader of a session can fall behind: a bridge or a watcher, the foreground’s stdout, the editor through the proxy, the agent reading its stdin. With unbounded queues, an editor that stopped reading cost about 315 MiB before anything happened, and a foreground that printed on the event loop blocked the whole host. A timeout on writes to the editor bounded memory only by what the agent writes in that time, and killed the agent of an editor that only paused. A long agent message (10 MB at the end of a burst; 20 MB in #82) is followed at once by its turn_ended, and a peer that asked for acp gets it twice at once, as the ACP line and as agent_message: no reader writes 20 MB in the time the host takes between them, so counting every line cut off peers that kept up (N2, P6, P3).

Considered.

  • A count of lines (first 4096 per peer): lines vary from a few bytes to megabytes. On a slow CI runner a raw event watch that was reading the whole time fell more than 4096 lines behind an agent streaming 20,000 chunks at once, and was cut off as if it had stopped.
  • Dropping acp events for a slow peer instead of cutting it off: lossy where --events all promises everything.
  • “Behind” as “the next line would take it past the limit”: it cuts off peers that keep up when one big message comes while they are a few MB behind, and one message over the limit cuts off every peer, brnr session status included.
  • A 30 s timeout on writes to the editor, counted as the editor gone: memory bounded only by how much the agent writes in 30 s, and the agent never feels the editor’s pace.
  • Backpressure plus that timeout: memory is bounded without it, and it kills the agent of an editor that only paused.
  • An unbounded buffer for the foreground (more of the memory problem), or blocking the host on it (it stops the control socket, the agent’s traffic and signals).
  • Raising the limit: a longer message would do the same.
  • A time instead (behind for so long): observers have no times, and a stopped peer would hold memory for that long.
  • Setting aside every line that takes the peer past the limit, however short: a stream of short lines to a stopped peer would each take it past, and it would be cut off only at 80 MiB.
  • Setting aside every line longer than the limit, without a cap: a stopped peer of a session sending long messages would hold them all.
  • Counting the line the peer’s writer is writing as written: which line that is when the host queues the next one is a race.
  • Telling the peer it was cut off, in its own channel, before closing it: a peer that stopped reading has part of a line in its socket buffer, so a note after it couldn’t be read as a line; and keeping the connection until the note is written holds the peer’s queue for as long as it doesn’t read.

10.2 A peer cut off catches up from the transcript

Principles: what was sent is never lost silently (P3); the session never waits for an observer (P1, ADR 10.1); nothing is guessed (P4).

Positions

  • Every event a process emits, and every ACP message it records, has a position, seq: one more than the process’s last. It is per process, not per session. A peer subscribes to a process and gets one stream of every session’s events (a bridge, --pid), which one number orders. The events a session watcher gets come from three files (its events, its raw ACP, and the host log, which has the process’s own events such as process_exited and ACP of no session), which one number merges exactly.
  • A session’s file has gaps where other sessions’ events are. They are not losses: a records_skipped note says what is lost (ADR 10.1).
  • An event carries seq as its last key, live and in the transcript. A raw ACP record carries it before dir (…,"session":"sess-1","seq":12, "dir":…), and event log gives it to the acp event it makes of the record. The copy of a session/new or session/fork in the new session’s raw file has none: the request has its position where it was first recorded, the host log for a session/new (no session is open yet), the forked session’s raw file for a session/fork. A position names one record, so a reader that merges the files never meets it twice.
  • subscribe’s answer says where the subscription starts: peer, the connection’s name as the host log has it (socket#7), host_id, pid, and seq, the last position before it. session new --wait’s ready report on the start channel says the same (socket#start).
  • The host log notes each subscribe (peer_subscribed, with its peer) once the peer is subscribed, so whoever finds the note there knows the peer gets every event after it that its subscription selects: the tests wait for it before they make an event an observer must see, not a time (#333). A started bridge has bridge_started for it. The start channel has no note: its ready report goes in the same step of the event loop that subscribes it, before any event can.

Recording the cut-off

  • A peer cut off (ADR 10.1) gets a peer_dropped record (peer, reason fell_behind, last_queued_seq) in the host log, and its connection is shut down. Lines queued for it and not written are dropped with the queue. last_queued_seq is the last position when the peer was cut off: nothing after it was queued for the peer; some lines before it may not have been written.
  • The process keeps the last 64 cut-offs, the peer’s name and last_queued_seq, for was_cut_off.
  • It emits a peer_cut_off event (peer, last_queued_seq) to the other peers, once the line that cut the peer off has reached them, so that each sees positions in order. The event is the process’s (no session), in the host log, and shown by default.

Asking, and catching up

  • A request, was_cut_off {peer}, is answered {peer, cut_off, last_queued_seq}: whether the process cut that peer off, and where.
  • A command whose connection ends before the end it waits for (process_exited, its session’s session_closed, its turn’s end) catches up:
    1. It connects again and asks was_cut_off for its peer’s name. Not cut off, or not one of the last 64: it ends as it did (the process closed the connection).
    2. It subscribes again to what it subscribed to. The answer’s seq is where the new subscription starts, R. Every event after R comes on the new connection.
    3. It sends logged (ADR 5.5). Once answered, the transcript has every event up to R.
    4. It reads the host log, whose session_opened records name each session’s files, and the files of the session it follows (every session’s for --pid; the raw ACP too when it asked for acp). Of the process’s records, it takes those it subscribed to after its last event, L (or where it subscribed), up to R, in order of position, once each (process_exited is in every session’s transcript and the host log).
    5. They come before what the new connection has sent since, and it goes on there. Its last event is then the last the new connection sent, or R if none. Cut off again, it catches up after that, so nothing comes twice.
  • A process that has gone can’t be asked. Its host log’s peer_dropped for the peer says it was cut off, steps 2 and 3 are left out, and its transcript, whole once it has gone (ADR 5.5), is read to its end. So is the transcript of a process that goes while the command catches up, once it has said that it cut the peer off: its socket refuses the next connection.
  • A process that is stopping still accepts until its socket goes, and hangs up on what it is asked (#275). One that hangs up on step 1, or whose socket refuses, is waited for, up to 10 s, until it has gone: its pid, which names the socket, has exited, or is a zombie nothing has reaped yet. Its socket isn’t asked: a process removes it before its last records are written, and a full backlog refuses on macOS and blocks on Linux. Gone, it is caught up with as above if its host log has the peer’s peer_dropped. Otherwise the command fails, as it does for a peer that wasn’t cut off. One that hangs up on step 3 has already said it cut the peer off: it is waited for the same way and, gone, its transcript is read to its end; still there after 10 s, the command says what it missed up to R, as below.
  • These commands catch up: event watch, prompt send --wait, session new --wait and session resume --wait (on the start channel, or with --pid), event wait, and event notify on the socket.
  • A request that only asks (status, pending) and was cut off unanswered is asked again once caught up. Unable to catch up, the command says what it missed, as below. A request that acts (send) is never sent twice.
  • event notify cut off while its command runs lets the command finish, then catches up, and runs the command for each event it missed. If its connection ends otherwise (the process killed), it stops the command (ADR 5.8).
  • Cut off again while it catches up (it reads nothing from the new connection meanwhile), a command does the same again, up to 3 cut-offs in a row with nothing read live in between. Cut off a 4th time, it gives up, as below. A new subscription that fails, or whose answer has no seq, gives no R: that is one more cut-off, and the command connects and subscribes again. The process has already said it cut the peer off, so it isn’t asked again.

When it can’t

  • The command can’t catch up where the transcript doesn’t have what it missed:

    • none is kept (log = "off");
    • no raw ACP is kept (log = "events"), for a peer that asked for acp;
    • records weren’t written where it missed events: a records_skipped note’s first_seq and last_seq between L and R is a hole;
    • a full disk didn’t take records that no note says yet: logged answers lost.

    The command doesn’t guess around a hole (P4).

  • It then says what it missed, after which event, up to where, and why, in the shape of the logger’s records_skipped note:

    {"event":"events_missed","ts":"…","host_id":"…","pid":4466,"peer":"socket#7","after_seq":120,"until_seq":180,"error":"the process keeps no transcript (log = \"off\")"}
    

    until_seq is R, where the command subscribed again. Given up at the 4th cut-off in a row with no R (its last new subscription failed), it is where the process said it cut the peer off, was_cut_off’s last_queued_seq. It is null in two cases only: the process has gone (its socket refuses a new connection), so its transcript is read to its end; or the process, live, cut the peer off but said no last_queued_seq, which brnr’s own process always says, and error then says that it gave no position.

  • event watch shows it as its last event, in text or JSON; the others on stderr (brnr: cut off: events after 120 up to 180 missed: …). The command exits 3, which no other outcome has (ADR 8.3).

Bridges

  • A started bridge isn’t caught up. Its events come on its stdin, a pipe the process opened; cutting it off closes the pipe and sends SIGTERM (ADR 10.1), and there is no connection to open again. The host log’s peer_dropped and the other peers’ peer_cut_off say that it was cut off and where.
  • A bridge that must not miss events subscribes on the socket itself (BRNR_SOCKET): brnr event notify <session> -- … rather than --stdin, or a client of its own that catches up as above.
  • event notify --stdin cut off says so and exits 1.

What a peer can learn

was_cut_off answers whether and where, never what: no event is in its answer. What a peer catches up on it reads from the transcript itself, as the user, which processes of the user’s can read anyway (P13), and only the events it subscribed to. A peer may ask about another peer. It learns where that one was cut off, which tells it nothing it couldn’t get by subscribing, and the record isn’t consumed, so asking can’t take it from its owner.

Consequences.

  • A peer that keeps up gets every event, once and in order, whatever the burst, as long as the transcript has it and it catches up within 3 cut-offs in a row. Otherwise it says what it missed and exits 3. The limits of ADR 10.1 stay; this is what follows a cut-off.
  • Every event line, live and recorded, and every raw ACP record is a few bytes longer.
  • A cut-off costs a connection and reads of the process’s files: its host log, and its session’s events, and raw ACP for a peer that asked for acp; every session’s for --pid. Lines of other processes, and out of the range, are passed over without being read whole. What it missed is held in the command’s memory while it goes out.
  • event watch doesn’t end when it falls behind. It ends with process_exited, its session’s close, or exit status 3.
  • The names this adds (seq, peer_cut_off, last_queued_seq, first_seq, last_seq, events_missed with after_seq and until_seq) follow ADR 5.9, and their shapes in --json ADR 8.2. The change is kept to one field on every event, one event, one note and one request.

Why. A burst of lines longer than 16 MiB that comes to more than the 64 MiB ADR 10.1 sets aside still cuts off a peer that keeps up (#117): a thought and a message each over 16 MiB, to a peer that asked for acp, are four lines at once. When the connection closed, the peer couldn’t tell that from the process going: event watch said the process closed the connection, prompt send --wait failed as if the agent had gone, event notify stopped its command. Raising the limit only moves the boundary, and ADR 10.1 rejects telling the peer in its own channel and rules based on time. What the peer missed is in the transcript (ADR 5.1); what it needs is a position, which ts can’t be, and a way to tell being cut off from the process going.

Considered.

  • Positions per session: a bridge or a --pid peer follows every session in one stream, which numbers per session can’t order, nor merge with the process’s own events in the host log.
  • ts as the position: it is to the microsecond, so not unique; an acp event’s and its raw record’s are taken at different moments; and the wall clock can step back.
  • A line count of each file: per file, and a file holds several processes’ records, appended.
  • The process keeping what a cut peer missed until it comes back: memory without bound, what ADR 10.1 cuts peers off to avoid; the transcript has it.
  • The process replaying the transcript on the new connection (subscribe from a position): it would read files on its event loop, or hold the new peer’s queue while a thread did (P1). The command reading the transcript as the user needs nothing from the process but positions.
  • A note in the cut peer’s own channel, or a rule based on time: rejected in ADR 10.1.
  • Telling a gap from its times (since, until) against the last event’s ts: a clock that steps back hides one; positions don’t.
  • Catching up without a bound: a peer that can’t keep up even so would go round for ever without saying so (P3).
  • A started bridge reconnecting on the socket: it would hold two subscriptions, its stdin’s and the socket’s (ADR 5.8).

10.3 Lines too long to read

  • The host reads (interprets, and keeps in the raw transcript) a line from the agent’s stdout or from the editor of up to 32 MiB, its newline included. While it waits for its newline the line is its reader’s, and isn’t counted against the 16 MiB cap (ADR 10.1): counted, a line longer than the cap would deadlock its reader. So one pipe can cost the host the cap and one line’s worth, 48 MiB, whatever the lines.
  • A longer line isn’t kept whole. Its first 32 MiB, then the rest as each read brings it, go on counted and held back as any output is:
    • with an editor attached, to the agent or the editor, byte for byte (P1). The host treats it as a line it can’t parse (ADR 2.5): it isn’t interpreted, nor recorded as raw ACP;
    • headless, from the agent, nowhere: it is dropped (P4).
  • Either way, a line_too_long event (from: agent or editor; limit, in bytes; relayed: whether it went on) says so once for each such line, when it passes the limit: in every session’s events file, to watchers and bridges, and in the foreground (P3). It belongs to no session: the host hasn’t read it, so, as process_exited, it goes to all of them.
  • The agent’s stderr isn’t interpreted. It goes on as each read brings it, up to 64 KiB, a line or not, every byte and in order, to the editor’s stderr through the proxy and to the foreground’s, unchanged (ADR 2.6, ADR 3.6). The host log has a record for each line, or for each piece of 64 KiB of a longer one. A character that a piece’s end would cut starts the next piece. A line of exactly 64 KiB is one record, not one and an empty one.
  • A failed start’s tail keeps a long line’s first 2000 bytes, cut between characters, as it keeps those of any line (ADR 3.6).
  • A started bridge’s stderr and the process’s own stderr, detached (process_stderr, ADR 3.7), go into the host log the same way: a line or a piece of 64 KiB at a time, a character a piece’s end would cut starting the next piece. A bridge’s note’s decoded text is at most 64 KiB too, the rest in the next notes.
  • A peer’s request, a line on a control connection or on a started bridge’s stdout, is read up to the same 32 MiB, its newline included. A longer one isn’t read past that, and nothing after it is: where the next request would start can’t be known. The peer is answered command_invalid, “a request longer than 33554432 bytes: cut off” (ADR 8.7; no req_id: the request wasn’t read), the host log has peer_dropped (peer, reason line_too_long, limit), and the peer is cut off: a connection is closed once the answer is written, a started bridge gets SIGTERM, as one that fell behind does (ADR 10.1). It didn’t fall behind, so it isn’t one of the cut-offs was_cut_off knows, nor a peer_cut_off event, and a command doesn’t catch up from it (ADR 10.2): its request fails with the answer’s error (ADR 10.4).

What is bounded, and what isn’t:

  • Bounded:
    • the agent’s stdout and the editor’s input: 16 MiB queued, and up to 32 MiB of a line still coming, each;
    • the agent’s stderr: the same cap, plus a piece of 64 KiB;
    • a started bridge’s stderr, and the process’s own stderr, detached: a line or a piece of 64 KiB at a time;
    • the link: 16 MiB, and a frame is at most a line the host read or a piece;
    • each peer’s queue: 16 MiB, plus the lines set aside, up to 64 MiB of them, and one more line (ADR 10.1);
    • the logger’s queue: 64 MiB (ADR 10.1);
    • requests the host answered that the editor was shown, kept for its late answer (ADR 4.5, 7.1): 1024, the oldest going first, none past their session’s close;
    • requests the agent cancelled that the editor was shown, kept to record the editor’s answer in their session (ADR 4.5, 7.1): 1024, the oldest going first, none past their session’s close;
    • sessions brnr closed under the editor, kept to answer the editor’s requests for them (ADR 7.1): 1024, the oldest going first;
    • the foreground’s display (ADR 3.5);
    • the proxy reads the editor 64 KiB at a time;
    • a peer’s request: 32 MiB, on a control connection or a started bridge’s stdout;
    • how many connections the process serves at once: 128 (ADR 10.4);
    • how deep a line may nest for brnr to read it: 128 levels for what the agent, the editor or a peer sends, 256 for what brnr wrote, and so the stack any value takes (ADR 2.5). No thread is sized to a line.
  • Not bounded by a count of bytes:
    • the agent’s message or thought being assembled from its chunks, for an agent_message event: each chunk has been through the cap, and the message is as long as the agent makes it;
    • what a session keeps (held messages and context, the last message, config options and commands), whose size the user and the agent choose.

What isn’t bounded is a gap measured against N2 (ADR 1).

Consequences.

  • An editor’s late answer to a request no longer kept goes to the agent, which ignores it (ADR 2.5), and the editor isn’t told who answered first. An editor’s request for a session closed under it that is no longer kept reaches the agent, which answers it with its own error.
  • An editor’s answer to a request the agent cancelled that is no longer kept still goes to the agent as it is (ADR 4.5), but with no session: it is recorded in the host log, not the session’s transcript, and its acp event has session: null.
  • A message over 32 MiB, valid JSON or not, isn’t seen by the host: no events for it. If it answered a request of the host’s, the request goes unanswered, as for a line it can’t parse (ADR 2.5). With an editor, the editor still gets it.
  • An editor’s line over 32 MiB goes to the agent as it is. A prompt that long isn’t counted as a turn, a session/load that long isn’t checked against the session’s lock (ADR 3.9), and an initialize that long isn’t stripped of fs and terminal (ADR 2.7). Editors don’t send those that long; refusing them would mean reading them.
  • The host’s memory doesn’t grow with the length of a line. A 128 MiB line to an editor that stopped reading leaves the host at about 54 MB: the line’s first 32 MiB, queued for the link and written from where it is (a frame’s payload isn’t copied), and what the host holds anyway.
  • The limit is twice the cap so that one message bigger than a peer’s queue, which ADR 10.1 lets through to a peer that keeps up, is still read.
  • A prompt or a block of more than about 32 MiB, JSON-escaped, can’t be sent through the socket; prompt send fails with the process’s error. ACP has no such limit, but the agent’s side of the host reads no longer line either.

Why. A line counted only once its newline came let a newline-free stream go past the cap without limit: 64 MiB of x took the host from 3 MB to 71 MB, and 96 MiB to an editor that had stopped reading, 486 MB. The editor’s input and the agent’s stderr had the same gap, and so did a peer’s requests (#269): a client of the user’s that wrote without a newline grew the host’s memory as far as it wrote. The peer is the user’s own process (P13), so this is reliability, not a boundary, but the host’s memory is everyone’s sessions’ (N2). Holding back the pipe can’t fix it alone: a line longer than the cap would hold its own reader back for room only its newline could make, a deadlock in the middle of a message. So past some length a line can’t be kept whole. With an editor attached the bytes must reach it unchanged (P1); headless, brnr is the client, and refuses what it can’t be sure of (P4). Either way it says so (P3), and memory stays bounded (P6).

Considered.

  • Keeping the requests the host answered, those the agent cancelled and the sessions closed under the editor until the editor follows up, without a cap: an editor that never answers a withdrawn or cancelled request, or never loads a closed session again, grows them for the process’s life (#332, #364).
  • Counting a line still coming against the cap, and so a limit of 16 MiB: one bound for everything, but messages ADR 10.1 promises to peers (20 MB) would not be read.
  • A larger limit (64 MiB, say): more of the host’s memory is the agent’s to take, for messages no adapter sends.
  • Cutting the line in the proxy role, or replacing it with an error: it changes the editor’s bytes (P1).
  • Spooling a long line to disk so the host can still read it: memory bounded, but a parse of an unbounded line isn’t, and disk use becomes the agent’s to choose.
  • Reading a long line leniently for its id and method: the guess ADR 2.5 rejects.
  • An event at the line’s end with its length: one that never ends would never be told.
  • Leaving a peer’s requests unbounded, as the user’s own process: a client with a bug costs every session of the process its memory.
  • Skipping a peer’s long request and reading on after its newline: the bytes up to it are still read, as long as the peer writes, and a peer whose request is that long has gone wrong.

10.4 Connections and waits

The process serves its socket however its clients behave, and a command never waits on a process without end (N2, P6, P3).

  • An accept that fails (out of file descriptors, EMFILE) is tried again after 10 ms, then after twice as long each time it fails again, up to 1 s; one that succeeds starts again from 10 ms. The accepting thread never spins.
  • The process serves at most 128 connections at once, each with two threads and a queue of up to 16 MiB (ADR 10.1). The 129th is answered process_unreachable, “too many connections: 128 open” (ADR 8.7), and closed, with no thread started for it. A connection counts until both its threads have ended and the process has let go of it. Once its reader has seen it end, or it is cut off for a request too long (ADR 10.3), its writer writes what was queued for it, and what comes within 5 s (an answer still to come, logged on a stalled disk), and ends; the connection is shut down then, or after 5 s if the peer doesn’t read, so a client that stops reading and closes its side doesn’t hold a slot, a thread and a socket for ever. The start channel of session new and started bridges aren’t connections to the socket, and don’t count.
  • A command finds the processes (process list, and every command that names a session) by asking each for its status, all at once, each on a thread of its own: it waits about 5 s in all (5 s and a margin of 1 s), not 5 s for each. A process not answering by then is listed as not answering (ADR 3.9). Its thread isn’t waited for; it ends by itself, as each of its steps waits at most 5 s (below).
  • Connecting to a process waits at most 5 s for it to take the connection: on Linux a stopped process whose backlog is full makes a connection wait for as long as it stays full (macOS refuses it). Past that, the command says not answering, as for a request. So every step a command takes against a process is bounded, and no thread is left blocked for good: a command that finds the processes twice (reading a session that is closing) doesn’t pile them up.
  • Every request a command makes waits 5 s for its answer, on a connection of its own or on one it is subscribed on: none of those it makes there (subscribe, status, pending, logged, was_cut_off, send) waits on the agent. One that does (config set, session fork, session close) waits 120 s. Events wait as long as --timeout says, and without it for as long as the session runs; a start, session new --pid or session resume --pid, as long as its own timeout (ADR 3.4). Past its wait, a request fails with not answering.
  • A request whose write makes no progress for 5 s (the process has stopped reading) fails the same way.
  • Whether anyone listens on a socket, to tell a process gone (ADR 3.9), is asked without waiting: a full backlog is someone listening.
  • An error the process says to no request in particular (no req_id), before it closes the connection, is the answer to the request waiting: a request too long to read (ADR 10.3), too many connections. The command fails with it (P3), not with the process closed the connection.

Consequences.

  • A command over k processes that don’t answer waits about 5 s, not 5k s.
  • A process that takes a connection only just before 5 s, then answers late, keeps its probe’s thread past the command’s 6 s, each step 5 s at most: the command lists it as not answering and goes on without it.
  • A 129th client gets an error rather than a connection; brnr’s own commands say it. A client of the user’s that holds 128 connections open keeps brnr’s commands out of that process until it lets them go (docs/threat-model.md).
  • A request’s write that takes some of the request and then stalls waits 5 s for each time the kernel stops taking it, so a long request may wait up to twice that before it fails.
  • A process whose logged is held up by a stalled disk for more than 5 s is one a command can’t catch up with (ADR 10.2), and says so: before, the command waited for as long as the disk did.

Why. An accept that failed was tried again at once, so a process out of file descriptors spun on its accepting thread; each connection took two threads and a queue, without a limit on how many (#269). discover asked the processes one after another, 5 s each, so k stopped processes cost 5k s for every command; on Linux a connection to a stopped process whose backlog was full blocked for good. A request on a subscribed connection had no timeout, and a write none either, so a process that stopped reading or answering held the command for good, with nothing said (P3).

Considered.

  • Waiting for each process in turn, with a shorter wait: a busy process would be listed as not answering more often, and k of them still add up.
  • An async runtime for the probes: a crate, for what a thread each does (N1: few crates).
  • A connection that blocks, left on a thread of its own the command doesn’t wait for: a thread for each stopped process, every time the processes are found, blocked for as long as the process is stopped.
  • A bounded pool of threads for the probes: blocked connections still hold its threads, and k processes over n threads cost k/n waits.
  • Making the 129th connection wait in the backlog rather than answering it: the backlog is the kernel’s and small, its client can’t tell a full process from a stopped one, and on macOS a full backlog refuses connections, which a command takes as a process gone.
  • A cap on connections per client: the socket can’t tell clients apart (docs/threat-model.md: no peer credentials), and they are all the user’s.
  • A timeout for events: a turn takes as long as it takes, and the user chooses with --timeout (ADR 8.3).

Tests

Run cargo test --release adr_0010_. Named claims, by section:

  • 10.1:

    • tests/headless.rs: adr_0010_slow_watcher_is_disconnected, adr_0010_reading_watcher_stays_connected, adr_0010_huge_message_reaches_watchers, adr_0010_big_message_to_a_lagging_watcher, adr_0010_every_watcher_sees_the_exit, adr_0010_a_stalled_disk_skips_records_and_says_so, adr_0010_editor_that_stops_reading_holds_the_agent_back, adr_0010_a_stalled_agent_holds_the_editor_back, adr_0010_a_long_message_doesnt_put_a_watcher_behind, adr_0010_a_reply_bigger_than_the_queue_reaches_every_peer.
    • src/log.rs: adr_0010_past_the_cap_records_are_skipped_and_noted_before_the_next, adr_0010_a_gap_is_noted_in_the_host_log_and_each_session_that_lost_records, adr_0010_a_failed_write_is_noted_once_the_file_takes_records_again.
    • src/host/control.rs: adr_0010_a_message_and_its_acp_line_fit_at_once, adr_0010_a_peer_that_stopped_reading_is_cut_off_soon_after_the_limit.
  • 10.2:

    • tests/headless.rs: adr_0010_a_watcher_cut_off_catches_up, adr_0010_a_copied_open_request_has_no_position, adr_0010_a_burst_past_64_mib_reaches_a_watcher, adr_0010_a_watcher_that_cant_catch_up_says_what_it_missed, adr_0010_a_wait_cut_off_catches_up, adr_0010_event_wait_cut_off_catches_up, adr_0010_the_host_log_notes_each_subscription.
    • tests/cli.rs: adr_0010_notify_cut_off_catches_up_once_its_command_is_done.
    • tests/security.rs: adr_0010_was_cut_off_says_where_never_what.
    • src/ctl/client.rs: adr_0010_a_cut_off_while_catching_up_is_tried_again_then_given_up, adr_0010_a_live_process_that_cant_be_caught_up_with_says_until_where, adr_0010_a_new_subscription_that_fails_is_one_more_cut_off, adr_0010_a_peer_cut_off_by_a_stopping_process_catches_up, adr_0010_a_process_has_gone_once_it_has_exited, adr_0010_an_event_live_while_subscribing_again_comes_once.
    • src/ctl/talk.rs: adr_0010_event_wait_cut_off_looking_says_what_it_missed, adr_0010_a_start_channel_cut_off_catches_up_or_says_what_it_missed.
    • src/ctl/notify.rs: adr_0010_notify_cut_off_looking_runs_for_what_it_read_then_says_what_it_missed.
    • src/transcript.rs: adr_0010_a_records_position_is_read_from_its_end_or_head.
    • src/log.rs: adr_0010_what_the_transcript_lost_is_said_by_position.
  • 10.3:

    • src/host/approvals.rs: adr_0010_answered_requests_past_the_cap_lose_the_oldest, adr_0010_a_sessions_answered_requests_go_with_its_close, adr_0010_given_up_requests_past_the_cap_lose_the_oldest, adr_0010_a_sessions_given_up_requests_go_with_its_close.
    • src/host/sessions.rs: adr_0010_sessions_closed_under_the_editor_past_the_cap_lose_the_oldest, adr_0010_a_closed_sessions_answered_requests_go, adr_0010_a_request_cancelled_after_its_close_is_not_kept.
    • tests/headless.rs: adr_0010_headless_an_agent_line_past_the_limit_is_dropped_and_said, adr_0010_a_long_line_to_an_editor_that_stops_reading_is_held_back, adr_0010_an_editor_line_past_the_limit_goes_to_the_agent_unread, adr_0010_the_agents_stderr_without_a_newline_is_bounded, adr_0010_a_bridges_long_stderr_line_goes_to_the_host_log_in_pieces, adr_0010_a_bridges_stderr_line_that_fills_a_piece_is_one_note, adr_0010_a_bridges_stderr_keeps_a_carriage_return_inside_a_line, adr_0010_a_bridges_stderr_keeps_a_character_a_piece_would_cut, adr_0010_an_agents_stderr_line_that_fills_a_piece_is_one_record, adr_0010_an_agents_stderr_keeps_a_character_a_piece_would_cut, adr_0010_the_processs_own_stderr_goes_to_the_host_log_in_pieces, adr_0010_a_request_past_the_limit_is_answered_and_cut_off, adr_0010_a_bridges_request_past_the_limit_cuts_it_off.
    • src/host/mod.rs: adr_0010_stderr_read_as_lines_ends_with_what_a_piece_left, adr_0010_a_stderr_note_is_at_most_a_piece_once_decoded, adr_0010_a_tails_line_is_cut_between_characters.
    • src/host/lines.rs: adr_0010_lines_are_read_whole_however_the_reads_split_them, adr_0010_a_line_that_ends_at_the_limit_is_read_whole, adr_0010_a_relayed_line_past_the_limit_goes_on_as_it_comes, adr_0010_a_cut_line_is_in_parts_of_the_limit, adr_0010_the_newline_after_a_cut_only_ends_its_line, adr_0010_a_character_a_cut_would_split_starts_the_next_part, adr_0010_a_cut_is_between_characters, adr_0010_a_byte_at_a_time_reads_as_all_at_once.
    • src/host/control.rs: adr_0010_a_request_is_read_up_to_the_limit_and_no_further.
  • 10.4:

    • src/host/control.rs: adr_0010_a_connection_past_the_cap_is_told_and_closed, adr_0010_a_cut_off_connection_closes_once_written_or_after_a_wait, adr_0010_a_writer_let_go_of_ends_after_its_wait, adr_0010_accept_errors_back_off_doubling_to_a_second.
    • src/ctl/client.rs: adr_0010_processes_not_answering_cost_one_wait_in_all, adr_0010_a_request_not_answered_or_taken_is_not_answering, adr_0010_an_error_said_to_no_request_is_the_answer.
    • src/sys.rs: adr_0010_a_connection_a_full_backlog_holds_waits_at_most_its_wait.

    Not covered by a Rust test: an accept failing for real (running a test process out of file descriptors would fail its other tests); the back-off is tested as the waits it chooses.

11. Building, releasing and support

Draft 2026-10-19, 11.9 2026-10-24. Implemented; Muse’s authenticated acceptance review (#223) is not complete. Factors: N1, and F1 for 11.9 (ADR 1). Brings together former ADRs 37, 38, 39, 40, 45, 47 and 52 (docs/adr/README.md maps them).

How brnr and its adapters are built, found, versioned, released and published, how its documentation is published, how a user reports a bug, and how agents with ACP of their own are checked. The supply chain serves N1: pinned builds compiled where they run, reproducible release builds with an SBOM, publication without a stored token, and bug reports that send nothing the user didn’t choose to paste. The check of agents with ACP of their own serves F1: what brnr does with each is seen, not assumed.

11.1 Adapters through Homebrew

  • brnr-claude-adapter and brnr-codex-adapter, formulae in brnr’s tap, compile the adapters on the user’s machine from brnr’s adapters/ at the same tag, pinned by bun.lock, with bun build --compile. bun, in homebrew-core, is a build-only dependency. Nothing prebuilt is distributed: the user’s machine fetches and compiles the packages, as adapters/build.sh does for anyone who builds from source. The npm packages are mentioned as the alternative.
  • One formula per adapter. You install what you use (each Node adapter is about 60 MB and its own build; the native Muse binary is smaller). Each has the license that fits: only the Claude adapter compiles in the SDK, license :cannot_represent with a caveat; the Codex adapter is Apache-2.0. One adapter’s upstream breaking doesn’t stop the other from installing. A third agent’s adapter is one more formula.
  • adapters/ packages the adapters unchanged. brnr adds only finding the user’s own agent, and --version (adapters/claude.ts, codex.ts).
  • Muse Code uses brnr-muse-adapter, built from the pinned muse-acp source tag with Cargo (Rust and Python are build-only dependencies). Its upstream Rust sources are unchanged, including --version and the search for the user’s own muse. adapters/muse.py builds a production-only workspace offline: upstream’s test-only and ACP client SDK dependencies aren’t needed. A new production dependency fails the build until reviewed. The formula stages a checksum-verified source resource; a source checkout fetches the same tag. No upstream prebuilt executable is installed. adapters/muse.rb.in is the formula template, published by the maintainer’s release workflow with the pinned source’s SHA-256. The npm package is an alternative for people who choose its bundled prebuilt binaries.

Not covered by a Rust test: Homebrew formulae live in the separate tap repository; this checkout cannot prove their installation or license declarations. The adapters CI job builds and exercises the pinned Node adapters and Muse’s source build; the release workflow tests the public brnr formula, and the tap’s own CI builds, tests and audits its formulae from source on Linux and macOS. A new adapter’s formula joins that CI after the release that first writes it to the tap.

Why. brnr runs the community’s ACP adapters for Claude Code and Codex. They are Node packages. claude-agent-acp compiles in Anthropic’s Claude Agent SDK, under Anthropic’s Commercial Terms, so brnr’s tap can’t ship prebuilt adapters.

Considered.

  • Telling Homebrew users to install the npm packages: that needs Node 22 on the editor’s PATH, and the packages likely bring their own copies of the agents through optional dependencies (build.sh leaves those out).
  • One formula for both (brnr-adapters): it loses each reason for one formula per adapter, above.
  • A tap per adapter: more brew taps for users and more release plumbing, for nothing a formula per adapter doesn’t give.
  • deno as the compiler (also in homebrew-core): build.sh uses bun build --compile with a frozen lockfile, its output is what brnr’s tests run against, and both adapters are written for Node. deno’s npm compatibility would be one more thing to verify, for code that spawns and talks to subprocesses.

11.2 The adapters’ names, and finding them next to brnr

  • The compiled adapters are brnr-claude-adapter and brnr-codex-adapter, and brnr-muse-adapter. brnr acp -- claude-agent-acp runs the npm package. brnr doctor reports both kinds.
  • A bare agent name (no /) is looked for next to brnr first, then on PATH, so an editor’s PATH needn’t include Homebrew’s. “Next to brnr” is the running binary’s directory, and the directory of the path brnr was started by (argv[0], when it is a path). Both paths can be the caller’s choice: a symlink or hard link to brnr, or a chosen argv[0], can select a lookup directory; see the program-starting Gap. Homebrew links bin/brnr and the adapters into its prefix’s bin. On macOS the running binary’s path is the link’s, so an adapter next to the link is found. On Linux it is the link’s target in the Cellar, where the adapters aren’t.
  • brnr session new, brnr session resume and brnr acp, started by that path, do the lookup, since whoever starts a process resolves everything (ADR 3.3). They pass the path found to the process, which starts the agent. The rule is fixed and documented (P4).
  • A started bridge’s bare command (~ expanded) is looked for the same way, in the same place. So command = "brnr", args = ["event", "notify", …] works from an editor whose PATH lacks brnr, and a bridge linked into Homebrew’s bin is found on Linux too (ADR 5.7, ADR 5.8).

Why. An editor’s PATH often lacks Homebrew’s bin, and on Linux the running binary’s own directory is in the Cellar, away from the adapters.

Considered.

  • The npm packages’ command names (claude-agent-acp, codex-acp), so docs and configs read the same either way: with a Homebrew install next to a global npm install, two commands of one name would be on PATH, and which one ran would depend on PATH order.
  • Looking only next to the running binary: on Linux, through Homebrew’s symlink, the adapters aren’t found.

11.3 Which adapter version is built

  • Each adapter formula’s version is its npm package’s (brnr-claude-adapter 0.85.1), written by the release workflow from adapters/package.json. A brnr release that doesn’t move the pin changes the formula’s source but not its version, so nobody rebuilds for nothing. brew outdated shows an adapter when its package moves.
  • Muse’s exact version is the @brokkai/muse-acp devDependency in adapters/package.json, tracked by bun.lock and Dependabot. It is only a version catalogue: bun install --production never installs that package or its prebuilt binaries. adapters/muse.py fetches v<version> from BrokkAi/muse-acp, checks the source’s Cargo version, and builds it. The formula’s source resource is pinned by SHA-256 as well as its tag.
  • When adapters/ changes without a new npm version, release.sh says so: bump the formula’s revision by hand if users need the new build. That is any change in adapters/ but the pins’ files (package.json, bun.lock), and theirs too when no pin moved: bun.lock alone moving is a dependency of a pinned package moving, which changes the build as much. The release workflow drops the revision when the npm version next moves, since a new version starts the count over.
  • The adapters say what they were built from (--version, compiled in), and brnr doctor shows it. For npm-installed adapters doctor shows the version from the package.json their bin link leads to. brnr session status shows what the agent says it is in initialize: ACP’s agentInfo, as its agent’s name and version, beside program (ADR 8.2).
  • Muse 0.16.0 already has --version, printing muse-acp <version>; doctor accepts that for the renamed source build and a standalone upstream binary, or reads the scoped npm package manifest. Version probes close stdin and are killed after five seconds, including older Muse releases which might otherwise start ACP. The unrelated unscoped npm muse-acp package is not a supported source.
  • Dependabot opens a pull request for new releases of the two packages, and the scoped Muse package, weekly; the next brnr release ships them. A nightly workflow (canary.yml) builds the newest releases first, without moving the pins, checks them with brnr and opens an issue when they fail, so a breaking release is known before Dependabot proposes it. Every pull request, a Dependabot one included, builds the pinned adapters and checks them with brnr the same way (adapters/check.py --brnr).

Muse integration is ACP v1 (ADR 2.2), with the existing steering convention, approvals, authentication, config selectors and session lifecycle. Muse’s private extensions pass through an editor’s proxy and are kept in raw ACP; they add no dedicated headless commands. Muse metadata does not change brnr’s interpretation of standard events. Dedicated capabilities are follow-up issues (#402–#405). A real authenticated Muse acceptance run is required before this integration is considered complete; stand-in CI proves only transport.

Consequences. The pin matters. The adapters behave differently from each other, and from one version to the next, wherever ACP leaves room (ADR 4.2). brnr’s tests run against exactly the pinned builds.

Considered.

  • A brnr release for every upstream release: batching them into brnr’s releases keeps the pace a person’s.

11.4 release.sh

Two steps, because main only changes through reviewed pull requests:

  • release.sh <bump> lints and tests main and opens the release pull request, with the changes and the adapters’ versions.
  • release.sh tag, after the merge, checks that CI passed on main, tags, follows the release workflow, and checks the tap and crates.io (ADR 11.6).
  • release.sh notes prints what the release pull request would say. Generating release notes requires Git 2.13 or newer, checked before looking up the last tag: older Git cannot exclude release candidates from a final release’s comparison, and must fail rather than list all commits.

Release notes

A release’s notes are its section of CHANGELOG.md, which follows Keep a Changelog 1.1.0: what someone upgrading notices, under its six change types (Added, Changed, Deprecated, Removed, Fixed, Security, a fixed advisory by its id), each entry with the ADR it follows (P9: release notes say what changed). Before 1.0 a breaking change goes under Changed or Removed, starting with Breaking:.

  • A pull request that changes what users see adds its entry under ## [Unreleased].
  • release.sh <bump> refuses an empty Unreleased unless a final release folds in its release candidates’ entries. On the release branch it heads what it has ## [X.Y.Z] - YYYY-MM-DD, under a new, empty Unreleased. It moves the link definitions to match: [X.Y.Z] compares the last tag with vX.Y.Z, and [Unreleased] vX.Y.Z with HEAD. The release pull request shows the section, to be edited there. release.sh changelog --named X.Y.Z prints the file as it will be.
  • release.sh tag refuses a version CHANGELOG.md has no section for. The release workflow publishes the section with gh release create --notes-file, and fails before the build if there is none.
  • release.sh changelog [<version>] prints a version’s section, the one reading of the file both use: ## [1.1] isn’t ## [1.1.0], the link definitions are left out, and each paragraph and list item is on one line, since GitHub shows line breaks as they are.

Release candidates

A release candidate lets users try a version before Homebrew users get it with brew upgrade.

  • A version is X.Y.Z or X.Y.Z-rc.N (N from 1), as SemVer 2.0.0 writes them, and comes after the current one in SemVer’s order: X.Y.Z after its release candidates. release.sh refuses anything else (1.2.3.4, 1.0.0rc1, an older version), rather than release it.
  • release.sh 1.0.0-rc.1 names the first. From a release candidate, rc is the next one, and 1.0.0 the release. major, minor and patch fail there, since they could mean the release or a version past it (P4). release.sh next <bump> prints the version a bump makes.
  • A tag with a - makes a GitHub pre-release (gh release create --prerelease), so the latest release stays the last X.Y.Z. The release workflow publishes it to crates.io, where cargo install brnr only takes it with --version. It doesn’t update the formulae in the tap, and skips the Homebrew smoke test, which installs from there (ADR 11.7). release.sh tag checks that the GitHub release is a pre-release, doesn’t check the tap, and says how to install it.
  • A release candidate’s CHANGELOG.md section and pull request cover what changed since the last tag, a release candidate or not: they are its GitHub release’s notes. The release’s cover what changed since the last release: release.sh X.Y.Z folds the sections of X.Y.Z-rc.N into X.Y.Z‘s, under each change type the Breaking: entries first, newest first, removes their links, and compares X.Y.Z with the tag the first release candidate compared from. Its pull request lists the commits and adapter changes since the last release. With nothing under Unreleased, the release candidates’ entries are its notes; it refuses an empty section.

Not covered by a Rust test: tagging, publishing and updating the tap change external repositories and registries, so the suite can’t run them; release.yml and release.sh’s checks after publication are the evidence. There is no sandboxed end-to-end release.sh test. That a -rc.N tag makes a pre-release and leaves the tap alone rests on release.yml’s if:s and release.sh tag’s check that the GitHub release is a pre-release.

Why. main changes only through reviewed pull requests, so a release is a pull request and then a tag. Release notes are for whoever upgrades, and are best written with the change, by whoever made it (P9).

Considered.

  • One command that pushes the bump to main and tags: it skips review.
  • Doing it all in a workflow (workflow_dispatch): it works, but is harder to run and debug than a script you can read.
  • gh release create --generate-notes: the pull requests’ titles, which say what changed to whoever reviewed it, not what to do to whoever upgrades.
  • Release notes written in the release pull request: once, by whoever releases, long after the change.
  • Release candidates in the tap, as a brnr@rc formula or a --HEAD build: a second formula to keep, for a few weeks before each major version. crates.io and the release’s tarball reach those who want one.
  • Keeping each release candidate’s section under the release’s: the release’s notes would say only what changed since the last release candidate, and someone upgrading from the last release reads them all.
  • major, minor and patch from a release candidate as npm’s semver inc does (1.0.0-rc.1 major is 1.0.0): it picks for the maintainer whether the bump releases the candidate or passes it.

11.5 Bug reports

  • brnr doctor --report runs the checks and prints, instead of them, a bug report to read, then paste into an issue. It is Markdown, and starts with a comment that says to read it first. Then:
    • brnr’s version and the OS (macOS 26.4 (Darwin 25.4.0, arm64): the product’s name and version from SystemVersion.plist or os-release, and uname’s);
    • the adapters, as doctor’s lines have them (where each is, and the version, ADR 11.3);
    • the checks that aren’t ok (fail, warn and info);
    • the last 20 lines of the latest host log, and of the latest log of a process that panicked or died without recording it (ADR 3.7), when that is another one, each with how it ended (exited, brnr panicked, running, died without recording it). A line longer than 4000 characters is cut, saying how much more there was. Each line that is a record, read as transcripts are (ADR 2.5: nested up to 256), has what ADR 9.1 redacts redacted again, whatever wrote it; it is otherwise as recorded. A log in a format this brnr doesn’t read isn’t one of them, and a record in one is not shown (ADR 5.10). A line nested deeper is not shown, and says so.
    • Everywhere, the home directory is ~, as a path and as the start of a project folder’s name.
  • doctor --report --json is one object with the same data (P5, ADR 8.2): brnr, os, adapters, checks (doctor’s {level, check, message}), and host_logs (run, ended, lines, the lines as the text has them). --report exits as doctor does. --fix doesn’t go with it.
  • A panic prints, after Rust’s message, a link to a pre-filled bug form (issues/new?template=bug.yml), URL-encoded, with the title (Panic at <file:line:col>), brnr --version, the OS and the panic’s message (at most 1000 characters of it). It never has the command’s arguments, only which command it was. Nothing is sent; the user opens the link or doesn’t. It goes where the user of the panicking process looks:
    • the CLI (every command but host), and brnr acp: on stderr, which is the editor’s log for acp;
    • a host in the foreground (ADR 3.5): on its stderr, from its hook;
    • a detached host has no terminal (its stderr is its host log): when its start fails with the panic, brnr session new, brnr session resume and brnr acp print the link after the reason. A detached host’s panic later on is the process_exited error that watchers and event wait see, and the host log doctor --report shows. It has no link, which would be noise in every event a panic ends.
  • The bug form asks for brnr doctor --report, not doctor --json.

Why. A bug report needs the brnr version, the OS, the adapters, what doctor finds and what the host log says. Gathered by hand, that is --version, doctor --json (which names paths and sessions) and a host log, trimmed. A panic said only what Rust says, and a detached host’s panic is recorded (ADR 3.7) where nobody reads it as it happens. brnr listens on no network (P13) and never phones home (P15): what reaches an issue is what the user chose to paste (#23, #24).

Consequences.

  • The report shows the host log’s lines as they are, prompts included (the process_started record has the start_request, ADR 3.3): only what brnr knows is secret is redacted. The comment at its top, the documentation and the form say to read it first.
  • A panic that keeps the hook from running (an abort, ADR 3.7) prints no link.

Considered.

  • Sending reports (telemetry, a crash reporter): brnr reaches nothing beyond the machine (P13, P15), and the user decides what to share.
  • The session transcripts in the report: they hold prompts and code; brnr event log is there for what shows the bug.
  • Every host log of a process that died: the latest is what a report is about, and doctor’s check already counts the rest.
  • The command line in the link: arguments carry prompts and paths.
  • Writing the link into the host log too: the log is the record, and the panic is in it.

11.6 brnr on crates.io

  • brnr is published to crates.io as brnr, at every release and release candidate, by the release workflow. A crates job runs after the GitHub release and the tap, once the reproducibility check and, for a release, the Homebrew smoke test (ADR 11.7) have passed. A release candidate skips the smoke test (ADR 11.4).
  • It uses crates.io’s trusted publishing, with no stored token. The job exchanges GitHub’s OIDC token for a short-lived crates.io token (rust-lang/crates-io-auth-action, which revokes it when the job ends). The crates.io side trusts only release.yml in brnrhq/brnr, in the crates-io environment.
  • Before anything is made public, the release job runs cargo publish --dry-run. A version that won’t package stops before the GitHub release, and a version already published can’t be replaced.
  • The package includes only what the build needs: src/, skills/ (which brnr skill embeds), the README, and the license and NOTICE, which Apache-2.0 asks a redistribution to carry. The tests, docs, site and workflows stay in the repository.
  • The published library is private but for its facade, brnr::run and the typed functions that mirror the command line; only the facade is covered by compatibility (ADR 8.5).
  • cargo install brnr --locked is documented next to Homebrew. It installs brnr only. The adapters come from Homebrew or npm (ADR 11.1), because a crate can’t build them.
  • release.sh tag checks that crates.io has the new version, as it checks the tap (ADR 11.4).

Not covered by a Rust test: publishing requires the crates.io trusted-publisher environment and creates an immutable external version. release.yml runs cargo publish --dry-run before publication and uses the crates job for the real publish; release.sh checks the published version. The runtime suite cannot prove registry permissions or publication.

Why. cargo install brnr is what a Rust user tries first, and anyone could publish a crate by that name. A tool that runs coding agents with the user’s credentials makes a good lure for someone who impersonates it (N1). With Homebrew as the only channel, Linux users without Homebrew had to build from a clone.

Consequences.

  • A crates.io version can be yanked but not deleted. A bad release is fixed by the next one, as with the tap.
  • The first version (0.6.0) was published by hand, with a token scoped to brnr and publish-new, then revoked: trusted publishing can only be set up for a crate that exists. After that, no token is needed.

Considered.

  • An empty placeholder crate to hold the name: crates.io’s policy discourages it, and the real crate costs no more.
  • A CARGO_REGISTRY_TOKEN secret: a long-lived credential that can publish, kept in the repository’s secrets. Trusted publishing needs none.
  • Publishing from release.sh on the maintainer’s machine: the same long-lived token, kept locally, and a publish that doesn’t come from the tested, tagged build.
  • Prebuilt binaries through cargo binstall: binstall can already fall back to building from source. Release binaries are a separate decision.

11.7 Reproducible builds and an SBOM

  • On pull requests, main, and before a tag is published, Linux and macOS each build the committed source twice with cargo build --release --locked. Each build has its own source and target directories, without a target cache, and runs at a different wall-clock time. Both use the commit timestamp as SOURCE_DATE_EPOCH and remap the source directory to /brnr with --remap-path-prefix. Their SHA-256 hashes are printed and must match. The tag calls the same workflow that checks pull requests.
  • Before publication, pinned cargo-cyclonedx generates a CycloneDX 1.5 JSON SBOM, including transitive Rust dependencies across all targets. It must leave Cargo.lock unchanged. The release attaches it as brnr-X.cdx.json, with build provenance, next to the source archive.
  • After the release and the tap update, a separate, fresh macOS runner runs brew install brnrhq/tap/brnr and brew test brnrhq/tap/brnr, checks brnr --version against the tag, and runs brnr doctor. It uses the public formula and source download, with no checkout or local build to fall back to. A release candidate leaves the tap alone, so it has no smoke test (ADR 11.4).

Not covered by a Rust test: these claims are exercised by workflow jobs rather than Rust tests. reproducible.yml independently rebuilds and compares SHA-256 hashes on Linux and macOS; release.yml generates the SBOM and runs the fresh Homebrew smoke job. The runtime suite cannot prove a public installation or a release attachment.

Why. Build provenance says where the source archive came from. It does not say that rebuilding it gives the same binary, list its dependencies in a machine-readable form, or prove that the published Homebrew formula works (#37). A failed check must fail the workflow (P3, P7), before publication wherever possible.

Consequences.

  • Reproducibility is checked within each runner’s toolchain and OS. This does not promise identical binaries across Rust versions, platforms or linkers; stable Rust and runner images still move. Releases ship source, not prebuilt binaries.
  • The SBOM describes brnr’s Rust crate. It does not inventory the adapters’ npm dependencies or claim that an inventoried dependency is safe.
  • The smoke test fails the release workflow if installation, the formula’s test, the version check or doctor fails. The GitHub release and the tap push have already happened and this check cannot roll them back. Publishing to crates.io, where a version can’t be replaced, waits for it (ADR 11.6): a failed smoke test leaves the version off crates.io. Missing optional adapters are informational to doctor and need no credentials.

Considered.

  • Reusing one target directory: Cargo may reuse the first binary, which proves nothing about an independent rebuild.
  • Checking only on main: a tag can point at a commit without a successful main run. Publication must depend on the check itself.
  • Running the smoke test from the release checkout: it can accidentally test a local binary, and bypass what the user downloads and installs.

11.8 The documentation is a book on the site, and the README is short

  • The documentation is an mdBook whose source is docs/ (book.toml at the repository’s root; mdbook build writes it to target/book, never into the repository): an introduction, installing, the guide, the interface reference (docs/reference/), the design (ADR 1, these records and the threat model, at the paths the code and the skill link to) and the project’s pages. It has mdBook’s own search, and resolves #374.
  • pages.yml publishes it with the landing page: site/ at the root of https://brnrhq.github.io/brnr/, the book at docs/, so the book is at https://brnrhq.github.io/brnr/docs/. It runs when docs/, site/, book.toml, the build script or the workflow changes. ci.yml’s lint job builds the book too, so a pull request that breaks it fails, not only the deploy.
  • mdBook is the release’s Linux binary, at a pinned version, checked against a pinned SHA-256 before it runs (.github/scripts/book.sh); not cargo install, nor a third-party action.
  • The README is the short entry point: badges, what brnr is and its diagram, installing, a quick start, links to the book’s pages, and how to contribute and the license. The crate packages it (ADR 11.6), and crates.io shows it, so its links to the book are absolute.
  • The examples in the book are tested as the README’s are (tests/docs.rs, ADR 8.6): each page with sh or toml blocks is in its DOCS, and the guide’s pages, together, must name every command and option of brnr --help.
  • The interface reference is a section of the book, docs/reference/: an overview with the synopsis brnr --help prints, a page for each command group, and pages for the events, the bridge protocol, exit codes, errors, the configuration and the files. Each output has a table of its fields, one row for each, and an example. Each json block there is an example whose command a test runs, comparing the shape of what brnr prints with it (the fields at every level, each one’s JSON type, null only where its row says so), or is in the test’s JSON_SKIPPED, with why (#375).

Not covered by a Rust test: that the book builds, and that the site publishes it. ci.yml’s lint job builds it on every pull request, and pages.yml publishes it from main.

Why. The README had grown to over a thousand lines: a reference, a guide and the project’s process in one page, with no search and no way to find a section but its headings. The ADRs and the threat model, the why behind it all, were files in a folder (F5: a focused command line needs its reference easy to find). A book keeps every page where it is in the repository, so that a change to the code changes its page in the same pull request, and runs its examples as tests, as before (P3: what the documentation says can’t drift silently).

Consequences.

  • What users read is the book on the site, built from main; the README points there. A released version’s documentation is its tag’s docs/.
  • Links in docs/ to files outside it (the code, the tests, SECURITY.md) are absolute links to the repository on GitHub, so that they work in the book too.
  • mdBook is one more pinned tool in CI, outside Cargo’s lockfile; a new version is a new version and SHA-256 in book.sh.

Considered.

  • Keeping the README as the whole documentation: no search, no structure beyond its headings, and crates.io and GitHub render all of it.
  • A docs site generator with a theme of its own (Docusaurus, MkDocs): Node.js or Python and their dependencies in CI, for what mdBook, a single Rust binary, does.
  • cargo install mdbook or an action that installs it: a build from source on every run, or a third party’s code with the workflow’s permissions, where a checked release binary does.
  • The documentation in GitHub’s wiki: not versioned with the code, and its examples can’t be tested.

11.9 Agents with ACP of their own are checked by hand, with a smoke check

  • brnr runs an agent that speaks ACP itself (JetBrains Junie, junie --acp true; Cursor, cursor-agent acp) as it runs an adapter: the command after --, or a profile’s agent. The guide has a profile for each (docs/guide/native-agents.md).
  • adapters/smoke.py checks such an agent through brnr, with the agent itself: adapters/smoke.py junie, cursor, or -- <agent> [args...]. It says brnr’s version and the agent’s (its --version, and the agentInfo of initialize), then checks initialize, session/new, a prompt answered “ok”, a turn cancelled once it runs, and a clean shutdown (brnr process stop: the process, the agent and every process the agent started gone, and the host log ending with process_exited). Fork, list, resume (session/resume, else session/load) and close it checks only where the agent advertises them, and says unsupported where it doesn’t (P7). The sessions it made it deletes from the agent’s store where the agent can, and says where it can’t. However it ends, an error, an exception or Ctrl-C, it stops the processes it started and waits for them to go before it removes its scratch folder; one that doesn’t go keeps the folder, and fails the check, saying so (P14).
  • It runs by hand only, never in CI: it needs the agent installed and logged in, and spends the user’s quota (four short turns at most). It runs in a scratch BRNR_HOME, BRNR_DIR and project folder, with the user’s HOME, for the agent’s login. Its cwd has its symlinks resolved, because an agent may record a cwd that way.
  • What it found, with the versions, the date and the machine, is in the guide (docs/guide/native-agents.md), each failure with whose it is. A failure that is brnr’s gets a test with the fake agent and a fix, or an issue. One that is the agent’s is recorded, and brnr doesn’t work around it (F1).
  • A test runs it against tests/fake_agent.py as the agent: every check passing, each capability left out reported unsupported, and a wrong reply, a turn that can’t be cancelled and an agent that doesn’t start failing it, and Ctrl-C leaving no process running.

Why. #231: research named Junie’s and Cursor’s ACP entry points, but nobody had run them through brnr, so whether they work was a guess. F1 says brnr behaves the same with every agent, and P2 that an agent’s own behaviour can’t be relied on: the way to know is to run each, and say what was seen. A check that needs the agent’s login and quota can’t run in CI, nor quietly (P15: what reaches the network is what the user runs), so it is a command a person runs, and its results are recorded with the versions they hold for.

Consequences.

  • The results are as old as their date: a new version of the agent can change them. Run the check again, and update the page.
  • Cursor 2026.10.19 fails two checks of its own (it ends every reply with an error message, and its session/load replays no history), and doesn’t always exit when its stdin closes, so brnr’s stop sends it SIGTERM (ADR 3.2). The guide says so; brnr doesn’t change for it.

Considered.

  • Extending adapters/check.py: that checks the pinned adapters with stand-in agents, with no login, on every pull request. This check needs the real agent and its account; one script for both would run one way or the other.
  • A nightly job with the agents logged in: credentials for third-party accounts in CI, and quota spent every night, for what changes when an agent’s version moves.
  • An adapter or a mode per agent, to smooth over what each does wrong: brnr doesn’t compensate for an agent (F1), and one agent’s behaviour isn’t a convention (P2).

Tests

Run cargo test --release adr_0011_. Named claims, by section:

  • 11.1: none; see the section.
  • 11.2: tests/headless.rs: adr_0011_adapters_next_to_a_symlinked_brnr, adr_0011_bridges_next_to_a_symlinked_brnr.
  • 11.3: tests/doctor.rs: adr_0011_adapter_versions. adr_0011_muse_npm_identity_is_scoped checks scoped npm metadata, refuses the unrelated npm package, and bounds a native version probe that hangs.
  • 11.4: tests/release.rs:
    • adr_0011_a_releases_notes_are_its_changelog_section.
    • adr_0011_a_version_without_a_section_has_no_notes.
    • adr_0011_a_release_names_unreleased_and_moves_its_links, through changelog --named, which <bump> writes.
    • adr_0011_the_version_being_built_has_its_notes: so a release pull request without them fails CI, before release.sh tag; also that every section has only Keep a Changelog’s change types, in its order.
    • adr_0011_a_version_comes_after_cargo_tomls: 0.8.0 to 1.0.0-rc.1 to rc.2 to 1.0.0 through release.sh next, and what it refuses.
    • adr_0011_a_release_takes_in_its_release_candidates.
    • adr_0011_a_releases_commits_start_from_the_last_release, through release.sh notes in a scratch repository with tags, including the refusal of Git older than 2.13 before it can produce notes from the wrong tag.
  • 11.5: tests/headless.rs: adr_0011_a_panic_prints_a_link_to_report_it; tests/doctor.rs: adr_0011_the_report_is_what_to_paste, adr_0011_the_report_redacts_a_deep_line, adr_0011_the_report_shows_a_death_without_a_record.
  • 11.6, 11.7: none; see the sections.
  • 11.8: tests/docs.rs: adr_0008_every_example_is_run_or_skipped_and_runs and adr_0008_every_toml_block_loads run the book’s examples (ADR 8.6), adr_0008_every_json_example_has_the_shape_brnr_prints runs the reference’s JSON examples and checks their shape, the_interface_reference_matches_cli_help checks the reference’s synopsis against brnr --help, and the_guide_has_every_command_and_option checks that the guide names every command and option; the build and publication, none (see the section).
  • 11.9: tests/smoke.rs: adr_0011_the_smoke_check_runs_every_check_an_agent_advertises, adr_0011_the_smoke_check_says_what_the_agent_doesnt_advertise, adr_0011_the_smoke_check_fails_what_fails, adr_0011_the_smoke_check_stops_what_it_started_when_interrupted, with the fake agent. Not covered by a Rust test: the real agents, which the check runs by hand (see the section).

12. Remote execution

Draft 2026-10-27. Implemented. Factors: F3, F5, N1, N2 and N4 (ADR 1). Resolves #401 and, for 12.2, #409.

12.1 Public commands can execute through the system SSH client

--remote <target> before -- executes a public command on that target. The target is always an SSH destination in [user@]host form (including an SSH alias). An explicit username is passed to SSH; otherwise SSH’s own configuration and defaults decide it. Ports, keys, jump hosts and connection sharing belong in SSH configuration.

System ssh means the executable named ssh on the caller’s PATH, not a pinned path. This applies to every --remote command and remote check, including read verbs. The SSH client reads its own configuration, which can also request local commands. Command rules cannot make these starts safe: program choice and behavior depend on the caller’s environment and files. See the program-starting Gap.

The sequence is:

  1. Parse the public command using the existing argument table, with transport selection added. A flag’s value and words after -- are never transport options. Help stays local and does not read config or connect. Invalid command-table syntax does not connect; command-specific validation (such as incompatible flags) runs on the destination.
  2. Pass the destination straight to SSH without reading local brnr config. Do not resolve profiles, attachments or sessions. Without --remote, execution stays local, except that remote check <target> explicitly starts SSH to run the destination’s doctor (12.2).
  3. Replace the local process with system ssh, preserving its standard streams: -T -o BatchMode=yes -o StrictHostKeyChecking=yes. Missing authentication or host trust fails; the user establishes these with ssh <destination> beforehand. No keys or SSH libraries are bundled.
  4. The remote shell finds brnr on its PATH, then probes its _remote --version, with stdin /dev/null. This also detects old executables without the remote entry point. Require exactly the local package version, including release-candidate suffixes. A missing brnr (remote_brnr_not_found) or a mismatch (remote_version_mismatch) fails before the actual command. The probe writes nothing to the command’s stdout; its failure has stderr diagnostics and, for --json, an error object, with its code (ADR 8.7).
  5. Execute remote brnr with the same public command and arguments, minus --remote. The private _remote entry point refuses another --remote hop, without leaving an environment marker in agents. Profiles and state are resolved on the destination. Never fall back locally.

Every remote shell word is quoted (P8); a destination must be nonempty, not start with -, and contain only ASCII letters, digits and SSH destination punctuation (-._@:%[]+). It is one SSH argument. The remote shell must support POSIX shell syntax, and shell startup files must leave stdout clean. No local shell interprets arguments.

All execution commands support this, including doctor, skill and --version. Inspection commands under remote remain local; they refuse --remote. For skill install, installation is remote. Attachments, --cwd, --dir, agent executables and event notify callbacks are remote paths/programs. There is no file transfer or path translation. An editor must send workspace paths that make sense remotely.

The remote command’s stdout, stderr and ordinary exit status pass through SSH. SSH’s transport/authentication failure is status 255 with its own stderr, and need not have brnr JSON. A remote command that itself exits 255 cannot be distinguished from a transport failure by exit status alone. Local routing failures use brnr’s normal error reporting and exit 1.

ACP still starts an editor-owned agent, through the destination’s ordinary proxy and host. Closing input is EOF to that proxy. Losing the SSH channel, once detected, closes its pipes; normal editor-owned cleanup then applies. There is no reconnect, retry or ownership transfer. A network black hole can take SSH’s configured keepalive/timeout interval to detect. Headless sessions survive their submitting command and an observer disconnecting. SSH does not promise local ACP’s exact signal, wait-status or pipe-closure semantics: a remote signal exit is represented by SSH, and individual stdout EOF need not reach the local editor before the SSH channel ends.

Why. F3/F5 put the same CLI in local terminals, scripts and editors. System SSH preserves existing authentication and trust policy with no new crypto dependencies (N1/N4). It adds no network listener; the remote Unix sockets remain private (P13). The network access is explicitly requested (P15). F5’s preference for external composition gives way to a thin shared routing layer so every command and profile uses one rule.

Considered. Embedded SSH libraries add dependencies and a second implementation of users’ SSH configuration. Forwarding control sockets couples clients to a private protocol. Automatic reconnect would risk replaying prompts or approvals, and changes ownership (P11/P14).

12.2 --remote is the only transport, and a profile is read where the command runs

--remote <target> on the command line is the one way a command reaches another machine for ordinary execution. remote check <target> explicitly connects without that flag to check the destination. Profiles hold no routing:

  • A profile is always read on the machine that runs the command. Without --remote, --profile is a local profile. With --remote, --profile goes to the destination, which loads it from its own config, for every verb that takes --profile (acp, session new, session resume, session list, session delete). A verb that takes no --profile refuses it, before anything connects (ADR 8.1).
  • Without --remote, no command but remote check connects to another machine through brnr’s transport. There is no default routing: profiles.default is a local execution profile, as every profile is.
  • A profile has no remote table. A remote key is an unknown key, which fails to load (ADR 6.1); brnr doctor names it.
  • The destination’s brnr is brnr on the remote shell’s PATH, and its BRNR_DIR, BRNR_HOME and BRNR_CONFIG are that shell’s. They are set in the destination’s shell environment, for example ~/.zshenv or ~/.bashrc, which a non-interactive SSH shell reads. If brnr is not on that PATH, the error says so, and where to set it (remote_brnr_not_found).
  • The remote command runs where the remote shell starts, the user’s home there; relative paths (--file) are from it. A start’s working directory is --cwd or the destination profile’s headless.cwd; acp’s sessions have the cwd the editor sends.
  • The _remote entry point refuses --remote: one hop only.

There is no [remotes] registry and no remote list command. Hostnames, users, keys, ports and jump hosts belong in SSH configuration.

remote check <target> [--json] runs the version preflight, then the destination’s doctor. It reads no local brnr configuration. The result and exit status are doctor’s interface. Checks neither write local config nor create a missing config file or directory. Local doctor checks local profiles only, and does not use SSH. Even without --fix, doctor runs the three brnr-*-adapter programs and non-npm muse-acp with --version, resolved using adapter lookup (ADR 11.2); it reads npm adapters’ versions from package.json. These are program starts, not a guarantee that the selected adapters have no side effects; remote check starts SSH and runs those probes remotely.

The CLI never writes config (N1). Profiles are maintained by hand, on each machine, and keep the private-file and symlink rules (ADR 9.4). An agent reads them with brnr profile (ADR 6.5), locally or, with --remote, on the destination.

Why. Remote execution has --remote on its command line, so it is visible to an agent’s tool-permission rules (N1), but prefix rules cannot exclude it at every argument position; see the threat model’s Gap. remote check connects without that flag and runs the destination’s diagnostic programs. --profile has one meaning, a profile read where the command runs (ADR 8.1); before, it had three: a local execution profile, a local routing profile, or a destination profile. profiles.default.remote sent a plain brnr acp or brnr session new to another machine, and the command line didn’t show it (P4). The overrides that a routing table held (executable, cwd, runtime_dir, home, config) are the remote shell’s environment, which SSH users already keep, so brnr doesn’t need a second place for them (P12, N4). SSH already owns the connection’s identity and authentication; a remote-name registry would duplicate its configuration (F5, P4). Commands never install software or change host trust (P7, P15).

Consequences.

  • A setup that used a routing profile puts --remote <alias> in the editor’s or script’s command line, and the destination profile’s name in --profile.
  • brnr must be on the remote PATH of a non-interactive shell. A brnr installed where only a login shell finds it fails with remote_brnr_not_found, which says how to fix it.
  • Direct file access still depends on filesystem permissions; this is no boundary against unrestricted same-user code (P13).

Considered.

  • Routing profiles, a [profiles.<p>.remote] table with the target, the destination profile and path overrides (the first draft of this record): three meanings for --profile, routing the command line doesn’t show, and a second place for the remote shell’s environment.
  • A [remotes] registry and remote list: duplicate SSH’s aliases.
  • remote init and remote remove: they edit configuration, which stays the user’s to do (N1).
  • An --executable flag for a brnr off the remote PATH: one more transport flag for what the remote shell’s environment already says.

Tests

tests/remote.rs exercises the actual remote brnr and POSIX shell through a fake SSH client, without requiring credentials:

  • 12.1: adr_0012_remote_sessions_stdin_and_json_use_the_destination, adr_0012_shell_quoting_preserves_prompts_and_delimiters, adr_0012_auth_missing_client_version_and_bad_targets_fail, adr_0012_direct_user_destinations_use_remote_path_without_initialisation, adr_0012_acp_has_clean_streams_and_remote_profile_resolution, adr_0012_help_and_invalid_commands_never_connect, adr_0012_event_streams_deliver_live_events_and_disconnect_without_stopping_headless
  • 12.2: adr_0012_profile_without_remote_never_connects, adr_0012_with_remote_profile_reaches_the_destination_for_every_verb_that_takes_it, adr_0012_nested_remote_routing_is_refused, adr_0012_a_remote_table_fails_to_load_and_doctor_names_it, adr_0012_a_missing_remote_brnr_says_how_to_fix_the_path, adr_0012_remote_checks_never_write_or_require_local_configuration, adr_0012_ssh_destinations_bypass_local_config_and_legacy_registry_is_rejected

On Linux, adr_0012_system_ssh_authenticates_and_runs_cli_and_acp_on_linux uses a real loopback OpenSSH server with temporary host/client keys, known_hosts and client configuration. The server’s SetEnv gives the remote shell its PATH and BRNR_* paths, as a destination’s ~/.zshenv or ~/.bashrc would. CI installs OpenSSH for this test. The test checks that ssh-keygen, /usr/sbin/sshd and /usr/bin/ssh can execute before setup, and uses the shared skip helper if any cannot; this is a failure in CI or with BRNR_TESTS_STRICT set.

Not covered by a Rust test: real editor rendering and path agreement, third-party SSH authentication agents, and detection time after a network black hole. These require testing in the user’s editor/SSH environment.

Threat model

brnr runs a coding agent in a process of its own and lets other commands reach it over a Unix socket, including answering the agent’s approvals from outside the editor. That makes it a security boundary: whoever can reach the process can act as the agent’s user. This document says who can reach what, how brnr keeps it so, and which test checks each claim. Where a claim has no enforcement or no test, it is listed as a gap. SECURITY.md says what is in scope for a report; the principles cited are ADR 1’s.

Assets

  • The agent’s actions on the user’s machine. The agent runs as the user: it edits files and runs commands. Whoever can prompt it, or answer its approvals, directs those.
  • Approvals. A permission request is the agent asking before it acts. An answer given by the wrong party, or given when nobody answered, is an action the user didn’t take.
  • Elicitations. The agent asking the user for input (ADR 4.5): a form’s values, or a URL to open, such as an MCP server’s login. An accept given by the wrong party, or for nobody, is input the user didn’t give; a URL the agent sends is its text, and opening it is the user’s to do.
  • Prompts and code in transcripts. ~/.brnr keeps every session’s events and raw ACP (ADR 5.1), until the user deletes them, or, with retention set, until they are older than it (ADR 9.5): prompts, the agent’s replies, tool calls with their input and output, diffs of the user’s code, and, in an editor’s session, what the editor answered the agent’s file and terminal requests with, where the profile or strict mode passes them: files as its buffers have them, unsaved changes included, and commands’ output (ADR 2.7).
  • Secrets. The values of a profile’s or an editor’s MCP servers’ env and headers (tokens, Authorization), which go to the agent in the requests that open a session (ADR 9.1).
  • The config file. config.toml names the commands brnr runs as the user (the agent, bridges, MCP servers) and holds the profiles’ MCP secrets (ADR 6.3). Whoever can write it runs code as the user; whoever can read it has the secrets.

Actors

ActorTrusted withWhere it stands
Other local usersnothingoutside: kept out of the runtime directory, sockets, transcripts and session locks by file modes, and a config file they can read or write is refused (P13)
Rooteverythingoutside brnr’s reach; can do anything as any user
Processes running as the same usereverything the user can doinside the boundary (P13): see below
The editorits session, and serving the agent’s file and terminal requests (fs/*, terminal/*)inside; it runs brnr acp, and its bytes pass unchanged (P1); what it reads, writes and runs for the agent is its own to allow (ADR 2.7)
The agent (the adapter and what it runs)the user’s machine, as far as its own permission prompts goinside as a process; its text is untrusted (P8)
Bridges and event notify commandseverything a socket client can doinside: run as the user from the user’s config; what they forward leaves the machine (P13)
A malicious adapter or npm packageas the agentinside once run: brnr can’t contain it

Processes running as the same user are inside the boundary, and that is a deliberate choice, not a gap: P13 is “only you”, and any process of the user’s is the user to the kernel. It can open the control socket, approve whatever is waiting, read the transcripts, edit the config to add a bridge, or ptrace the agent. brnr has nothing to tell such a process from the user at a terminal, and doesn’t pretend to; SECURITY.md lists “anyone who can already run code as the user” as out of scope. What brnr does keep apart within the user is protocol, not access: actions on an editor’s session are experimental and refused unless enabled by name (ADR 7.1), and strict mode has none of them (ADR 2.1). Those protect the editor’s view from surprises, not the user from their own processes.

An agent is one of those processes once it may run brnr. Allowing an agent to run brnr with any arguments allows it to run any command, as the user, and, with --remote, on any machine the user’s SSH reaches: the agent’s command in session new -- <agent> is any program, and so is event notify’s, and an agent it starts can be told to ask nothing. brnr is not a permission boundary between an agent and the agents it starts (P13); the boundaries that hold are the agent’s managed settings, an OS sandbox, and the agent’s own command rules, as the Gaps below say, and brnr from a restricted agent how to set them.

brnr profile (ADR 6.5) is a hole made on purpose in what a user may have set up within the user: an agent that its tool permissions keep from ~/.config can still run brnr, and brnr profile reads the profiles for any same-user process, the values of MCP servers’ env and headers redacted. profile show --pid reads a process’s start request from its socket, for an agent in a sandbox that can reach the runtime directory. A user who wants an agent kept from the profiles denies it brnr profile as well. There is no command that writes the config, so none that an agent could use to change its own (N1).

Trust boundaries

 other local users, root (outside: file modes, P13)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 the user                              (B1)
                          $BRNR_DIR, 0700 ── <pid>.sock, 0600
                                    │      └─ brnr prompt send / permission / event
                                    │         watch, any process of the user's
 editor ──stdio── brnr acp ──socketpairs── brnr process ──pipes── agent
          (B3: bytes unchanged,             │   │              (B4: its text is
           but the named changes)           │   │               untrusted, P8)
                                            │   └── bridges, notify ──► Slack, push, …
                                            │       (B5: beyond the machine is theirs)
                          ~/.brnr, 0700 ── transcripts and host logs, 0600;
                                           session locks, sessions/ 0700
                                   (B2; secrets redacted, B6)
                ~/.config/brnr ── config.toml: read only if only the user
                                  can change or read it (B7)
  • B1, the runtime directory and the control sockets: between other local users and the process.
  • B2, the transcripts and host logs: between other local users and what the sessions said.
  • B3, brnr acp: between the editor and the agent, where brnr must be invisible (P1).
  • B4, the agent: its text (session ids, titles, commands, messages) and its permission requests reach brnr’s files, terminal and approvals.
  • B5, bridges and event notify commands: the edge of the machine.
  • B6, secrets: what brnr records and sends of the MCP servers’ values.
  • B7, the config file: between other local users and what brnr runs and the secrets it holds.

Claims

Remote SSH transport

--remote (ADR 12), the one transport, trusts the destination account, SSH server and the user’s system SSH client/config. The client owns key handling, host verification and encryption. brnr uses BatchMode=yes, StrictHostKeyChecking=yes and no terminal; it neither accepts unknown host keys nor stores credentials. Destination sockets and transcripts keep their existing user-only boundaries. Provider credentials stay remotely configured; profiles are not copied between machines.

remote::script quotes each shell word and validates the destination so it cannot become an SSH option. The preflight reads /dev/null and keeps successful output off ACP/JSON streams. _remote refuses another hop without exposing a marker to agents. Destinations are passed directly to SSH without local config lookup, and no profile routes: without --remote on its command line, no command but remote check connects through brnr’s transport (ADR 12.2, N1). remote check runs ssh <target> brnr doctor, with the version preflight and quoting described above. It starts system SSH and remote doctor. Even without --fix, doctor runs the three brnr-*-adapter programs and non-npm muse-acp with --version, using adapter lookup (ADR 11.2); the other npm adapters are identified from package.json. These request diagnostics, but do not constrain the selected executables. Command rules cannot make doctor, remote check or any --remote command safe. A deny-list policy must deny these paths whole, including --remote on allowed read verbs. See the program-starting Gap and the OS sandbox. Remote calls are visible to tool-permission rules, but prefix rules cannot exclude --remote at every argument position. The destination’s brnr is the one on its shell’s PATH, with that shell’s environment; brnr sets none of it. remote check needs no local config. SSH owns aliases and connection settings; there is no brnr remote registry. No command creates or edits config. Same-user processes remain trusted; removing CLI config editing does not prevent direct file access when the agent’s filesystem permissions already allow it.

tests/remote.rs checks command injection, prompt/delimiter parsing, isolated remote state, version/authentication failures, ACP/stdin streams, read-only config inspection and observer disconnects. Its Linux system-SSH test uses an isolated loopback server and temporary keys, without modifying the user’s SSH configuration or known_hosts. Black-hole detection time, editor path mapping and external authentication agents remain environment-dependent. SSH transport failures can have no JSON, and signals/individual pipe closures differ from local proxy semantics.

Each claim with what enforces it (file and function) and the test that checks it. Tests are in tests/ unless a module is named; security.rs holds those written for this document. A test that can’t run where it is (as root, without lsof) fails in CI or with BRNR_TESTS_STRICT set (skip, tests/common/mod.rs), so in CI it never passes unrun. Elsewhere it passes without checking its claim, and says skipped: on stderr.

B1: the runtime directory and sockets refuse others

ClaimEnforced byTested by
The runtime directory is created 0700 and the process refuses one that isn’t a directory owned by the user with no group or other bits, is a symlink, or, on macOS, has an access control list, which can grant what the mode doesn’t show (the error gives the chmod -N that removes it; brnr doesn’t); it then writes nothing there and starts no agent. It is opened without following a symlink and checked through what was opened (O_NOFOLLOW, fstat). The directory is the boundary: the sockets and metadata in it aren’t checked one by one (ADR 3.9).paths::ensure_private, paths::check_private (src/paths.rs), from Host::start (src/host/mod.rs); sys::has_acl (src/sys.rs)security.rs: a_runtime_dir_others_can_use_is_refused, a_runtime_dir_of_another_users_is_refused, adr_0003_a_runtime_dir_with_an_acl_is_refused (macOS); headless.rs: runtime_dir_symlink_is_refused; src/paths.rs: adr_0003_a_private_directory_is_checked_through_what_was_opened
Every command that reads the runtime directory refuses one others can use, a symlink, or, on macOS, one with an access control list, before it trusts anything there: no request, approval included, is sent through it.discover (src/ctl/client.rs), through paths::check_privatesecurity.rs: a_runtime_dir_others_can_use_is_refused, a_symlinked_runtime_dir_is_refused_by_every_command, no_approval_goes_through_a_dir_others_can_use, adr_0003_a_runtime_dir_with_an_acl_is_refused (macOS); headless.rs: shared_runtime_dir_is_refused
The control socket is 0600, the directory 0700, the session locks’ directory (sessions/ in the state directory, ADR 3.9) 0700 and each lock 0600, whatever the umask.Host::start (bind, then set_permissions 0600); lock::take (src/lock.rs)security.rs: what_brnr_makes_is_private_whatever_the_umask
Another user can’t connect to the socket: the directory and the socket’s mode both refuse them.the kernel, given the modes abovesecurity.rs: another_user_cant_connect (needs root, so cargo test ignores it; CI runs it as root on Linux, connecting as nobody)
A metadata file counts only with the socket next to it, so a planted file can’t point a command at another socket.read_meta (src/ctl/client.rs)headless.rs: metadata_names_its_own_socket
Session locks, in the state directory beside the transcripts they guard (ADR 3.9), are held to the runtime directory’s terms (private, with no access control list on macOS, or refused, with the chmod -N that removes one) and never followed through a symlink. A headless start, resume or fork that can’t take its lock is refused, as is a session opened in a running process (session new --pid, resume --pid), which the agent then closes again (ADR 3.9, ADR 8.1).lock::take (ensure_private, O_NOFOLLOW); sys::has_acl (src/sys.rs); own, take_lock (src/host/acp.rs); host_request_done, peer_opened, peer_result (src/host/requests.rs)security.rs: adr_0003_session_locks_are_private_and_never_followed, adr_0003_session_locks_with_an_acl_are_refused (macOS); cli.rs: adr_0003_a_new_session_that_cant_be_locked_isnt_started, adr_0003_a_resume_that_cant_be_locked_isnt_started, adr_0003_a_fork_that_cant_be_owned_is_refused, adr_0008_pid_session_that_cant_be_locked_is_closed
brnr listens on no network.the process binds only a UnixListener (src/host/mod.rs); P15security.rs: the_process_listens_on_no_network (with lsof, which CI has)
doctor fails a runtime directory others can use, or, on macOS, with an access control list, and --fix tightens its mode but never through a symlink, and never removes an ACL.runtime_dir, Found, private_problem, fixable (src/ctl/doctor.rs); sys::has_acl (src/sys.rs)doctor.rs: open_runtime_dir_fails_until_fixed, symlinked_runtime_dir_is_not_fixed; security.rs: adr_0003_a_runtime_dir_with_an_acl_is_refused (macOS)

B2: transcripts are private

ClaimEnforced byTested by
What brnr creates under ~/.brnr is 0700 (directories) and 0600 (files), whatever the umask.open_private (src/log.rs)headless.rs: transcripts_are_private; security.rs: what_brnr_makes_is_private_whatever_the_umask; src/log.rs: adr_0009_new_and_private_paths_are_opened_as_they_are
Before a record goes into a session’s events, its raw ACP or a host log, the state directory, each directory below it and the file are the user’s and have no group or other bits (and on macOS no access control list, which is refused, below), however they came to exist: one others can reach is made private through the descriptor that is then written to (fchmod), beneath private parents or traversable ones, and the host log records path_made_private with the mode it had (brnr session delete, which records session_deleted with no host log, says so on stderr, ADR 8.1). There is no override (ADR 9.3).open_private, keep_private (src/log.rs), the one open of all three (open_append); Writer::made_private; record_in_transcripts (src/log.rs), delete (src/ctl/delete.rs)security.rs: adr_0009_a_transcript_others_can_read_is_made_private_before_it_is_written; cli.rs: adr_0008_delete_records_in_each_transcript_it_can; src/log.rs: adr_0009_what_others_can_reach_is_made_private_before_a_write
A transcript, a directory on the way or the state directory that is a symlink is never followed; one that isn’t a directory or regular file, is another user’s, has another hard link, or, on macOS, has an access control list, which can grant what the mode doesn’t show, is refused (an ACL with the chmod -N that removes it; brnr doesn’t). Each is opened from the one above it (openat, O_NOFOLLOW) and checked by fstat of what was opened, so nothing can be swapped in between. A refused host log fails the start; a refused session file is session_log_failed in the host log, or, for brnr session delete, said on stderr, and the command fails. What reads transcripts (session list, event log, session resume, session delete, catching up, doctor) holds every part of the path to the same rules, opened the same way from the state directory it is in, and checked by fstat: nothing is looked in or read through a symlink (the state directory, projects, hosts, a project folder, the file), nor is what isn’t the user’s own directory or regular file, or has another hard link, which could be any file of the user’s taken for a session, or an access control list (ADR 8.1, ADR 9.3).open_private, keep_private, at (src/log.rs); sys::openat, sys::mkdirat, sys::has_acl (src/sys.rs); open, walk, check, entries (src/transcript.rs), the one place transcripts are readsecurity.rs: adr_0009_a_symlinked_transcript_is_never_followed, adr_0009_a_symlinked_transcript_is_never_read, adr_0009_a_symlinked_hosts_or_projects_folder_is_never_read, adr_0009_a_transcript_with_an_acl_is_never_written (macOS), adr_0009_a_transcript_with_an_acl_is_never_read (macOS); src/log.rs: adr_0009_a_symlink_is_never_followed, adr_0009_only_the_users_own_directories_and_files_are_written_to; src/transcript.rs: adr_0009_a_transcript_is_read_only_where_it_could_be_written, adr_0009_every_part_of_a_transcripts_path_is_the_users_own; cli.rs: adr_0008_delete_records_in_each_transcript_it_can
session delete --purge deletes only the session’s own files: in each project folder under the state directory, its events file and raw ACP, named for its id escaped (ADR 9.2), so an id can’t name another session’s file or climb out. The state directory, projects and each folder are opened without following a symlink, each from the one before, and the names removed from what was opened (unlinkat): a symlinked folder isn’t looked in, and a symlink named like the transcript is removed, not what it points at. The host logs stay (ADR 8.1).purge (src/log.rs); sys::openat, sys::unlinkat (src/sys.rs); paths::file_name (src/paths.rs)security.rs: adr_0008_purge_deletes_only_that_sessions_files; cli.rs: adr_0008_delete_purge
session prune --older-than <s>, and each process as it starts with the config’s retention, delete only what was last active more than <s> seconds ago, as --purge deletes it: a session’s own files, named for its id escaped, removed from the folders opened without following a symlink (openat, O_NOFOLLOW, unlinkat), its events file last; and the host log of a process that has gone, from hosts opened the same way. Never a session open in a process or whose lock is held: its lock is taken first, and its age read again under it. Never the host log of a running process (listed, or its pid alive without process_exited), nor a file brnr can’t read the age of. Nothing has an age limit unless the user sets one (ADR 9.5).prune, run, still_old (src/ctl/prune.rs); purge, purge_host_log (src/log.rs); lock::holding (src/lock.rs); check_retention (src/profiles.rs)cli.rs: adr_0009_prune_deletes_what_was_last_active_before_the_age, adr_0009_prune_never_touches_an_open_or_locked_session, adr_0009_a_process_prunes_as_it_starts_when_retention_is_set, adr_0009_retention_is_a_number_of_seconds_not_0, adr_0009_prune_keeps_a_session_it_cant_read_the_age_of, adr_0009_a_process_records_its_prune_before_it_exits
doctor warns of transcripts others can read, of one with an access control list (macOS), with the chmod -N that removes it, which --fix doesn’t do, of one it can’t open, which --fix leaves too, and of a state directory, hosts or projects that isn’t a directory, and --fix makes them private, never through a symlink: each path is opened from the one above it (openat, O_NOFOLLOW), checked by fstat, a directory listed through what was opened, and a mode changed through it (fchmod), so it doesn’t look below a symlinked state directory, hosts or projects, nor change what is put at a name after it looked (ADR 9.3).transcripts, Found (src/ctl/doctor.rs); sys::openat, sys::names, sys::has_acl (src/sys.rs)doctor.rs: readable_transcripts_are_made_private, a_state_part_that_is_not_a_directory_is_a_problem, adr_0009_doctor_says_what_it_cant_open_and_what_fix_left; src/ctl/doctor.rs: adr_0009_fix_changes_what_was_opened_not_its_name; security.rs: adr_0009_a_symlinked_hosts_or_projects_folder_is_never_read, adr_0009_a_transcript_with_an_acl_is_never_read (macOS)

B3: brnr acp passes bytes unchanged but for the named changes

ClaimEnforced byTested by
The editor’s lines reach the agent byte for byte, whatever their spacing, key order and escapes, MCP secrets included, lines that aren’t JSON too, but for a request’s id (below); the agent’s reach the editor the same way.editor_message, agent_message (src/host/acp.rs): a line is re-encoded only where the host changes it; json::members, json::replace (src/json.rs) change an id in placesecurity.rs: adr_0003_acp_passes_bytes_unchanged
Every request to the agent has an id of the host’s, the editor’s too, so no editor id can be taken for another requester’s, and an answer goes only to whoever sent the request: the editor’s with its id as it wrote it. The editor’s $/cancel_request reaches only its own requests (ADR 2.4).Outbound (src/host/outbound.rs); editor_message, agent_response, editor_cancel (src/host/acp.rs); host_request (src/host/requests.rs)headless.rs: adr_0002_an_editors_prompt_ends_only_with_its_own_answer, adr_0002_an_editors_request_with_a_host_requests_id_is_the_editors, adr_0002_ids_come_back_as_the_editor_wrote_them, adr_0002_the_editors_cancel_request_is_for_its_own_request; src/host/outbound.rs: adr_0002_ids_are_never_given_twice, adr_0002_an_answer_is_its_requests_once; src/json.rs: adr_0002_an_id_is_found_where_it_is_and_nowhere_else
The agent’s stderr comes out of brnr acp’s, and brnr acp exits as the agent did.src/proxy.rssecurity.rs: adr_0003_acp_passes_stderr_and_the_exit_status
The agent’s stdout ends on the editor’s when it ends, while the agent runs on, and brnr writes nothing there after it; its stderr comes out as it is written, newline or not, every byte once (ADR 2.6).agent_stdout_ended, read_agent_stderr (src/host/mod.rs); write_editor (src/host/acp.rs); run (src/proxy.rs); end_stdout (src/sys.rs)security.rs: adr_0002_the_editors_stdout_ends_with_the_agents, adr_0002_stderr_comes_as_it_is_written, adr_0002_stdout_and_stderr_end_on_their_own; src/host/fuzz.rs: adr_0002_brnrs_own_lines_end_with_the_agents_stdout
The editor’s stdin ends when the agent’s does, a stop’s, the agent’s own or its exit’s, so the editor’s next write fails, as on a pipe; what the editor wrote that reached the host before then isn’t sent, recorded in the raw ACP or answered, and the host log counts it, editor_bytes_dropped (ADR 2.6). An agent that closes its stdin itself is found out by the write that fails to reach it: that line is recorded as sent, and its request waits; the writes after it are the ones dropped.close_agent_stdin, editor_bytes_dropped (src/host/mod.rs); editor_bytes (src/host/acp.rs); relay_stdin (src/proxy.rs); end_stdin (src/sys.rs)headless.rs: adr_0002_the_editors_write_fails_once_the_agents_stdin_closes; src/host/fuzz.rs: adr_0002_the_editors_stdin_ends_with_the_agents
The editor’s fs and terminal capabilities don’t reach the agent by default, a named change, and the host log says so; those the profile’s client_capabilities names do, and in strict mode both, as the editor sent them. Where they do, the agent’s fs/* and terminal/* requests reach the editor as the agent wrote them, and the editor’s answers, results and errors, reach the agent: the editor serves them, as it would directly, and brnr neither approves nor answers them in an editor’s session (ADR 2.7).drop_capabilities, editor_request, agent_request, editor_message (src/host/acp.rs)headless.rs: adr_0002_fs_and_terminal_reach_the_agent_in_strict_mode_or_when_named, adr_0002_the_agents_file_and_terminal_requests_reach_the_editor
The editor’s load, resume or prompt of a session another process owns, not open in the editor’s process, is refused unless shared_sessions allows it, and never reaches the agent (ADR 3.9, ADR 3.10).attach, editor_message (src/host/acp.rs)headless.rs: adr_0003_an_editors_load_of_a_held_session_is_refused, adr_0003_an_editors_prompt_of_a_held_session_is_refused, adr_0003_shared_sessions_let_an_editor_load_a_held_session
A load or resume the agent answers with success after its session closed in the editor’s process, which another process took meanwhile, isn’t served there unless shared_sessions allows it: it doesn’t open, its lock isn’t held, the agent is asked to close it, and the editor is told which process holds it (ADR 3.9, ADR 3.10).open_answered, not_served (src/host/acp.rs); peer_done, peer_result (src/host/requests.rs)headless.rs: adr_0003_a_load_answered_after_another_process_took_its_session_isnt_served, adr_0003_a_resume_answered_after_another_process_took_its_session_isnt_served, adr_0003_shared_sessions_serve_a_load_answered_after_another_process_took_it
Actions on an editor’s session from outside are refused unless the profile enables each by name, and in strict mode always (ADR 7.1).check_experimental, check_editor_send (src/host/experimental.rs); check_strict (src/host/strict.rs)headless.rs: adr_0007_experimental_actions_are_refused_without_opt_in, adr_0002_strict_mode_has_no_experimental_actions, adr_0007_approve_answers_in_the_editors_place, adr_0002_a_late_answer_to_a_cancelled_request_is_dropped, adr_0004_an_editors_elicitation_is_seen_and_reaches_the_editor

B4: the agent’s text, and its approvals

ClaimEnforced byTested by
A session id becomes a file name only escaped: it can’t leave the project folder or the locks’ directory, and distinct ids never share a transcript or a lock (P8, ADR 9.2).file_name, session_log, session_lock (src/paths.rs)security.rs: a_session_id_cant_climb_out_of_its_folder; src/paths.rs: a_sessions_two_files, adr_0009_distinct_ids_get_distinct_names; headless.rs: adr_0009_distinct_ids_never_share_a_transcript, adr_0009_distinct_ids_never_share_a_lock
The agent’s text is shown with control characters and bidi overrides escaped, and permission show warns of a command dressed up as another.render::clean (src/render.rs)cli.rs: adr_0004_show_escapes_a_spoofed_command; security.rs: a_session_id_cant_climb_out_of_its_folder; src/render.rs: control_characters_are_escaped
The agent’s text never reaches a command line: event notify passes it in the environment and on stdin, and the host’s start request goes on a pipe.src/ctl/notify.rs (BRNR_TEXT, …); Request::send (src/request.rs)cli.rs: adr_0005_notify_runs_a_command_per_event; headless.rs: adr_0003_prompt_is_not_on_the_command_line
Headless, a permission request waits until someone answers it: brnr never answers for the user.agent_request (src/host/acp.rs); Approvals (src/host/approvals.rs)security.rs: adr_0004_an_unanswered_request_waits
Headless, a request the agent cancels ($/cancel_request) is answered only cancelled or cancel, as ACP has it, never an allow or an accept; in an editor’s session brnr answers nothing, and the editor’s answer goes on unchanged (P1). A turn’s end ends none, and an answer from outside after the cancel sends nothing (ADR 4.5).agent_cancel, editor_message (src/host/acp.rs); Approvals::give_up (src/host/approvals.rs)cli.rs: adr_0004_a_request_the_agent_cancels_ends_by_the_agent, adr_0004_a_turn_that_ends_leaves_its_request_waiting; headless.rs: adr_0004_an_editor_gets_the_agents_cancel_and_answers_it; src/host/approvals.rs: adr_0004_the_agents_cancel_ends_only_what_waits
A headless process offers the agent no fs or terminal (one started headless, forked in it, or taken over from an editor), and answers a request for them “method not found”: brnr reads, writes and runs nothing for the agent (ADR 2.7).begin_headless_start (src/host/requests.rs); agent_request (src/host/acp.rs)headless.rs: adr_0002_headless_sessions_offer_neither
response_timeout (or --response-timeout) only rejects once: the reject_once option, else the turn is cancelled (session/cancel, the request answered cancelled); never an allow, nor reject_always (ADR 8.1).fire_permission_timers (src/host/acp.rs); Approvals::time_out, choose (src/host/approvals.rs)security.rs: adr_0008_timeout_rejects_once_else_cancels_the_turn, adr_0004_a_timeout_never_allows; src/host/approvals.rs: adr_0004_a_timeout_rejects_once_or_cancels_the_turn
Headless, an elicitation waits until someone answers it, and response_timeout answers it only cancel: never accept, nor decline, the user’s no (ADR 4.5).agent_request, fire_permission_timers (src/host/acp.rs); Approvals::time_out (src/host/approvals.rs)security.rs: adr_0004_a_timeout_cancels_never_accepts; cli.rs: adr_0004_requests_and_show_list_an_elicitation
An accept sends only what fits the form: fields it names, the required ones, values of their type, within their bounds and choices, checked in the host for the CLI and bridges alike; one that doesn’t fit sends nothing. An elicitation is answered only in its own session, or outside any by its process (ADR 4.5).response, check (src/host/elicitation.rs); elicitation (src/host/control.rs); Approvals::answer (src/host/approvals.rs)cli.rs: adr_0004_accept_checks_fields_against_the_schema, adr_0004_a_request_scoped_elicitation_is_answered_by_pid; src/host/elicitation.rs: what_doesnt_fit_names_the_field
An elicitation’s URL is shown escaped, never opened or run: brnr has no code that opens one (P8, ADR 4.5).render::clean; show (src/ctl/elicitation.rs)cli.rs: adr_0004_requests_and_show_list_an_elicitation; src/render.rs: adr_0004_elicitation_events_have_lines
A request is answered only in its own session, with the option of the kind asked for, and no other kind in its place: reject can’t pick an allow option, nor allow a reject one, nor --always a once one; a missing or doubled kind answers nothing; a socket allow or reject with option, option_id’s old name (a field it doesn’t take, ADR 8.8), or with an option_id that isn’t a string (null, a number), is refused, not answered by kind in its place (ADR 8.1).check_request, answer (src/host/control.rs); Approvals::answer, choose (src/host/approvals.rs)security.rs: adr_0004_a_request_is_answered_only_in_its_session; cli.rs: adr_0008_allow_and_reject_pick_by_kind, adr_0008_a_missing_or_doubled_kind_fails, adr_0008_option_must_be_on_the_verbs_side, adr_0008_a_permissions_option_is_option_id, adr_0008_a_permissions_option_id_is_a_string

B5: bridges and event notify commands

ClaimEnforced byTested by
A started bridge runs the profile’s command as the user, with BRNR_PID and BRNR_SOCKET; it can do anything a socket client can (ADR 5.7).start_bridge (src/host/control.rs)cli.rs: adr_0005_notify_works_as_a_bridge, adr_0005_a_bridge_that_closes_its_stdout_gets_events
A bridge gets every event but acp unless it asks for it by name, so the raw ACP isn’t forwarded by default.Peer::wants (src/host/control.rs)security.rs: adr_0005_a_bridge_gets_no_raw_acp_unless_it_asks
A reader that falls behind is cut off and told, and never holds the session up (ADR 10.1).send_to, drop_peer (src/host/control.rs)headless.rs: adr_0010_slow_watcher_is_disconnected; cli.rs: adr_0005_notify_cut_off_as_a_bridge_stops_its_command
Asking whether a peer was cut off (was_cut_off) gives a position, never an event, for that peer or another, and takes nothing away from it: the record stays for its owner. What a command cut off catches up on, it reads from the transcript itself, as the user (B2), and only the events it subscribed to, as live: a peer that didn’t ask for acp gets no raw ACP. A peer learns nothing it couldn’t by subscribing (ADR 10.2).was_cut_off (src/host/control.rs); Follow::read, Found::wanted (src/ctl/catch_up.rs)security.rs: adr_0010_was_cut_off_says_where_never_what

What a bridge sends beyond the machine, and to whom, is the bridge’s: brnr can’t see past its stdin. That is the reach P13 says a bridge adds.

B6: secrets

ClaimEnforced byTested by
The values of MCP servers’ env and headers reach the agent unchanged, and are <redacted> in the host log, the raw ACP, the started record and acp events, for a profile’s session/new, session/fork, session/resume and session/load, and for an editor’s own session/new, load, resume and fork.log::redacted, redact_mcp_servers (src/log.rs); Request::recorded (src/request.rs); host_request (src/host/requests.rs); editor_message (src/host/acp.rs)headless.rs: adr_0009_a_profiles_mcp_secrets_are_redacted, adr_0009_an_editors_mcp_secrets_are_redacted; security.rs: adr_0009_a_resumed_sessions_secrets_are_redacted, adr_0003_acp_passes_bytes_unchanged, adr_0005_a_bridge_gets_no_raw_acp_unless_it_asks; src/log.rs: adr_0009_secrets_are_redacted_keys_and_structure_stay
doctor --report, made to be pasted into an issue, redacts what ADR 9.1 redacts again in the host-log lines it shows, a line nested past 128 too, read as transcripts are (ADR 2.5: to 256; a deeper one isn’t shown), shows no record in a format this brnr doesn’t read (ADR 5.10), and shows the home directory as ~; the rest of those lines is as recorded, prompts included, so it says to read it first (ADR 11.5).report_line (src/ctl/doctor.rs), record (src/transcript.rs), redact_record (src/log.rs)doctor.rs: adr_0011_the_report_is_what_to_paste, adr_0011_the_report_redacts_a_deep_line
brnr profile show <name> and show --pid show the values of MCP servers’ env and headers as <redacted>, their names kept, in text and JSON; no flag shows them. The start_request socket request answers with the recorded, redacted request, without the prompt. Arguments are not redacted.redacted (src/ctl/profile.rs); Request::recorded, request::shown (src/request.rs)cli.rs: adr_0006_show_redacts_mcp_secrets, adr_0006_show_pid_is_the_start_request
session status, process list and session list carry no secret.the process’s metadata and status hold no request (Host::start, status_report)security.rs: adr_0009_a_resumed_sessions_secrets_are_redacted

B7: the config file is only the user’s

ClaimEnforced byTested by
Before any command reads the config file, it and its folder are the user’s own and nobody else can write them, and nobody else can read the file, and on macOS neither has an access control list, which can grant what the mode doesn’t show; a symlink is followed, and the file it resolves to and that file’s folder are checked, through the descriptors the file is read from (openat, O_NOFOLLOW, fstat). Otherwise the command fails before it starts or reaches anything, naming the path, the owner or mode, and the chmod or chown that fixes it. brnr changes neither (P4). No file is no config (ADR 9.4).read_private, check_private (src/profiles.rs), from load_all, for every command that reads it, brnr profile too; sys::openat, sys::has_acl (src/sys.rs)security.rs: adr_0009_a_config_others_can_read_or_write_is_refused, adr_0009_a_config_of_another_users_is_refused, adr_0009_a_symlinked_config_is_checked_where_it_points, adr_0009_a_config_with_an_acl_is_refused (macOS), adr_0009_a_missing_config_is_no_config
No command writes the config file: brnr profile reads it, and remote check reads none of it (ADR 6.5, 12.2).no write path: profiles::load_all is the one reader, and nothing opens the file to writeremote.rs: adr_0012_remote_checks_never_write_or_require_local_configuration; cli.rs: adr_0006_show_is_what_start_would_use
doctor fails a config file others can reach, with the same problems and fixes, and --fix doesn’t change it.config_file (src/ctl/doctor.rs), through load_alldoctor.rs: adr_0009_doctor_fails_a_config_others_can_reach

The adapters and the release

ClaimEnforced byTested by
The Node adapters are built from pinned npm versions with a frozen lockfile, without optional dependencies (the agents themselves aren’t bundled). The Muse devDependency is version metadata only and is not installed.adapters/package.json, adapters/bun.lock, bun install --frozen-lockfile --production --omit=optional in adapters/build.shCI builds them and runs adapters/check.py
Muse is built from its pinned source tag, with unchanged Rust sources. Its Homebrew resource has a SHA-256. An offline production-only workspace excludes unused test/SDK registry dependencies and refuses unreviewed production/build dependencies.adapters/muse.py, adapters/muse.rb.in, release.ymlCI’s source build, adapters/test_muse.py with an empty Cargo registry and a live binary during replacement, adapters/check.py for ACP v1 transport and version reporting
The workflows pin actions by commit and are checked by zizmor; crates by cargo deny..github/workflows/, deny.tomlCI
Release binaries rebuild identically within the same toolchain and OS, in separate directories at different times..github/scripts/reproducible.sh, a prerequisite of publicationreproducible.yml, on Linux and macOS
The release inventories brnr’s locked Rust dependencies; the public Homebrew install is checked after the tap update, which a release candidate doesn’t make (ADR 11.4). This does not establish that dependencies are safe.release.yml: CycloneDX SBOM and homebrew-smoke job (ADR 11.7)SBOM generation must succeed without changing Cargo.lock; a fresh macOS runner checks the installed version and runs doctor

Gaps

What brnr doesn’t enforce, or doesn’t test, today.

  • SIGKILL of the host bypasses child cleanup. The host is the sole supervisor. Its death closes the agent and bridge pipes, but an agent or bridge that ignores EOF, is blocked, or leaves descendants can survive it. doctor --fix repairs stale metadata and locks; it does not kill those survivors. chaos.rs checks a flooding agent exits on its broken pipe, and that killing the proxy during a hung setup or turn lets the surviving host stop its agent. Neither establishes unconditional cleanup after host SIGKILL; that would require a separate lifetime supervisor on both macOS and Linux (#391). Its test, killed_host_leaves_no_agent_or_child_behind, fails today and is ignored until then.

  • Same-user processes. Inside the boundary by design (above): any of them can approve, prompt, read transcripts and add bridges.

  • An agent that may run brnr can start one that asks nothing. brnr session new --mode bypassPermissions -- brnr-claude-adapter opens a session and sets its mode before the first prompt (ADR 6.2), and brnr config set --mode does it later; the Claude adapter lists bypassPermissions unless it runs as root or settings disable it, and the Codex adapter always lists agent-full-access (approvals never, sandbox danger-full-access). The started agent then runs its tools without asking. What holds is the started agent’s managed settings: Claude’s permissions.disableBypassPermissionsMode = "disable" in managed settings, Codex’s allowed_approval_policies and allowed_sandbox_modes (or allowed_permission_profiles) in requirements.toml. The user’s own settings are not a boundary: an agent that can write a file can write them, and Claude reads a project’s .claude/settings.local.json, in the cwd the agent chose, over the user’s.

  • An agent that may run brnr can answer the approvals of one it started. brnr permission allow and brnr elicitation accept work from any socket client on a headless session, and on an editor’s where permission or elicitation is enabled (ADR 7.1). What holds is the agent’s own command rules, denying it those verbs. Skill rule 4 tells an agent not to answer approvals it wasn’t given or switch a worker to a mode that asks less; a prompt-injected agent (P8) can ignore it, and nothing enforces it.

  • An agent that may run brnr can prompt a session that already asks less. brnr prompt send reaches any headless session from any socket client, and an editor’s where send (or, with --context, context) is enabled (ADR 7.1): a worker the user, or an unrestricted agent, started with --mode bypassPermissions or agent-full-access does what the prompt says, without asking. brnr session fork copies a session into one that can be prompted, and brnr sends no mode with it: the Claude adapter resumes the copy in the mode its transcript recorded (unless settings disable it), so a fork of a session that asks nothing asks nothing too; the Codex adapter starts the fork in its initial mode. What holds is the agent’s command rules, denying it those verbs, and the managed settings above, which keep any session from being one that asks nothing.

  • An agent that may run brnr can run any command, with no agent at all. The agent’s command is any program: brnr session new -- sh -c '…' runs it, as does brnr acp -- <agent>; session resume and session delete run the agent recorded for the session (whatever program a transcript names), or the one --profile or -- names, and session list the one --profile or -- names; brnr event notify --stdin -- sh -c '…' runs one for each line it reads. brnr _remote is the destination’s entry point, but also runs any of these verbs locally. brnr host runs the program its stdin request names whenever fd 3 is a socket (with no arguments and stdin not a terminal). A shell can provide that socket by redirecting an inherited socket with 3>&1, or with bash’s /dev/tcp. The command rules have to deny brnr host too. Even without --fix, doctor runs the three brnr-*-adapter programs and non-npm muse-acp with --version. Every --remote command, including allowed read verbs, and remote check start SSH. Command rules cannot make these safe: program choice and behavior depend on the caller’s environment and files. Known examples, not an exhaustive list, include:

    • The caller’s PATH, which selects ssh and can select adapters.
    • The directories of the path brnr was started by (argv[0]) and the running binary’s path (ADR 11.2). A symlink or hard link to brnr, or a chosen argv[0], can select a caller-writable directory for adapters, agents and bridges even when PATH is fixed.
    • SSH configuration (~/.ssh/config, /etc/ssh/ssh_config and their Includes). The genuine SSH client can run local commands through ProxyCommand, Match exec, KnownHostsCommand or LocalCommand, even with BatchMode=yes and StrictHostKeyChecking=yes. A plain configuration write can suffice; no executable bit, network or keys are needed.
    • The inherited environment, including preload variables such as LD_PRELOAD and DYLD_INSERT_LIBRARIES, or interpreter option variables. Programs can load code from files with no executable bit.

    A deny-list policy must deny doctor, remote check and every --remote command whole. What holds is the OS sandbox, inherited by programs the agent starts. It must keep the agent from writing files that can be run or loaded as code (executables, shared libraries, scripts), or brnr links, anywhere, and from writing SSH configuration. These restrictions are not a complete sandbox policy.

  • An allowed read verb can read remote sessions. With --remote, it reads session state on every destination the user’s SSH reaches. The flag can come anywhere among a verb’s arguments, so Codex’s prefix rules cannot exclude it. Claude Code’s wildcard deny rule Bash(brnr * --remote *) can match it in either position, as the guide describes. It is best effort against an agent trying to evade it: quoting, an absolute path or env brnr can change the command text it matches. Command rules cannot make any --remote command safe, even a read verb: it starts programs whose choice and behavior depend on the caller’s environment and files. A deny-list policy must deny these commands whole. Network and key restrictions can limit remote reads but do not stop local commands. What holds is the OS sandbox, with the restrictions and limits described in the program-starting Gap.

  • The socket is a way out of a sandbox. An agent in an OS sandbox starts brnr inside it, but a brnr process started outside it, by the user or an editor, serves whoever reaches its socket: an agent in the sandbox that can reach the runtime directory can open a session there (session new --pid), prompt it, set its mode and answer its approvals, and the agent then acts outside the sandbox. What holds is the sandbox keeping the runtime directory (BRNR_DIR, by default $XDG_RUNTIME_DIR/brnr, else $TMPDIR/brnr-<uid>) out of its reach, or no brnr process running outside it.

  • No peer credentials on the socket. The process doesn’t check who connected (SO_PEERCRED, getpeereid); the directory’s and the socket’s modes are the only control. Root is never kept out.

  • A same-user process can fill the socket’s connections. A process serves 128 connections at once, and refuses the next with an error (ADR 10.4); a process of the user’s that holds 128 open keeps brnr’s commands out of it until it lets go. It is inside the boundary (P13), so this is reliability, not access; the limit keeps the process’s threads and memory bounded (N2). A request is read up to 32 MiB, and a longer one cuts its peer off (ADR 10.3). adr_0010_a_connection_past_the_cap_is_told_and_closed and adr_0010_a_request_past_the_limit_is_answered_and_cut_off check them.

  • The other-user test runs as root only on Linux in CI. another_user_cant_connect needs root, to connect as nobody, so cargo test ignores it; CI runs it as root (--ignored) on Linux, so the kernel’s side of B1 is checked there. On macOS it is checked only where someone runs it as root: CI doesn’t. The modes it relies on are tested everywhere.

  • The process checks the runtime directory once, at start. A directory opened to others while a process runs is refused by the commands (no_approval_goes_through_a_dir_others_can_use), but the running process goes on serving its socket, which its own mode still guards.

  • What others read before a repair. A transcript others could reach is made private when a process opens it again (ADR 9.3), not before: what was in it until then may have been read, which the host log’s path_made_private says. One no process opens again stays as it is until doctor --fix.

  • Another user’s file in the state directory is tested only as /. Making one takes root, so the ownership check is tested with / as the state directory; a file of another user’s beneath it is refused by the same check, untested. The readers’ check is tested with /usr/bin.

  • What reads transcripts lists names by path. The project folders and their files, and the host logs, are listed by path (read_dir) once the directories above them pass the checks; each file is then opened again from the state directory, part by part. A directory swapped for a symlink in between can show a name from elsewhere, never what is in it. doctor, which changes modes, lists through what it opened instead.

  • Another user’s config is tested only as root’s /etc/hosts. Making a file or folder of another user’s takes root, so the ownership check is tested with a file and folder that are both root’s, not as root; a private file of the user’s in a folder of another’s is refused by the same check, untested.

  • A session whose transcript is refused is served unrecorded. Logging never stops forwarding (P1, P6), so the session goes on; only the host log’s session_log_failed and doctor’s transcripts check say so.

  • Metadata files follow the umask. <pid>.json (pids, cwd, the agent’s command line, the socket’s path) is created with the default mode, so a permissive umask leaves it readable by mode; the 0700 directory, with no access control list, is what keeps it private, and an ACL on the file itself isn’t looked for. Not tested.

  • An editor’s session that can’t be locked runs unlocked. The proxy passes it through; session status reports lock_error, and the host log records lock_failed. A headless resume is refused while the editor’s process reports serving it, but a second process could acquire its lock if that process doesn’t answer and the lock failure was transient (ADR 3.9).

  • Redaction is by field, not by value. brnr redacts the MCP servers’ env and headers in the requests that open a session (ADR 9.1). A secret elsewhere is recorded as it is: in an MCP server’s args or url, in the agent’s command line, or repeated by the agent itself in its messages, tool calls, errors or stderr (ADR 3.6 puts the agent’s stderr in the host log), and it then reaches bridges with those events.

  • The editor’s file and terminal answers are recorded as they are. In an editor’s session the raw ACP has what the editor read for the agent (unsaved buffers too, a .env among them if the agent asks for it) and the output of the commands it ran: redaction is by field (above), and none of these is redacted. This is accepted, not open: brnr doesn’t redact file or terminal data, as it records the rest of the session as it passed (ADR 5.1), and the transcripts are only the user’s to read (P13, ADR 9.3). The editor decides what it serves; brnr doesn’t filter or gate those requests (ADR 2.7).

  • Approvals are the agent’s own asks. brnr answers the permission requests the agent makes; it doesn’t sandbox the agent. A malicious adapter or npm package, or an agent in a permissive mode, acts without asking, and nothing in brnr can stop it.

  • response_timeout is headless only. An editor’s session waits for the editor; with permission (or elicitation) enabled, any of the user’s processes may answer it (ADR 7.1, ADR 4.5).

  • An elicitation’s pattern and format aren’t checked. brnr has no regex engine; a value that doesn’t match them is sent, and the agent (or the MCP server behind it) checks them itself (ADR 4.5).

  • A headless turn waits on an elicitation. The agent asked and brnr doesn’t answer for the user, so an unattended run with no response_timeout waits for as long as nobody answers (ADR 4.5).

  • A state directory shared by two machines. Session locks are in the state directory (ADR 3.9), so two machines sharing it (a network home directory) contend for one lock only where the file system carries flock between them, and a holder’s pid is looked for on this machine: a lock another machine’s process holds looks like no process’s, and a resume here is refused only when it tries to take the lock and can’t, naming that machine’s pid. Not tested.

  • A refused runtime directory is a denial of service. With neither BRNR_DIR nor XDG_RUNTIME_DIR set, the directory is $TMPDIR/brnr-<uid>; where $TMPDIR is shared (/tmp on Linux), another user who creates that path first makes brnr refuse to start until it is removed. They gain no access.

  • brnr acp’s stdout and stderr share one connection. They come through the host in order, under one 16 MiB cap, rather than as two pipes: an editor that stops reading one eventually holds up the agent’s writes to the other, and an editor closing its stderr gives the agent no EPIPE. The editor’s stderr ends when brnr acp exits, not when the agent’s does (ADR 2.6), which adr_0002_stdout_and_stderr_end_on_their_own checks; the rest isn’t tested.

  • Requests in lines the host can’t read keep the editor’s id. A request the host doesn’t read (not JSON, past 32 MiB, nested past 128, or what the editor wrote after its last newline) reaches the agent untracked, with the editor’s id. If the editor gave it an id the host has given a request still waiting, which it was never told, the answer is taken for that request’s (ADR 2.4). Not tested.

  • The agent’s ids are passed to the editor as they are. An agent that reuses an id after the host answered a request with it (on brnr prompt cancel, brnr permission allow or brnr elicitation accept) can have the editor’s late answer to the first taken as its answer to the second (ADR 2.4). Not tested; no agent known reuses ids.

  • Agents’ lookup next to brnr. Both the start path and the running binary’s path can be caller-chosen (ADR 11.2): a symlink or hard link to brnr, or a chosen argv[0], can select a lookup directory. This is one of the inputs in the program-starting Gap, not a trusted installation boundary.

  • A process the library’s facade starts is the calling program. brnr::session::new and resume start it as <program> host (ADR 8.5), and look up bare names next to that program: the program, which runs as the user, is trusted as the brnr executable is. A program that doesn’t hand host to brnr::run runs its own code there, with the start request on its stdin, and the start fails: no process says it is ready. Tested only for a program that does (tests/facade.rs).

  • The adapters’ dependencies. Pinned and locked, but brnr doesn’t review them: a compromised version of an adapter’s package, pinned in a release, runs as the agent.

Out of scope

As SECURITY.md has it: the agents and the upstream adapters themselves, what an agent does with an approval its user gave, and anyone who can already run code as the user.

Contributing

CONTRIBUTING.md says how to build, test and propose a change, including the requirements for acceptable contributions and coding standards. brnr has five direct dependencies; CI checks their licenses and advisories with cargo deny, and with cargo vet that every crate is audited (by Mozilla, Google and others whose audits brnr imports) or listed as an exemption still to audit. The audit status records the remaining work; an exemption is not an audit. Report vulnerabilities privately, as SECURITY.md says.

License

Apache-2.0. See LICENSE and NOTICE.

Releasing

Generating release notes requires Git 2.13 or newer, so a final release’s comparison can exclude release candidates (ADR 11.4).

./release.sh minor     # or patch, major, 1.2.3: checks main, opens the release pull request
./release.sh tag       # once it's merged: tags, releases, updates the Homebrew tap
./release.sh notes     # what the release pull request would say
./release.sh 1.0.0-rc.1  # a release candidate; then rc for 1.0.0-rc.2, and 1.0.0 to release it

A release’s notes are its section of CHANGELOG.md, in Keep a Changelog 1.1.0 form, which pull requests add to under [Unreleased]. ./release.sh minor names that section for the version on the release branch and moves its compare links, ./release.sh tag won’t tag a version without one, and the release workflow publishes it as the GitHub release’s notes, or fails (ADR 11.4).

A release candidate, X.Y.Z-rc.N, is a GitHub pre-release and is on crates.io (cargo install brnr --version X.Y.Z-rc.N --locked), but the Homebrew formulae stay at the last release. X.Y.Z‘s section of CHANGELOG.md takes in its release candidates’ sections, and its pull request lists the commits since the last release, so its notes say everything since. A version must come after the current one (ADR 11.4).

Dependabot opens a pull request when an adapter’s npm package has a new release; the next brnr release ships it.

1.0.0

At 1.0.0 the ADRs are accepted, and ADR 8.4’s compatibility promise starts (docs/adr/README.md). release.sh doesn’t do either: the release pull request for 1.0.0 (not a release candidate’s) also changes, by hand, dated the day of the release:

  • Each topic’s status line, under its title in docs/adr/0001-*.md to 0012-*.md: Draft … becomes Accepted <date>. A line that says Implemented keeps the word, and what follows it: adr-tests.py reads it.
  • ADR 8’s status line: but 8.4 is a promise that applies from 1.0.0 goes, as 8.4 now applies.
  • ADR 8.4, its first paragraph: Nothing is implemented: the promise starts at 1.0.0. says the promise applies from 1.0.0.
  • The ADRs’ table, row 8, Implemented: partly: 8.4 applies from 1.0.0; goes.
  • The interface reference: Covered and not covered and Compatibility start Before 1.0.0 every interface here can change outright, which no longer applies.

After 1.0.0 an accepted record changes only by a new section that amends or supersedes it (docs/adr/README.md).

Changelog

What changed in each release, and what is still to be released, is in CHANGELOG.md, in Keep a Changelog 1.1.0 form. A release’s section is its GitHub release’s notes (Releasing).