Supercharge Development with AI! Refactoring Towards AI-Friendly Code

Tadashi Shigeoka ·  Tue, October 21, 2025

Recently, my development workflow has become unthinkable without AI coding tools. Codex, Claude Code, and Cursor—these tools function beyond mere auto-completion as “thinking pair programmers.”

However, as I’ve been using these tools extensively, I’ve noticed a common tendency: they frequently suggest refactoring. At first, I would sometimes dismiss these as “trivial fixes,” but at one point, I started consciously accepting those suggestions. And then, a remarkable change occurred. The accuracy of subsequent code generation and the speed of feature addition proposals dramatically improved, and overall development became supercharged.

From this experience, I’ve reached a conclusion: in the future of software development, writing “code that AI can easily develop with” will be extremely important for maximizing the productivity of the entire team, not just humans.

Why Does AI Suggest Refactoring?

AI coding tools read the context of the code we’ve written and predict/generate the code that should come next. The reason AI frequently suggests refactoring is that the current code is in a state that’s “difficult to read” or “hard to grasp the context” for AI.

AI is intimately familiar with excellent design patterns and coding styles learned from the vast open-source codebases it has studied. AI’s suggestions are kind advice based on that knowledge: “There’s a better way to write this.”

Following these suggestions has two main benefits:

  1. Improved AI Context Understanding: Clean, consistent code is the best clue for AI to accurately grasp its role and purpose. As a result, it can generate more accurate and higher-quality code.
  2. Improved Code Quality and Consistency: By following suggestions from an objective AI “mentor,” code naturally becomes cleaner, and coding styles within the team become more unified. This improves code readability and maintainability in the long term.

An Era Where Designers and Product Managers Also Write Code

This concept of “AI-friendly coding” becomes especially important when team members other than engineers start writing code.

Recently, it’s no longer uncommon to see designers and product managers directly write product code with AI assistance.

If the code they write is “AI-friendly” from the start, the burden on engineers when reviewing or integrating features later is dramatically reduced. AI serves as a “teacher who teaches common coding conventions,” raising the overall code quality of the team and promoting smooth collaboration across roles.

Summary: Welcome AI as a Team Member

AI coding tool suggestions aren’t just intrusive meddling. They’re valuable hints for improving our code and accelerating future development.

In the future of software development, it’s essential to view AI not merely as a tool, but as a thinking “team member.” Creating an environment where this excellent AI colleague can work comfortably—that is, an “AI-friendly codebase”—will be the most effective investment that ultimately maximizes our own productivity and explosively improves the development speed of the entire team.

So, why not start actively accepting refactoring suggestions from AI starting today?

That’s all from the Gemba, striving for better development together with AI.