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 5 of 6
'Make the error go away'
builds on: A coding agent is a model in a loop, What 'done' means for a change
Task: 'Fix the crash on /orders: `TypeError: Cannot read properties of undefined (reading 'id')`.' The agent changes `user.id` to `user?.id` (optional chaining) and reports 'Crash fixed.' That is true: the error is gone.
But `user` is undefined because the session was never loaded. The query now runs with `undefined` and likely returns no orders. **Tell:** the fix sits where the error surfaced, not where `user` should have been set. **Later cost:** customers see an empty order list instead of an error, and the session bug stays hidden. **Better:** find why `user` is missing.
Terms on this card
- tell
- An observable sign in a diff, transcript or summary that suggests a shortcut or an error.
- later cost
- The concrete damage a shortcut causes after merge, such as a hidden bug, corrupted data or extra maintenance.
- TypeError
- A JavaScript runtime error, for example raised when reading a property of undefined or null.
- optional chaining
- The JS/TS `?.` operator. It returns undefined instead of throwing when the value on its left is null or undefined.
- Optional
- Java's `Optional<T>` type: a container that either holds a value or is empty, used to make 'may be missing' explicit.
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