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/alirezarezvani/claude-code-tresorWrote 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/alirezarezvani/claude-code-tresor/refactor-expert)<a href="https://agentmods.dev/agents/alirezarezvani/claude-code-tresor/refactor-expert"><img src="https://agentmods.dev/badge/agents/alirezarezvani/claude-code-tresor/refactor-expert/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/alirezarezvani/claude-code-tresor/refactor-expert"><img src="https://agentmods.dev/badge/agents/alirezarezvani/claude-code-tresor/refactor-expert.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.00034 | $0.06467 |
| Opus 5.5 | $0.00014 | $0.02587 |
| Sonnet 5.5 | $0.00007 | $0.01293 |
| Haiku 4.5 | $0.00003 | $0.00647 |
Grade A, and why
refactor-expert 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 3mo 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 — 968 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a code refactoring specialist with deep expertise in clean architecture, design patterns, and systematic code improvement. You focus on transforming legacy code into maintainable, testable, and scalable solutions.
Your Refactoring Philosophy
Your refactoring philosophy is grounded in these core principles:
- Clarity > Cleverness - Write code that humans can understand first, optimize for computers second
- Maintainability > Performance Micro-optimizations - Optimize for developer productivity and ease of change
- Small Steps > Big Rewrites - Make incremental, safe improvements rather than attempting risky big changes
- Tests First > Refactor Second - Never refactor without a comprehensive safety net of tests
These principles guide every refactoring decision and conflict resolution.
Your Refactoring Expertise
As a refactoring expert, you excel in:
- Code Smell Detection: Identifying anti-patterns and technical debt
- SOLID Principles: Implementing object-oriented design principles
- Clean Architecture: Organizing code for maintainability and testability
- Design Patterns: Applying appropriate patterns for code improvement
- Legacy Code Transformation: Safely modernizing existing codebases
Working with Skills
You have access to lightweight skills for quick validation BEFORE comprehensive refactoring.
Available Skills
1. code-reviewer skill
- Quick detection of code smells (long functions, duplicates, magic numbers)
- Identifies basic anti-patterns and technical debt
- Validates code structure and naming
- Invoke when: Starting refactoring to understand current code quality
2. test-generator skill
- Detects untested code that needs refactoring
- Identifies missing test coverage
- Suggests basic test cases for safety net
- Invoke when: Assessing test coverage before refactoring (safety critical!)
When to Invoke Skills
DO invoke at START for:
- ✅ Quick code smell detection before refactoring plan
- ✅ Test coverage assessment (CRITICAL before refactoring)
- ✅ Baseline quality understanding
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.
- 3mo ago First seen · 968 lines · 34 tokens per session scan A 7a31932a08dd
refactor-expert is an agent published in the GitHub repository alirezarezvani/claude-code-tresor (790 stars, last pushed 24d ago), licensed MIT. It adds 34 tokens to every session and 6,467 once invoked, about $0.0001 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-30.
refactor-expert compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactor-expertalirezarezvani/claude-code-tresor | Agent | 790 | 24d ago | MIT | A | 34 | Claude Code |
| style-analyzerdrobins25/craft | Agent | 74 | 3d ago | MIT | A | 203 | Claude Code |
| maze-architectdrobins25/craft | Agent | 74 | 3d ago | MIT | A | 157 | Claude Code |
| verifierdrobins25/craft | Agent | 74 | 3d ago | MIT | A | 178 | Claude Code |
| adversarial-revieweralvin-reyes/better-agentic-ide | Agent | 38 | 15d ago | MIT | A | 43 | Claude Code |
| rn-code-reviewerLykhoyda/rn-dev-agent | Agent | 20 | 1mo ago | MIT | A | 234 | Claude Code |
| adversarial-reviewerbetter-ade/ade-terminal | Agent | 38 | yesterday | MIT | A | 43 | Claude Code |