refactorer

refactorer is a skill for Claude Code from hex/claude-council. It costs 0 tokens per session (884 once invoked), scanned A, original, MIT.

A code-refactoring guide for changing how code is organised without changing what it does.

In plain words
What is it for?
Use it to extract, rename, move, or split code and remove duplication across several places while checking tests and public behaviour.
Why use it?
It reduces the risk of missed references, accidental behaviour changes, and inconsistent code during large restructures.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions AGENTS.md.

Part of the claude-council plugin — 10 skills, 4 commands, 1 agent, 1 hook shipped together

Good fit Use it to extract, rename, move, or split code and remove duplication across several places while checking tests and public behaviour.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hex/claude-council/refactorer
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.

Any agent
npx skills add hex/claude-council --skill refactorer
Clone the repo
git clone --depth 1 https://github.com/hex/claude-council

Made for: Claude Code.

Or install claude-council, the plugin that ships this one along with the rest of its 10 skills, 4 commands, 1 agent, 1 hook.

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 refactorer

README.md
[![agentmods](https://agentmods.dev/badge/skills/hex/claude-council/refactorer/github.svg)](https://agentmods.dev/skills/hex/claude-council/refactorer)
Your own site
<a href="https://agentmods.dev/skills/hex/claude-council/refactorer"><img src="https://agentmods.dev/badge/skills/hex/claude-council/refactorer/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 refactorer

Your own site · 80×15
<a href="https://agentmods.dev/skills/hex/claude-council/refactorer"><img src="https://agentmods.dev/badge/skills/hex/claude-council/refactorer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 884 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.00000 $0.00884
Opus 5.5 $0.00000 $0.00354
Sonnet 5.5 $0.00000 $0.00177
Haiku 4.5 $0.00000 $0.00088

Measured 22d ago against content hash 5280570feecb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refactorer 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 22d 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.

mods/council-pane/specialists/refactorer/SKILL.md · 90 lines

How it starts

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

Refactorer

Restructure code without changing what it does. The result should be simpler to read, with one way to do each thing and no leftover paths.

Scope the change

  1. Restate the target shape in one or two sentences: what moves where, what gets a new name, what gets merged.
  2. Read the project's own instructions (AGENTS.md, CONTRIBUTING, lint and format config) and match the existing style, even where you would choose differently.
  3. List every site the change touches: definitions, call sites, imports, re-exports, config keys, docs, tests, and string references such as reflection, routing tables or serialized names. Search broadly, then read each hit. A textual match is only a candidate.
  4. Decide what counts as observable behaviour here: public API, CLI output, file formats, wire formats, error messages, log lines other tools parse. Those must not change. If the requested refactor would change one, stop and report it.

Baseline

  • Run the tests that cover the touched code before editing. Record the command and result.
  • If tests already fail, record which ones and do not treat them as caused by you. Do not fix them unless the task says to.
  • If nothing covers the touched code, say so. Then choose the cheapest real check you can run before and after, such as the CLI command, a sample request or a build, and record it.

Edit

  • Edit site by site. Never apply a regex or mass replace to write code. The same text can mean different things in different places; only reading the site tells them apart. Search tools are fine for finding sites.
  • Update every caller in the same change. Delete the old path: no alias, shim, wrapper, re-export layer, deprecated copy, or commented-out code. Version control is the archive.
  • Exception: if the old name is a public interface with outside consumers, stop and report it. Compatibility is a decision for the owner, not for you.
  • Import from the defining module, not through a barrel file that hides where things live.
  • Unify duplication only where three or more sites share the logic. Two similar sites may be coincidence; leave them and note it.
  • Remove test-only production seams (exports, flags, injection hooks with no production caller) only when the task includes them.
  • Do not mix in behaviour changes, bug fixes, dependency bumps or formatting sweeps. Record anything you notice for the report.

Read the full file on GitHub · 90 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. 22d ago First seen · 90 lines · 0 tokens per session scan A 5280570feecb

Subscribe to this mod's changes

refactorer is a skill published in the GitHub repository hex/claude-council (884 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 884 tokens. 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-09-26.