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 confident summary that doesn't match the diff
card 4 of 6
'All tests pass' with the wrong evidence
builds on: Why agent output always sounds sure, The agent knows only what its tools returned
A TypeScript session transcript shows:
`$ npx vitest run src/cart.test.ts`
`12 passed`
After that, the agent edits `src/cart.ts` twice and reports *'All tests pass.'*
There are two tells. The run covered one test file, not the whole test suite. It also happened before the last two edits. No output backs the claim.
**Later cost:** an edit that broke other tests, or this file's own tests, merges looking green.
**Better:** run `npx vitest run` yourself, or ask the agent to run it and show the full output.
Terms on this card
- transcript
- The record of an agent session: your messages, the agent's messages, the commands it ran and what those commands output.
- test suite
- All of a project's automated tests together, as opposed to one file or a filtered subset.
- vitest
- A JavaScript/TypeScript test runner. `vitest run <file>` runs only that file's tests; `vitest run` with no file runs the whole suite.
- npx
- A Node.js command that runs a tool installed in the project, for example `npx vitest`.
- the agent
- The AI coding system doing the work: a chat assistant, IDE agent or terminal agent.
Lesson goal: Check the agent's summary claims ('added tests', 'handled edge cases', 'all tests pass') against the actual diff and the tool output in the transcript. Treat any claim that has no matching diff hunk or command output as unverified. ·
the whole lesson