migrate-embedding-model

migrate-embedding-model is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 60 tokens per session (1,042 once invoked), scanned A, original, MIT.

A planning and code-generation command for changing the embedding model used by pgvector tables or Weaviate collections. Embeddings are numeric representations that let systems search text by meaning.

In plain words
What is it for?
Use it to plan model changes, find old-model references, estimate re-embedding costs, and generate SQL or Python migration artifacts.
Why use it?
It helps move existing vector data to a new model while identifying affected code, estimating API cost, and keeping the database migration reversible.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to plan model changes, find old-model references, estimate re-embedding costs, and generate SQL or Python migration artifacts.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kumaran-is/claude-code-onboarding/migrate-embedding-model
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/kumaran-is/claude-code-onboarding

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-embedding-model

README.md
[![agentmods](https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/migrate-embedding-model.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/migrate-embedding-model)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/migrate-embedding-model"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/migrate-embedding-model.svg" alt="Measured on agentmods" height="20"></a>
Per session 60 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,042 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.00060 $0.01042
Opus 5 $0.00030 $0.00521
Sonnet 5 $0.00012 $0.00208
Haiku 4.5 $0.00006 $0.00104

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

Security

Grade A, and why

migrate-embedding-model 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-embedding-model.md · 107 lines

How it starts

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

Migrate Embedding Model

Plan and generate a safe embedding model migration using expand-deploy-contract.

Input: $ARGUMENTS (e.g., "text-embedding-3-small text-embedding-3-large vendors tickets")

Steps

  1. Load the vector-database skill — read SKILL.md and references/embedding-migration-guide.md for the full procedure.

  2. Gather requirements — Extract from $ARGUMENTS or ask:

    • From model (current)
    • To model (new)
    • Tables/collections to migrate
    • Migration format (Flyway SQL / Alembic Python / Weaviate Python)
  3. Discover affected code — Grep the codebase for:

    grep -rn "{from_model}" --include="*.py" --include="*.sql" --include="*.ts"
    grep -rn "embedding_model" --include="*.py" --include="*.sql"
    

    Report all files referencing the old model that will need updates.

  4. Estimate cost:

    • For each table: SELECT COUNT(*), AVG(LENGTH({text_col})) FROM {table}
    • Calculate: total_tokens = row_count × avg_chars / 4
    • Cost at both model rates (from skill's model table)
    • Report: "Estimated cost: $X.XX for {from_model} → {to_model}"
  5. Generate migration artifacts:

    Phase 1 — Expand migration (safe, reversible)

    V{N}__expand_embedding_{table}_{new_model_slug}.sql
    
    • Adds embedding_v2 vector({new_dims}) column
    • Adds embedding_model_v2 varchar(100) column
    • Creates HNSW index on embedding_v2
    • Adds reembedding_status varchar(20) DEFAULT 'pending'

    Re-embedding script

    scripts/re_embed_{table}.py
    
    • Batch async re-embedding using embed_batch()
    • Reads from {text_col}, writes to embedding_v2
    • Progress logging + reembedding_status tracking
    • Idempotent: WHERE embedding_v2 IS NULL
    • Dry-run mode: --dry-run flag to preview without writing

    Verification queries

    scripts/verify_reembedding_{table}.sql
    
    • Count pending vs done
    • Spot-check recall comparison (old vs new similarity scores)

Read the full file on GitHub · 107 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. 5d ago First seen · 107 lines · 60 tokens per session scan A 318525c259b4

Subscribe to this mod's changes

migrate-embedding-model is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 60 tokens to every session and 1,042 once invoked, about $0.0003 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-09-03.