migrate-traffic

migrate-traffic is a command for Claude Code from studioKjm/ai-harness-template. It costs 28 tokens per session (550 once invoked), scanned A, original, MIT.

A command that moves a planned code migration from the expand phase to the migrate phase. A parallel change keeps the old and new versions available together before callers are switched over one at a time.

In plain words
What is it for?
Use it after implementing a replacement and confirming both versions exist, so you can begin moving callers from the old interface or behavior to the new one in separate changes.
Why use it?
It prevents the switch from happening before both versions are actually present and used. The command refuses the transition when either the old or new caller pattern cannot be found.

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/parallel-change/scripts/pc.py advance <plan-id> migrate.

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

Good fit Use it after implementing a replacement and confirming both versions exist, so you can begin moving callers from the old interface or behavior to the new one in separate changes.

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/migrate-traffic

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 migrate-traffic

README.md
[![agentmods](https://agentmods.dev/badge/commands/studiokjm/ai-harness-template/migrate-traffic.svg)](https://agentmods.dev/commands/studiokjm/ai-harness-template/migrate-traffic)
Your own site
<a href="https://agentmods.dev/commands/studiokjm/ai-harness-template/migrate-traffic"><img src="https://agentmods.dev/badge/commands/studiokjm/ai-harness-template/migrate-traffic.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 550 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.00028 $0.00550
Opus 5 $0.00014 $0.00275
Sonnet 5 $0.00006 $0.00110
Haiku 4.5 $0.00003 $0.00055

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

Security

Grade A, and why

migrate-traffic 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 8d 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/parallel-change/commands/migrate-traffic.md · 70 lines

How it starts

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

/migrate-traffic — Advance to Migrate Phase

Expand → Migrate 전환

When to use

  • After verifying with /expand <id> that both old and new coexist
  • When ready to start switching callers from old to new (one PR at a time)

Prerequisites

  • Plan in phase=expand
  • Both old.caller_pattern and new.caller_pattern registered
  • Both patterns currently match in the codebase

Usage

/migrate-traffic <plan-id>

Instructions

Step 1 — Run advance

python3 .harness/methodologies/parallel-change/scripts/pc.py advance <plan-id> migrate

The script:

  • Validates both caller_patterns are set
  • Counts callers of old (must be > 0) and new (must be > 0)
  • If valid: updates phases.current = "migrate" and appends to history
  • If invalid: refuses transition with reason

Step 2 — Report

On success:

"Plan {id}: expand → migrate. Now switch callers one at a time. The state gate enforces both old and new continue to exist until /contract."

On failure (script's stderr will explain):

  • "old signature has 0 callers" → either migration done out-of-band (advance to contract instead) or pattern wrong
  • "new signature not found" → implement new alongside old before transitioning

Step 3 — Migration guidance

After advancing to migrate, instruct the user on the workflow during this phase:

"Migrate phase rules:

  • Switch callers from old → new in small commits (per consumer or per PR)
  • Each commit must keep both old and new working (state gate enforces this)
  • When all callers migrated and pc.py callers <id> shows 0 for old, run /contract"

Constraints

  • Cannot skip from expand to contract — must pass through migrate
  • Cannot return to expand once advanced (state machine is forward-only; revert requires manual yaml edit)
  • The migrate phase is where most of the work happens — it can take days/weeks. Plans stay open until /contract.

Side effects

  • Plan file phases.current changes to migrate
  • Plan file phases.history gains an entry
  • Plan file last_check.timestamp updated
  • No code changes — this is purely a state transition

Read the full file on GitHub · 70 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. 8d ago First seen · 70 lines · 28 tokens per session scan A 2b6f641bdf3c

Subscribe to this mod's changes

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