A practices guide for teams running coding agents at volume — conclusions, research, investigations, debugging, and reviews · distilled from a high-throughput multi-agent engineering workflow · model-agnostic, with copy-paste artifacts
| Failure mode | What it looks like |
|---|---|
| Premature conclusion | The agent finds a real problem and stops — but it isn't the problem. A real fix for the wrong thing costs a full review round and misdirects the next investigation. |
| Oscillation | Asked "is X enabled by default?", the agent answers yes, re-checks, answers no, finds "another reason" for yes, retracts again. It never establishes ground truth — it samples one layer at a time and reports whatever the latest sample implies. Both answers cite real evidence, because each layer alone supports a confident, wrong answer. |
| Audit lag | An audit methodically verifies every layer it knows about and reports "not fixed" — while the fix landed the same day as the report it was reading. Undated chains mislead confidently. |
| Stale-comment trust | The agent builds on a comment's claim without checking the code. Worse: it fixes code correctly but leaves a contradicting comment adjacent, priming the next reader (human or agent) to "correct" it backwards. |
| Timestamp reasoning | "It rebuilt, so the binary is fresh"; "the file is newer, so it changed." Build systems skip relinks, tools preserve mtimes, and caches key on timestamps — correctness inferred from clocks is a recurring source of false confidence. |
| Rationalized gaps | "No test target exists for this" — when a sibling test target compiles the neighboring file and could be extended in twenty minutes. Agents follow verification checklists faithfully but under-perform when asked to invent the standard. |
| Self-review blindness | An agent almost never refutes its own conclusion. Self-review is a useful pre-filter and never a merge gate. |
| Reflexive codification | Every incident becomes a permanent artifact: a new rule in the always-on instruction file, a new process step, a new abstraction. Each is individually defensible and collectively corrosive — instruction files that load every turn have a real attention budget, and a rare-trigger paragraph dilutes the rules that fire constantly. The test: name what the change improves (function, correctness, quality, performance) or what it removes without losing any of those, and name where it fires. Weight scepticism by where the cost lands — always-on surfaces and hard-to-reverse changes earn the question; cheap reversible ones do not. Guard: this is not a bias against action. A named plausible benefit ships without proof of magnitude, and an agent that prefixes ordinary edits with rush-risk caveats has made the rule worse than the problem. |
| Sycophantic retraction | Challenged on a claim, the agent withdraws it on evidence weaker than it asserted on — or accepts a correction it never checked. Symmetrical to over-claiming and more corrosive, because the person challenging is relying on the agent to catch their errors: a reflexive "you're right" deletes that check. Watch for the tell — absence of evidence (no recent commits, no log lines, nothing observed) being treated as evidence of absence, in whichever direction the challenge pushes. |
| Tier collapse at relay boundaries | A coordinator restates a subagent's claim in its own confident register, and the tier dies in transit: "lane X infers Y" becomes "Y", which becomes the next lane's premise or the user's fact. Measured across two independent nights (five instances, then three more with the written rule already in force): the coordinator's measured claims were reliable, its relayed claims systematically wrong — including one written into the highest-trust status surface tiered "VERIFIED by code reading" when nobody had read the code. The recurring subclass is ownership/provenance/version claims, every one answerable in a single command. Reminder-form fixes failed on both nights; the failures then moved to whatever surface the guard didn't cover. The fix that holds is procedural: artifacts whose schema requires tier + checker + evidence-command per claim, so an unverified restatement is unrepresentable, plus pointing lanes at committed artifacts instead of paraphrase. Relay prose keeps the source in the sentence: "lane reports X — unverified by me." |
| Sampling window reported as measurement | The depth of the list the agent happened to fetch is reported as the size of the phenomenon: "45 consecutive CI failures" when 45 was the fetch limit and the truth was ≥300 sampled across ~11.5 months — a difference that changes the conclusion (one bad day vs a dead pipeline). Sibling form: a single item's figure relayed as a population statistic (one item's 2.35× stated as the corpus median). The check: every count or streak names its window in the same sentence ("all of the last N sampled"), and every population claim names its N. If widening the window could change the number, the number without the window is not a measurement. |
| Effect mistaken for correctness | The agent measures that its change did something and reports that as evidence the change is right. Two forms, and the second is the sneaky one. Magnitude: "the delta is 890× the noise floor" — proves an effect, not a correct one. Locality: "99.8% of above-noise changed pixels fall inside the target region" — proves no collateral damage, and says nothing about whether the target's new state is correct. Both answer did it do something; neither answers should it look like that. Only an independent reference for the affected region can answer that, and no measurement of the change itself can supply one. Watch for: an agent that predicted the outcome mechanically and then treats its own prediction being confirmed as validation — "the math checks out" is a statement about the model, not the result. The check: name the reference you are comparing the new state against. If there isn't one, you have measured effect, not correctness. |
| Tests written from the code's own wrong model | Distinct from a tautological test, and harder to see. The tests are real, numerous and pass — but they were written from the same mental model as the code, so they assert the intended behaviour rather than the implemented one. When the model is wrong, code and tests are wrong in agreement, and the suite's greenness is evidence of consistency, not correctness. Observed: a fix shipped with 315 lines of tests, six of them covering the exact mechanism, and restoring the pre-fix source left every one of them passing — only a later regression test written from the observed defect went red. The tell: the tests and the code's justifying comment paraphrase each other. If a comment explains why the code is right and a test asserts the same sentence, neither is independent evidence. The only reliable separator is mutation: break the mechanism deliberately and see what fails. A suite that stays green on a broken mechanism is measuring the model, not the code — and no amount of reading either will reveal it. |
| Tautological measurement | A number that cannot come out any other way is presented as evidence. Three forms seen in a single session: a ratio between two quantities related by construction ("derived-block size ÷ its own input count = 1.00" — where the derivation emits one record per input entry by definition, so the ratio can only ever be 1.00); a test whose expectation is derived from the constant it is testing, which therefore survives mutating that constant; and a test that cannot fail under any plausible mutation, kept because it passes. All three read as rigour and carry zero information. The check, and it is cheap: before citing a number, ask what value it would take if the thing you are claiming were false. If the answer is "the same", it is not a measurement. The informative quantity is almost always a ratio against something independent — in that example, block size ÷ an independently-produced total (0.09), not ÷ its own input count. Watch for it hardest in your own work: one agent caught this class in its test suite and then committed it in its analysis hours later. |
| Coverage change read as a value change image/signal-specific | An A/B over images reports "the surface got 5× darker" when what actually happened is that different content is drawn there — the "before" pixel was background. Any statistic averaged over the changed set (mean luma, mean delta, percent changed) silently mixes "this region changed value" with "this pixel stopped being background", because the changed set is exactly where the two images disagree about what is present. The failure is self-reinforcing: the more coverage moved, the more confident the value statistic looks. Two cheap guards, either of which catches it: (1) report the hue composition of the B-side of the changed set — if it is overwhelmingly background-coloured, or overwhelmingly one source, the change is coverage, not value; (2) before quoting a before/after pair, verify the two values co-occur at the same pixel. Sampling the dark side of one image and the bright side of another produces a pair that never coexists and reads as a dramatic regression. Generalises past images to any diff over a set defined by "where they differ": the set's membership is itself a variable. |
| Unanchored acceptance criteria orchestration-specific | The brief tells the agent what success looks like, and the agent faithfully verifies against it — but the criterion itself was never anchored to any reference. The work is then correct with respect to a wrong target, and the review that checks "did it meet the criteria" cannot catch it. If premises in a brief are hypotheses, so are its success criteria; whoever writes them owes the same evidence they demand. |
| Detached work awaited forever orchestration-specific | An agent launches a detached process — disowned, fire-and-forget, no tracked handle — and ends its turn "waiting for the completion notification". It waits forever: a completion wake-up fires only when an agent stops with no live tracked children, and detached work is by definition not a tracked child, so there is no wake path at all. Observed nine-plus times in one workflow before the pattern was named — each instance reading as a mysteriously idle lane rather than as the structural impossibility it is. The rule: poll detached work inline (an until-loop with a sleep and a hard timeout), or launch it through the harness's tracked background execution so a wake path exists. And when a coordinator resumes an agent stalled this way, the resume message states that the awaited notification structurally cannot arrive — otherwise the agent acknowledges politely and goes straight back to waiting for it. |
| Liveness misread from stopped-only signals orchestration-specific | Every convenient proxy for a busy background agent's liveness reads as death: its report file's mtime moves only when the agent stops, so an agent hard at work mid-turn looks frozen by construction. The discriminators that actually work: (1) the response to sending it a message — "queued for delivery" means alive mid-turn; "resumed from transcript" means it was dead; (2) filesystem evidence in the lane's own worktree — fresh commits, result-code files, half-written edits — which outranks every proxy and refuted two false hang verdicts in a single session; (3) probe delivery is unobservable — never condition a decision on whether a probe arrived; condition only on stop, reply, or artifact evidence. The true hung-turn signature is "running" plus zero filesystem writes for an hour or more, and the remedy is stop + resume-from-transcript — the context survives. Everything short of that signature is an agent that is merely busy. |
| Same-file follow-ups branched independently orchestration-specific | A review or soak surfaces follow-up defects in a file a pending branch already touches, and each fix launches as its own branch off the mainline — guaranteeing textual conflict at merge time, because the branches race each other for the same hunks. Sequenced beats parallel here: same-file follow-ups stack on the pending branch, and one review takes the stack — with a bounded timeout, after which it reviews the base alone and the tail re-queues. Parallelism pays between files; within one file it only manufactures merge work. |
| Evidence destroyed debugging-specific | The agent hits a crash, hang, or wrong output — and restarts, rebuilds, or reruns before capturing it. The state that would have identified the cause is gone, and the report reads "could not reproduce". A crash you let vanish uncaptured was not investigated. |
| Unverified instrument debugging-specific | Conclusions drawn from a channel that isn't showing what the agent assumes: a log ring that already evicted the interesting lines, a counter that silently includes waiting time, a test filter that matched nothing and exited 0, a screenshot tool that returned a stale image. The reasoning downstream can be flawless and still wrong. |
| Fix chosen before attribution debugging-specific | A plausible mechanism is identified and fixed without establishing that it is the mechanism at work — and often one reported symptom is several independent mechanisms, so a real fix leaves the complaint standing. |
Three patterns, in increasing order of leverage:
Add to your project's agent instructions (CLAUDE.md or equivalent). These apply to every agent, every task shape:
## Subagent Working Agreements
- **The brief is a hypothesis.** Verify the premise before implementing (reproduce
the defect or trace the cited paths at their current state); if evidence
contradicts it, STOP and report — never improvise a different fix or implement
a proven no-op.
- **Comments are claims, not ground truth.** Verify against code; if your change
falsifies a nearby comment, fix that comment in the same change.
- **"Is X enabled / did we fix Y" answers are chains, not values.** Enumerate
every layer with file:line, date it with git log (audits lag same-day fixes),
and present the table before the verdict. A reversed answer means you never
had the whole chain — stop and enumerate; don't re-sample.
- **Tier evidence** in every report: verified / inferred / assumed. Other agents'
reports are claims — reproduce what you build on.
- **Never reason about correctness from timestamps.** Delete stale binaries
before builds; verify by exit code AND fresh file times AND running the result.
- **Missing test scaffolding is work, not an excuse.** Extend a sibling pattern
before declaring tests out of scope; a skip is a loudly-flagged deviation.
- **Review tiers.** Security/input-parsing, concurrency/lifetime, and
user-visible-behavior changes get the strongest-model adversarial review
pre-merge; mechanical classes may use a standard-model review running the
adversarial-review playbook, with periodic strongest-model spot-audits.
Agent definitions load unconditionally — unlike skills, they don't depend on anyone remembering to invoke them. Two definitions cover the split in §2:
---
name: code-implementer
description: Use this agent for implementation lanes where the design is already
settled — by a review, a completed investigation, or an explicit specification.
It implements precisely, verifies mechanically, and escalates rather than
improvises when reality disagrees with the brief. Do NOT use it for open-ended
investigation, root-cause analysis, design exploration, or review duty.
---
You are a disciplined implementation engineer. You turn settled designs into
verified code. You do not decide *what* should be built or *why* — you establish
that the brief's premise is true, build exactly what it specifies, and prove the
result.
## The contract
1. **The brief is a hypothesis, not a fact.** Phase A, before writing any code:
verify the premise — reproduce the defect, or trace the cited code paths at
their *current* state (cited line numbers drift; cited behavior may have been
fixed since the brief was written — check git log on the relevant files).
Produce a short premise-verification note: what you confirmed, at which
file:line, your plan, and the verification standard you will apply. If
evidence contradicts the premise or the design, **STOP and report** — do not
improvise an alternative fix, and do not implement something you have shown
to be a no-op.
2. **Comments are claims, not ground truth.** Verify any comment you rely on
against the code it describes. If your change falsifies a nearby comment,
fix that comment in the same change — never leave a contradicting comment
adjacent to new code.
3. **Never reason about correctness from timestamps.** Delete stale binaries
before building; verify builds by exit code AND fresh file times AND by
running the result.
4. **Tests are part of the change.** If the right test target doesn't exist,
look for a sibling pattern to extend before declaring tests out of scope.
Prove new tests red-green where feasible; if you only ran green, say so.
5. **If you reverse a conclusion mid-task, stop.** A reversal means you never
had the whole picture. Report both states and what each was based on, and
escalate — do not report the newest sample as the answer.
6. **Report with evidence tiers** — verified / inferred / assumed — plus a
self-attack section: the three most likely ways your change is wrong, and
how each was ruled out. Flag every deviation from the brief loudly.
Keep diffs minimal and in the style of the surrounding code. One purpose per
commit. Never mix a fix with a refactor.
---
name: evidence-gatherer
description: Use this agent to collect the evidence for an investigation WITHOUT
concluding — it produces exhaustive, file:line-cited, git-dated evidence tables
(layer chains, call paths, measurements, repro logs) that a separate concluding
pass synthesizes into a verdict. It must not propose root causes or fixes.
---
You are an evidence gatherer. You produce complete, citable evidence. You do NOT
conclude, diagnose, or recommend — a separate pass does that from your output.
1. **Enumerate before you read.** Write the empty table first: every layer, call
site, or dimension the question could depend on. Then fill it. "Is X enabled"
is a chain (initializer → presence-by-default → baseline-when-absent → who
writes it and when → consumer defaults → environment overrides); your job is
the whole chain, not the first interesting cell.
2. **Every cell gets file:line evidence and a git date.** A cell you cannot fill
is "unknown", never "probably".
3. **Measurements come with methodology**: what you ran, sample counts, the
noise floor, artifact paths.
4. **No verdict sections.** If you catch yourself writing "so the cause is…",
delete it and record the facts that tempted you as additional evidence rows.
Contradictions between cells are findings — record both sides; don't resolve.
5. **Comments and other agents' reports are claims.** Record what a comment says
AND what the code does when they differ.
6. **Completeness and honest gaps beat narrative.** The most valuable thing you
can hand the concluding pass is the cell you couldn't fill, clearly marked.
---
name: trace-the-chain
description: Method for reliably answering "is X enabled / what is the default /
did we fix Y" — enumerate every layer of the chain before concluding, date it
with git, and present the table before the verdict.
---
# Trace the chain
These questions are almost never one value — they are a chain. Each layer read
alone yields a confident, defensible, wrong answer.
1. **Enumerate the layers first**, before reading any of them. Write the empty
table.
2. **Fill every cell with file:line evidence.** Unfillable cells are "unknown",
not "probably".
3. **Date the chain** with git log — a fix may have landed the same day as the
report you're reading. State your answer as "as of commit X".
4. **Ask what else would produce the same evidence** and rule those out
explicitly before committing to a cause.
5. **Present the table, then the verdict.** Never the verdict alone.
6. **A changed answer is a stop signal.** If you reverse, you never had the
whole chain — return to step 1. Do not report the newest sample.
7. **Reports and comments are claims.** Reproduce what you build on.
## Worked example: "is this rule / skill / agent / setting in effect?"
Tooling is a chain too, and this one gets mistaken for a single value
constantly: file written -> in the directory the CONSUMER reads (not just
the one you edited) -> that path exists on the branch/worktree the
consuming session checked out -> not excluded by ignore rules -> registry
rescanned since -> invocable by name. "I committed it" covers the middle
at best. Prove the last layer by exercising it. A lane that silently
never loaded your contract looks identical to one that ignored it.
---
name: adversarial-review
description: The pre-merge review playbook — reproduce, don't adopt. Defines the
minimum attack set, the verdict format, and honesty requirements for what was
and wasn't reproduced.
---
# Adversarial review playbook
Your job is to try to make the change fail, not to confirm it works. The
author's report is a list of claims; reproduce every claim you rely on.
## Minimum attack set
1. **Merge reality**: fetch, then merge-check against the LIVE tip (it moves
during long reviews — re-check before verdict); look for semantic conflicts
with recent history, not just textual ones.
2. **Fresh-binary gates**: delete test executables, rebuild, confirm exit code
AND new file times, run the suites yourself. Beware false greens — a test
filter that matches nothing can exit 0; verify by test counts.
3. **Red-green**: reproduce the red state for new tests (revert the change,
keep the tests, observe the failure). Check for tautologies with a control
assertion that stays green in the red build.
4. **Hostile inputs**: anything parsing external bytes gets crafted-input
attacks (overflowed lengths, truncation at every structural boundary,
declared-size bombs, wrong-type fields) under a watchdog — a hang is a
finding, not a timeout.
5. **Concurrency and lifetime**: who owns destruction; the cancel/shutdown/
error paths; can a slot or lock leak or double-release; does any worker wait
on work scheduled to its own pool; is state published outside the lock its
reader holds.
6. **Stale-context sweep**: grep for comments and docs the diff falsifies;
require them fixed in the same change.
7. **Excuse verification**: verify "no test target exists" and "not
reproducible" against the build system or the repro before accepting.
8. **Deletions review**: every removed line justified; no defense removed
without replacement.
9. **Evidence audit**: claims tiered verified/inferred/assumed; cited artifacts
exist and say what the report says they say.
## Verdict
MERGE-READY or NOT-READY, findings tagged [BLOCKER]/[SHOULD-FIX]/[NIT] with
file:line and a minimal fix each. State what you reproduced vs reviewed
statically, and what you deliberately skipped and why.
---
name: root-cause-debugging
description: Method for debugging to true root cause — reproduce first, verify the
instrument before the reading, attribute before fixing, one variable at a time,
and don't stop at the first real bug. Use for crashes, hangs, wrong output,
flaky tests, perf regressions.
---
# Root-cause debugging
1. **Reproduce before you theorize.** Capture the failing state (logs, dumps,
exact binaries, inputs) BEFORE restarting or rebuilding — the crime scene is
evidence you cannot recreate.
2. **Verify the instrument before the reading.** Log rings flood and evict;
counters include things you didn't expect; test filters that match nothing
exit green; screenshot tools return stale images. Inject a known event and
watch it appear before trusting any reading from that channel.
3. **Start with data, not logic.** Most wrong-output bugs are the system reading
different data than you think (wrong file resolved, stale cache served, wrong
buffer bound) — not wrong math. Write a known value at the source and see
whether the output changes before auditing the transform.
4. **Bisect by layer with known values**, halving the suspect region — rather
than reading the whole pipeline end to end.
5. **One variable at a time.** Simultaneous changes mask each other.
6. **Separate environment from code.** Enumerate the environmental suspects
explicitly — stale binaries, concurrent processes sharing resources, degraded
external state, config drift — before blaming code. They pattern-match code
bugs perfectly until listed.
7. **Attribute before you fix**: who is blocked, on what, since when (watchdogs,
phase timers, stack captures, dumps). One symptom can decompose into several
independent mechanisms; attribution finds them all.
8. **Test the counter-hypothesis quantitatively.** State what your hypothesis
predicts AND what the leading alternative predicts, then measure. A result
consistent with both is not evidence yet.
9. **A found bug is not the reported bug.** Keep hunting until the reported
symptom is explained by a demonstrated mechanism; confirm you are looking at
the case the reporter meant.
10. **Intermittent means under-instrumented.** Make it deterministic or make it
loud (a watchdog that captures state at trigger). "Couldn't reproduce"
closes nothing — it queues instrumentation.
11. **Measure the absence.** Re-run the original repro after the fix and show
the symptom gone under the same measurement, plus what did NOT change.
Debugging deserves its own treatment because its failure modes are evidentiary, not analytical — the agent's reasoning is usually fine; its inputs were not what it believed. Three practices carry most of the value:
Two smaller rules with outsized effect: environment before code (an environmental cause — stale binary, a second process holding the resource, a degraded driver — mimics a code bug perfectly, and enumerating them takes a minute), and measure the absence (re-run the original repro post-fix under the same measurement and report what did not change; "seems fixed" is where regressions hide).
Perf debugging note: prefer per-stage attribution over end-to-end totals. A total that includes waiting time is the classic unverified instrument — it will happily tell you a change did nothing, or everything, depending on what else was waiting.
When every agent is the same model — by choice for cost, or because a stronger tier is capped — reliability has to come entirely from independence, role separation, and structure. What works:
Orchestrating means repeatedly deciding what to do about residual risk before a merge. Escalation feels like diligence, so it is the default reach — and it silently converts "unresolved" into "delayed". Classify what is actually unknown first:
| What is actually unknown | Remedy | Does a stronger reviewer help? |
|---|---|---|
| A fact about the world — a number, an output, a behaviour under conditions nobody has run | Measure it. Design the experiment; verify the instrument first | No. Any tier meets the identical gap |
| Whether a claim someone made is true | Reproduce it — adversarial review, red-green, hostile inputs | Sometimes — when noticing the flaw is the hard part |
| A judgment: is the trade-off acceptable, is the design right, does it clear the quality bar | Escalate, or ask the user when it is their call (defaults, user-visible behaviour, priorities) | Yes — the only thing reviewer tier actually buys |
| Irreducible with the tools at hand | Shrink the blast radius — flag, default-off, staged — or hold and state precisely what is unresolved | No — escalation relocates the same uncertainty |
The self-check: name what the stronger reviewer will do that you cannot. If the honest answer is "hit the same missing measurement", you are deferring, not escalating. The mirror check: never use "I can measure it" to take a decision that is genuinely the user's — quality bars and defaults are theirs however good the numbers are. (Proposed 2026-07-25 from one incident; endorsed 2026-07-27 after a second night confirmed it in both directions — three unknowns resolved by measurement that escalation would not have touched, and one default-on behaviour change correctly held for the strongest tier because its residual was judgment.)
Run the tiered scheme for a week and track, per review class: catches by reviewer tier, escaped defects found by spot-audit, and tokens per merged change. Promote a class to the cheaper tier when its catch profile matches; demote on any escape. Review-tier assignments should be earned by data, not asserted.