migrate

migrate is a command for Claude Code, Codex from terrene-foundation/kailash-coc-claude-py. It costs 55 tokens per session (5,706 once invoked), scanned C, original, Apache-2.0.

A repository migration command that adds the COC setup to an existing codebase or updates an older COC setup. It supports different project templates and can preview or roll back changes.

In plain words
What is it for?
Use it to adopt a non-COC repository, refresh an outdated setup, preview migration changes, or undo a migration.
Why use it?
It removes the manual work of introducing or upgrading the repository's COC files while preserving project information and settings.

Command for Claude CodeCodex

Written for Claude Code and Codex: $CLAUDE_PROJECT_DIR variable, but also reads ~/.codex or $CODEX_HOME. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

Good fit Use it to adopt a non-COC repository, refresh an outdated setup, preview migration changes, or undo a migration.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/terrene-foundation/kailash-coc-claude-py/migrate
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.

Clone the repo
git clone --depth 1 https://github.com/terrene-foundation/kailash-coc-claude-py

Made for: Claude Code, Codex.

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/terrene-foundation/kailash-coc-claude-py/migrate/github.svg)](https://agentmods.dev/commands/terrene-foundation/kailash-coc-claude-py/migrate)
Your own site
<a href="https://agentmods.dev/commands/terrene-foundation/kailash-coc-claude-py/migrate"><img src="https://agentmods.dev/badge/commands/terrene-foundation/kailash-coc-claude-py/migrate/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 migrate

Your own site · 80×15
<a href="https://agentmods.dev/commands/terrene-foundation/kailash-coc-claude-py/migrate"><img src="https://agentmods.dev/badge/commands/terrene-foundation/kailash-coc-claude-py/migrate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,706 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00055 $0.05706
Opus 5 $0.00028 $0.02853
Sonnet 5 $0.00011 $0.01141
Haiku 4.5 $0.00006 $0.00571

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

Security

Grade C, and why

migrate scanned grade C with 1 finding 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 9d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

**Implementation pattern (do NOT wholesale `cp -r sister/.claude/ ./.claude/`):** walk `$SISTER/.claude` per-file; write sister content for shared paths; preserve project-only files. The skill carries the canonical bash
.claude/commands/migrate.md · 147 lines

How it starts

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

/migrate is the COC-adoption front door for an EXISTING repo. Two entry scenarios:

  • (A) Adopt — a NON-COC-NATIVE repo (an existing codebase with no .claude/ COC tree): --adopt bootstraps COC in, selecting the right template family, then emits the per-CLI surfaces.
  • (B) Update — an OUTDATED-COC repo (COC present but stale): full migration upgrades a CC-only lineage to multi-CLI; --refresh re-pulls multi-CLI overlays; a version-behind consumer routes to /sync-from-template.

Template families the co-owner named, all handled here:

  • kailashkailash-coc-claude-{py,rs} (CC-only) + kailash-coc-{py,rs} (multi-CLI), for Kailash-SDK projects.
  • basecoc-claude-base (CC-only) + coc-base (multi-CLI), the stack-agnostic non-Kailash templates (NO kailash- prefix; first-class COC consumers).
  • multi-CLI axis — the CC-only (coc-claude-*) vs multi-CLI (coc-* / kailash-coc-{py,rs}) distinction WITHIN each family; that is the full-migration + --refresh surface, not a separate family.

Project source, workspaces, journals, briefs, todos, .session-notes, .env, and SDK pins are preserved throughout. Detailed protocol (family detection, --adopt bootstrap steps, additive-merge semantics, 3-way reconciliation, verification table, marker schema, --emit-only non-COC lane): skills/30-claude-code-patterns/multi-cli-migration.md. Manifest source-of-truth: .claude/sync-manifest.yaml (repos: for target families/slugs, multi_cli_overlays: for the refresh set).

Modes

Invocation Behavior
/migrate Detect repo state; RECOMMEND the right disposition (adopt / migrate / refresh / sync-from-template) per Step 0. Runs full migration on a CC-only lineage.
/migrate --adopt Scenario A: bootstrap COC onto a repo with NO .claude/ tree. Auto-detects family (or --family kailash|base); defaults to multi-CLI (--cc-only for claude-only).
/migrate --dry-run Detect + print every step's planned actions (adopt OR update); apply nothing.
/migrate --refresh Multi-CLI consumer ONLY: re-pull top-level overlays per multi_cli_overlays.paths.
/migrate --emit-only Non-COC lineage ONLY (e.g. claude-squad-local): emit .codex/, .gemini/, AGENTS.md, GEMINI.md from project's own .claude/.
/migrate --rollback Inline porcelain guard, then git reset --keep main + restore from .pre-migrate.bak.

Read the full file on GitHub · 147 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. 9d ago First seen · 147 lines · 55 tokens per session scan C f53a375cc729

Subscribe to this mod's changes

migrate is a command published in the GitHub repository terrene-foundation/kailash-coc-claude-py (12 stars, last pushed 24d ago), licensed Apache-2.0. It adds 55 tokens to every session and 5,706 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.