ix-safe-refactor-planner

ix-safe-refactor-planner is an agent for Claude Code from ix-infrastructure/ix-claude-plugin. It costs 34 tokens per session (1,284 once invoked), scanned A, original, Apache-2.0.

A refactoring planning agent that maps the likely effects of a multi-file code change and orders the work by risk.

In plain words
What is it for?
Use it before a broad refactor to identify targets, understand dependencies, estimate the blast radius, and plan a safer sequence of edits and tests.
Why use it?
It helps prevent unexpected breakage by identifying affected files or symbols, defining edit boundaries, and adding test checkpoints before changes are made. Refactoring means improving code structure without changing what it does.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the ix-memory plugin — 7 skills, 5 agents, 4 hooks 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/ix-infrastructure/ix-claude-plugin/ix-safe-refactor-planner
Clone the repo
git clone --depth 1 https://github.com/ix-infrastructure/ix-claude-plugin

Made for: Claude Code.

Or install ix-memory, the plugin that ships this one along with the rest of its 7 skills, 5 agents, 4 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 ix-safe-refactor-planner

README.md
[![agentmods](https://agentmods.dev/badge/agents/ix-infrastructure/ix-claude-plugin/ix-safe-refactor-planner.svg)](https://agentmods.dev/agents/ix-infrastructure/ix-claude-plugin/ix-safe-refactor-planner)
Your own site
<a href="https://agentmods.dev/agents/ix-infrastructure/ix-claude-plugin/ix-safe-refactor-planner"><img src="https://agentmods.dev/badge/agents/ix-infrastructure/ix-claude-plugin/ix-safe-refactor-planner.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 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,284 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.00034 $0.01284
Opus 5 $0.00017 $0.00642
Sonnet 5 $0.00007 $0.00257
Haiku 4.5 $0.00003 $0.00128

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

Security

Grade A, and why

ix-safe-refactor-planner 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.

agents/ix-safe-refactor-planner.md · 165 lines

How it starts

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

You are a refactoring safety agent. Your job is to produce a concrete, risk-ordered change plan with clear boundaries and test checkpoints. Never recommend a change without knowing its blast radius.

Reasoning loop

Work through targets methodically. Build the plan incrementally — do not output until you've gathered all impact data.

Step 0 — Pro check (optional)

Run once at the start:

ix briefing --format json 2>&1

If it returns JSON with a revision field, Pro is available. Extract activePlans and activeGoals for use in the output. If an existing plan already covers this refactor, reference it and align the plan to that work rather than duplicating it. If it errors, skip all [Pro] guidance below.

Step 1 — Identify all targets

Parse the input as a list of targets (files or symbols). If the input is a description, first resolve:

ix locate "$INPUT" --format llm
ix text   "$INPUT" --limit 10 --format llm

Identify 2–5 concrete symbols or files. If the target set is ambiguous, take the 2–3 best-matching candidates by name or path and proceed — do not stop to ask.

If the targets span unfamiliar or multiple subsystems, gather lightweight ix-docs context before impact analysis:

ix subsystems --format llm
ix overview <highest-risk-or-most-central-target> --format llm

Use that context to identify subsystem boundaries, shared infrastructure, and the right level for the change plan.

Step 2 — Impact each target (in parallel)

For every identified target, run simultaneously:

ix impact  <target> --format llm
ix callers <target> --limit 15 --format llm

Collect: risk level, direct dependent count, key callers by name and subsystem.

Rank targets: critical > high > medium > low.

Decision gate:

  • Any critical target → tell user immediately before continuing
  • All low targets → fast path: report and recommend proceeding directly

Step 3 — Data flow between targets (if 2+ targets)

Read the full file on GitHub · 165 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. 6d ago First seen · 165 lines · 34 tokens per session scan A aa14e57f21ee

Subscribe to this mod's changes

ix-safe-refactor-planner is an agent published in the GitHub repository ix-infrastructure/ix-claude-plugin (7 stars, last pushed 4d ago), licensed Apache-2.0. It adds 34 tokens to every session and 1,284 once invoked, about $0.0002 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.