Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Review an agent diff fast and well
card 3 of 6
The five-step pass
builds on: Triage a diff: where to look first, A confident summary that doesn't match the diff, Verify by running, not by reading claims
1. **Task vs diff**: reread the task, compare its size to the diff's size, and flag risky files (tests, config, CI, dependencies, error paths, security).
2. **Tests first**: look for deleted, skipped or loosened assertions. Could each new test fail without the fix?
3. **Unrelated hunks**: list them.
4. **Summary**: match each claim to a hunk or to command output.
5. **Decisive check**: run the one check that fails if the fix is wrong.
Terms on this card
- diff
- The change under review in unified diff format: '-' lines are removed, '+' lines are added, unprefixed lines are unchanged context.
- hunk
- One contiguous block of changed lines in a diff, with its surrounding context.
- CI
- Continuous integration: the automated server-side build and test run on every push or pull request.
- decisive check
- The single run whose result would differ if the fix were wrong. Usually it is the original failing scenario, rerun on the changed code.
- the diff
- The change under review in unified diff format: '-' lines removed, '+' lines added, unprefixed lines are unchanged context.
Lesson goal: Review an agent diff in minutes. Triage by risk, read the test changes first, separate unrelated changes, reconcile the summary with the diff and run the decisive check yourself. End with a clear accept, change or reject decision and the reasons for it. ·
the whole lesson