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 5 of 6
The 240-line diff, walked through
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. The task is one line; the diff is 240, so expect noise.
2. Tests: no new test, and one assertion is loosened (next card).
3. Unrelated: 6 files reformatted and a logging level changed in config. Ask for a revert.
4. Summary: 'added tests' has no hunk; 'all tests pass' has no `pytest` output.
5. You restore the assertion and run `pytest tests/test_pages.py`: green.
Decision: **request changes**, giving those reasons.
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.
- assertion
- A line in a test that checks a condition, such as an exact expected value, and fails the test if the condition is false.
- logging level
- A setting that controls which log messages a program records, for example only errors, or also detailed debug output.
- pytest
- The common Python test runner. `pytest path/to/file.py` runs the tests in that file and reports passes and failures.
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