rename-refs

rename-refs is a skill for Claude Code from Borda/AI-Rig. It costs 135 tokens per session (18,300 once invoked), scanned A, original, Apache-2.0.

A structural refactoring tool for renaming Python functions, classes, methods, or modules and updating their known references. It can also preserve an old name as a deprecated alias or remove it when no callers remain.

In plain words
What is it for?
Use it to rename Python symbols or modules, preview affected files, update imports and documentation references, and optionally mark old names as deprecated.
Why use it?
It reduces the risk of missing imports, re-exports, callers, or Sphinx documentation links during a rename.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the codemap-py plugin — 6 skills shipped together

Good fit Use it to rename Python symbols or modules, preview affected files, update imports and documentation references, and optionally mark old names as deprecated.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Borda/AI-Rig
Claude Code
/plugin install codemap-py

Made for: Claude Code.

Or install codemap-py, the plugin that ships this one along with the rest of its 6 skills.

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 rename-refs

README.md
[![agentmods](https://agentmods.dev/badge/skills/borda/ai-rig/rename-refs/github.svg)](https://agentmods.dev/skills/borda/ai-rig/rename-refs)
Your own site
<a href="https://agentmods.dev/skills/borda/ai-rig/rename-refs"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/rename-refs/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 rename-refs

Your own site · 80×15
<a href="https://agentmods.dev/skills/borda/ai-rig/rename-refs"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/rename-refs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 135 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 18,300 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00135 $0.18300
Opus 5.5 $0.00054 $0.07320
Sonnet 5.5 $0.00027 $0.03660
Haiku 4.5 $0.00014 $0.01830

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

Security

Grade A, and why

rename-refs scanned grade A with 1 finding 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 13d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

answer = subprocess.run(
plugins/codemap-py/claude-skills/rename-refs/SKILL.md · 913 lines

How it starts

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

Rename a Python symbol/module with preflight and verification. Every source write is journaled by rename_snapshot.py: a post-edit failure restores all-or-nothing — each file the run changed gets its original bytes and a recorded git mv is undone with git mv back, but a file changed outside the run's recorded edits is a conflict, and any conflict keeps every file as it is and is reported; Step 7 lists restored files, conflicts and remaining work. Coverage:

  • Definition site (def/class line)
  • __all__ re-exports in __init__.py files
  • Import call sites across all callers (fn-rdeps + symbol line-range narrowing)
  • Non-call references — imports, base classes, isinstance targets, callback values, ancestor __init__.py re-exports — in every file that imports the symbol's module or a re-exporting ancestor package (rdeps)
  • Sphinx docstring cross-refs across .py and .rst
  • Optional pyDeprecate @deprecated alias (--deprecate; needs pyDeprecate)
  • Optional hard-delete when exhaustive=true + zero callers

Subcommands:

  • symbol <old_qname> <new_qname> — function/class/method. qname bare (MyClass) or qualified (MyClass.method); matches symbol-local qualified_name. Module-qualified form (module::symbol) is not accepted by find-symbol.
  • module <old_module_path> <new_module_path> — dotted path (mypackage.old_name). Renames file + all import lines.

Flags:

  • --dry-run — show change sites; no edits
  • --deprecate[=<decorator>] — symbol only: preserve old name as pyDeprecate @deprecated wrapper → new; needs pyDeprecate. Bare derives decorator from symbol type; value pins it, single-quoted (--deprecate='@deprecated_class(...)'). --no-deprecate declines the wrapper.
  • --since <ver> / --removed-in <ver> — deprecation decorator values; default "?"
  • --remove-if-no-callers — symbol only: confirm then delete definition when exhaustive=true + zero callers

Hard limits (static-analysis boundary):

  • getattr(obj, "old_name") — statically unbound string; Step 7 emits grep advisory
  • Cross-repo callers — out of scope; public APIs need --deprecate + semver bump
  • Importers beyond one re-export hop, string references, and same-name symbols of another origin — never edited automatically; Step 6 lists residual whole-word OLD_NAME in Python files for symbols (methods scoped to reference-site files), or literal dotted OLD_REF in Python, stub, documentation and config files for modules. Step 7 reports the count and unresolved references

IDE/LSP coverage preview → --dry-run. Only 1:1 renames.

NOT for: index builds (/codemap-py:scan-codebase); query-only work (/codemap-py:query-code); non-Python; ABC/Protocol symbols with subclass overrides. Static imports don't track overrides: manually review fn-rdeps; rename overrides explicitly. No --index <path>: always default project index. Monorepo --root <pkg> index from /codemap-py:scan-codebase isn't auto-resolved — resolve_proj_index.py derives PROJ only from git-root basename. Before rename, confirm path via resolve_index_env.py or keep --root consistent with default scans.

Step 0: Parse arguments

Question delivery: every AskUserQuestion uses at most 6 plain lines (target 600 characters, hard cap 1,500), no table, pipe layout, or code fence. Include the decision headline, counts and named content file path when applicable. Options carry labels and one-line descriptions, no previews; preserve existing answer mapping and keep the recommended option second. For new candidate/blast artifacts below, use $CSID for <session-id> and probe the path before Writing; if taken, append -2, then -3, … until free. Keep that resolved path for the matching question.

Parse $ARGUMENTS in one Bash block; parse_rename_args.py tokenizes it once (shell quoting rules), validates it and writes every value to a project-qualified sentinel. Later steps read sentinels because shell vars die at each Bash() boundary.

Read the full file on GitHub · 913 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 13d ago Changed · +77 lines · +13 tokens per session 3a352786ca50
  2. 17d ago Changed · +417 lines · -4 tokens per session 84a0cef9cb25
  3. 1mo ago Changed · -1 lines bfd602410d0f
  4. 1mo ago Changed · -278 lines 4e2f50f5a4f5
  5. 1mo ago Changed · -25 lines ac4d7fc61779
  6. 1mo ago Changed · -3 lines 2e717dbff415
  7. 1mo ago Changed · +4 lines bfd7221ce8e7
  8. 1mo ago Changed · +10 lines 41496589bb4f
  9. 2mo ago Changed · +49 lines 05c042f8cd40
  10. 2mo ago First seen · 663 lines · 126 tokens per session scan A d85f62f6ea62

Subscribe to this mod's changes

rename-refs is a skill published in the GitHub repository Borda/AI-Rig (31 stars, last pushed yesterday), licensed Apache-2.0. It adds 135 tokens to every session and 18,300 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

rename-refs compared with skills from other repositories

rename-refs next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rename-refsBorda/AI-RigSkill31yesterdayApache-2.0A135Claude Code
neo-rustBenknightdark/neo-skillsSkill713d agoMITA83Claude Code, Codex
py-reviewerRaNDoM6913/claude-code-superkitSkill3yesterdayMITA35Claude Code
python-anti-patternsJartan-LLC/grimoireSkill47d agoMITA19Claude Code
neo-pythonBenknightdark/neo-skillsSkill713d agoMITA51Claude Code, Codex
coding-guidance-pythonn-n-code/n-n-code-skillsSkill429d agoMITA53Claude Code, Codex
building-telegram-botsisvlasov/rageatc-ossSkill104mo agoMITA68Claude Code