Stop Your AI Coding Agent From Rewriting Your Whole Repo
Description and use
A disciplined agent guided by AGENTS.md limits changes to the minimum necessary, avoids unwanted refactors and dependency bumps, and delivers a verifiable report.
Problem
AI coding agents often rewrite large portions of a repository when asked to fix a single bug, leading to unnecessary changes, dependency bumps, and duplicated code.
Outcome
The disciplined agent produced a minimal diff, avoided unnecessary refactors, and provided a verifiable report, enabling quick review and preventing accidental repository changes.
Workflow
- 1. Create AGENTS.md in repo root. 2. If tool doesn’t read it, add adapter pointer from adapters/ folder. 3. Optionally copy templates/AGENTS.project.template.md to AGENTS.project.md and fill build/test commands. 4. Ask AI to "fix the login button". 5. AI searches for existing code, posts a short plan with before/after visualization. 6. AI touches only the lines needed, updates affected docs, and reports verification. 7. Review the small diff and concise report within two minutes.
Evidence
The diff comes back with 14 changed files. Variables were renamed, imports reordered, a dependency was bumped "while it was there", and a helper you already had was rewritten from scratch.
When uncertain, do less, not more.
The result is a small diff you can review in two minutes.
The new sections only add to the original rules. Sections 1–26 keep their numbering and purpose.
- Record date: 2026-10-08T00:41:12.565Z