Getting Started with CodeScene's PR Refactoring Agent
CodeScene’s PR Refactoring Agent turns code health insights into instant action.
How it works
The CodeScene PR Refactoring Agent is a tool that helps developers automatically fix code health issues detected in pull requests on GitHub, GitLab & Azure DevOps. When a PR shows problems, developers can simply click the “Fix” button to trigger guided refactoring. This updates the PR automatically and ensures it meets quality gates before merging, resulting in faster delivery, fewer defects, and cleaner, AI-ready code every time.

This feature is fully centralized and repeatable across teams, making refactoring easier and more consistent.
ℹ️ Currently this feature is only available to customers using GitHub, Gitlab and Azure DevOps. Support for other git providers will follow.
Preflight checks
Before a refactoring run starts, the PR Refactoring Agent checks that your configured AI provider is reachable and that the model you've specified actually exists. If something's wrong, for example an invalid API key, a typo in the model name or an unreachable provider, the run stops immediately before any tokens are spent. A clear error message is posted directly in the pull request comment so you know exactly what to fix.
ℹ️ These checks currently cover the Anthropic, OpenAI, Google, and GitHub Copilot providers. For any other provider, the run proceeds without a preflight check. If something's misconfigured, you'll see the error in the workflow run log instead of the PR comment.
See it in action 👇🏽
📖 Check out this documentation page for details on how it works + privacy & security.