Skip to main content
subagent CX Codex

refactoring_specialist — Claude Code subagent: purpose and setup

refactoring_specialist — a subagent for Claude Code plans code refactoring while preserving observable behavior. It pairs structural changes with regression protection.

no license ★ 776 updated 2026-11-12

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/refactoring_specialist.md
Open on GitHub

What refactoring_specialist does

The subagent examines code structure, change boundaries, and risks, then produces an ordered refactoring plan with representative file-level edits. It covers dependencies, APIs, state, and error handling. The package also includes characterization tests, regression checks, and a rollback plan.

Its recommendations draw on repository evidence such as source excerpts, tests, or static-analysis results when provided. It leaves unrelated feature work out and preserves public behavior unless a breaking change is authorized. It does not report tests as passing or files as changed without execution evidence.

What it helps with

  • split a large module into smaller parts
  • identify code smells backed by repository evidence
  • preserve public behavior during refactoring
  • plan regression checks for structural edits

Example prompts for the agent

  • Review this module and plan a refactor that preserves its current behavior.
  • Prepare a refactoring package for src/ with sample edits and regression checks.
  • Assess the risks of this refactor and outline a rollback plan.

How to install refactoring_specialist

Manually: put the files in place

.claude/agents/refactoring_specialist.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about refactoring_specialist

How do I install refactoring_specialist in Claude Code?

Add the agent file at .claude/agents/refactoring_specialist.md.

What does refactoring_specialist do?

It analyzes code structure and prepares a refactoring plan with sample edits, risk assessment, tests, and rollback steps.

How does the subagent protect behavior during refactoring?

It proposes characterization tests and regression checks. It does not claim that tests passed without evidence that they ran.

Similar subagents

All subagents for Code review and refactoring →

From the same set24

The whole set →
accessibility_tester accessibility_tester is a Claude Code subagent that reviews interface evidence for accessibility requirements. It covers keyboard use, focus, semantics, contrast, and interaction. CX Codex ★ 776repo stars business_requirements_analyst The business_requirements_analyst Claude Code subagent turns unclear stakeholder requests into testable business requirements. It connects goals to acceptance criteria and flags gaps or conflicting statements. CX Codex ★ 776repo stars test_driven_qa test_driven_qa — a subagent for Claude Code turns requirements and repository materials into a QA plan or test artifact. It ranks test scenarios and keeps observed evidence separate from proposed checks. CX Codex ★ 776repo stars performance_engineer The performance_engineer Claude Code subagent finds application, API, database, and infrastructure bottlenecks from measurements. It builds an optimization plan with baselines, experiments, and regression checks. CX Codex ★ 776repo stars research_queries The research_queries Claude Code skill turns research questions into targeted searches. It identifies entities, dates and constraints, then looks for evidence behind unresolved claims. CX Codex +1 ★ 776repo stars evidence_synthesis The evidence_synthesis Claude Code skill builds concise answers from supplied observations and task materials. It links claims to evidence and distinguishes reported facts from model inference. CX Codex +1 ★ 776repo stars source_verification The source_verification Claude Code skill ties claims to supporting sources. It helps check dates, figures, and entity identity in research responses. CX Codex +1 ★ 776repo stars web_navigation The web_navigation Claude Code skill reads public web pages and gathers evidence for specific facts. It follows relevant links to find supporting details. CX Codex +1 ★ 776repo stars

Project sponsors

Companies that keep this analytics open