Skip to content

Lessons learned

What we learned from letting AI coding agents work largely on their own, around the clock, on two real projects: this repository and a proof of concept for a contract-checking application (aise-feecheck-poc). The setup: a Linux server and a Windows laptop run Claude Code sessions in throwaway sandboxes (small virtual machines), a Raspberry Pi hub watches them, GitHub holds all the work, and the owner takes the decisions that are theirs.

This page gives the big picture for a reader who has never seen the repositories. The detail lives in the linked issues and pages.

In short

  • Agents can do most of the work, if the rules are written down. What made parallel agents productive was not a smarter model but explicit rules: one issue per piece of work, a list of what an agent may do without asking, and a fixed path from issue to reviewed change.
  • The owner's attention is the scarcest resource. Questions scattered over comments went unanswered for days. One decision page per topic, with a recommended option, turned waiting into a few minutes of reading.
  • Automation multiplies small costs. Agents push, re-check and re-review far more often than people do. CI minutes ran out within a week, and sessions ran on an expensive model nobody had chosen. Every metered service needs a budget, an alert and a default set on purpose.
  • Restarts are normal, so everything must survive one. Sandboxes, machines and sessions stop. Work that lives only in a running session is lost; work recorded in GitHub and in small state files comes back.
  • Silent failures cost the most. An expired login, a review that quietly never came, a value set in the wrong place: each looked like something else and sent us searching in the wrong direction. Checks are now built to say what they could not check.
  • AI reviewers help, but are advice, not a gate. They find real problems, yet they also stop working for hours or loop over the same change. The merge decision rests on deterministic checks and on written rules.
  • Trust is limited on purpose, and that has a price. Agents never raise their own rights, act only on consent given in their own session, and leave secrets, CI and architecture to the owner. This keeps the setup safe, but every hand-off costs the owner a context switch.

A few words used on this page

Word Meaning
Issue A ticket on GitHub describing one piece of work.
Pull request A proposed change, reviewed and checked before it becomes part of the code.
Coordinator A long-running agent session that hands issues to workers and tracks them.
Worker An agent session that works on one issue, in its own copy of the code.
Sandbox A small, disposable virtual machine an agent session runs in.
CI The automatic checks GitHub runs on every change; they cost paid minutes.
Decision page One web page per topic where the owner answers the agents' open questions.

Cost and billing

What we found. Agents trigger metered services far more often than people do. Every push and every merge re-ran the full set of automatic checks on all open pull requests, and short checks were billed as whole minutes. The monthly CI allowance was used up in eight days, after which every check failed within seconds (cost of the checks). External AI services work the same way: one model needed billing set up before it answered at all, then prepaid credit, and used an older, more expensive variant by default until a default was set on purpose (#667). Sessions also ran on an expensive model until a default was set per role. A cloud sandbox lasts at most a day.

What it caused. A day of fully blocked work when the CI budget ran out, money spent on re-checking the same change, and money spent on models nobody had chosen.

Status. Partly solved. The checks were trimmed (one Linux job, none on Windows since #946), the owner raised the budget, the AI service used for reviews in the sandboxes runs on prepaid credit with a monthly budget and a daily request limit, and each role has a model set on purpose (workers the strongest model, coordinators a cheaper one).

Ideas / next steps. Run checks and AI reviews once per change rather than on every push, and merge in batches so one update does not re-run every open pull request (#697). Cut the token cost of review loops (feecheck #156). Report cost and token use per role (ADR 0005 (docs/adr/0005-cost-source.md)).

What we found. The rules on what an agent may decide alone matter more than anything else. A short written list of standing consent (cleanup, starting tasks, routine merges, plugin updates) removed most of the waiting; architecture, CI, secrets and scope stay with the owner (decisions). Consent counts only when the owner gives it in the session that acts: a coordinator refuses a "yes" relayed by another session. Agents never raise their own rights; a step that needs an administrator is prepared and handed to the owner. Two pull requests were merged under the shared agent account, and no session could be found that had merged them (#478).

What it caused. Without the list, agents stopped and waited for routine yes-or-no answers. With strict per-session consent, the setup is safe but the owner has to switch to the right session, and some destructive steps (deleting a sandbox) are blocked even with the owner's yes, so the owner runs them by hand. An untraceable merge let a change ship without its version number.

Status. Partly solved. Standing consent is written down, workers never merge, and the owner's own merges are enforced by GitHub. Tracing every merge to the session that made it is open.

Ideas / next steps. Make every merge traceable and technically impossible for a worker (#478). Flag a change that adds a paid call per request for the owner (#651).

Work organisation

What we found. One issue, one worker, one copy of the code, one pull request: this rule made parallel work possible (parallel work). It also applies to the coordinator, which once started fixing things itself instead of filing an issue. Small jobs (a lookup, a review) run as a light helper rather than a full worker. Owner questions spread across comments were answered nowhere; one decision page per milestone or epic, with a recommended option first, fixed that (#166, #177). About twenty pull requests piled up waiting for the owner; finishing on stated assumptions, with a follow-up issue listing them, kept work moving (feecheck #131). Plans reviewed independently before they were filed avoided rework: every review round found real contradictions. Agents also asked the owner things they could have found out themselves, such as a review that was simply still running.

What it caused. Before these rules: idle workers waiting on stale dependencies, duplicate work, and owner questions lost for days. Long messages between sessions filled about 70 % of a coordinator's working memory (#272).

Status. Largely solved. Issue-first, decision pages, a Question Board listing everything that waits for the owner, finish-on-assumptions, and one-line reports between sessions with the detail behind a link are in place. Investigate before asking is a standing rule.

Ideas / next steps. Milestones the agents can work end to end once their preconditions are met (#616), with a clear outcome per milestone (#676), and a clearer split of work item kinds (#677).

GitHub as the central stage

All parallel work meets in one place: the main branch on GitHub. Workers on two machines open pull requests side by side, and each merge changes the ground under every other open one. People merge a few times a day; the agents merged dozens of times, so problems that a small team rarely sees became routine. Each lesson below says what happened, why, what we do now and where that is enforced. The issues and pull requests linked are the record.

Merges that undid other merges

What happened. Two pull requests both raised the workflow plugin from version 0.4.0 to 0.5.0. GitHub saw identical edits to the version file, the second merged cleanly, and main ended up with two different changes under one version number. Machines that had installed the first 0.5.0 never received the second change, and the plugin updater said "already at the latest version" (#99). The same happened again with #385: it merged at version 0.44.1, which #384 had taken minutes before, while the worker's higher version still sat unpushed on its machine (#391).

Why. A pull request's checks test it against main as it was when they ran. GitHub does not run them again when main moves on, and a plugin's version number is a counter that every parallel pull request of that plugin raises from the same starting value.

What we do now. The version check compares against the current main, not against the point where the branch started. A branch that falls behind main merges main in, raises its version again when the check asks for it, and runs the checks again before it can merge (#409).

Enforced by. scripts/ci/check-version-bump.sh inside validate, on every pull request and, since #735, on every push to main; the coordinator's main_red finding; and the pull request watcher of the git-flow plugin, which merges main into a branch when main changed what the branch changes. Before #735 the main ruleset also required the validate check on an up-to-date branch (next section).

The up-to-date rule, and what it costs

What happened. After #385, the main ruleset was set to "Require branches to be up to date before merging" (#409). It closed the gap above, and it had a price. Every merge made every other open pull request "behind". Each of them then merged main, raised its version where needed, and ran the full checks again before it could merge. Merges therefore ran one after another: update a branch, wait for validate, merge, and start over with the next. One pull request, #701, merged main four times before it landed.

Why. The rule is the simplest of GitHub's two ways to make sure the tested code is the merged code; the other is a merge queue. With 3 to 8 open pull requests per repository, one merge set off 3 to 8 full runs that tested the same change again, and each further merge did it again for those still waiting (#697).

What we do now. The rule is off (#735): a pull request merges behind main unless main changed a plugin or file it also changes, or it has a conflict. Those merge main in first: pr-watch asks for it, and coordinator announce after each merge names them and turns their auto-merge off until they are green again. A version clash is no longer prevented but detected: the version check runs on every push to main, a red main is the coordinator's main_red finding, and a follow-up raises the version. A branch update counts as no fix round.

Status: changed. Measured from 2026-11-08 to 2026-11-11, runs on a head that only merged main were about a quarter of the pull-request check runs (docs/ci/cost.md). A merge queue (#736) would test the merged result once and prevent the clash instead of detecting it.

Shared files collide

What happened. Three kinds of collision came up again and again:

  • Version bumps. Two pull requests that change the same plugin both raise its version, and one of them has to raise it again (above).
  • Numbers handed out by hand. Two pull requests wrote an architecture decision record with the same number, ADR 0005 (#648 and #693). The second renumbered its record to 0006 when it merged main, with every reference to it.
  • Moved files. #701 moved the tests into a new folder while #708 fixed one of them in its old place. The fix had to be carried into the moved file when #701 merged main.

Why. Each worker sees only main and its own branch, not the other open branches. A file that every change of a kind touches (a version file, a numbered list, a folder that is being moved) turns parallel work into a race.

What we do now. The coordinator starts only one task per plugin at a time; a second one waits until the first pull request has merged. For numbered records and moves there is no rule yet: the pull request that merges second resolves the clash when it merges main.

Enforced by. The coordinator's choice of the next tasks (parallel work, "Collisions"), and the version check for the bumps.

Working practices that came out of it

What happened. Running many workers through one GitHub repository needed rules that GitHub itself does not provide. Each practice below answers a concrete failure.

What we do now, and where it is enforced:

  • A branch update keeps the owner's approval. Some pull requests need the owner's Approve review on GitHub before they merge. A push after the approval normally needs a new one, but a branch that main overtook on a file it also changes, or that has a conflict, must push a merge of main. A push that only merged main and raised plugin versions therefore keeps the approval (#481). Enforced by the coordinator's merge check (pr-watch base-sync).
  • Auto-merge only for agent pull requests, and off before every push. GitHub can merge a pull request by itself once its checks pass. The coordinator turns this on only for routine pull requests (merge:agent), because the ruleset requires no approval and GitHub would otherwise merge a pull request that waits for the owner. A push leaves auto-merge on, and the new commit could merge before anyone re-reads what it changed, so the worker turns it off before each push and the coordinator turns it on again once the pull request is green (#490). Enforced by coordinator auto-merge.
  • One push at a time per machine, and the checks before the push. The same checks as in CI run on the worker's machine before every push, so a broken change costs no CI minutes. They take 6 to 15 minutes, and three workers pushing at once ran the laptop out of memory, so each machine has one push slot (#268, parallel work). Enforced by the pre-push hook and pr-watch push.
  • Claim comments, because GitHub has no atomic claim. Two coordinators can both read an issue as free and label it at the same moment. A claim is therefore a label plus a comment with the machine, session, time and branch; the first claim comment since the last release holds, and the later coordinator withdraws (parallel work). Enforced by the coordinator's start.
  • The Approve review stays with the owner. The agents on the owner's machines share one bot account, so an approval by an agent would prove nothing. For the pull requests that need the owner (CI, secrets, rules, decision records) the consent is therefore the owner's Approve review on the current commit; a yes in chat does not count (decisions). Cloud sessions act under the owner's own account, and GitHub lets nobody approve a pull request by its own author; for those, the owner's yes in chat, recorded for one commit, takes the review's place. Enforced by the coordinator's merge check; GitHub's code owner review is prepared in CODEOWNERS for when the ruleset requires it.

The cost side

What happened. Every push runs the checks, and every merge makes the other pull requests push again. In eight days of October, the checks used about 3,000 billable minutes, a typical monthly allowance, and on the eighth day jobs stopped getting a runner at all (cost of the checks). On 10 November the account was at 90 % of its monthly quota again (#695).

Why. GitHub rounds each job up to a whole minute and counts Windows minutes twice, the full plugin test suite took 7 of the 10 minutes of a validate run, and the up-to-date rule repeats the runs for every open pull request.

What we do now. The checks run as one Linux job (cost of the checks). Since #695, a pull request also runs only the tests of what it changed, and since #946 no job runs on Windows.

Status: open. The runs that test the same change again after each merge, the second run after a merge into main and the full checks on every push to a draft remain (#697).

Scripts grew one at a time

What happened. The tooling grew script by script, each one written when a need came up:

  • host scripts in scripts/linux/ and scripts/sandbox/, such as status.sh, rotate.sh, set-token.sh, sandboxes.sh and github-account.sh;
  • their PowerShell counterparts in scripts/windows/;
  • the cross-platform environment checker, dev-doctor;
  • each plugin's own tools in its bin/ folder, such as coordinator, pr-watch and gh-issues.

Each has its own path, its own flags and its own help text. When #701 moved about thirty scripts and tests into new folders, it had to change 65 files, 20 of them documents and skills that named a path.

Why. Nobody planned a toolset; each script solved the problem of its day. A path written into a document or a skill is an interface, and scattered scripts have many of them.

What we would do now. Build one front door from the start: an installable command with subcommands, such as <cli> status, <cli> token rotate, <cli> sandbox setup and <cli> doctor, that hands each one to a small script, as tools like GSD ship. Documents then name the command, and a script can move without breaking them. Two things would stay separate:

  • The plugins' bin/ tools ship and update with their plugin, on every machine that installs it, so they stay with the plugin.
  • Where the dispatcher lives follows the owner's path rules: the token and root scripts sit in folders whose changes need the owner's approval (#701), and a front door that can call them changes what those rules protect.

Status. A lesson for next time; the scripts are unchanged.

Infrastructure and operations

What we found. Restarts and upgrades are routine, and each one broke something the first time. Background workers and scheduled jobs do not come back after a restart; only system services do. A tool upgrade silently changed the base image of new sandboxes, which then lacked basic tools (#665). A sandbox ran out of memory with three builds at once (#612), and parallel checks exhausted the laptop's memory (#268). Services read no personal settings files, so a value set "in the shell" never reached them (Linux host). With several sessions on one machine under one user, one session stopping "its" process stopped its neighbours' too (#435). Every fix that worked on Linux tended to break on Windows, and the other way round.

What it caused. Sessions that looked offline while still running, lost background work, broken sandbox setups after an upgrade, and hours of diagnosis per incident.

Status. Partly solved. A drain protocol (save all work, then say "ready") precedes every sandbox restart, a watchdog restarts what stopped (#585, #609), the sandbox image is pinned, one push at a time runs per machine, and the rule "staged is not active" is part of every script. Windows sandboxes have their own setup (Windows laptop); their provisioning failures are fixed (#638, #704).

Ideas / next steps. Move to the vendor's current sandbox images with our additions (#666), and give each coordinator its own copy of the code inside its sandbox (#320). Scheduled jobs that survive a restart (#657).

One operating system for agents

What happened. We supported several operating systems for the autonomous agents: sandboxes on Linux and on Windows, CI jobs on both, scripts written in two shells (bash and PowerShell), and a host setup for each. Every change had to be thought through twice, and every fix that worked on one system tended to break on the other. The Windows sandbox work piled up as issues that stayed open: #311, #321, #593, #832, #839, #840, #844, #871 and #877. CI added its own failures on Windows, such as #935 and #943, where a test passed on Linux and failed under Git Bash.

Why. Each system has its own sandbox behaviour, its own shell, its own file and line-ending rules and its own antivirus. A second system does not add a second copy of the work: the two copies must also agree with each other, which is what the alignment issues (#839, #840) were about.

What we would do now. Pick one operating system for the autonomous agents from the start and keep the other as the owner's workstation. Since 2026-11-21 agents run on Linux only, and Windows is the owner's workstation: it runs Claude Desktop, the owner's answers over Remote Control, the intake and research sessions and the overall coordinator, and no workers and no sandboxes (setup/owners-workstation.md).

Status. Decided on 2026-11-21 (#947). The Windows sandbox work is on hold, not deleted; the Windows CI job was removed in #946.

Quality and review

What we found. Each change is meant to pass deterministic checks (tests, linters, secret scans) and two AI reviewers, when they are available (quality gate). The AI reviewers find real problems, but one pull request needed ten review rounds in under three hours, each with new findings, until the reviewer's quota ran out (feecheck #157). A reviewer also stopped reviewing for hours without saying so (#161), or silently ignored a second request while its first was still running (#81). Agents ended their turn after a review step, leaving finished work unsent (#354). Checks that ran only in CI caught problems late.

What it caused. Long review loops that cost time, tokens and CI minutes, pull requests stuck waiting for a review that never came, and work that looked done but was not pushed.

Status. Partly solved. AI review counts as advice and never blocks a merge; waivers cover an unavailable reviewer; the same checks run locally before every push as in CI; and a watcher tracks each pull request until it is green, with a limit on fix rounds.

Ideas / next steps. Ask the AI reviewers once, when a change is ready, not on every push (#697). Hand review threads an agent cannot resolve to the owner (#655).

Secrets and accounts

What we found. Agents need many credentials (GitHub, AI services, monitoring), and each one expires, gets rotated or is pasted with an invisible extra character. A copied token with a trailing space looks exactly like a revoked one. A credential set in one place blocked another tool on the same machine (#304), and a running session kept using an old token after a new one was stored (#337). Agents work under a separate bot account, never the owner's, and secrets are never typed into a chat or put on a command line (secrets).

What it caused. Errors that pointed at the wrong cause, owner time spent on rotation, and a risk of a secret ending up in a log.

Status. Partly solved. Tokens are tested before they are stored and the old one is revoked only afterwards (token rotation); a central password vault is the single source on the Linux server; every commit is scanned for secrets, and the public docs site has its own privacy gate (ADR 0006 (docs/adr/0006-public-docs-site.md)).

Ideas / next steps. Finish the vault on the other machines and test that one change reaches all of them (#420, #419). A read-only token with its own budget for monitoring (#436).

Observability

What we found. Knowing what a dozen agents are doing is a job of its own. A coordinator that is parked, waiting for the owner, stops checking in and looked "stale" although it was healthy (#556). An expired sandbox login made every tool blind, and the monitor only said "coordinator stale" (#589). A live worker between two steps was read as finished, and a duplicate was started (#194). The status check itself became slow under load (#661). Answers the owner gave on a decision page went unnoticed until the owner said so (#342, #643).

What it caused. False alarms that cost the owner attention, real failures hidden behind a generic warning, duplicate work, and answers that waited for days.

Status. Partly solved. A Session Board and a Question Board show every session and every open owner question; the monitor distinguishes "stale but alive" from "gone"; answers on decision pages are read back on a schedule; and each coordinator watches the size of its working memory.

Ideas / next steps. An operator view that brings these boards together (#374), a dashboard on the Pi hub (#557), and a regular re-check of issues waiting on the owner for more than three days (#444).

What we would do differently next time

  • Write the rules before scaling out. Start with one agent, write down what it may decide, and add more agents only once that list holds.
  • Set budgets and model defaults on day one, for CI, every AI service and every role, with alerts before the hard limit.
  • Design for restarts from the start: every session records its state where the next one finds it, and every scheduled job runs as a service.
  • Pin what you build on, such as sandbox images and tool versions, and upgrade on purpose.
  • Make every failure loud and specific. A check that cannot run must say so, not report "OK" or something unrelated.
  • Give the owner one place to decide, with a recommended option, from the first question on.
  • Keep AI review as advice from the start, and run it once per change, not per push.