AI agents are incredible at writing functions. They're even better at accidentally duplicating your entire business logic without you realizing it.
If you use Claude Code, Cursor, or any LLM-based agent to refactor code, you’ve probably seen the pattern. You ask it to 'extract this logic into a reusable utility,' and while the new function works perfectly, a few days later, there's a slightly different version of that same logic tucked away in another service. The variable names are different, the whitespace is updated for modern formatting, but the underlying complexity—the actual structural implementation—is identical.
This is 'shadow duplication.' It doesn't show up on a standard grep or a simple diff. A human reviewer might miss it during a PR because the surface-level syntax looks fresh. But as the codebase grows, your technical debt isn't just accumulating; it's mutating.
I built the Code Clone Detector MCP server specifically to kill this pattern at the source by giving AI agents a way to 'see' through the syntactic noise.
The Failure of Syntax-Based Detection






