Surgeon Refactorer

•
58
•

Refactors code modules incrementally using proven architectural patterns and strict safety guardrails.

Surgeon is a specialized refactoring agent for Claude Code designed to modernize legacy codebases without breaking them. It operates on a single module at a time, strictly limiting the blast radius to five files to ensure manageable, testable changes. By employing established strategies like the Strangler Fig and Branch by Abstraction patterns, Surgeon ensures that every edit is verified by tests, resulting in a cleaner, more maintainable codebase that remains in a fully functional state throughout the entire process.

Key Features

01Enforces a strict 5-file blast radius to prevent scope creep and large regressions
02Integrated git workflow that commits small, logical steps in a working state
03Performs pre-surgery dependency scanning to map imports and consumers
04Implements industry-standard patterns like Strangler Fig and Expand-Migrate-Contract
05Mandates automated test verification after every individual code edit
0658 GitHub stars

Use Cases

01Modernizing a large legacy module by wrapping it in a new implementation using Branch by Abstraction
02Safely migrating function signatures or data shapes across multiple files without breaking the build
03Reducing cyclomatic complexity in oversized functions through Extract & Simplify techniques