Skip to content

Threads that start threads

An agent can split a big task by starting threads of its own. Each of those is a full thread with its own agent, conversation and worktree, and they run in parallel. The thread that started them is the parent, and they are its children.

You don’t have to set anything up. Ask for something large (“add CSV export to all four report pages”) and the agent may decide to split it. You can also ask outright: “do these three in parallel”.

Children are listed under their parent, folded. The parent’s header has a button that counts them, with how many are working and how many need you. It opens the Threads tab of the tools panel, which has a row for each child and what it’s doing.

In the parent’s transcript, the turn that started the children shows a card with a live row for each. When a child finishes, a single quiet line appears: “Export for invoices finished”, or “failed”, or “asked you”. Click it to read the child’s answer, or open the child itself.

A child is an ordinary thread. Open it, read it, message it, answer its questions. If a child stops to ask something, it’s you it asks: its row needs you, the parent’s row says so too, and Space reaches it. The parent isn’t woken, because it can’t answer for you.

When a child finishes the task it was given, the parent’s agent is woken with a report: how the turn ended and what the child said.

What happens to the child’s code depends on where the parent started it:

  • On a copy of the parent’s folder, as it was at that moment, uncommitted files included. This is for work that builds on the parent’s. The child’s Changes shows only its own work, and when it’s done the parent can merge it into its own folder. The changes arrive uncommitted, and any conflicts are left marked for the parent’s agent to resolve. The parent’s branch ends up with everything, and that’s the branch you review and ship. The children’s rows say where each one’s work stands: “merged into this thread”, or “not merged into this thread”.
  • In a fresh worktree from the project’s base branch, which is what an agent picks unless it has a reason not to. The work stays on the child’s own branch, to be reviewed and shipped from the child like any other thread’s.

The diagram shows the first case.

sequenceDiagram
  participant You
  participant Parent
  participant A as Child A
  participant B as Child B
  You->>Parent: Add CSV export to the three reports
  Parent->>A: start, on a copy of its folder
  Parent->>B: start, on a copy of its folder
  A-->>Parent: finished (wakes the parent)
  Parent->>Parent: merges A's changes
  B->>You: asks a question
  Note over Parent,B: The parent isn't woken. It can't answer for you.
  You->>B: answers
  B-->>Parent: finished
  Parent->>Parent: merges B's changes
  Parent->>You: done, with everything on its branch

Children don’t present evidence or get asked to prove their work. The parent is responsible for what it brings back.

A parent hears about every turn its children end, but it’s only woken for the ones that are its business:

  • a child finished or failed the work the parent gave it,
  • a child’s turn was started by something other than a person: CI, a schedule, another thread.

If you go into a child and talk to it yourself, those turns belong to you. The parent gets a quiet note about them and isn’t woken.

An agent chooses where a new thread works:

  • A fresh worktree from the project’s base branch. The default.
  • A copy of its own folder, for work that builds on what it has done so far and comes back by merging.
  • Its own folder, shared, or the folder of another thread it started. No setup, and both threads edit the same files. Suited to reading and research.
  • An existing branch, such as a colleague’s or a pull request’s.
  • Another project, for a feature that spans repositories.
  • No project, for work that needs no code.

Either of the first two can also run in a sandbox, so you can ask an agent to keep its workers off your computer.

It can also give a thread a role:

  • An explorer reads code and answers questions. It has no tools for editing files. Other threads working on the same feature can ask it things, which saves each of them from learning the codebase separately.
  • A coordinator only delegates. It can start threads, message them, ask you things and read what its threads publish. It can’t edit files or run commands.

Rows with a role show a small mark in the list.

A thread an agent starts inherits its starter’s permission mode. It runs on the starter’s model unless you asked for a particular one, or its project can’t use the starter’s account.

Children can start children of their own, to a depth of three levels.

An agent can also link threads it started whose work touches each other’s, two halves of one interface for example. Linked threads are told about each other and can message one another directly.

Agents can message any thread whose id they know, and an agent that receives a message can reply. An archived thread can’t be messaged until you unarchive it. They can also search and read your other threads in the same project, archived ones included, which is how an agent finds out what was decided last week. Given a commit’s SHA, the search finds the thread that made the commit.

With profiles, an agent asks you before it reaches into a thread or project of another profile.

When you mention a thread with # in a message, the agent is given that thread’s id, so it can read it wherever it lives.

Agents are asked not to send acknowledgements or thanks, so two of them don’t keep each other running. The loop guard stops it if they do.

You can restructure by hand:

  • Move under a thread…, or dragging a row onto another, makes a thread the child of another in the same project. The new parent hears about its turns from then on.
  • Move to top level makes a child a thread of your own again.

A thread an agent started for you without following it is yours from the start. It’s listed at the top level and nothing reports back.

Archiving or snoozing a parent does the same to its children. An archived parent isn’t woken by its children’s reports. It reads them the next time you start it.

Deleting a parent lists its children with a checkbox each. The ones you uncheck are kept as your own threads.

If you rewind a parent to before it started a child, the child is stopped but not deleted. It’s still there if you switch back to that branch.