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.
Scope creep and unasked-for changes in a diff
card 3 of 6
Every hunk must trace to the task
builds on: You own every line the agent writes
Check each hunk against the request. Any hunk the task doesn't need is a tell. Common tells and their later cost:
- **Reformatting or re-sorted imports**: hide the fix in noise. Blame history credits those lines to this commit. Teammates editing the same lines can hit merge conflicts.
- **Renames**: break callers the diff doesn't show.
- **Moved code, new classes or helpers**: more to maintain. Moved code shows as delete-plus-add, so an edit inside it slips past review.
- **Config edits**: change behaviour for every file or every environment.
- **Dependency or lockfile changes**: unreviewed code ships to production.
Tools that help: `git diff --stat` and `git diff -w`.
Terms on this card
- hunk
- One contiguous block of changed lines in a diff, with a few context lines around it.
- lockfile
- A generated file (e.g. package-lock.json, Cargo.lock) recording the exact version of every dependency installed.
- blame history
- What `git blame` shows: which commit last changed each line. Reformatting makes unrelated lines point at the reformatting commit instead of the one that wrote the logic.
- merge conflicts
- When two branches change the same lines differently, git cannot combine them automatically and a person must resolve them by hand.
- `git diff --stat`
- Shows only which files changed and how many lines each, so you spot files outside the task quickly.
Lesson goal: Recognise drive-by reformatting, renames, refactors, new abstractions, config tweaks and dependency bumps mixed into the requested change. Explain how they hide the real change, raise risk and make review and revert harder. ·
the whole lesson