strangler-route

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

A command for managing routing rules during a strangler-fig migration, a gradual replacement of an old software module with a new one.

In plain words
What is it for?
Use it to add or remove rules for HTTP routes, event names, jobs, or other request patterns in an existing migration plan.
Why use it?
It records which requests should go to the old or new implementation, making it possible to move traffic in stages and reduce migration risk.

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 route add \.

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

Good fit Use it to add or remove rules for HTTP routes, event names, jobs, or other request patterns in an existing migration plan.

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-route

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-route

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/studiokjm/ai-harness-template/strangler-route"><img src="https://agentmods.dev/badge/commands/studiokjm/ai-harness-template/strangler-route.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 918 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.00021 $0.00918
Opus 5 $0.00010 $0.00459
Sonnet 5 $0.00004 $0.00184
Haiku 4.5 $0.00002 $0.00092

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

Security

Grade A, and why

strangler-route 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-route.md · 102 lines

How it starts

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

/strangler-route — Manage Routing Rules

Decide which endpoints/patterns flow to legacy vs new module.

When to use

  • After /strangler new — register the first patterns to route
  • During coexist phase — flip patterns from legacy to new as new module catches up
  • When discovering an unrouted endpoint (gate warned about it)

Usage

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

Prerequisites

  • Plan exists (created via /strangler new)
  • For add: --pattern and --target required

Instructions

Step 1 — Run the script

# Add rule
python3 .harness/methodologies/strangler-fig/scripts/sf.py route add \
  sf-2026-04-30-billing-rewrite \
  --pattern "POST /api/refunds" \
  --target new \
  --reason "validated 2 weeks in coexist, no incidents"

# Remove rule
python3 .harness/methodologies/strangler-fig/scripts/sf.py route remove \
  sf-2026-04-30-billing-rewrite \
  --rule-id rule-3

Step 2 — Pattern formats supported

The pattern is a free-form string. Common conventions:

Pattern style Example Use case
HTTP route POST /api/refunds REST API
HTTP wildcard GET /api/refunds/* URL family
Function symbol BillingService.calculate Direct function call routing
Queue topic events:refund.processed Async/event-driven
Feature flag flag:new-billing-enabled Flag-gated routing

The facade implementation (in <plan>.facade.path) interprets these patterns. The methodology doesn't enforce a specific format.

Step 3 — Coverage auto-recompute

Adding/removing rules triggers _recompute_coverage:

  • coverage.routed_count updates
  • coverage.unrouted list refreshes
  • coverage.percent recomputes

If coverage.legacy_endpoints is empty, coverage stays at 0% even with many rules. Run /strangler show to verify endpoint list, or use --scan-endpoints to populate it from the codebase.

Read the full file on GitHub · 102 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 · 102 lines · 21 tokens per session scan A 8cddf0619a6e

Subscribe to this mod's changes

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