JetBrains Rider Empowers AI Agents With Its Refactoring Engine
AI agents can now leverage Rider's powerful refactoring engine for faster and more reliable code transformations.
1Previous Limitations of AI in Code Refactoring
The study revealed that an AI model made 2,513 tool calls across 15 C# refactoring tasks without performing any structural refactoring operations. The model resorted to basic edits using git (422 calls), sed (392 calls), and dotnet build (163 calls), approximating refactorings due to lacking access to Rider's dozens of built-in C# refactoring capabilities.
2New Refactoring Engine Integration
JetBrains Rider 2026.2.1 introduces the 'refactoring-code' feature, allowing AI agents to directly utilize the IDE's ReSharper-powered refactoring engine. This integration provides agents with access to the syntax tree, enabling them to safely perform complex operations like symbol renaming, method extraction, and interface creation.
3Performance Improvements
When retesting the same 15 tasks with the new engine, average task time dropped from 157.9s to 26.6s (83% faster). Cost per task decreased from $0.52 to $0.19 (64% cheaper), while tool calls reduced from 17 to 6.2 per task (63% fewer). The elimination of edit-build-read-error cycles particularly improved 95th percentile times from 346.4s to 56.9s.
4Technical Details and Workflow
Rider's refactoring engine uses the same resolved syntax tree model that powers the IDE's inspections and navigation systems. It knows which declaration each identifier binds to, which overload each call resolves to, and where references exist across the solution. This allows it to apply in one operation what AI agents previously tried to guess through multiple builds.
5Evaluated Refactoring Operations
Testing focused on eight core refactoring operations: symbol renaming, method extraction, interface creation, base class extraction, API signature changes, type moving between namespaces, namespace reorganization, and safe deletion. These were selected for their clear success/failure criteria and well-defined contracts.
6New AI Agent Workflow Dynamics
With the refactoring engine integration, AI agents' dotnet build calls dropped from 163 to 3. Total tool calls decreased from 2,513 to 926, though sed remained the most frequently used tool. Structural changes were delegated to the refactoring engine while simple text edits stayed in the editor's domain.
7Industry Significance
This development marks a milestone in the evolution of AI-assisted software development tools. The ability to safely refactor large codebases has significant potential to boost developer productivity. JetBrains' move illuminates the future of integration between IDEs and AI tools.
8Future Projections
The success of this refactoring engine integration may inspire other IDE vendors to develop similar solutions. The coming years will likely see more structural code operations exposed to AI agents and tested in increasingly complex scenarios. Advances in this area could fundamentally transform software development processes.
9Impact on Developers
This innovation will significantly reduce time spent on routine code maintenance tasks. AI-assisted refactoring will be particularly valuable for teams working with legacy codebases. However, developers will need to understand refactoring principles and AI limitations to use these tools effectively.