Ghost Features: The Haunting Cost of Unsupervised Agentic Coding
By Ben Houston, 2025-05-02
In a world where AI writes our software, what happens when it forgets to forget?
The promise of agentic coding is seductive: you give an instruction, walk away, and return to find the work done. Need a refactor? A new endpoint? A UI fix? Just describe the goal, and your agent takes care of it.
But as developers begin to rely more on AI agents to generate, modify, and maintain codebases, a strange phenomenon emerges -- features that weren't asked for, features that persist after their purpose is gone, features that behave like relics of a prior reality.
These are Ghost Features.
They're not bugs. They compile. They pass tests. But they don't belong. And they can quietly ruin your system's coherence.
What Is a Ghost Feature?
A ghost feature is a leftover piece of functionality that persists after its motivating intent has disappeared. It might be:
- A UI toggle that no longer connects to anything
- A backend validation that no longer applies to current logic
- A configuration flag that was meant to be temporary
- A test that validates obsolete behavior
It's the software equivalent of an abandoned hallway in a building renovation -- still there, still wired, but leading nowhere.
Where Ghost Features Come From
Ghost features emerge most often in unsupervised agentic workflows -- where an AI coding assistant is tasked with modifying code without an explicit understanding of original intent or system-wide design constraints.
Here's how it happens:
- Initial Generation: The agent is asked to build a feature. It scaffolds components, utilities, hooks, routes, and usually this goes well.
- Modification: A later task alters part of that functionality, but the change is scoped too narrowly (e.g., “change the form logic”).
- Persistence: The agent avoids deleting things it doesn't fully understand. It doesn't want to break anything.
- Accumulation: Over time, multiple partial changes lead to a layer of “undead” functionality: code that isn't broken, but is no longer meaningful.
These features don't show up in bug trackers because they're not obviously wrong. They survive code reviews because no one remembers why they were added.
Why Ghost Features Matter
Ghost features aren't just clutter. They:
- Mislead AI and humans: Future agents and developers reading the code assume the ghost features are still important.
- Increase complexity: Every additional branch, flag, or test adds cognitive load and risk.
- Create subtle regressions: When an agent builds on top of a ghost feature it doesn't understand, behavior becomes unpredictable.
- Break user expectations: Features that look like they should work (but don't) confuse users and erode trust.
In traditional development, ghost features were uncommon because every line of code had a human advocate. In agentic workflows, code is written without persistent memory of intent -- which makes ghosting inevitable.
Why Agents Can't See Ghosts
The root of the problem is intent decay.
LLMs operate in context windows. When generating code, they see the current files and recent instructions -- but not the full historical arc of why the system looks the way it does.
Unless the developer explicitly states, “remove this behavior, it's no longer needed,” the agent assumes it's safe to preserve existing functionality.
Agents are cautious. They don't delete without a reason. But that's exactly how ghosts survive.
Supervision Is Not Optional
One common misconception is that agentic coding eliminates the need for human oversight. In practice, it's the opposite. The more autonomy you give your agent, the more important your role as curator of intent becomes.
You must:
- Define clear constraints: Make explicit what is and isn't part of the desired outcome.
- Review deltas carefully: Don't just check for correctness -- look for ghosts.
- Prune aggressively: If something isn't clearly needed, cut it.
- Document intent: In the absence of intent files, future agents (and devs) will guess -- and they will guess wrong.
Think of yourself not as a coder, but as a conductor of implementation. The agent plays the notes. You set the score.
Preventing Ghost Features by Design
The most effective way to prevent ghost features is to make intent explicit and persistent. That's what intent-based development aims to solve.
When you maintain structured intent files as the source of truth:
- Generators only produce what's declared.
- Outdated features don't persist -- they simply stop being derived.
- Regeneration becomes an act of simplification, not accumulation.
In an intent-based system, code has no right to exist unless it is justified by current intent.
That's the ghost cure.
Conclusion: The Haunting Will Continue Until Intent Improves
Ghost features are a symptom of a deeper problem: we're deploying autonomous agents into systems without giving them memory, constraints, or context. We treat AI like a human developer, but don't give it the social contract that would allow it to act with confidence.
And so it defers. It preserves. It lets the old code linger, just in case.
This is not a call to abandon agentic coding. It's a call to do it responsibly -- by pairing automation with architectural clarity, and code generation with intent preservation.
As more teams embrace AI in their development workflows, recognizing and addressing ghost features will be critical to maintaining system quality.
Don't let your codebase become a haunted house.