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 clean, focused change
card 2 of 6
Why the agent leaves its scaffolding behind
builds on: Scope creep and unasked-for changes in a diff, What 'done' means for a change
The agent works by trial. It prints values to see them, tries one approach, keeps the old one just in case and writes a scratch script to check. Once tests turn green it stops, and nothing pushes it to tidy code that still passes. It writes the message from the diff, so it says *what* changed. The *why* is in your ticket or your head. **Later cost**: noisy logs, misleading code, a broken helper someone reuses, and history nobody can explain.
Terms on this card
- scratch script
- A throwaway file written to try something out. It is not part of the real change.
- later cost
- The concrete damage a shortcut does after merge, such as a hidden bug, data corruption or maintenance burden.
- the diff
- The change under review in unified diff format: '-' lines removed, '+' lines added, unprefixed lines are unchanged context.
- the agent
- The AI coding system doing the work: a chat assistant, IDE agent or terminal agent.
- diff
- The set of line changes between two versions of the code: removed lines start with '-', added lines with '+'.
Lesson goal: Recognise a mergeable change: one purpose per commit, no debug prints, commented-out code, dead helpers or stray files, it follows the codebase's conventions, and the commit message explains why the change was made. ·
the whole lesson