refactoring-specialist

refactoring-specialist is an agent for Claude Code from TheBeardedBearSAS/claude-craft. It costs 10 tokens per session (2,246 once invoked), scanned A, original, MIT.

An agent focused on safely restructuring existing code without changing what it does, including legacy code and technical debt.

In plain words
What is it for?
Use it to split long methods or oversized classes, move code to better locations, replace repeated conditionals, and introduce clearer data types.
Why use it?
It helps identify code smells—patterns that make code harder to maintain—and choose refactoring techniques that reduce the risk of breaking behavior.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Part of the claude-craft plugin — 56 skills, 94 commands, 47 agents, 5 hooks shipped together

Good fit Use it to split long methods or oversized classes, move code to better locations, replace repeated conditionals, and introduce clearer data types.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/thebeardedbearsas/claude-craft/refactoring-specialist
Install

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.

Clone the repo
git clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craft

Made for: Claude Code.

Or install claude-craft, the plugin that ships this one along with the rest of its 56 skills, 94 commands, 47 agents, 5 hooks.

Wrote 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.

agentmods badge for refactoring-specialist

README.md
[![agentmods](https://agentmods.dev/badge/agents/thebeardedbearsas/claude-craft/refactoring-specialist/github.svg)](https://agentmods.dev/agents/thebeardedbearsas/claude-craft/refactoring-specialist)
Your own site
<a href="https://agentmods.dev/agents/thebeardedbearsas/claude-craft/refactoring-specialist"><img src="https://agentmods.dev/badge/agents/thebeardedbearsas/claude-craft/refactoring-specialist/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.

agentmods 80×15 button for refactoring-specialist

Your own site · 80×15
<a href="https://agentmods.dev/agents/thebeardedbearsas/claude-craft/refactoring-specialist"><img src="https://agentmods.dev/badge/agents/thebeardedbearsas/claude-craft/refactoring-specialist.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,246 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Sonnet 5 · 6 Sept 2026 📄 Read the review
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00010 $0.02246
Opus 5 $0.00005 $0.01123
Sonnet 5 $0.00002 $0.00449
Haiku 4.5 $0.00001 $0.00225

Measured 9d ago against content hash 8619683451e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

refactoring-specialist 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 9d 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.

.claude/agents/refactoring-specialist.md · 321 lines

How it starts

The opening of the file, as written. The whole thing — 321 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refactoring Specialist Agent

Identité

Tu es un Refactoring Specialist Senior avec 15+ ans d'expérience en modernisation de code legacy, réduction de dette technique et transformation de codebase. Tu maîtrises les techniques de refactoring sécurisé sans casser l'existant.

Expertise Technique

Code Smells

Smell Symptômes Refactoring
Long Method > 20 lignes, plusieurs responsabilités Extract Method
Large Class > 500 lignes, God Object Extract Class
Feature Envy Méthode utilise plus une autre classe Move Method
Data Clumps Mêmes paramètres répétés Extract Class/Parameter Object
Primitive Obsession Strings/ints au lieu de types Value Objects
Switch Statements Switch répétés sur type Polymorphism
Parallel Inheritance Hiérarchies miroirs Merge hierarchies
Comments Commentaires = code peu clair Rename, Extract Method

Refactoring Patterns

Pattern Usage
Extract Method Isoler une responsabilité
Extract Class Séparer une classe trop large
Move Method/Field Repositionner vers classe appropriée
Replace Conditional Polymorphisme au lieu de if/switch
Introduce Parameter Object Grouper paramètres liés
Replace Temp with Query Remplacer variable par méthode
Decompose Conditional Extraire conditions complexes
Replace Magic Number Constantes nommées

Patterns Legacy

Pattern Description
Strangler Fig Remplacer progressivement le legacy
Branch by Abstraction Introduire abstraction avant changement
Sprout Method/Class Ajouter du neuf sans toucher au vieux
Wrap Method Encapsuler pour ajouter comportement
Seam Point d'injection pour tests

Méthodologie

Analyse Avant Refactoring

  1. Cartographier le Code
    • Identifier les dépendances
    • Mesurer la complexité cyclomatique
    • Repérer les hotspots (fréquence modification)
    • Évaluer la couverture de tests

Read the full file on GitHub · 321 lines

Changes

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.

  1. 9d ago First seen · 321 lines · 10 tokens per session scan F 8619683451e6

Subscribe to this mod's changes

refactoring-specialist is an agent published in the GitHub repository TheBeardedBearSAS/claude-craft (105 stars, last pushed 6d ago), licensed MIT. It adds 10 tokens to every session and 2,246 once invoked, about $0.0001 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-30.

Related

Other agents, from other repositories