The Lead Holds the Pen

The Lead Holds the Pen

Claude Code Agent Teams is an experimental feature, and Loa treats it as one. The v1.39.0 reference that documents it, tracked in issue #337, is short, mostly a table, and carries a status line at the top that says Experimental. We run Loa across every repo in the fleet, so when a reference like this lands we read it for one thing: where does it put the pen, and who is allowed to pick it up. This essay is our reading of that document. It is not a benchmark and it does not claim the feature makes anything faster. The reference does not claim that either.

The accession stamp dried before anyone pressed it; the camera had been sent away for repair.
The accession stamp dried before anyone pressed it; the camera had been sent away for repair.

What a team is

The reference describes the shape in a paragraph. A lead agent spawns teammates that work in parallel. Each teammate has its own context window, loads the same project CLAUDE.md, and coordinates through a shared task list and peer-to-peer messaging. The upstream description in the Claude Code documentation matches this, and the Loa reference adds nothing to the mechanics. What it adds is the governance around them.

Enabling the feature is an environment variable, set in the shell or in the user-level settings file:

{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}

When it is on, the lead gains seven tools: TeamCreate, TaskCreate, TaskUpdate, TaskList, TaskGet, SendMessage, and TeamDelete. The reference lists these as tools the lead gains, not tools a teammate gains. The tree has one root.

Detection without a flag

The reference is candid about a gap: there is no programmatic check for whether Agent Teams is active. The lead is told to attempt a team tool and, if it is unavailable, proceed in single-agent mode. The only signal is the presence of TeamCreate in the tool list.

Loa wraps this in a config gate in .loa.config.yaml with three values. auto uses teams if available. true requires them. false disables them. For a fleet, auto is the only reasonable default, because a repo should not fail to run on a machine where the experimental flag was never set. We would rather a sprint run on one session than not run at all. true exists for the case where a sprint plan was written assuming parallel implementers, and running it alone would produce something different from what was planned.

The matrix

Most of the reference is a table of skills with two columns, Lead and Teammate, and a one-line rationale for each row. The rule that generates the table is stated once, at the bottom:

If a skill writes to a single shared artifact (PRD, SDD, sprint plan, state files) or manages lifecycle/infrastructure, it is lead-only. If it writes to sprint-scoped directories (a2a/sprint-N/), teammates can invoke it.

Read through that lens, the table stops looking like a list of permissions and starts looking like a map of where contention would live. The planning skills, /plan-and-analyze, /architect, and /sprint-plan, each produce one document per cycle, so two agents running them would produce two documents and a merge nobody asked for. The orchestration skills, /simstim, /autonomous, /run, and /run-bridge, are loops that call other skills, and a loop inside a loop is how a team ends up with two leads. The infrastructure skills, /deploy-production, /mount, /update-loa, and /loa-eject, touch the framework or the environment itself. All of these are lead-only.

The teammate column is narrower and more interesting. /implement sprint-N is described as the core parallel work pattern, which is the whole reason teams exist. /review-sprint and /audit-sprint are open to teammates because one teammate can review another's work, and the output lands in a sprint-scoped directory rather than a shared state file. /bug, /translate, /validate, /compound, and /enhance are open because each is independent of the others. /loa is open because it is read-only.

A second clock at the end of the hall, keeping a time none of the rooms use.

What we care about most is the last sentence of that section. The rule is enforced mechanically by team-skill-guard.sh, a PreToolUse hook on the Skill tool. A teammate that invokes /architect does not get a paragraph of guidance about why it should not. It gets blocked before the skill loads. We prefer hooks to prose for anything we actually need to hold, and this is the pattern in its plainest form: the policy is a table, the table is a shell script, and the shell script runs before the model can act.

One writer for beads

The beads section is the part of the reference we read most carefully, because it is where parallel work meets a database. Beads, invoked as br, stores issues in SQLite, and SQLite permits one writer at a time. The reference does not try to work around this. It states that in Agent Teams mode all beads operations are serialized through the lead.

The workflow it gives is a sequence, not a protocol with branches:

  1. At session start, the lead runs br sync --import-only.
  2. Before spawning teammates, the lead creates beads tasks from the sprint plan.
  3. When a teammate starts work, the lead updates the bead to in progress on the teammate's behalf.
  4. The teammate reports back to the lead over SendMessage rather than touching the database.

The point is that teammates do not hold a connection. They hold a conversation with the agent that does. This costs a round trip per status change, and the reference does not pretend otherwise. What it buys is a bead store with one writer, and a lead whose view of task state is the only view.

What the shape tells us

Three layers in this reference, and the same decision at each of them. Planning artifacts have one writer. Lifecycle and infrastructure have one writer. The issue database has one writer. Parallelism is permitted where the filesystem already partitions the work, in sprint-scoped directories, and not elsewhere. Teams in Loa are not a way to make more agents do more things. They are a way to make more agents do the one thing that was already safe to split, implementation inside a sprint, while the lead keeps every pen that writes to shared state.

We should be plain about the limits of our reading. The feature is experimental upstream and marked experimental in Loa. The copy of the reference we are working from describes the beads workflow through the point where a teammate messages the lead, and we have not reproduced anything past that here. We have no measurement of how much wall-clock time teams save on a sprint, and we will not estimate one. The reference itself makes no speed claim. Its claims are about who may write where, and those can be checked against the Loa repository directly.

If there is a lesson for anyone running agents outside Loa, it is the generating rule rather than the table. Ask of every skill or command: does it write to something of which exactly one copy should exist? If yes, one agent owns it. If it writes into a directory that already has the sprint number in its path, hand it out. Then put the answer in a hook, not a document, so the next session does not have to remember it.


Get the next post

Free membership: new posts on how the fleet is built, delivered by email. Subscribe free

№ 3577