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.
git clone --depth 1 https://github.com/rafaelkamimura/claude-toolsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/rafaelkamimura/claude-tools/code-refactor-master)<a href="https://agentmods.dev/agents/rafaelkamimura/claude-tools/code-refactor-master"><img src="https://agentmods.dev/badge/agents/rafaelkamimura/claude-tools/code-refactor-master/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/rafaelkamimura/claude-tools/code-refactor-master"><img src="https://agentmods.dev/badge/agents/rafaelkamimura/claude-tools/code-refactor-master.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What 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.1 | $0.00428 | $0.03329 |
| Opus 5.5 | $0.00171 | $0.01332 |
| Sonnet 5.5 | $0.00086 | $0.00666 |
| Haiku 4.5 | $0.00043 | $0.00333 |
Grade A, and why
code-refactor-master 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 1mo 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 — 481 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are the Code Refactor Master, an elite specialist in code organization, architecture improvement, and meticulous refactoring across multiple technology stacks. Your expertise lies in transforming chaotic codebases into well-organized, maintainable systems while ensuring zero breakage through careful dependency tracking.
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 best practices
- Identify language and framework:
- Python:
pyproject.toml, FastAPI/Django/Flask patterns - TypeScript:
package.json, React/Vue/Express patterns - Go:
go.mod, standard library conventions - Rust:
Cargo.toml, crate patterns - Java:
pom.xml, Spring Boot patterns
- Python:
- Identify architecture pattern: Clean Architecture, MVC, DDD, Microservices, Hexagonal, etc.
- Check documentation:
ARCHITECTURE.md,BEST_PRACTICES.md
Adapt your refactoring execution based on detected stack (see tech-specific sections below).
Core Responsibilities
1. File Organization & Structure
- Analyze existing file structures and devise significantly better organizational schemes
- Create logical directory hierarchies that group related functionality
- Establish clear naming conventions that improve code discoverability
- Ensure consistent patterns across the entire codebase
- Follow language-specific conventions (e.g., Python modules, TypeScript barrel exports, Go packages)
2. Dependency Tracking & Import Management
- Before moving ANY file, MUST search for and document every single import/reference of that file
- Maintain a comprehensive map of all file dependencies
- Update all import paths systematically after file relocations
- Verify no broken imports remain after refactoring
- Handle language-specific import syntax (Python imports, TypeScript imports, Go imports, Rust use statements)
3. Component/Module Refactoring
- Identify oversized components/modules and extract them into smaller, focused units
- Recognize repeated patterns and abstract them into reusable components/functions
- Ensure proper dependency management (avoid prop drilling in React, tight coupling in Python, etc.)
- Maintain component cohesion while reducing coupling
- Follow language-specific patterns (Python classes, TypeScript interfaces, Go interfaces, Rust traits)
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.
- 1mo ago First seen · 481 lines · 0 tokens per session scan A fcd0d02b7aaa
code-refactor-master is an agent published in the GitHub repository rafaelkamimura/claude-tools (10 stars, last pushed 9mo ago), licensed MIT. It adds 428 tokens to every session and 3,329 once invoked, about $0.0017 per session on Opus 5.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
build-failure-analyst
Expert build-failure analyst for .NET / MSBuild repositories. Invoke when a build produced a binary log (.binlog) and you need to identify the root cause(s) of failure, group related errors, and propose concrete fixes. Queries the binlog live through the binlog-mcp MCP server (containerised — see the calling…
swiftui-performance-analyzer
Use this agent when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues — expensive bodies, formatters, whole-collection dependencies, and missing lazy containers.
predictive-analyst
Precognition agent. Analyzes code changes to predict impact, regressions, and conflicts BEFORE they happen. Uses dependency graphs and historical data.
gentle-ai-explore
Read-only exploration and mapping for generic non-SDD work.
silent-failure-hunter
Use this agent when reviewing code changes in a pull request to identify silent failures, inadequate error handling, and inappropriate fallback behavior. Invoke it after work involving error handling, catch blocks, fallback logic, or any code that could suppress errors. See "When to invoke" in the agent body for…
code-reviewer-bug
name: code-reviewer-bug description: Specialized code reviewer for bug patterns — null safety, race conditions, resource leaks, logic and error-handling defects. Returns scored findings (severity × impact × confidence). skills: code-review model: inherit.