A growing body of developer experience is crystallizing around a counterintuitive reality: AI coding agents that seem almost magical when building from scratch often leave existing projects worse off after seemingly simple refactoring tasks.

The Greenfield Illusion

Give an AI agent an empty directory and a page of requirements, and it will impress you. Give the same agent an existing codebase and a one-line feature request, and there's a good chance it will satisfy that request while leaving the project slightly worse than before. This isn't just a problem with legacy code anymore—the author notes that "existing" now means even recently written, well-structured projects.

Why Context Becomes the Enemy

The core challenge appears to be context overwhelm. When an agent must understand thousands of lines of existing patterns, dependencies, and implicit conventions, its ability to make targeted changes without collateral damage diminishes significantly. Unlike a human developer who knows which parts of the codebase are fragile or tightly coupled, AI agents often lack this institutional memory.

The Refactoring Paradox

The irony is that refactoring—supposedly improving code structure—becomes dangerous territory for autonomous agents. A feature request might be technically correct when implemented, but the side effects on surrounding code can introduce subtle bugs, technical debt, or violations of project-specific conventions that weren't immediately apparent.

Key Takeaways

  • AI agents perform dramatically better in greenfield scenarios than with existing codebases
  • The problem extends to modern, well-maintained projects—not just legacy code
  • Simple feature requests often come at the cost of overall codebase quality
  • Context awareness and understanding implicit project patterns remain significant hurdles

The Bottom Line

Until AI agents develop genuine understanding of codebase history and context—rather than just pattern matching on current state—we're going to keep seeing this divergence between impressive demos and real-world code degradation. The gap between "works" and "correctly works in your specific project" is where these tools still stumble hard.