Claude Code Workflows That Actually Ship Code (vs. Chat With Extra Steps)

Anand B · 2026-07-18

Forty-two autonomous Claude Code maintenance loops run against our monorepo on a schedule right now. Each tick wakes up, finds exactly one issue (a flaky test, a dead export, a docs page that contradicts the code), fixes it, and opens exactly one small pull request. None of these loops has a clever prompt. All of them live or die by the scaffolding around the prompt: a fresh checkout, a bounded task, and a merge gate that refuses anything unverified.

That system taught us an opinion we now hold firmly. The prompt is not the unit of Claude Code productivity; the workflow around it is. Small verifiable increments, isolation per task, and a hard merge gate beat any amount of prompt polish. Teams that run many small supervised claude code agents in parallel ship more working software than teams perfecting one prompt for a single serial session. If your claude code workflow is one long conversation in one terminal window, you have built chat with extra steps.

One finding, one fix, one PR

A single unreviewable 40-file pull request compared with five small verifiable increments
The same total change, two shapes. Only one of them gets read properly.

The rule that made our loops work is embarrassingly simple: each tick may address one finding, produce one fix, and open one PR. If the fix balloons mid-task, the agent aborts and files an issue instead of pressing on. That abort rule did more for us than any prompt engineering. An agent that keeps going past its scope produces a 40-file diff nobody wants to review; an agent that stops produces a paper trail a human can act on next tick.

Small increments also make verification cheap. Our gate runs typecheck, build, and an end-to-end check of the actual served behavior, not just the artifacts. This week that last step caught a real nginx redirect bug: the build was green, the container was healthy, and the page the server returned was wrong. The gate curls the live URL, so the bug never merged. Inside a thousand-line serial session, that redirect would have been one line in a pile of changes. As a one-fix PR, it was the only thing on the table.

Worktrees make parallelism boring

Parallel agents sound risky until you remove the shared mutable state. Every tick in our system runs in a fresh git worktree branched off the integration branch. No loop ever touches the main checkout, cleanup always runs even when a tick fails, and merges happen only when CI is green. That is the entire trick behind claude code parallel agents: the same isolation discipline you would demand from human teammates, applied mechanically.

Claude code worktrees are cheap enough that there is no reason to ration them. git worktree add ../repo-wt-task work/task takes about a second and gives each session its own working directory against the same object store. The failure mode people fear, two agents clobbering each other's edits, becomes structurally impossible rather than merely unlikely.

Two practical notes, since this is where setups usually break. A fresh worktree has no node_modules, .venv or .build, so the first action in a new tree is always the install step; skip it and you get a failure that looks like broken code and is really a missing dependency. And a tree that is never removed keeps its branch alive, so git worktree list growing without bound means your cleanup step is being skipped. The full mechanics, including the claim field that stops two agents taking the same task, are in our agent teams walkthrough.

We wanted to watch this happen instead of tailing logs, which is why we built SpeakCode, a macOS canvas where each terminal card is its own agent session. The product exists because supervising ten small tasks visually beats babysitting one terminal.

Scouts, executors, and duplicate-PR season

Our biggest workflow refinement splits finding from fixing. A cheap scout tick scans for issues and writes a fully specified plan into a JSON queue file, capped at three entries. A separate executor tick pops exactly one plan and applies it verbatim. If the code drifted since scouting, the executor drops the entry rather than improvising against a stale plan.

The cap exists because we got burned. Early on, executors lagged behind scouts, and five duplicate scout PRs piled up targeting the same fix. Queues need caps, and the scout must abort when the queue is full — an agent that cannot tell whether its work is already in flight will happily do that work six times.

The split also lets both halves run on smaller models: haiku for mechanical pattern work, sonnet where the change needs bounded judgment. Our heuristic is blunt. If a routine tick needs the biggest model available, the task is under-specified; shrink the unit of work instead of upgrading the model. That one habit improved our ai coding workflow more than every system-prompt tweak combined, and it cut per-tick cost enough that running 42 loops stopped being a budget conversation.

The case for the long session

The strongest counterargument deserves a fair hearing. Some work genuinely needs deep context: a gnarly refactor across an event-sourced core, a migration where step four depends on what you learned during step two — a long serial session holds the whole picture in one context window, while a swarm of small tasks fragments it. Supervision is not free either; reviewing fifteen small PRs costs attention that one focused pairing session does not.

That critique is right about exploration. When we do not yet know what the fix even is, we run exactly the long interactive session this post argues against, and it earns its keep. Prompt quality matters there, and context accumulates in ways no queue file can capture.

It is worth naming the cost, though, because a long session is not free. A conversation carries its whole history into every subsequent turn, so the token bill grows with the length of the session rather than the size of the change. That is the main reason running several agents costs what it does, and it is an argument for ending a session once exploration is finished rather than letting it drift into execution.

Curve showing the chance a diff is genuinely reviewed falling steeply as diff size grows
Review quality does not degrade gracefully with diff size. It falls off a cliff.

There is also a harder limit than tokens. Somewhere between a 100-line and a 1000-line diff, review stops being review and becomes skimming, and nobody announces the moment they crossed over. Small increments are not primarily about agent capability — they are about keeping diffs inside the range where a human is still actually reading. That ceiling, not compute, is what caps how many agents one person can usefully run: we find the honest number is 3 or 4.

But watch what happens the moment exploration ends. The output of a good long session is not merged code; it is a plan. The shipping still happens as small, isolated, verified increments, because that is the only shape a reviewer can trust and the only shape a merge gate can check. Exploration is a phase inside the workflow, not a replacement for it.

The merge gate is the whole point

Every loop PR gets reviewed like a teammate's PR. That sentence carries more weight than it appears to. It means agent output enters the same trust pipeline as human output: CI, human review, easy revert. A bad tick costs one small revert, not an archaeology dig through a mega-branch. Nobody has to trust the model. Everybody trusts the gate.

A gate running typecheck, build and a curl of the real URL before allowing a merge
Two of these three checks pass on code that is broken in production. The third is the one that matters.

Our gate is three checks in sequence: typecheck, build, then an end-to-end probe of the behavior the change claims to affect. The third check is the one teams skip, and it is the one that catches the bugs the first two cannot see, like that nginx redirect. If you are still on single-session basics, the getting-started tutorial covers the fundamentals; everything in this post layers on top of them.

The other half of a gate is being explicit about what it is not allowed to wave through. Gates are good at shape and useless at truth: a change can typecheck, build, serve a 200, and still be wrong in a way only a person notices. So every loop we run declares whether it may merge its own output. Mechanical fixes with a real test behind them do. Anything touching content, public copy, or security posture opens a PR and waits, because a linter cannot tell a confident falsehood from a fact. Write that rule into the loop definition rather than keeping it in your head, or it stops applying the first time someone else runs the loop.

Measure your claude code workflow by merged, verified increments per week, not by the brilliance of any single transcript. Cap the queue at three. Branch a worktree per task. Abort when the fix balloons. Curl the served page, not the build log. The teams shipping the most with claude code agents have unremarkable prompts and remarkable gates: their worst transcript still cannot break main.

All posts · SpeakCode