migrate

migrate is a command for Claude Code from datathings/marketplace. It costs 16 tokens per session (3,018 once invoked), scanned C, original, Apache-2.0.

A command workflow for GreyCat schema changes, data transformations, bulk import or export, and storage maintenance. A schema defines the fields and structure used to store data.

In plain words
What is it for?
Use it to add, remove, change, or rename fields; migrate stored data; import or export CSV and JSON files; or check, back up, and defragment storage.
Why use it?
It organizes database-management work that can be sequential, interactive, or destructive, and prompts for backups and safety checks before changes.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./bin/greycat install.

Part of the greycat plugin — 1 skill, 8 commands shipped together

Good fit Use it to add, remove, change, or rename fields; migrate stored data; import or export CSV and JSON files; or check, back up, and defragment storage.

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/datathings/marketplace
agentmods
npx agentmods add commands/datathings/marketplace/migrate

Made for: Claude Code.

Or install greycat, the plugin that ships this one along with the rest of its 1 skill, 8 commands.

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/datathings/marketplace/migrate/github.svg)](https://agentmods.dev/commands/datathings/marketplace/migrate)
Your own site
<a href="https://agentmods.dev/commands/datathings/marketplace/migrate"><img src="https://agentmods.dev/badge/commands/datathings/marketplace/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/datathings/marketplace/migrate"><img src="https://agentmods.dev/badge/commands/datathings/marketplace/migrate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,018 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.00016 $0.03018
Opus 5.5 $0.00006 $0.01207
Sonnet 5.5 $0.00003 $0.00604
Haiku 4.5 $0.00002 $0.00302

Measured 3mo ago against content hash a9a15f0dc422, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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.

- **D) Dev reset**: `rm -rf gcdata` (destructive, dev only)
plugins/greycat/commands/migrate.md · 291 lines

How it starts

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

GreyCat Migration & Database Management

Purpose: Schema changes, data transformations, bulk import/export, storage maintenance.

⚠ These ops are sequential, interactive, and destructive — do them one at a time, never in parallel, and back up before anything risky.


Step 1: Choose Operation (AskUserQuestion)

  • A. Schema Evolution — add/remove fields, detect breaking changes
  • B. Data Migration — transform existing data
  • C. Import/Export — bulk CSV/JSON ops
  • D. Storage Health — defrag, backup, diagnostics

Operation A: Schema Evolution

A.1 Scan models

find src -name "*.gcl" -not -name "*_api.gcl" -not -name "*_reader.gcl" -not -name "*_writer.gcl"

Per file: extract type Name { ... } definitions + field lists.

A.2 Ask change type (AskUserQuestion)

Add field · Remove field · Change field type · Rename field (requires migration).

A.3 Add field — safety analysis

The runtime diffs the new program against the stored ABI on rebuild and auto-migrates compatible changes:

  • Add a NULLABLE attribute            → auto-migrates (existing instances read it as null).
  • Add a NON-NULL attribute WITH a default → auto-migrates (existing instances get the default).
  • Add a NON-NULL attribute WITHOUT a default → load FAILS — provide a default or write a migration.
  • Remove an attribute → auto (dropped on next save). Rename → NOT auto (looks like remove + add).

Options:

  • A) Nullable (Recommended): field: T?; — no data touched, safe
  • B) Non-null with default: field: T = <default>; — auto-migrates existing instances to the default
  • C) Nullable → backfill → tighten: for a computed (non-constant) backfill, safe for production
  • D) Dev reset: rm -rf gcdata (destructive, dev only)
  • E) Cancel

Option C (computed backfill) — generate migration:

// src/migration/migrate_YYYYMMDD_<desc>.gcl
fn migrate_add_device_priority() {
  info("Start: add Device.priority");
  var count = 0; var errors = 0;
  for (id: int, device in devices_by_id) {
    try {
      device->priority = 1;  // user-provided default
      count = count + 1;
      if (count % 100 == 0) info("Migrated ${count}...");
    } catch (ex) { error("Failed ${id}: ${ex}"); errors = errors + 1; }
  }
  info("Done: ${count} updated, ${errors} errors");
}

Then: greycat run migrate_add_device_priority → set type non-nullable → greycat lint.

Read the full file on GitHub · 291 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. 3mo ago First seen · 291 lines · 16 tokens per session scan C a9a15f0dc422

Subscribe to this mod's changes

migrate is a command published in the GitHub repository datathings/marketplace (12 stars, last pushed 3d ago), licensed Apache-2.0. It adds 16 tokens to every session and 3,018 once invoked, about $0.0001 per session on Opus 5.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-08-30.

Related

migrate compared with commands from other repositories

migrate next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
migratedatathings/marketplaceCommand123d agoApache-2.0C16Claude Code
initfcakyon/claude-codex-settingsCommand1.2ktodayApache-2.0A0Claude Code
securityajitpratap0/GoSQLXCommand127yesterdayApache-2.0A21Claude Code
database-setupimsaif/design-with-claudeCommand1114d agoMITA36Claude Code
new-migrationRaNDoM6913/claude-code-superkitCommand3todayMITA22Claude Code
json.batch_getstratalab/strata-coreCommand5todayApache-2.0A0Claude Code
kv.batch_getstratalab/strata-coreCommand5todayApache-2.0A0Claude Code