Agentic Refactoring: An Empirical Study of AI Coding Agents
Kosei Horikawa, Hao Li, Yutaro Kashiwa, Bram Adams, Hajimu Iida, Ahmed E. Hassan

TL;DR
This study empirically analyzes how AI coding agents perform refactoring in real-world open-source Java projects, revealing their focus on internal quality improvements and their impact on code structure.
Contribution
It provides the first large-scale empirical analysis of AI agent-driven refactoring, comparing it to human efforts and assessing its effects on code quality.
Findings
Refactoring occurs in 26.1% of commits involving AI agents.
Agents mainly perform low-level, localized refactorings like renaming and type changes.
Agentic refactoring leads to small but significant improvements in code structure.
Abstract
Agentic coding tools, such as OpenAI Codex, Claude Code, and Cursor, are transforming the software engineering landscape. These AI-powered systems function as autonomous teammates capable of planning and executing complex development tasks. Agents have become active participants in refactoring, a cornerstone of sustainable software development aimed at improving internal code quality without altering observable behavior. Despite their increasing adoption, there is a critical lack of empirical understanding regarding how agentic refactoring is utilized in practice, how it compares to human-driven refactoring, and what impact it has on code quality. To address this empirical gap, we present a large-scale study of AI agent-generated refactorings in real-world open-source Java projects, analyzing 15,451 refactoring instances across 12,256 pull requests and 14,988 commits derived from the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Advanced Software Engineering Methodologies · Scientific Computing and Data Management
