If AI coding is lowering your code quality, you're not managing quality right
TL;DR Highlight
Seven layers of defense cut bugs while output rose 2-3x with coding agents
Who Should Read
Backend or full-stack developers worried that adopting coding agents will raise their team's bug count
Core Mechanics
- Have AI review requirements first
- After adopting spec-driven development, bugs in newly written code reportedly dropped sharply.
- Before that, up to a third of a feature's effort went to post-development bug fixing.
- The key step is having AI find gaps, edge cases, and conflicts with existing code in the requirements or tech design.
- Tests first, implementation second
- Have the agent think through test scenarios from the requirements first.
- Then write tests, write the implementation, run the tests and fix issues, and backfill coverage gaps.
- This avoids tests that merely pass on bugs the agent just introduced.
- Manual testing is not replaced
- Human testing of edge cases saw only modest productivity gains.
- That is why output rose 2-3x rather than 10x.
- E2E tests are only a rough check and don't replace manual testing.
- Split quality checks into separate passes
- The author finds agents poor at following complex instructions in AGENTS.md or CLAUDE.md.
Community Reactions
- Opinion that tests end up mirroring the implementation
- One commenter suggested running two sub-agents in parallel for tests and implementation so neither pollutes the other's context.
- Skepticism about coverage numbers
- A commenter argued that 95%+ coverage says nothing about the solution itself.
- Another recommended a functional core, imperative shell design instead.
- Experience applying it to legacy code
- One commenter used Claude on a 22-year-old legacy system for dependency updates, security audits, and new features.
- They raised coverage from 65% to 80%+ and still review code before merging.
- Doubt about TDD with agents
- A commenter cited an HN article concluding that asking agents to do TDD wasn't particularly helpful.
- They worried about slower work, more tokens, and more code to review.
- Limits of turning authors into editors
- One commenter said finding bugs in AI code can be harder than writing correct code yourself.
How to Apply
- Run a requirements gap-review prompt
- Today, paste the spec of the feature you're building into an AI before implementing.
- Check the proposed edits yourself, since AI can invent issues.
- Add quality passes to your implementation skill
- Split security, duplication, naming, and logic checks into separate passes in your agent workflow.
- Measure whether implementation time grows by 5-15 minutes.
- Add two AI reviews plus a pruning pass to PRs
- Run reviews from different models on each PR.
- Add a final agent pass that filters out trivial comments.
- Connect your error tracker to auto-diagnosis
- Have an agent root-cause errors captured by a service like Sentry and open fix PRs.
Try It
# Paste into a Claude or ChatGPT chat (the article's Layer 1 method turned into a prompt)
Review the requirements document below. Do not write code.
Find: 1) missing requirements and edge cases 2) unexpected interactions with existing code 3) contradictions or ambiguities in the scenarios
[Requirements]
{{requirements document}}
[Existing code context]
{{relevant code or description}}
Give a one-line rationale for each problem, and mark anything that may not be a real issue as 'uncertain'.
Next step: add only the confirmed items to the requirements, then ask 'write test scenarios based on these requirements first'.Terminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.