Detailed Analysis
A developer working with an 18,000-line Rust codebase spread across two source files raises a pointed critique about the state of AI-assisted code refactoring, specifically the absence of intelligent, tool-backed refactor operations in agentic coding environments like Claude. The core complaint centers on what the author describes as "raw-dogging" code — forcing a language model to rewrite or manipulate large source files in bulk rather than leveraging structured, surgical transformations like "move function X to file Y." The author draws a direct comparison to VS Code's existing "Move to File" code action for TypeScript and JavaScript, which performs exactly this kind of scoped, deterministic refactor without touching unrelated code. The frustration is that equivalent capabilities have not been surfaced as tool calls available to AI agents, leaving users burning a disproportionate share of their context or usage limits on what should be a trivially automatable task.
The technical gap the author identifies is real and well-understood in developer tooling circles: Language Server Protocol (LSP) servers expose code actions — including symbol-aware moves, renames, and imports resolution — that editors like VS Code already invoke on behalf of users. The author acknowledges that LSP-based and AST/tree-sitter-based MCPs (Model Context Protocol servers) exist, but characterizes them as primarily search-oriented rather than transformation-oriented. This is an important distinction. Giving an agent the ability to *read* a codebase efficiently through AST queries is a materially different capability than giving it the ability to *restructure* that codebase through code actions that preserve semantic correctness. The author speculates that LSP code actions could serve as the correct underlying abstraction for this class of refactor tooling, while conceding that LSP startup latency and configuration complexity could pose practical obstacles — though also noting that models might be capable of autonomously navigating those configuration challenges.
The research context surrounding Claude Code's recommended workflows does not directly address this tooling gap, but it does illuminate current best practices that partially mitigate the problem. Anthropic's own guidance suggests using Plan Mode (invoked via Shift+Tab twice in Claude Code) before any code-writing operation, placing the model in an architect posture where it can analyze and propose changes without immediately executing them. This approach reduces wasted context on failed attempts by front-loading human approval of the transformation strategy. The diff-first workflow — reviewing changes incrementally rather than accepting bulk rewrites — is also cited as a safer pattern for refactoring work. These are meaningful ergonomic improvements, but they remain workarounds that operate within the raw-dogging paradigm the author critiques rather than replacing it with structured tool calls.
The broader significance of this complaint sits at the intersection of two trends in AI-assisted development. First, as AI coding agents mature, the bottleneck is increasingly shifting from raw generation capability to *tool surface area* — the richness and precision of the operations an agent can invoke on its environment. Models like Claude Sonnet and Opus are already capable of complex reasoning about code structure, but without tools that expose semantic operations (move, rename, extract, inline), that reasoning must be laundered through text generation, which is both wasteful and error-prone at scale. Second, the developer ecosystem has not yet converged on a standard MCP or agent-tool layer that wraps LSP code actions into callable, composable primitives. Anthropic's own engineering writing on tools for agents acknowledges the importance of tight tool design, but the gap between editor-native code actions and agent-accessible tool calls remains largely unbridged as of early 2026. The author's frustration reflects a legitimate and growing demand that will likely drive tooling development as agentic coding workflows become standard practice across professional software teams.
Read original article →