mcp-rancher: Command for Claude Code

.claude/commands/retrofit.md

retrofit is a command for Claude Code from rex/mcp-rancher. It costs 17 tokens per session (2,733 once invoked), scanned C, original, MIT.

A command that updates an existing code repository so coding agents can work on it more consistently. It applies a five-step change sequence, with each step committed and pushed.

In plain words
What is it for?
Use it to prepare a brownfield repository—that is, an existing project—for agent-assisted development. It helps apply the required repository changes as separate commits or pull requests.
Why use it?
It provides a defined process for preparing an older codebase for agent collaboration. It also checks the repository's Git setup before making branch or push changes.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is rex/mcp-rancher's own configuration. It tells Claude Code how to work on mcp-rancher itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-rancher configures →

Reuse

Borrowing it

Nothing to install: this file belongs to rex/mcp-rancher. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/rex/mcp-rancher/main/.claude/commands/retrofit.md
Clone the repo
git clone --depth 1 https://github.com/rex/mcp-rancher

Made for: Claude Code.

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 retrofit

README.md
[![agentmods](https://agentmods.dev/badge/commands/rex/mcp-rancher/retrofit/github.svg)](https://agentmods.dev/commands/rex/mcp-rancher/retrofit)
Your own site
<a href="https://agentmods.dev/commands/rex/mcp-rancher/retrofit"><img src="https://agentmods.dev/badge/commands/rex/mcp-rancher/retrofit/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 retrofit

Your own site · 80×15
<a href="https://agentmods.dev/commands/rex/mcp-rancher/retrofit"><img src="https://agentmods.dev/badge/commands/rex/mcp-rancher/retrofit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,733 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 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.00017 $0.02733
Opus 5 $0.00009 $0.01367
Sonnet 5 $0.00003 $0.00547
Haiku 4.5 $0.00002 $0.00273

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

Security

Grade C, and why

retrofit scanned grade C 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 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

description mentioning `rm -rf /`). Workaround:
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • retrofit — 100% identical, 0 lines differ
.claude/commands/retrofit.md · 237 lines

How it starts

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

/retrofit — brownfield agent-readiness retrofit

This command runs the 5-PR brownfield sequence top-to-bottom. The user invoking it IS the consent — proceed without any "are we doing this?" check. Each PR is one commit; each commit pushes immediately.

Step 0 — Detect git environment

Before applying any PR, detect the working tree's shape. Each PR's CHECKLIST starts with git checkout -b chore/... — that fails if this is a worktree, detached HEAD, or trunk-strategy repo.

git rev-parse --is-inside-work-tree 2>/dev/null   # is this a git repo?
git symbolic-ref --short HEAD 2>/dev/null         # current branch (empty = detached)
git worktree list 2>/dev/null                     # main checkout vs worktree?
git config --get remote.origin.url 2>/dev/null    # remote URL (empty = no remote)
test -f VIBE.yaml && grep -E '^\s*branch_strategy:' VIBE.yaml  # trunk vs feature-branch?

What to do with each signal:

  • Detached HEAD or worktree: skip the git checkout -b step in every CHECKLIST. Push with git push origin HEAD:<trunk> (where <trunk> is the trunk branch — usually main, sometimes master).
  • branch_strategy: trunk in VIBE.yaml: also skip git checkout -b. Commit directly on the current branch and push.
  • No remote: push steps no-op silently. Surface that and ask the user to add a remote, or proceed without push.

If everything is normal (attached HEAD, single checkout, no trunk strategy), follow each CHECKLIST verbatim.

Step 1 — Discovery (minimal — most answers come from the repo)

Read what's already there before asking anything:

git log --oneline -20      # context for recent activity
ls -la                     # top-level layout
cat README.md              # stated purpose (or AGENTS.md if present)
test -f pyproject.toml && echo python      # stack signal
test -f package.json && echo typescript    # stack signal
test -f Cargo.toml && echo rust            # stack signal
test -f go.mod && echo go                  # stack signal
test -f VIBE.yaml && cat VIBE.yaml         # existing repo policy

Read the full file on GitHub · 237 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 Changed · -33 lines a852d757151b
  2. 10d ago First seen · 270 lines · 17 tokens per session scan C d3f5d634b1c5

Subscribe to this mod's changes

retrofit is a command published in the GitHub repository rex/mcp-rancher (1 stars, last pushed 2d ago), licensed MIT. It adds 17 tokens to every session and 2,733 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.