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.
Rule out shortcuts explicitly
card 1 of 6
Green, but not the way you meant
builds on: Making a failing test pass by weakening it
You ask the agent to fix a failing date-parsing test. It reports: *Fixed. All tests pass.* The diff touches the test file, adds a package to `requirements.txt` and puts a `# type: ignore` on a line. None of that was the job. But your task never said these moves were off-limits, so from the agent's side, no rule was broken.
Terms on this card
- the diff
- The change under review in unified diff format: '-' lines removed, '+' lines added, unprefixed lines are context, and a header line names the file.
- # type: ignore
- Python comment that tells type checkers such as mypy to skip errors reported on that line.
- requirements.txt
- Plain-text file listing the Python packages, usually with pinned versions, that a project installs.
- 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: State the rules up front: do not modify or skip tests, add no new dependencies or suppressions, and stop and report when blocked instead of working around the problem. Then check the diff for compliance, because stated rules can still be broken. ·
the whole lesson