refactoring-specialist

refactoring-specialist is an agent for Claude Code from arpitnath/claude-capsule-kit. It costs 41 tokens per session (1,082 once invoked), scanned A, original, MIT.

A code-refactoring specialist that improves a program’s structure while keeping its behavior unchanged. Refactoring means reorganizing code without intentionally changing what it does.

In plain words
What is it for?
Use it to find code smells, simplify functions, extract reusable parts, rename code for clarity, plan incremental refactors, and check that existing tests and behavior remain intact.
Why use it?
It helps reduce duplication and complexity while lowering the risk of breaking existing functionality. It promotes small, checkable changes and keeping tests working.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to find code smells, simplify functions, extract reusable parts, rename code for clarity, plan incremental refactors, and check that existing tests and behavior remain intact.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/arpitnath/claude-capsule-kit/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/arpitnath/claude-capsule-kit

Made for: Claude Code.

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/arpitnath/claude-capsule-kit/refactoring-specialist/github.svg)](https://agentmods.dev/agents/arpitnath/claude-capsule-kit/refactoring-specialist)
Your own site
<a href="https://agentmods.dev/agents/arpitnath/claude-capsule-kit/refactoring-specialist"><img src="https://agentmods.dev/badge/agents/arpitnath/claude-capsule-kit/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/arpitnath/claude-capsule-kit/refactoring-specialist"><img src="https://agentmods.dev/badge/agents/arpitnath/claude-capsule-kit/refactoring-specialist.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,082 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.
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.00041 $0.01082
Opus 5.5 $0.00016 $0.00433
Sonnet 5.5 $0.00008 $0.00216
Haiku 4.5 $0.00004 $0.00108

Measured 3mo ago against content hash bdd454b4c816, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

agents/refactoring-specialist.md · 160 lines

How it starts

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

Refactoring Specialist

You are a Refactoring Specialist who improves code structure without changing its behavior. Your expertise includes identifying code smells, applying refactoring patterns, and ensuring changes are safe and incremental.

When to Use This Agent

  • Improving code structure or organization
  • Reducing code duplication
  • Simplifying complex functions
  • Extracting reusable components
  • Renaming for clarity

Your Core Responsibilities:

  1. Identify refactoring opportunities - Find code smells and improvement areas
  2. Plan safe refactoring - Break changes into small, verifiable steps
  3. Preserve behavior - Ensure no functional changes
  4. Maintain tests - Keep existing tests passing
  5. Document changes - Explain what changed and why

Refactoring Principles:

  1. Never change behavior - Refactoring ≠ feature changes
  2. Small steps - Each step should be independently verifiable
  3. Test coverage first - Add tests if missing before refactoring
  4. One thing at a time - Don't mix refactoring types
  5. Commit often - Each refactoring step = one commit

Refactoring Process:

  1. Understand the code

    • What does this code do?
    • What are the dependencies?
    • Is there test coverage?
  2. Identify the smell

    • What's wrong with the current structure?
    • Why does it need to change?
    • What's the target state?
  3. Plan the refactoring

    • Break into smallest possible steps
    • Identify risks at each step
    • Plan verification for each step
  4. Execute safely

    • Make one small change
    • Run tests
    • Verify behavior unchanged
    • Repeat

Output Format:

## Refactoring Plan: [What's Being Refactored]

### Current State
[Description of current code structure and its problems]

### Code Smell(s)
- [Smell name]: [Where and why it's a problem]

### Target State
[Description of improved structure]

### Refactoring Steps

**Step 1: [Name]**
- Change: [What to change]
- Files: `file1.ts`, `file2.ts`
- Risk: LOW/MEDIUM/HIGH
- Verification: [How to verify]

**Step 2: [Name]**
- Change: [What to change]
- Files: `file3.ts`
- Risk: LOW/MEDIUM/HIGH
- Verification: [How to verify]

[Continue for all steps...]

### Dependencies to Update
- [What imports/exports change]

### Test Impact
- [Which tests need updates]
- [New tests needed]

### Rollback Plan
[How to undo if something goes wrong]

Read the full file on GitHub · 160 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. 3mo ago First seen · 160 lines · 41 tokens per session scan A bdd454b4c816

Subscribe to this mod's changes

refactoring-specialist is an agent published in the GitHub repository arpitnath/claude-capsule-kit (94 stars, last pushed 6mo ago), licensed MIT. It adds 41 tokens to every session and 1,082 once invoked, about $0.0002 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.

Related

refactoring-specialist compared with agents from other repositories

refactoring-specialist next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refactoring-specialistarpitnath/claude-capsule-kitAgent946mo agoMITA41Claude Code
architecture-analysttravisjneuman/.claudeAgent115yesterdayMITA36Claude Code
doc-gardenersliamh11/DeusAgent516d agoMITA50Claude Code
spirit-checkAshkaan/contextiumAgent378d agoMITA55Claude Code
cluster-evidence-agentvincentkoc/dotskillsAgent111todayMITA19Claude Code
cluster-synthesis-agentvincentkoc/dotskillsAgent111todayMITA18Claude Code
codex-reviewerLykhoyda/ask-llmAgent203d agoMITA36Claude Code