strangler-retire

strangler-retire is a command for Claude Code from studioKjm/ai-harness-template. It costs 24 tokens per session (932 once invoked), scanned A, original, MIT.

A final safety check for retiring a legacy module during a Strangler Fig migration, where a new implementation gradually replaces an old one. It verifies that routing and test-coverage conditions are ready before deletion.

In plain words
What is it for?
Checking that all routes use the new module, coverage is complete, no unrouted paths remain, and the legacy module is ready for deletion after manual traffic verification.
Why use it?
Deleting old code while production still uses it can cause outages. The check confirms the recorded migration conditions, while requiring a person to verify that production traffic has stopped.

Command for Claude Code

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

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 .harness/methodologies/strangler-fig/scripts/sf.py show <plan-id>.

Part of the harness plugin — 44 commands, 11 agents shipped together

Good fit Checking that all routes use the new module, coverage is complete, no unrouted paths remain, and the legacy module is ready for deletion after manual traffic verification.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/studioKjm/ai-harness-template
agentmods
npx agentmods add commands/studiokjm/ai-harness-template/strangler-retire

Made for: Claude Code.

Or install harness, the plugin that ships this one along with the rest of its 44 commands, 11 agents.

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 strangler-retire

README.md
[![agentmods](https://agentmods.dev/badge/commands/studiokjm/ai-harness-template/strangler-retire/github.svg)](https://agentmods.dev/commands/studiokjm/ai-harness-template/strangler-retire)
Your own site
<a href="https://agentmods.dev/commands/studiokjm/ai-harness-template/strangler-retire"><img src="https://agentmods.dev/badge/commands/studiokjm/ai-harness-template/strangler-retire/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 strangler-retire

Your own site · 80×15
<a href="https://agentmods.dev/commands/studiokjm/ai-harness-template/strangler-retire"><img src="https://agentmods.dev/badge/commands/studiokjm/ai-harness-template/strangler-retire.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 932 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.
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.00024 $0.00932
Opus 5 $0.00012 $0.00466
Sonnet 5 $0.00005 $0.00186
Haiku 4.5 $0.00002 $0.00093

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

Security

Grade A, and why

strangler-retire 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 10d 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.

methodologies/strangler-fig/commands/strangler-retire.md · 110 lines

How it starts

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

/strangler-retire — Final Retirement Check

The point of no return. After retire, legacy module is deleted.

When to use

  • All routing rules target new
  • Coverage = 100%
  • Legacy module has had 0 inbound traffic for 30+ days (manually verified)
  • Ready to delete legacy code from the repository

This is the highest-stakes transition. Misuse means deleting code that's still serving production traffic.

Prerequisites

  • Plan in new-primary state
  • All routing_rules have target: new
  • coverage.percent == 100
  • (Manual) production telemetry confirms legacy module has 0 calls

Usage

/strangler-retire <plan-id>

This is an alias for /strangler advance <plan-id> retired.

Instructions

Step 1 — Pre-flight check

Before advancing:

python3 .harness/methodologies/strangler-fig/scripts/sf.py show <plan-id>

Verify:

  • All routing rules target: new
  • coverage.percent: 100
  • coverage.unrouted: []

Step 2 — Manual verification (off-system)

The methodology cannot check production traffic. The user MUST verify before retiring:

  1. Application logs / APM: 0 calls to legacy module functions in last 30 days
  2. Database query logs (if applicable): 0 reads from legacy-specific tables
  3. Feature flag system (if used): legacy paths fully disabled
  4. Stakeholder sign-off (for client projects): client has reviewed cutover

Step 3 — Run retire

python3 .harness/methodologies/strangler-fig/scripts/sf.py retire <plan-id>

The script enforces (auto):

  • Plan in new-primary state
  • All rules target new
  • Coverage 100%

If any check fails, the script blocks. Use --force only with explicit reason recorded.

Step 4 — Post-retire actions

After advancing to retired:

"Plan {id} retired. You may now safely delete the legacy module:

  • Remove {legacy_module.path} directory in a separate commit
  • Update facade to remove legacy fallback code
  • If facade itself becomes unnecessary, remove it after one more cycle
  • Mark related ADRs as superseded"

Read the full file on GitHub · 110 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. 10d ago First seen · 110 lines · 24 tokens per session scan A 4d0753440475

Subscribe to this mod's changes

strangler-retire is a command published in the GitHub repository studioKjm/ai-harness-template (43 stars, last pushed 3mo ago), licensed MIT. It adds 24 tokens to every session and 932 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-30.