Skip to content

Case study 04 · Public repo · test runs only

Coding agents,on a token budget.

A planner that launches headless Claude Code agents in chunks, merges their work through a checked merge train, and can run a roadmap unattended under a dollar cap.

Role
Design, build, tests
Stack
Python standard library, one HTML page, git worktrees, headless Claude Code
Built
211 commits, Oct 3 to 19, 2026
Status
Public, MIT. Figures are test runs

Read the code ↗

127.0.0.1:8765 · Runway
The Runway board for a sample project: two sprints of token-estimated tasks, one running, two in review, one done, with a token burndown and the five-hour and weekly budget meters.
The planner page in its local harness with sample data. The runs shown used the harness's stand-in agent, not a live model.

The problem

An agent is cheap to start and expensive to leave alone.

Start ten coding agents and three things go wrong at once. They edit the same files, nobody knows what the afternoon will cost, and the finished work piles up waiting for someone to merge it by hand.

Runway plans the work as token-estimated tasks, gives each agent its own worktree and branch, and lands finished work through a merge train that runs the project's own checks. A budget ledger is consulted before every launch.

How it works

Follow one requestthrough it.

Drag sideways to follow it →

Local helper · runway.pylaunchred: blocked, kept for a fixPlanner pageboard, estimates, budget1 Fill a chunktasks grouped to a token budget2 Worktree per taskits own branch, its own folder3 Headless agent runclaude -p, stopped if far over estimate4 Merge trainthe project's own checksBudget ledgerdollar cap, checked before each launchInteractive sessionMCP: claim_task, finish_taskIntegration branchgreen work merges hereYour branchlands when you say so
A task whose checks pass: launched, run in its own worktree, merged, landed.A task whose checks fail: held at the train and sent back, with the worktree kept.
  1. Estimate first

    Every task carries a token estimate, calibrated from past runs per model and kind of task.

  2. One worktree per task

    Agents never share a working folder, so two runs cannot overwrite each other.

  3. Checks before merge

    The train runs the project's own checks. Red work is blocked and kept for a fix.

  4. A cap on the bill

    Autopilot stops when the next task's projected cost would pass the dollar cap.

What is measured

An end-to-end test run, not a production result.

7 of 7
tasks merged by the merge train in the autopilot test run, with 0 manual git commands
71%
of the dollar cap spent in that run, computed by the real ledger from injected token counts
740
tests passing. The suite never calls a model
211
commits, Oct 3 to 19, 2026

Read this before the numbers

  • That run used a scripted agent in a seeded throwaway repo, not live Claude agents. The roadmap came from a canned planning reply. What ran for real was roadmap validation, the autopilot loop, worktree creation, the merge gate, the budget ledger and the run report.
  • No real tokens were spent in it. The 71% is the pricing and ledger code working on token counts that were supplied to it.
  • Not measured: a full unattended run with live agents, wall-clock time for real runs, review time, or time saved against doing the work by hand.

What it leaves out

The limits,stated plainly.

  • More than one person or machine

    State lives in one home folder, and the defaults assume macOS.

  • A hard spending ceiling

    The cap is a launch gate. A task that runs far over its estimate can push spend past it.

  • Self-correcting estimates

    The run report flags drift. It does not correct for it mid-run.

  • A host for the page

    It was written to run inside a host that provides a database and a shell bridge. The repo gives you a sandbox harness instead.

  • Other launched agents

    Codex can claim tasks over MCP, but launched runs call the Claude CLI.