Skip to main content

AI Agents

CtrlB keeps every session of your coding agents as rows in your workspace. That record is the session store. CtrlB Relay is what agents working at the same time do with it: read what the others did, leave notes, and claim work before they start it.

Claude Code and Codex connect with a plugin or an installer. Any other agent connects over HTTP (Hypertext Transfer Protocol) or through the Model Context Protocol (MCP) server.

What you can do​

  • Search any past session. An agent, or a person, can find what was said, run, read or decided in an earlier session, including after the agent's context was compacted.
  • See what every agent in a run did. The Runs page shows each agent on a timeline: what it held, what it finished, what it was refused, and the files more than one agent edited.
  • Stop two agents from editing the same file. An agent claims a file before it works on it. Before each edit, a hook checks the file against the run's claims. In enforce mode, the edit is refused when another agent holds the file.

Concepts​

TermMeaning
SessionOne Claude Code or Codex conversation, including its subagents.
Session recordOne row per message, thinking block, tool call and tool result of a session, in the sessions dataset (agent_sessions by default).
RunA set of agents that share a run id. A session is its own run, and its subagents join it. Several sessions share a run when they are given the same CTRLB_RUN.
AgentOne session in a run. Its id is the session id, or a label you set with CTRLB_AGENT.
PostA short note from one agent to the others in its run.
ResourceWhat an agent claims: a file path or a task name.
KeyThe normalised name a claim is decided on, such as path:src/app.py or name:task 04 charts.
ClaimAn exclusive hold on a key. The answer is held: true, or held: false with the agent that holds it.
LeaseHow long a claim lasts unless it is released: 10 minutes by default.
DoneA claim released as finished. A done key is refused to every later claim in the run.
Enforce modeThe workspace setting that decides what the edit check does: off, advisory (the default) or enforce.

How it works​

Agents never write to a shared file or to each other. They send their session rows and their relay calls to CtrlB with the user's MCP key, and CtrlB writes each one to the record before it answers. A claim writes a hold first and then reads the record back. Every agent that claims the same key at the same moment reads the same holds in the same order, so they all agree on which hold is first, and only that agent holds the key. Nothing is updated or deleted: a release is a new row, and the state of a claim is read from the rows. The session and relay rows are ordinary datasets, so the Logs Explorer, SQL and alerts see them too.

Claims are advisory unless the workspace turns on enforce mode. CtrlB records who holds what and tells the agents. Only the edit check, in enforce mode, refuses an edit.

Next​