Skip to content
CohortDocs

Agents that drive Cohort

Every agent Cohort runs gets Cohort’s own tools: an MCP server (cohort mcp) and the cohort command line. With them an agent can split its task across other agents, wait for them, land their work on its own branch, and stop to ask you something. You don’t set anything up: ask in plain words.

Split this into three parts and give each one to a child thread. Merge them into your branch when they’re done.

The full list of tools and their arguments is in MCP tools.

An agent starts a child with start_thread: another agent on its own task, in its own worktree and branch. By default the child:

  • starts from the parent’s branch, and its work lands back on the parent’s branch;
  • runs the same agent, model and login as the parent, in the same project;
  • gets the parent’s permission mode, or a lower one if the parent asks. Never a higher one.

The parent can ask for a different agent or model (a Codex child under a Claude Code parent), another project (a shared library the project uses), a project’s login for that work, or another of your machines (see Servers).

In the parent’s thread a Started child thread row links to the child, and the child shows under its parent in the thread list. Open it to watch or steer it like any thread. More in Child threads.

  • wait_for_threads waits until its children are done, failed or stopped, then hands the parent each one’s status and last message.
  • get_thread and list_threads check on them: status, branch, last message, the files they changed.
  • send_message steers a child’s running turn or queues a message for after it.
  • stop_thread stops one.

When a child finishes, its parent hears about it: a Child thread done (or failed, or stopped) row with the child’s last message.

merge_thread lands a child’s work on its target, the parent’s branch by default, the same way Merge does for you: it lands only once the project’s checks pass, and shows up in the parent’s folder too. The parent waits until it has landed or failed. See Merging.

  • ask_user puts a Question card in Needs you, with suggested answers when the agent gives some. The agent waits for your answer.
  • report_progress posts a short note on the thread, for you to read later. It doesn’t stop the agent.

An agent that needs an API key asks with request_secret. You get a Secret card in Needs you: “The agent asks for OPENAI_API_KEY”, why it needs it, and where it goes (a .env file in the thread’s folder, kept out of git, or the project’s secrets). Type the value and Save, or Cancel.

The agent never sees the value. It learns only whether you saved it, cancelled or didn’t answer in time.

From a terminal: cohort secret provide answers a request (it reads the value without showing it), cohort secret cancel turns it down.

wake wakes the agent’s own thread once, later, with a prompt: “check back in 10 minutes”, “look at the deploy at 18:00”. It shows in Loops until it fires. If the thread is busy then, the prompt waits for its turn to end.

Agents can also create and run loops (create_loop, run_loop, list_loops).

When you ask, an agent can move its own thread: move_to_worktree (from the project’s checkout into a new worktree of its own), move_to_folder (another folder of the project), move_to_project (another project). The move happens when its turn ends. archive_self archives its thread once the turn ends.

Everything above has a cohort command, for agents that prefer a shell or scripts of your own:

Terminal window
cohort thread start "Add rate limiting to the API" --project api --follow
cohort thread list
cohort thread send thr_… "Use the existing middleware"
cohort thread merge thr_… --wait
cohort secret request OPENAI_API_KEY --reason "To run the embedding tests"
cohort wake 10m "Check whether CI passed"

--follow prints the transcript as the turn goes and exits when it ends: 0 done, 1 failed, stopped or gone, 3 waiting on you. See the CLI reference.

cohort mcp is an ordinary MCP server, so an agent you run yourself, outside Cohort, can use it too: Claude Code in your terminal, Cursor, anything that speaks MCP. Cohort must be running (the app, or the daemon on its own) and cohort must be on your PATH.

Claude Code:

Terminal window
claude mcp add cohort -- cohort mcp

Cursor: add it to .cursor/mcp.json in your project (or ~/.cursor/mcp.json for every project):

{
"mcpServers": {
"cohort": { "command": "cohort", "args": ["mcp"] }
}
}

An agent outside Cohort isn’t a thread, so it has no children of its own. It can:

  • start threads with start_thread. They are top-level threads in Cohort, listed and merged like ones you start;
  • check on them with get_thread and list_threads (which lists every thread), and wait for the ones it names with wait_for_threads;
  • list and run loops, list your machines, and share a port.

The tools that act for a calling thread (send_message, stop_thread, merge_thread, ask_user, request_secret, report_progress, wake, the moves) say they need one. Steer, stop and merge those threads from Cohort, or with cohort thread send, cohort thread stop and cohort thread merge.

Made by Bussin Bytes© 2026 Bussin Bytes Ltdcohort.bussinbytes.io