claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Claude Code needs semantic code understanding and IDE-like refactoring capabilities for large-scale code changes

Open johngambleubind opened this issue 6 months ago • 7 comments

Problem

When performing large-scale refactoring tasks (like renaming methods across an entire codebase), Claude Code is significantly slower and less reliable than manual work with proper IDE tooling. A recent repository-wide method renaming task took "many hours" with Claude Code that could have been completed "in under an hour" manually.

Current Limitations

  1. Relies on basic text search tools: Uses grep/sed instead of semantic code understanding
  2. No language-specific metadata: Lacks RAM-cached symbol tables and reference tracking like modern IDEs
  3. Error-prone: Misses references and has incomplete understanding of code relationships
  4. Incredibly slow: Multiple search iterations required, no atomic operations
  5. No semantic understanding: Cannot understand code structure, dependencies, or relationships

Requested Improvements

To make Claude Code genuinely useful for refactoring, it needs:

  • Language Server Protocol (LSP) integration: Real-time symbol resolution, find-all-references, rename refactoring
  • Semantic code understanding: AST parsing, type information, dependency graphs
  • IDE-like capabilities: Go-to-definition, call hierarchies, symbol indexing in RAM
  • Atomic refactoring operations: Rename method/class across entire codebase in one operation
  • Language-specific metadata caching: Keep symbol tables, references, and relationships in memory

Expected Outcome

Claude Code should be faster than manual work, not slower. Large-scale refactoring should be completed in minutes, not hours, with zero missed references.

User Quote

"The value of AI is that it should be faster and that you don't miss things. This was slower and many things were missed."

"Relying on grep and sed is not viable, it's problematic, and it's incredibly slow."

Context

This feedback comes from a user performing a repository-wide method renaming task across a large C# codebase (6 repository interfaces, implementations, and hundreds of method call sites). The current tool-based approach was significantly slower and less reliable than using Visual Studio's built-in refactoring tools.

johngambleubind avatar May 26 '25 00:05 johngambleubind

I agree 100%, but if you had limited time to pick one, I think you would get the most from LSP.

LSP could also map well to Agentic tools - a tool such as find_symbol, rename_symbol, etc, would go a long way to improving it.

If you (anyone who happens to read this) thinks this is a really good idea you'd like to contribute to, might I suggest a fun open source project: try to create an MCP server that does that - exposes LSP as tools to Claude - that could be really awesome.

benbuzbee avatar Jun 03 '25 00:06 benbuzbee

mcp servers for lsp are already a thing: https://github.com/isaacphi/mcp-language-server

anuramat avatar Jun 08 '25 00:06 anuramat

I Thinks that's also what https://github.com/oraios/serena MCP tries to achieve. Have an eye on them, but it would 100% be preferable to see as native Claude Code capability.

alex-orlovskyi avatar Jul 06 '25 13:07 alex-orlovskyi

To solve the code search problem we built an MCP for it: https://github.com/zilliztech/claude-context It analyzes code into AST and indexes as Merkle tree, then uses vector db for search.

codingjaguar avatar Aug 16 '25 07:08 codingjaguar

JetBrains in this has an absolute advantage if it exploited it with Agent Junie

marcoscale98 avatar Aug 28 '25 10:08 marcoscale98