Batch runs: scripts run the loop, a person decides

How I went from one coordinating session that routed every step to runs of 75 or more tasks driven by scripts, where my session wakes only for decisions. October 15 to November 15, 2026. Some parts are running, some piloting; each section says which. By Hamed Taheri.

Back to the playbook · Workflow reference · Results and cost cohorts · Agentic Kanban

Units. Every dollar figure is usage priced at API list rates. Workers, reviewers and cloud sessions run on a subscription with no API key, so no figure here is an invoice. "Landed" means merged into an integration branch through the guarded landing tool, not released to production.

Where to find what

This page is the detail behind short paragraphs in the playbook. Read the part you need.

If you want to Read
The month in one screen What changed
The process to adopt before any tooling Three levels: backlog, run, improve
Who does what, and what it costs Roles
How events move from a worker to a person The loop in code
What happens to one task from launch to landing Life of a chain
What can merge without a person Gates and What runs alone, and what asks
The caps I use Budgets and caps
How I start a run Starting a run
Why one prompt can now run for hours What made long runs possible
Lessons you can use without my scripts Principles that generalize
The rules, grouped Standing rules
What happened, by date Timeline
Setting this up in your own repository Adopt it in your repository
Prompts to hand your AI Give this to your AI

What changed in one month

In one month the loop moved out of a chat session and into scripts. On October 14 one interactive coordinator session routed every step of the scripts (prepare, run, review, land). It worked, but it was expensive and fragile: the coordinator took 44–72% of all spend in every window I measured, and runs stalled whenever a step needed a hand.

By November 14 five things had changed:

  1. Scripts run the loop; the coordinator only decides. A driver launches tasks. A supervisor, a script with no model, reads every log line, handles routine events itself and puts the rest in an inbox. The coordinator session wakes only when a digest, the batched inbox, is ready.
  2. Work runs in the cloud. Workers moved to cloud VMs after my PC hit its ceiling on November 9. Reviews followed on November 14, behind a switch. Landing, board writes and anything that touches production stay on the trusted PC.
  3. Decisions became reusable. Rulings, pre-approval by group, "proceed on the recommended option" for anything reversible, and batched plain-language questions. The basis was a study of 1,109 of my own answers: only about 6–7% truly needed me.
  4. The queue fills itself. Grooming runs inside a run, too-big cards are split, spec tasks file their own child tasks, and existing stuck PRs are adopted and finished. Readiness had become the limit: on November 5, 1 of 386 backlog cards was ready for an agent.
  5. The process split into three levels. Backlog sessions shape the work. Repeatable run sessions execute it within a budget, using the tools as they are. A less frequent improve cycle changes the tools and this playbook from what the runs recorded.

The agents stopped being the constraint in October. In November the constraint moved from "a person must route every step" to "a person must make the few real decisions, in one sitting". Whether that holds at 75 or more tasks per run is what the largest pilot, still open at this revision, tests.

Three levels: backlog, run, improve

Adopt this split before any tooling; it is the month's main process change. piloting since November 14.

Level Who How often Input Output Must not
Backlog A person talking with an AI Whenever there are ideas Goals, bugs, conversations Epics and tasks on the board, some detailed, some rough Run work
Run One fresh session plus the scripts Repeatedly, as budget allows; target 150–200 tasks per run The board, the decisions database, a budget Landed PRs, one batch of real questions, a learning log Build or change tools mid-run
Improve A session, or a small run, on the tools and the playbook Every two or three runs, and at least weekly The learning logs of past runs Tool PRs, playbook and guideline edits, a smoke run of the new runner version Hand an untested runner version to the next run
//: # (/visual)

Inside a run, in order:

  1. Pick ready tasks up to the budget.
  2. Prepare the ones that are close: groom, split too-big cards, write specs. Truly vague epics stay in the backlog.
  3. Decide. If a recorded decision already covers a question, answer it and cite the decision. Otherwise add it to one batch for the person. Every new answer goes back into the decisions database, so each run asks fewer questions.
  4. Execute: driver, supervisor, cloud workers and reviews, landing.
  5. Record learnings; don't act on them. What was missing, what broke, what was slow, with numbers.
  6. Hand off: metrics, the landed list, open questions, learnings.

Why the split matters.

The run prompt is a template with parameters: pool, budget, cap, slots, held keys and pre-approvals. It is not rewritten for each run; only its "state at handoff" block changes.

What the person does per run: sets the budget and the pool, answers one batch of questions (usually in the morning) and reads the metrics. Everything else is the system's job.

The Agentic Kanban framework places these levels next to its four ceremonies.

Roles

Role What it is Runs where Cost
Person Sets budget, pool and rulings; answers held, spec and sensitive questions in one sitting The scarcest resource
Coordinator One interactive Claude Code session. Reads digests, writes commands, rotates at about 150K context PC Calls × context: about $0.10 per call at 160K
Supervisor A deterministic state machine, no model PC, background $0
Driver Launches tasks up to a parallel limit and follows a plan file PC, background $0
Worker One task, one PR, as a headless claude -p with a strict empty MCP config Cloud VM or PC At most $2 per worker session
Reviewer Light or deep; verdict MERGE, MERGE AFTER or DO NOT MERGE, plus a gate line Cloud (behind a switch) or PC $0.15–1.20 per review
Fixer One fix round: a new worker on a fix branch, a light re-review, a merge into the task branch Cloud or PC About $0.75 per round
Lander The guarded landing tool; the only way anything merges PC Small
Groomer A headless model that sorts cards into ready, held, spec or too big PC $1.50–3 per groom
Board Team memory. Workers write through a small command-line tool, never through MCP (MCP schemas add about 220K tokens) API Not the constraint

The loop in code

piloting since November 12.

A batch run since November 12, in three bands:

Coordinator calls per landed PR were 27 in the November 10–11 run, before the supervisor; the target is 10 or fewer.

The same loop, as the scripts see it:

plan file  (one entry per task: key, repository, base, brief, kind = code | spec | adopt, held)
   |
driver --parallel 8 --follow       re-reads the plan every 60 s, so new children start without a restart
   |   per entry: worker -> PR -> light review -> deep review -> board write -> fix rounds
   v
event log    one line per event, in fixed shapes; every shape has a replay test
   |
supervisor --apply --cap-usd N     groups events into chains by root task key
   |-- routine: handles it (rerun flaky CI, update a stale branch, wait for disk, retry a review with
   |            no verdict once, relaunch failed cloud starts, land a plain MERGE, stop a churning chain)
   |-- everything else: an item in the inbox
   |-- every 5 items or 60 minutes (at once on a crash or when idle): writes a digest, prints "DIGEST ready"
   |-- reads the commands file every 15 s: land | approve <note> | fix <note> | close | park | ruling
   v
coordinator    one watcher with the filter "DIGEST ready|crash"; reads the digest; appends commands
   |
board          status, report and blocker lines; done when landed

Coordinator cost is calls times context. The biggest cost was waking up, so routine events (flaky CI, a stale base, a full disk, board writes) had to be handled by code, not by a model reading them. I built the supervisor from the transcript of a 177-task run (November 10–11), where the coordinator:

The supervisor shipped with 140 tests and a replay of that run's 2,368-line log. It cost about $48.50 to build.

Life of a chain

A chain is a root task plus all its fix rounds and nested fixes.

Gates

Only a plain MERGE lands without a person; everything else stops at a gate.

Budgets and caps

The values I used for the 76-chain run that started November 14:

Cap Value
Batch budget, preparation plus run $800 of usage
Supervisor stop --cap-usd 715: $800, minus about $45 of preparation, minus a $40 reserve
Worker session $2 (a stage cap that a larger per-run cap does not raise)
Churn breaker 4 rounds or $15 per chain
Parallel workers 8, raised to 12 cloud slots after 10 clean launches
Tasks per batch 110 (default 70)
Coordinator context Rotate at about 150K tokens
Paid bulk cloud operations Stop and ask above $5 or 1,000 paid calls
API key Refused: every script exits if an Anthropic API key is set

Dollar caps on a subscription. Cloud sessions have no per-session dollar cap. The real ceiling is the plan's usage limit plus the supervisor's --cap-usd, which counts usage estimates in dollars. That is why the October advice against scheduled cloud sessions became "cloud workers and reviews, under a shared slot cap and a supervisor cap".

What runs alone, and what asks

Alone:

Asks, batched, in plain language, with options described as outcomes and the recommendation first:

Silence is still not approval. A proposed decision stays proposed until I confirm or change it.

Starting a run

Preconditions first. Each one cost a run something.

  1. The runner checkout is at the expected version. Check that every tool change the run needs is an ancestor of its commit.
  2. No API key is set. Every script refuses to start with one.
  3. The landing tool can run without a permission prompt. Without an allow rule, nothing lands: the 177-task run had 78 approved PRs and landed none for about 20 hours.

Then:

  1. Set the environment: batch folder, session id, cloud reviews on, slot count, task limit.
  2. Start the driver with --parallel 8 --follow in the background.
  3. Start the supervisor with --apply --cap-usd N in the background.
  4. Start a periodic status line.
  5. Start one watcher, filter DIGEST ready|crash. Nothing else wakes the coordinator.
  6. On each digest: routine items take the recommended option; held, spec and sensitive items go into one batched question.
  7. Rotate the coordinator at about 150K context. At the end, write metrics, the landed list, open questions and learnings to a handoff file.

Handoff. A new session reads the handoff file, never the old transcript. approve is safe to repeat after a restart.

What made long runs possible

Long runs became possible when stalls stopped needing a hand. An agent could already do one task end to end, but every stall needed a hand step: one November 13–14 pilot had 8 tasks and 239 coordinator actions. The tool work after it removed most of those steps:

What will show it works: coordinator wakes per landed task (48 in that pilot; the target is 10 or fewer) and inbox items that reach me (only real decisions).

Early observations from the 76-chain run (snapshot of November 15, run still open; observations, not results):

These go into the learning log for the next improve cycle, not into the running tools.

Principles that generalize

The parts you can apply without my scripts, each with its evidence.

  1. Your decisions become the queue; make them reusable. 120 of 206 runs waited on me (October 6–14). Of 1,109 answers, 76% took the recommendation and about 6–7% truly needed me. Record rulings, pre-approve groups with named exceptions, proceed on the recommended option for anything reversible, and batch the rest as plain-language questions.
  2. Coordination cost is calls times context. Move routing into code. The coordinator's share was 44–72% in every October window and about 28% in the 177-task run (about 2,130 calls). A deterministic supervisor handles routine events, the session wakes only on a digest, rotates at about 150K, and hands off through files.
  3. Supply of ready work is the real limit, not compute. 6 of 90 cards ready (October 26), 1 of 386 (November 5), 17 runnable of 81 groomed (November 10). Groom inside the run, split too-big cards, let spec tasks file their children, and adopt stuck PRs.
  4. Every stall must surface. Silence is a bug. In one pilot three log-line shapes matched nothing, and chains sat idle with no alert. Every event shape needs a parser and a replay test on real logs; unknown events go to an inbox; commands are never dropped.
  5. Bound the fix loop, then ask a design question. One night landed nothing and produced 408 fix PRs; one chain ran 22 rounds for $43; one PR got 6 deep reviews that never converged. Break at 4 rounds or $15; past that, land with a follow-up card or escalate.
  6. Landing is a permission problem before it is a code problem. 78 approved PRs, none landed for 20 hours, because no allow rule existed. Before an unattended run, check that the landing tool runs without a prompt. Landing goes only through the guarded tool.
  7. A reviewer sees only what you put in front of it. About 10 re-reviews were bought only to restate evidence the reviewer couldn't see. Put rulings and CI notes at the top of the PR description; pass local test results in as a file.
  8. Missing CI is not green and not red. Run tests locally in a clean install and treat "no checks" as its own state.
  9. One deep review is not enough; calibrate it. A second review of 27 merged PRs it had passed found 10 real major bugs in 8 of them (about 30%). Explicit miss questions (sibling paths, field contracts, failure branches that leave state behind, a flag turned on against existing data) plus an automatic second pass named 10 of 18 known misses against 3 of 18 before, at the same cost.
  10. Test against the real contract, not a stub. Unit tests that stubbed the spec gate hid a dead spec lane twice, and a fix of a fix crashed the normal approve path. Briefs that connect two tools quote the exact lines, exit codes and file shapes; at least one test uses real tool output; every fix round re-tests the normal path.
  11. Separate improving the system from running it. See three levels.
  12. Move compute off the laptop when it becomes the ceiling; keep trust on the trusted machine. Workers and reviews in cloud VMs; landing, board writes and production stay local. Cloud sessions carry no secrets.
  13. Guardrails must be enforced by tools, not prompts. The cloud tool list was not enforced, branch protection lived only in the prompt, and one cloud worker overstepped its brief. Push guards, a protected-branch check after every run, an API-key refusal, sensitive paths matched by segment.
  14. Count all the spend, including the interactive session. On October 23 my dashboard showed 19% of real spend (about $307 of about $1,625 over 48 hours), because interactive sessions weren't counted; they were 72% of it. Report coordinator and interactive sessions separately; on a subscription, treat dollars as a usage estimate and set caps in those units.
  15. Hold-heavy batches are the slowest path. A pilot that held 6 of 8 tasks needed 48 coordinator calls per landed task, against about 9 in the others. Build pools where at least 40 of every 50 can land without a person; put held work in a separate, small queue.
  16. Bigger pools amortize setup. Setup raised one 7-task pilot from 9.3 to 14.6 coordinator calls per landed task. Run 50–200 tasks per run, not 7.

Standing rules

Each came from an incident.

Safety and production

Landing and review

Workers and sessions

Decisions

Process

Timeline

October 15–22: overnight runs and a rules day

October 23–29: real cost, lean runs, a November backlog

October 30–November 6: the autonomous task flow and review calibration

November 7–9: other agents' drafts and cloud workers

November 10–12: a 177-task run and the supervisor

November 13 onward: pilots

Each pilot tests one thing and adds a dated row.

Pilot Size Landed Coordinator share Coordinator calls per landed What it showed
November 13, UI tasks 7 tasks 7 of 7 about 40–50% 9.3 (14.6 with setup) Tiny pools can't reach a low coordinator share; 8 tool gaps, such as path matching by substring
November 13, chains 9 chains 7 of 9 about 25% 8.7 The first clear drop; 35 of 61 coordinator calls were hand landings
November 13–14, mostly held 8 chains, 6 held 5 of 8 41% 48 Log lines the supervisor didn't parse left chains stalled with no alert
November 14 onward 76 chains: 20 code, 2 spec, 51 adopted PRs, 3 carried over Running: 40 of 73 tasks by November 15 About 36% so far (target 12% or less) Target 10 or fewer Tests whether the tool fixes hold at scale; 11 tool PRs first, about $45 and 24 fix rounds

Also on November 13, a variant orchestrator ran 22 tasks in a Python repository for $69.99, and all 22 merged. That is one more repository, not any repository.

Chart: usage per landed PR in three panels, one per basis (everything, coordinator only, runner only), drawn from the batch-run data. Compare within a panel, not across panels.

The cost per landed task for each cohort, with its basis, is in the results reference.

Adopt it in your repository

Order matters: the process first, the tooling second.

  1. Board and briefs. One board, any tracker; tasks with six-field briefs (section 1); a written definition of ready.
  2. Decisions. A decisions file or database from day one. Write the never list and the pre-approved classes. Answer questions in batches.
  3. Lean workers. Headless sessions with no MCP, a small fixed card and a $2 cap per task (section 2). One task per worktree or per cloud VM.
  4. One review gate. A deep review that returns a verdict for an exact commit, plus a second pass. A guarded merge tool that refuses anything but a plain MERGE for that commit.
  5. A run loop in code, not in a chat. A driver that launches tasks from a plan file, a supervisor that reads the event log and handles routine events, an inbox for the rest. Start with 5 tasks, then 20, then 50. Measure coordinator calls per landed task.
  6. Three levels. Backlog sessions, run sessions from a template, an improve cycle every two or three runs. Never fix tools during a run; write the learning down.
  7. Safety from the start. Separate credentials, containers or cloud VMs, a push guard, a protected-branch check after each run, and no API keys in unattended work if you run on a subscription.

The runner scripts behind this page aren't public yet; ask if you'd like to see them.

Where it doesn't work yet

Give this to your AI

Set up a run session from a template.

Act as the coordinator of one run session. You route; you never implement.
Inputs: the run template, its parameters (pool, budget, supervisor cap, slots, held
keys, pre-approvals) and the last handoff file. Do not read old transcripts.
Before starting, check: the runner version includes every required tool change;
no API key is set; the landing tool runs without a permission prompt. Stop if not.
Start the driver and the supervisor in the background, and one watcher that wakes
you only on "DIGEST ready" or a crash.
On each digest: take the recommended option on reversible routine items and record
it as a proposed decision; answer from recorded decisions where one applies and cite
it; put held, spec, sensitive, production and over-budget items into one batched
plain-language question with outcomes as options and your recommendation first.
Never change the tools during the run. Write what was missing, broken or slow, with
numbers, to the learning log. Rotate at about 150K context through a handoff file.

Run an improve cycle.

Read the learning logs of the last two or three runs and group the entries by cause.
For each cause, propose one change: a tool fix, a rule, a template parameter or a
playbook edit. Rank them by what they cost the runs (coordinator calls, stalled
hours, wasted review rounds) and show me the list before building anything.
Build the approved tool fixes as reviewed PRs with tests that use real tool output
and re-test the normal path. Then run a smoke run of the new runner version on a
few low-risk tasks. Only a version whose smoke run passed may be used by real runs.
Record what changed and why, and update the run template and the rules it cites.