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.
When to stop, reset or take over
card 5 of 6
The diff after three attempts
builds on: Long sessions: lost instructions and drift, Patching the symptom instead of the cause
`as any` alone already silences the type error. So the `@ts-ignore` above it is a leftover from an earlier attempt: two silencers on one line mean attempts were stacked, not replaced. `if (!d) continue` drops every row whose date fails to parse. Later cost: report totals quietly missing rows, and the `string | number` mismatch from the loader still unresolved for every caller. This is the moment to revert, not to ask for attempt four.
// TypeScript
--- a/src/report.ts
+++ b/src/report.ts
@@ -20,4 +20,6 @@ export function rows(
for (const r of data) {
- const d = parseDate(r.date);
+ // @ts-ignore
+ const d = parseDate(r.date as any);
+ if (!d) continue;
out.push(fmt(d, r.amount));
}
Terms on this card
- Later cost
- The concrete damage a shortcut does after merge: a hidden bug, silent data corruption or a maintenance burden.
- the diff
- The change under review in unified format: '-' lines removed, '+' lines added, unprefixed lines are context, with a header naming the file.
- as any
- TypeScript cast that turns off type checking for that expression, so any type error there disappears.
- @ts-ignore
- TypeScript comment that hides every type error on the next line.
- type error
- An error reported by a type checker or compiler when a value's type doesn't match what the code requires.
Lesson goal: Recognise a session going bad: the agent repeats a failed fix, the diff keeps growing, suppressions pile up or it contradicts itself. Then revert to a clean commit, start a fresh session with a distilled summary, or do the change yourself. ·
the whole lesson