trace-mcp-refactoring

trace-mcp-refactoring is a skill for Claude Code from nikolai-vysotskyi/trace-mcp. It costs 39 tokens per session (652 once invoked), scanned A, original, MIT.

A safe workflow for changing code across a project indexed by trace-mcp, a tool that maps symbols and their references between files. It assesses a proposed change, finds likely refactoring targets, and traces affected code.

In plain words
What is it for?
Use it before renaming symbols or files, extracting functions, changing function signatures, splitting modules, or making other multi-file refactors.
Why use it?
It reduces the chance of missing imports, callers, tests, or other references when renaming or restructuring code.

Skill for Claude Code

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

Part of the trace-mcp plugin — 4 skills, 2 hooks, 1 MCP server shipped together

Good fit Use it before renaming symbols or files, extracting functions, changing function signatures, splitting modules, or making other multi-file refactors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nikolai-vysotskyi/trace-mcp/trace-mcp-refactoring
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 nikolai-vysotskyi/trace-mcp --skill trace-mcp-refactoring
Clone the repo
git clone --depth 1 https://github.com/nikolai-vysotskyi/trace-mcp

Made for: Claude Code.

Or install trace-mcp, the plugin that ships this one along with the rest of its 4 skills, 2 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 trace-mcp-refactoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/nikolai-vysotskyi/trace-mcp/trace-mcp-refactoring/github.svg)](https://agentmods.dev/skills/nikolai-vysotskyi/trace-mcp/trace-mcp-refactoring)
Your own site
<a href="https://agentmods.dev/skills/nikolai-vysotskyi/trace-mcp/trace-mcp-refactoring"><img src="https://agentmods.dev/badge/skills/nikolai-vysotskyi/trace-mcp/trace-mcp-refactoring/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 trace-mcp-refactoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/nikolai-vysotskyi/trace-mcp/trace-mcp-refactoring"><img src="https://agentmods.dev/badge/skills/nikolai-vysotskyi/trace-mcp/trace-mcp-refactoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 652 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00039 $0.00652
Opus 5 $0.00019 $0.00326
Sonnet 5 $0.00008 $0.00130
Haiku 4.5 $0.00004 $0.00065

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

Security

Grade A, and why

trace-mcp-refactoring 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 12d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/trace-mcp-refactoring/SKILL.md · 87 lines

How it starts

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

trace-mcp — Refactoring Workflow

Use this skill whenever you are about to rename, restructure, extract, or otherwise refactor code in a project indexed by trace-mcp. The goal is to never break cross-file references and never guess at what is affected.

When to Use

  • Renaming a class, function, method, variable, or file
  • Extracting a function or method
  • Restructuring a module or splitting a file
  • Changing a function signature
  • Any change that touches more than one call site

Refactoring Workflow

1. Assess before touching anything

assess_change_risk({ file_path: "src/foo.ts" })
# or
assess_change_risk({ symbol_id: "<id>" })

This returns the risk level of the target change based on churn, complexity, fan-in/fan-out, and test coverage. Use it to decide whether to proceed, add tests first, or split the change.

2. Find what actually needs refactoring

get_refactor_candidates()

Do not guess. This surfaces high-complexity, high-churn, and anti-pattern-laden symbols that are the real refactor targets.

3. Know what will break

get_change_impact({ symbol_id: "<id>" })

Returns the reverse-dependency graph: every file, symbol, and test that depends on the target. Review this list before editing.

4. Quantify complexity

get_complexity_report({ file_path: "src/foo.ts" })

Gives you a baseline so you can verify the refactor actually reduced complexity.

Renaming a Symbol — MANDATORY Flow

Never rename with Edit and replace_all. It silently misses import sites, re-exports, type references, and cross-file usages.

# 1. Collision detection first
check_rename({ symbol_id: "<id>", target_name: "newName" })

# 2. Apply rename across ALL files (definition + every reference)
apply_rename({ symbol_id: "<id>", new_name: "newName" })

apply_rename updates the definition, imports, re-exports, call sites, JSX usages, and tests in one atomic operation.

Extracting a Function

extract_function({
  file_path: "src/foo.ts",
  start_line: 42,
  end_line: 67,
  new_name: "computeTotals"
})

Read the full file on GitHub · 87 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. 12d ago First seen · 87 lines · 39 tokens per session scan A 8cb8a409b09b

Subscribe to this mod's changes

trace-mcp-refactoring is a skill published in the GitHub repository nikolai-vysotskyi/trace-mcp (175 stars, last pushed today), licensed MIT. It adds 39 tokens to every session and 652 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-30.

Related

Other skills, from other repositories

m1nd-first

Use when investigating a repository, searching for implementation, reviewing changes, working from specs/docs, or preparing a risky code change in an environment where m1nd is available. This doctrine makes m1nd the first investigative layer before grep, glob, or manual file reads, except when the task is pure…

maxkle1nz/m1nd · 78 tokens

qartez

Semantic code intelligence skill for qartez MCP. Use qartez tools for code exploration, impact analysis, and guarded refactors; treat built-in code-tool denials as routing signals and recover via qartez replacements.

kuberstar/qartez-mcp · 48 tokens

sem

Use sem to get entity-level (function/class/method) semantic diffs, impact analysis, blame, and dependency context from any Git repo. Trigger this skill whenever the user asks what changed in a commit or PR, wants to understand the blast radius of a change, needs to know who last modified a function, wants to trace…

Ataraxy-Labs/sem · 112 tokens

sem

Semantic version control CLI. Entity-level diffs for Git (functions, classes, methods instead of lines).

Ataraxy-Labs/sem · 0 tokens

lsp-inspect

Full code quality audit for a file, package, or directory. Supports batch mode (directory walk with --top ranking), comparison mode (--diff for branch-only issues), severity calibration by blast radius, fix suggestions, and confidence tiers. Applies a check taxonomy (dead symbols, silent failures, error wrapping…

blackwell-systems/agent-lsp · 126 tokens

lsp-dead-code

Enumerate exported symbols in a file and surface those with zero references across the workspace. Use when auditing for dead code, cleaning up APIs, or checking which exports are safe to remove.

blackwell-systems/agent-lsp · 43 tokens