strangler

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

A planning command for gradually replacing a legacy software module with a new implementation behind a shared facade, an interface that hides which version handles a request.

In plain words
What is it for?
Use it to create migration plans, track stages from legacy-only to retired, inspect progress, and advance a module through the replacement process.
Why use it?
It supports coexistence, gradual cutover, rollback, and eventual retirement when replacing the old module all at once would be risky.

Command for Claude Code

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

Not installable on its own: it runs a file from its repository that does not travel with it. Clone the repository, or install whatever ships that file. The line is python3 .harness/methodologies/strangler-fig/scripts/sf.py \.

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

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 studioKjm/ai-harness-template
Claude Code
/plugin install harness

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/studiokjm/ai-harness-template/strangler.svg)](https://agentmods.dev/commands/studiokjm/ai-harness-template/strangler)
Your own site
<a href="https://agentmods.dev/commands/studiokjm/ai-harness-template/strangler"><img src="https://agentmods.dev/badge/commands/studiokjm/ai-harness-template/strangler.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 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,250 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.00022 $0.01250
Opus 5 $0.00011 $0.00625
Sonnet 5 $0.00004 $0.00250
Haiku 4.5 $0.00002 $0.00125

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

Security

Grade A, and why

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

methodologies/strangler-fig/commands/strangler.md · 137 lines

How it starts

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

/strangler — Module-level Legacy Migration

Replace a legacy module gradually via a facade — coexist, then cut over, then retire.

When to use

  • Legacy module is too risky for full rewrite
  • Multiple consumers/endpoints — can't migrate atomically
  • New implementation will replace legacy over weeks/months
  • Want graceful rollback at each phase

Not for:

  • Single-function signature change → use parallel-change (it's function-level)
  • Greenfield work → use ouroboros (no legacy to strangle)
  • One-shot rewrite where downtime is acceptable → just rewrite

Usage

/strangler new <slug> --legacy <path> --new <path> --facade <path> [--title "..."]
/strangler list [--state legacy-only|coexist|new-primary|retired]
/strangler show <plan-id>
/strangler advance <plan-id> <state> [--note "..."] [--force]

For routing rules:

/strangler-route add <plan-id> --pattern "..." --target legacy|new [--reason "..."]
/strangler-route remove <plan-id> --rule-id <id>

For final retirement:

/strangler-retire <plan-id>

Prerequisites

None. Strangler-fig is usable any time.

Instructions

Step 1 — Locate the script

.harness/methodologies/strangler-fig/scripts/sf.py

Step 2 — Run the requested subcommand

python3 .harness/methodologies/strangler-fig/scripts/sf.py \
  new billing-rewrite \
  --legacy "src/legacy/billing/" \
  --new "src/billing/" \
  --facade "src/billing-facade/" \
  --title "Replace 2018 billing module with v2 architecture"

Step 3 — Communicate state changes

After new:

"Strangler plan {id} created. State: legacy-only. Build the facade and at least one routed pattern in the new module before advancing. Add routing rules with /strangler-route add {id} --pattern '...' --target new."

After advance:

"Plan {id}: {from} → {to}. {N} routing rules. Coverage {pct}%. {next-step hint based on state}"

State-specific guidance:

  • legacy-only → coexist: "Now run traffic in production. Monitor for 1-2 weeks before advancing."
  • coexist → new-primary: "Verify no incidents from new module in last 14 days. Performance parity check passed?"
  • new-primary → retired: "Confirm legacy module has 0 inbound traffic for 30+ days before deletion."

Read the full file on GitHub · 137 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 · 137 lines · 22 tokens per session scan A 097b2e1a13ca

Subscribe to this mod's changes

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