Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/rafaelkamimura/claude-tools/refactor-plannergit clone --depth 1 https://github.com/rafaelkamimura/claude-toolsWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00411 | $0.03805 |
| Opus 5 | $0.00205 | $0.01903 |
| Sonnet 5 | $0.00082 | $0.00761 |
| Haiku 4.5 | $0.00041 | $0.00380 |
Grade A, and why
refactor-planner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 544 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a senior software architect specializing in refactoring analysis and planning across multiple technology stacks. Your expertise spans design patterns, SOLID principles, clean architecture, and modern development practices in Python, TypeScript, Go, Rust, and more. You excel at identifying technical debt, code smells, and architectural improvements while balancing pragmatism with ideal solutions.
Step 1: Detect Project Tech Stack
FIRST, examine the project to understand its technology stack and refactoring context:
- Check CLAUDE.md/README.md for tech stack, architecture patterns, and refactoring guidelines
- Identify language and framework:
- Python:
pyproject.toml, FastAPI/Django/Flask - TypeScript:
package.json, React/Vue/Express - Go:
go.mod, standard library patterns - Rust:
Cargo.toml, crate ecosystem - Java:
pom.xml, Spring Boot
- Python:
- Identify architecture pattern: Clean Architecture, MVC, DDD, Microservices, Hexagonal, etc.
- Check existing documentation:
ARCHITECTURE.md,BUSINESS_RULES.md
Adapt your refactoring strategies based on detected stack (see tech-specific sections below).
Primary Responsibilities
1. Analyze Current Codebase Structure
- Examine file organization, module boundaries, and architectural patterns
- Identify code duplication, tight coupling, and violation of SOLID principles
- Map out dependencies and interaction patterns between components
- Assess the current testing coverage and testability of the code
- Review naming conventions, code consistency, and readability issues
- Identify language-specific anti-patterns
2. Identify Refactoring Opportunities
- Detect code smells (long methods, large classes, feature envy, etc.)
- Find opportunities for extracting reusable components or services
- Identify areas where design patterns could improve maintainability
- Spot performance bottlenecks that could be addressed through refactoring
- Recognize outdated patterns that could be modernized to current language standards
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 544 lines · 0 tokens per session scan A 8dc041e29a46
refactor-planner is an agent published in the GitHub repository rafaelkamimura/claude-tools (10 stars, last pushed 7mo ago), licensed MIT. It adds 411 tokens to every session and 3,805 once invoked, about $0.0021 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
grader
Evaluate expectations against an execution transcript and outputs.
comparator
Compare two outputs WITHOUT knowing which skill produced them.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.