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.
The agent knows only what its tools returned
card 4 of 6
Stale build, cut-off output (TypeScript)
builds on: A coding agent is a model in a loop, What the agent sees: its context
The agent fixed a date bug in `src/format.ts`, ran `node dist/cli.js 2024-02-29` and reported *'output is correct now'*. `dist/` is produced by `tsc`, which it never ran after the edit. So it executed the old code: a stale build. That output says nothing about the fix. Likewise `npm test 2>&1 | head -n 40`: 'no failures seen' covers only 40 lines. Better: `npx tsc && node dist/cli.js ...`, and test output read to its summary line.
Terms on this card
- stale build
- Compiled output (a jar, a dist folder, a binary) built before the latest source edit, so running it runs old code.
- tsc
- The TypeScript compiler. It turns `.ts` source into JavaScript, often written to a `dist/` folder.
- npx
- Command that runs a tool installed in the project's Node packages, such as `npx tsc`.
- npm test
- Runs the test command defined in the project's `package.json`, for example Jest.
- dist/
- A common output folder for compiled or bundled JavaScript. It only reflects source as of the last build.
Lesson goal: Explain that if the agent did not run the test, it has not seen it pass. Show how truncated output, the wrong working directory or a stale build can mislead it. Read a transcript to tell claims backed by tool output apart from unbacked assertions. ·
the whole lesson