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.
Fine on test data, broken at scale
card 1 of 6
Green on three rows, down at 200,000
builds on: What the agent cannot see
You asked the agent for an endpoint that lists orders with customer names. It came back in minutes with clean code, and the tests are green against a fixture of three orders. Two weeks after release, the page takes 40 seconds and database CPU sits at 100%. A nightly job that reuses the same loop gets killed for running out of memory. Nothing in the diff looked wrong. What did you miss?
Terms on this card
- fixture
- Prepared test data loaded before a test runs.
- 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.
- endpoint
- A URL plus method (such as GET /items) that a web API answers requests on.
- diff
- The set of line changes between two versions of the code: removed lines start with '-', added lines with '+'.
Lesson goal: Recognise code that passes small tests but fails on production volumes: N+1 queries from ORM calls inside loops, unbounded queries with no pagination, reading whole files or tables into memory, quadratic list lookups in loops, and regexes prone to catastrophic backtracking. Explain why the agent cannot see this coming, and which check (query log, profile, large fixture) exposes it. ·
the whole lesson