OpenRewrite is a critical piece of the AI agent stack, specifically for agents tasked with software maintenance and code generation. Agents often struggle with the 'last mile' of code modification—ensuring changes are syntactically correct, type-safe, and adherent to existing style guides. OpenRewrite's Lossless Semantic Tree (LST) provides a reliable actuator for these agents, allowing them to execute complex refactoring recipes with surgical precision instead of writing raw, error-prone code blocks.
For builders in the agent ecosystem, OpenRewrite offers a library of pre-tested 'safe' transformations that can be called by an agentic workflow. This moves the agent's responsibility from 'how to change the code' to 'where and when to apply this transformation,' significantly reducing the risk of broken builds or formatting regressions. As coding agents move from simple completions to autonomous migrations, OpenRewrite serves as the structural foundation that makes those operations enterprise-ready.
OpenRewrite represents a shift in how engineering organizations manage code maintenance. For decades, the industry focused on static analysis—tools that identify vulnerabilities, deprecated APIs, or code smells but leave the actual fixing to human developers. This created a persistent backlog where the identification of problems far outpaced the capacity to fix them. OpenRewrite, and its commercial steward Moderne, address this by focusing on automated remediation at scale.
At the technical core of the project is the Lossless Semantic Tree (LST). Most compilers and analysis tools use an Abstract Syntax Tree (AST), which strips away details like whitespace, comments, and specific formatting to focus on logic. While sufficient for a compiler, an AST is poor for automated refactoring because it causes 'code churn' where a simple logic change re-formats the entire file, making code reviews difficult. The LST preserves every character of the original source file while providing the type-safe semantic information needed to perform complex transformations. This ensures that an automated fix looks exactly as if a human developer had written it, following the project's specific style guide.
The project operates through 'recipes'—declarative or imperative programs that define specific code transformations. These range from simple package renames to complex, multi-step framework migrations, such as moving an entire application from Spring Boot 2 to Spring Boot 3 or upgrading JUnit versions. Because these recipes are composable, teams can build sophisticated migration paths by chaining smaller, tested units of change. This approach is particularly effective for platform engineering teams who need to enforce standards and security patches across large-scale distributed architectures.
OpenRewrite was founded within the context of high-scale enterprise environments, specifically by individuals with backgrounds in Netflix's engineering team and the Spring framework ecosystem. While the project is open-source and community-driven, Moderne provides the commercial infrastructure to execute these recipes across an entire organization's codebase in a single pass. This moves the unit of work from a single repository to an entire code search and transformation campaign.
In the emerging world of AI-assisted development, OpenRewrite is becoming a critical infrastructure layer. While large language models (LLMs) can suggest fixes, they often hallucinate non-existent APIs or fail to follow subtle formatting rules. By utilizing OpenRewrite recipes as the actual execution mechanism, AI agents can perform changes with much higher reliability. This reduces the agent's role to selecting and orchestrating proven transformations rather than generating raw text, which is a far more stable path for automated software engineering.
Automated mass refactoring of source code to eliminate technical debt.
OpenRewrite is hiring.