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.
Ask for a plan before code
card 4 of 6
Reading the assumptions line
builds on: Why agents fill gaps with plausible guesses
The agent's plan: *Files: `products/service.py`, `requirements.txt` (add `cachetools`). Approach: LRU cache around `get_product`. Assumptions: no cache exists; entries need no expiry.*
Tells: a new package suggests it never found your helper; "no expiry" contradicts the price rule. Your reply: *Use `app.cache.cached(ttl=60)`; prices may be at most 60 s stale; no new packages.* Two lines now instead of a rewrite later.
Terms on this card
- LRU cache
- Least-recently-used cache: holds up to a maximum number of entries and, when full, throws out the one used longest ago. Entries never expire on their own.
- cachetools
- A third-party Python package providing cache classes and a cached decorator.
- ttl
- Time to live: how long a cached entry stays valid before it must be fetched again.
- requirements.txt
- A file listing the Python packages a project installs; adding a line adds a new dependency.
- Tells
- Observable signs in a diff, transcript or summary that suggest a shortcut or an error.
Lesson goal: Have the agent explore and propose a plan, listing the files it will touch, its approach and its assumptions, before it edits anything. Correct wrong assumptions at the plan stage, where they are cheap to fix. ·
the whole lesson