Transform how you refactor code with intelligent analysis, safety checkpoints, and structured workflows. Use standalone for deterministic refactoring, or with AI for context-aware changes.
npm install -g refactogent
Open source • MIT License • TypeScript, JavaScript, Python, Go
Choose the right approach for your refactoring needs
Automated refactoring without AI. Fast, consistent, repeatable.
# Extract types automatically
refactogent refactor ./src
# Batch process with options
refactogent refactor ./src \
--ignore "**/*.test.ts" \
--types-path "src/types" \
--dry-run
Enhance Claude with refactoring superpowers via MCP.
# Install MCP server
npm install -g @refactogent/mcp-server
# Configure with Claude
claude mcp add --transport stdio \
refactogent -- npx -y \
@refactogent/mcp-server
Everything you need for safe, intelligent refactoring
Automatically extract interfaces and types to separate .types.ts files with smart import management.
Git-based safety points with automatic rollback if validation fails. Never break your code.
Understand the blast radius of changes with dependency tracing and risk scoring.
Run tests, linting, and type checking automatically after refactoring changes.
AST-based parsing with complexity metrics, dependency mapping, and symbol indexing.
TypeScript, JavaScript, Python, and Go support with language-specific optimizations.
Simple workflow, powerful results
Install globally and run on your codebase
AST parsing finds refactoring opportunities
Types extracted, imports updated automatically
Run your build and tests - everything works
Add Refactogent to Claude's MCP config
AI creates git safety point before changes
AI analyzes context and makes intelligent changes
Auto-runs tests, rolls back if needed
Real scenarios, real solutions
Extract types from 50+ files in seconds. Clean separation of interfaces and implementation with automatic import updates.
$ refactogent refactor ./src \
--ignore "**/*.test.ts"
🚀 RefactoGent: Complete Refactoring
📁 Discovered 50 files
✅ Indexed 50 files with 120 symbols
✅ Found 35 type abstractions
✅ Applied 35 type abstractions
$ npm run build
✓ Build passes!
User: "What's the impact of
changing UserService?"
Claude:
1. Analyzing dependencies...
2. Found 47 dependent files
3. Risk score: 82/100 (High)
4. Suggesting incremental approach
Create checkpoint? [Y/n]
Understand blast radius before making changes. AI traces dependencies and suggests safe refactoring strategies.
AI makes intelligent changes with automatic checkpoints. If tests fail, instant rollback to safety.
User: "Extract UserProfile types"
Claude:
1. Created checkpoint #abc123
2. Analyzing UserProfile.tsx...
3. Extracting 8 type definitions
4. Updating 12 import statements
5. Running tests...
❌ 2 tests failed
6. Rolling back to checkpoint
7. Analyzing failures...
8. Suggesting fixes...
Open source, MIT licensed, and ready to use today
npm install -g refactogent
npm i -g @refactogent/mcp-server