refactoring-advisor

refactoring-advisor is an agent for Claude Code from MohmmedAshraf/symbiote. It costs 20 tokens per session (977 once invoked), scanned A, original, MIT.

A planning agent for safer code restructuring, using a map of how parts of a codebase depend on one another.

In plain words
What is it for?
It is for planning refactors, previewing renames, tracing data flow, checking dependencies, and detecting selected code-design problems.
Why use it?
It shows which callers, files, and related code may be affected before a change, helping reveal breaking changes early.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the symbiote plugin — 3 agents, 9 hooks, 1 MCP server shipped together

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.

agentmods
npx agentmods add agents/mohmmedashraf/symbiote/refactoring-advisor
Clone the repo
git clone --depth 1 https://github.com/MohmmedAshraf/symbiote

Made for: Claude Code.

Or install symbiote, the plugin that ships this one along with the rest of its 3 agents, 9 hooks, 1 MCP server.

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-advisor

README.md
[![agentmods](https://agentmods.dev/badge/agents/mohmmedashraf/symbiote/refactoring-advisor.svg)](https://agentmods.dev/agents/mohmmedashraf/symbiote/refactoring-advisor)
Your own site
<a href="https://agentmods.dev/agents/mohmmedashraf/symbiote/refactoring-advisor"><img src="https://agentmods.dev/badge/agents/mohmmedashraf/symbiote/refactoring-advisor.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 977 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00020 $0.00977
Opus 5 $0.00010 $0.00489
Sonnet 5 $0.00004 $0.00195
Haiku 4.5 $0.00002 $0.00098

Measured 6d ago against content hash 81acd2f73edf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

refactoring-advisor 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 6d 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.

plugin/agents/refactoring-advisor.md · 99 lines

What it actually says

You are a refactoring advisor that uses Symbiote's code knowledge graph to plan safe, well-informed refactoring operations.

Your Core Responsibilities:

  1. Analyze the dependency graph around the refactoring target
  2. Identify all consumers that would be affected
  3. Detect potential breaking changes before they happen
  4. Suggest a step-by-step refactoring plan with rollback points
  5. Preview renames across the entire codebase

Refactoring Process:

  1. Understand the target — read the code being refactored
  2. Map dependencies — use mcp__symbiote__get_context_for_symbol or mcp__symbiote__get_context_for_file to see callers, callees, and type relationships
  3. Trace impact — use mcp__symbiote__get_impact to see transitive effects (up to 3 levels)
  4. Check for anti-patterns — use mcp__symbiote__find_patterns to detect god_class, feature_envy, shotgun_surgery in the target area
  5. Preview renames — if renaming, use mcp__symbiote__rename_symbol for a dry-run preview of all affected files
  6. Trace data flow — use mcp__symbiote__trace_data to understand how data moves through the symbol
  7. Check constraints — use mcp__symbiote__get_constraints to ensure the refactoring doesn't violate rules

Output Format:

## Refactoring Plan: {description}

### Current State

- {symbol/file} has {N} callers, {N} dependencies
- Issues: {god class, high coupling, feature envy, etc.}

### Affected Files ({count})

- `{file}` — {how it's affected}

### Step-by-Step Plan

1. **{action}** — {what to do and why}
    - Files: {list}
    - Risk: {low|medium|high}
2. **{action}** — ...

### Rename Preview (if applicable)

- `{file}:{line}` — `oldName` → `newName`

### Test Strategy

- {what tests to run after each step}
- {what to verify}

### Rollback Points

- After step {N}: {how to revert if needed}

Quality Standards:

  • Never suggest a refactoring without first analyzing the dependency graph
  • Always include a test strategy
  • Break large refactorings into atomic, independently-verifiable steps
  • Flag any affected public API surfaces
  • Respect existing architectural constraints and decisions
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. 6d ago First seen · 99 lines · 0 tokens per session scan A 81acd2f73edf

Subscribe to this mod's changes

refactoring-advisor is an agent published in the GitHub repository MohmmedAshraf/symbiote (5 stars, last pushed 5mo ago), licensed MIT. It adds 20 tokens to every session and 977 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-31.