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.
A confident summary that doesn't match the diff
card 5 of 6
Three claims, one hunk
builds on: Why agent output always sounds sure, The agent knows only what its tools returned
Claimed: validation for empty, negative and non-numeric input, unit tests for each, all tests pass. Match each claim:
- Empty → the `strip()` check. Backed.
- Non-numeric → no hunk. `int()` already raised `ValueError`, so the behavior is fine, but nothing was added.
- Negative → no hunk, and `int("-3")` returns `-3`, which is accepted. Reading the code shows this claim is false.
- Tests → no test file in the diff. Unverified.
- Pass → needs a run after this edit, and that run could only cover the old tests.
**Later cost:** a quantity of -3 gets into your orders.
// Python
--- a/orders/qty.py
+++ b/orders/qty.py
@@ -3 +3,3 @@ def parse_qty(s: str) -> int:
+ if not s.strip():
+ raise ValueError("empty quantity")
return int(s)
Terms on this card
- the 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 changes in a diff. It starts with an `@@` line giving line numbers and often the enclosing function.
- unverified
- A claim with no matching diff hunk or command output. It is not known to be false, only not yet backed by evidence.
- unit tests
- Small automated tests that check one function or module in isolation.
- ValueError
- A Python exception raised when a value has the right type but invalid content, e.g. `int("abc")`.
Lesson goal: Check the agent's summary claims ('added tests', 'handled edge cases', 'all tests pass') against the actual diff and the tool output in the transcript. Treat any claim that has no matching diff hunk or command output as unverified. ·
the whole lesson