migrate

migrate is a command for Claude Code from Piyush8296/claude-workspace. It costs 10 tokens per session (546 once invoked), scanned A, original, MIT.

A guided process for replacing one coding pattern, library, or approach with another across a project. It first measures the affected code, assesses risk, plans the work, and applies changes in small batches.

In plain words
What is it for?
Use it to move code from an old library or design to a new one, estimate the affected files, organize the migration, verify each batch, and remove the old approach afterward.
Why use it?
Large migrations can break shared code or miss hidden users of the old pattern. Incremental changes with tests, type checks, checkpoints, and rollback notes make problems easier to find and undo.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/piyush8296/claude-workspace/migrate
Clone the repo
git clone --depth 1 https://github.com/Piyush8296/claude-workspace

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 migrate

README.md
[![agentmods](https://agentmods.dev/badge/commands/piyush8296/claude-workspace/migrate.svg)](https://agentmods.dev/commands/piyush8296/claude-workspace/migrate)
Your own site
<a href="https://agentmods.dev/commands/piyush8296/claude-workspace/migrate"><img src="https://agentmods.dev/badge/commands/piyush8296/claude-workspace/migrate.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 546 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.00010 $0.00546
Opus 5 $0.00005 $0.00273
Sonnet 5 $0.00002 $0.00109
Haiku 4.5 $0.00001 $0.00055

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

Security

Grade A, and why

migrate 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 5d 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.

.claude/commands/migrate.md · 71 lines

What it actually says

Migration Assistant

Migrate: $ARGUMENTS

Instructions

1. Assess scope

# Find all files using the old pattern
grep -rn "<old-pattern>" src/ --include='*.ts' --include='*.tsx' | wc -l
grep -rn "<old-pattern>" src/ --include='*.ts' --include='*.tsx' --files-with-matches

Report:

  • Total occurrences
  • Files affected
  • Areas of the codebase impacted

2. Risk assessment

Classify risk:

  • LOW: Internal utility, full test coverage, isolated
  • MEDIUM: Shared component, partial tests, known consumers
  • HIGH: Core abstraction, minimal tests, unknown dependents

3. Create migration plan

For each step:

  1. What changes
  2. How to verify it works
  3. How to rollback if needed
  4. Estimated scope (files/lines)

4. Execute incrementally

For each batch:

  1. Create a checkpoint: git stash or commit
  2. Apply changes to a small batch (5-10 files max)
  3. Run tests: npx vitest run
  4. Run type check: npx tsc --noEmit
  5. Commit if green: git commit -m "refactor: migrate <batch> from <old> to <new>"
  6. If red: diagnose, fix, or rollback

5. Cleanup

After all batches:

  • Remove old pattern if fully migrated
  • Update documentation
  • Remove deprecated imports/exports
  • Run full test suite

Common Migration Paths

From To Strategy
Class components Function + hooks Wrap, convert, verify
Redux Zustand Create store alongside, migrate consumers
CSS/SCSS Tailwind Component by component, visual regression
REST tRPC/GraphQL Dual-write period, switch consumers
Jest Vitest Config swap, fix API differences
CRA Vite/Next.js New entry point, move routes incrementally
PropTypes TypeScript Add types alongside, remove PropTypes
Moment.js date-fns Function by function replacement
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. 5d ago First seen · 71 lines · 10 tokens per session scan A daa40d26064d

Subscribe to this mod's changes

migrate is a command published in the GitHub repository Piyush8296/claude-workspace (2 stars, last pushed 4mo ago), licensed MIT. It adds 10 tokens to every session and 546 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-31.

Related

Other commands, from other repositories

review-pr

Multi-agent PR review with four modes (review, re-review, self-review, address-feedback) - spawns parallel subagents, saves diff to /tmp for context efficiency, supports file exclusion patterns.

hoblin/claude-ruby-marketplace · 39 tokens

resume_handoff

Resume work from handoff document with context analysis and validation.

hoblin/claude-ruby-marketplace · 11 tokens

feature

Command "feature" from hoblin/claude-ruby-marketplace, covering input format, context, workflow, step 1: setup and step 2: gather historical context.

hoblin/claude-ruby-marketplace · 0 tokens

sm-sail

Command "sm-sail" from ScienceIsNeato/slop-mop, covering /sm-sail — drive a pr to green, autonomously, the loop, when sail parks on review threads, when to stop before "pr ready" — only two reasons and expect convergence, not one pass.

ScienceIsNeato/slop-mop · 0 tokens

sm-buff

You usually don't run buff directly — run sm sail. sm sail drives the whole PR to green and calls buff watch / triage for you, stopping only when it needs you to act (see /sm-sail). Reach for sm buff here only for surgical work: inspecting a specific failure, or resolving a single review thread when sail has parked on…

ScienceIsNeato/slop-mop · 0 tokens

sm-wake-angry-drunk-captain

The last-resort verb. Use it ONLY when the loop is genuinely exhausted: barnacles filed, gates green or truly unfixable, and the single remaining move is a human judgment call no sm verb can make for you.

ScienceIsNeato/slop-mop · 0 tokens