The absence of a Phase 0 grep is not a flaw of the agent. It's a flaw of the pilot who skipped the least expensive step in the whole chain.
Phase 0 — two minutes, one file
# Phase 0 — before any new component in an existing domain
DOMAIN="invoices" # the keyword of the project
find app/api/$DOMAIN/ lib/$DOMAIN/ \
-type f \( -name "*.ts" -o -name "*.tsx" \) | head -20
# If an expected pattern is nameable, check that it doesn't already exist
grep -rl "ExistingPattern\|RenderPdf\|exportPdf" app/ lib/
Two minutes, tops. The output fits on a screen. If an existing component handles the need, read it before proposing anything new. If nothing exists, you have proof you looked.
The measured cost of the shortcut is one dev-day. The component that should have been read fit in a single file with a telling name, in the directory right next door. Two minutes of find would have sufficed. The reverted day is what blind trust in the plausibility of a draft nobody connected to its neighborhood actually costs.
The metacognitive signal
When the agent re-read its own work in light of the existing component, it proposed to revert, not defend. That's a good signal — an agent that locks itself into its invented design would be far costlier than one that admits it missed existing code. But the good signal comes too late. The rule is to not get there in the first place.
The rule
Before any new format, template, or component in a domain already covered, Phase 0 grep, neighborhood read, verbalization of the existing. Otherwise, the next day, you revert.
Phase 0 grep checklist and audit script, pseudonymized:
github.com/michelfaure/rembrandt-samples/tree/main/one-day-thrown-away-rule