Project essay
The software factory: agents build it, people decide what ships
How a small engineering team at Snap eHealth keeps five applications moving with Claude agents working overnight, and why every change still has to earn its way to production.
- My role
- Designed it and run it at Snap eHealth
- Focus
- Claude agents · Linear · CI/CD · Release safety
- Project stage
- In daily use · Five applications
Why I built it
Snap eHealth has five applications, all at different stages. Some are live with clinics, some are being built, and one is waiting on data that arrives in January. The engineering team is small, and the list of things to build is not.
I’ve written all of my code through AI for years, so the question was never whether agents could write code. They can. The question was whether we could trust what they wrote at volume, in healthcare, without reading every line ourselves. Our senior engineer’s answer at the start was no. He expected slop, and he wasn’t wrong to. Unchecked agent output is mostly slop.
What changed his mind wasn’t a better model. It was linters, code checks and CI standing between the agent and the main branch. The software factory is that idea taken all the way from the first line of a spec to the last hour of a release.
What a night looks like
Work starts as a Linear ticket. When someone labels it, a chain of Claude agents picks it up and drafts the spec, the design note and the task contract. A Linear webhook triggers an AWS Lambda, so they start within seconds; an hourly sweep catches anything the webhook misses. A person approves the design before any code gets written.
Overnight, 50 to 100 coding agents take approved tickets and work them through the build steps. By morning there are pull requests waiting. Each one bundles up to 8 to 10 related tickets and stays under 400 changed lines, so a person can actually review it.
- Agent work
- Automated check or release
- A person decides
The 14 steps
Every change has a place in the same 14-step process. Agents do most of the typing. People own the decisions that are expensive to get wrong: what we’re building, whether the design is sound, whether the change does what the ticket asked, and whether it stays on in production.
Plan
Decide what “done” means before anything gets built.
- Spec and task contractAcceptance criteria, plus the files in scope and the ones that are off-limits.agent drafts
- Design noteA short ADR that a second engineer reads and approves.person approves
- Tests firstAgent-drafted tests, plus evals for any AI behavior.agent drafts
Build
Agents write the code inside the lines the contract drew.
- Branch from mainFresh branch for every pull request.automated
- Agent writes the codeThe engineer steers through the contract and the review.agent + engineer
- Run it in DockerSame container shape it will ship in.automated
- Local checksTests, lint, format and type checks before anything leaves the box.automated
Check
Prove it works, then have people agree it’s right.
- Pull requestThe agent drafts it. The engineer owns it and can explain every line.agent + engineer
- CILint, types, tests, Docker build, dependency and secret scanning, evals.automated
- ReviewAI reviewer first, then an engineer, then a product demo against the acceptance criteria.people decide
Ship
Release slowly and keep a way back.
- Squash mergeOne clean commit per pull request.automated
- DeployTagged with the commit SHA. Migrations run, then smoke tests.automated
- Feature-flag release5%, then 50%, then 100%, with release notes.automated
- 24-hour watchError rate, latency and cost. Roll back by flag or to the last tag.person watches
Two steps carry more weight than the rest. Step 1 is where agents get their boundaries. The task contract lists the files they may touch and the ones they may not, so an agent that wanders gets caught by a check rather than by luck. Step 3 puts the tests in place before the code exists, which means the agent is working toward something a person already agreed is correct.
Risk decides how many steps run
Running all 14 steps on a typo would be silly, and people would start routing around the process. So every change falls into one of four risk tiers, and the tier decides the path. Four things never get skipped: a branch, a pull request, CI, and the checks that gate the merge.
| Tier | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Also |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 · Trivialtypo, copy, config | Merges on passing tests and AI review | ||||||||||||||
| 2 · Small bug fixknown, contained | One-line spec and a failing test that reproduces the bug | ||||||||||||||
| 3 · New featurenew behavior | A person approves the merge | ||||||||||||||
| 4 · High riskpatient data, Sally, access | Eval set with a pass bar, security check, feature flag, longer watch |
runs lighter version skipped
Tier 4 exists because of Sally, our patient-facing voice agent. Anything that changes what she says, what data she can reach, or who can do what runs the whole process plus an eval set with a pass bar, a security check and a longer watch. It’s the kind of eval that once caught Sally hanging up before she finished saying goodbye in 40% of runs. A single test pass would have missed it.
Tiers 1 and 2 are where the time savings come from. Small fixes merge on passing tests and an AI review, without waiting for a person. People spend their review time on features and on anything that touches patients.
Keeping agent work readable
The biggest risk with agent-written code isn’t that it’s wrong. It’s that nobody understands it six months later. A few rules keep that from happening:
- A person approves the design before code gets written.
- No pull request goes over 400 changed lines.
- The engineer who owns a change has to be able to explain all of it without the agent.
- If a reviewer makes the same comment twice, it becomes a rule in AGENTS.md or a lint check, so no agent makes that mistake again.
- Docs change in the same pull request as the code.
The fourth rule does the most work over time. Every review makes the next night’s agents a little better, and the rulebook grows from real mistakes rather than from guesses.
No staging, on purpose
We don’t have a staging environment, and with a team our size I’d rather not maintain one. Instead the checks it would have given us happen earlier and later. Migrations run against a production-shaped copy of the database filled with fake data. Tests and evals run in CI. Product signs off on a demo before the merge.
Production is where the remaining risk gets handled. Every deploy is tagged with its commit, every feature sits behind a flag, and the flag goes from 5% to 50% to 100% while someone watches error rate, latency and cost for a day. If something looks wrong, we turn the flag off or redeploy the last tag. Neither one needs a meeting.
What changed
The clearest example came the week of November 23. We hit a significant production bug. Using the factory’s bug-fix path (a one-line spec, a failing test that reproduced the bug, an agent fix, CI and review), it was diagnosed, fixed and released in about 37 minutes. A hotfix like that used to take three to four days.
That number comes from the process, not from anyone typing faster. The bug-fix path is short because it’s narrow: the failing test pins down the bug before anyone touches the code, so the fix has something concrete to pass.
Because the work runs overnight and all five applications sit in the same queue, we also work ahead. By the time a clinic asks for something on an app that’s still early, the groundwork is often already merged behind a flag.
The same pattern, at startup scale
Larger companies have built the same thing. Stripe’s Minions merge more than 1,300 pull requests a week with no human-written code. Spotify’s Honk is a background coding agent built on Claude’s Agent SDK. The shape is the same as the factory’s. Work comes in as tasks, agents run unattended in isolation, and deterministic checks plus human review decide what merges.
Ours runs at a fraction of their volume, but on the same parts. Growing it means adding agent workers and review capacity, not rebuilding it. Review is the part that limits you first. That’s why the risk tiers matter, and why the rulebook keeps turning repeated review comments into automated checks.
What I’d tell a founder
Don’t judge agents by how much code they write. Judge them by how much of their output you can merge without reading every line. Put the effort into the gates, not the prompts.
Let risk set the process. If a typo takes as long to ship as a new feature, people will start skipping steps, and they’ll pick the wrong ones to skip.
Turn every repeated review comment into a rule. That’s how the system gets better without anyone having to remember anything.