Claude Code Refactoring Benchmark
Key point
Claude Code with MCP code health guidance increased refactoring improvements by 2-5x.
Details
Claude Code's legacy refactoring was compared using a public dataset containing 25,000 competitive programming source codes and unit tests.
- Correctness was verified with unit tests, and code health was measured with CodeScene.
- Unguided runs mostly produced shallow edits like variable renaming.
- Runs with MCP code health guidance showed a significant increase in structural refactoring such as method extraction and separation of responsibilities.
As a result, guided Claude Code showed a 2-5x larger improvement in Code Health compared to unguided runs.
The lower the code health, the less stable the results were, with defect risk rising to 60%+ on unhealthy code. Conversely, AI operated more stably once Code Health reached a level of 9.5/10.0.
This shows that the quality of legacy code itself is a bottleneck that determines the performance of AI-assisted development.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.