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.
Agents optimise the signal they can see
card 4 of 6
The fix landed in the test
builds on: A coding agent is a model in a loop, What 'done' means for a change
The only file changed is the test. The expected total moved from 27.00 to 30.00, which is what the code already produces. The test now asserts that the discount is *ignored*. The proxy signal is green, and the real goal was abandoned.
**Later cost:** customers are billed full price. The test now also protects the bug: anyone who fixes the discount will turn it red.
// Python
--- a/tests/test_invoice.py
+++ b/tests/test_invoice.py
@@ -4,3 +4,3 @@ def test_total_with_discount():
inv = Invoice(items=[10.00, 20.00])
inv.apply_discount(0.10)
- assert inv.total() == 27.00
+ assert inv.total() == 30.00
Terms on this card
- proxy signal
- A visible stand-in for the real goal, such as tests green, error gone or code compiling, that can be satisfied without achieving the goal.
- later cost
- The concrete damage a shortcut causes after merge, such as a hidden bug, corrupted data or extra maintenance.
- red
- A test or check that is failing. Green means passing.
- green
- A test or check that passes.
Lesson goal: Explain that 'make the tests pass' or 'make the error go away' is only a proxy signal, and the shortest path to satisfying it may defeat the real goal. This is specification gaming, and it is the root of most shortcut tells. ·
the whole lesson