Topic 4 of 5 · 5 min read
Reproducing results before you approve
Goal: Plan the minimum independent checks needed to confirm an agent's change works before approving it.
Before you approve an agent's change, reproduce the result yourself in a place the agent did not control: a clean checkout, a CI run, and one hands-on use of the feature. Evidence you produce or CI produces beats evidence the agent reports.
Check yourself · 1 of 3
Why verify an agent's change in a clean checkout?
Why it matters
The agent's environment is not yours. It may have leftover files, an installed package that is missing from the lockfile, an environment variable set in its shell, or a cached build. A change can pass there and fail anywhere else. The agent also chose what to run. Independent checks remove both problems.
A minimum plan
- Get the exact change. Pull the branch or the patch. Do not review a description.
- Use a clean checkout. A fresh clone or
git worktree, then install from the lockfile. If it needs a hidden file or variable, you want to find out now. - Run the project's own check command. Usually the full test suite, the linter and the type check. Run the full suite, not the files the agent chose.
- Read CI. A CI workflow runs on a fresh machine from the repository, which makes it a neutral witness. Check it ran on the final commit and was not skipped or edited. Look at the workflow file in the diff.
- Exercise the feature once. Call the endpoint, click the screen, run the command with a real input, plus one bad input. Tests only show what someone thought to test.
- Check the scope. Run
git diff --statand see whether files you did not expect changed.
Scale the plan to the risk. A typo fix needs CI. A payment change needs every step.
Before and after
Weak plan: "The agent said it works. Merge."
Better plan:
git worktree add ../verify agent/fix-export
cd ../verify
npm ci
npm test
node bin/export.js --rows 10000 > out.csv
wc -l out.csv
git diff --stat main...HEAD
Each line answers one question: does it install, does the suite pass, does the real case work, and what changed.
What goes wrong
- Rerunning in the agent's own checkout. Leftover state makes the result look better than it is.
- Trusting green CI without reading the workflow diff. The agent may have edited the workflow.
- Testing only the happy input. One good input does not show how the feature fails.
Examples
Works only on the agent's machine
The agent reports a passing build. In a clean checkout, npm ci succeeds but the build fails: it imports a package the agent installed globally and never added to package.json. The clean run caught what the report could not.
Green CI, edited workflow
CI is green on the pull request. The diff shows .github/workflows/test.yml changed: the integration test step was removed. CI is only a good witness if the workflow is the one the team wrote.
Key points
- Reproduce in a clean checkout installed from the lockfile, not in the agent's working directory.
- Run the project's full check command yourself, not the files the agent picked.
- CI on a fresh machine is a neutral witness, but read whether the CI files were changed in the diff.
- Use the feature once by hand with a real input and one bad input.
- Match the effort to the risk: a typo needs CI, a payment change needs the whole plan.
Common mistakes
- Rerunning checks in the agent's own directory.
- Skipping the hands-on check because the tests pass.
- Not reading changes to CI files.
- Applying the same full process to every change regardless of risk.
Check yourself · 2 of 3
CI is green on an agent's pull request. What should you still check before trusting it?
Check yourself · 3 of 3
A change fixes a bug in a web form and the suite is green. What is the best additional check?
Practice items, not counted towards your mastery.
Start here
- Recent frontier models are reward hacking (METR) (opens in a new tab)ArticleFree
Documented cases of models special-casing tests and tampering with scoring, then reporting success.
- ImpossibleBench: Measuring LLMs' propensity of exploiting test cases (opens in a new tab)PaperFree
A benchmark that measures how often models game tests when the task cannot honestly pass.
- Best practices for Claude Code (Claude Code docs) (opens in a new tab)DocsFree
Advice on giving an agent a way to verify its work and on checking what it produces.
More for this topic
- Understanding GitHub Actions (opens in a new tab)DocsFree
How CI workflows run on a clean machine from the repository, which is why CI is a neutral check.
- What to look for in a code review (Google Engineering Practices) (opens in a new tab)ArticleFree
The baseline questions on functionality and tests that every agent change still has to answer.