SafetyAppears in · Toast / Status lineAdded

Migration Guard

Asks before Claude touches migrations or runs destructive DB commands, with the risk and the line it found.

Migration Guard · Effect preview · IllustrationIllustrative
> Add pagination to the order list
⏺ I’ll look at the list component first.
❯
⚠ High risk · migration-guard
Claude wants to write .../0042_cleanup.sql
DROP COLUMN: deletes the column and its data. Found: ALTER TABLE "users" DROP COLUMN "email"
[1 No] [2 Yes] [3 Yes for this file] (illustrative)

Illustration. Actual results depend on the mod, terminal and environment.

Install

Installation is unusual; follow the original author’s instructions

Read the author’s instructions ↗

What it accesses

Based on the author’s documentation, checked when listed; use claude plugin validate to check for yourself.

Reads

Yes

Reads pending Write/Edit/Bash/PowerShell/Monitor/MCP tool-call arguments and the session cwd.

Writes files

Yes

Writes Q&A history into the mod store Claude Code provides (keepHistory can disable it).

Runs commands

None

Network

None

Introduction

Migration Guard is a Claude Code function-hooks mod that asks before Claude writes or edits migration files, or runs destructive database commands through Bash, PowerShell, Monitor, or MCP, showing risk level and the matched line.

  • Coverage: common ORMs and migrators (Prisma, TypeORM, Rails, Django, Alembic, Supabase, Drizzle, and more), plus direct SQL such as psql/dropdb.
  • Choices: deny, allow once, or allow for this file; optional 15-minute batch allow for ordinary migration files (high risk still asks).
  • History: /migration-guard shows recent Q&A (up to 300, secrets masked); off/on only work when you type them.
  • Access: the author says it only reads the pending tool-call arguments, keeps history in Claude Code's store, and does not read disk, use the network, or run external commands.

Install by git clone into ~/.claude/skills/migration-guard (no marketplace). Needs Claude Code 2.1.287+. Rule-based; not a backup. Preview is illustrative.

Who it is for

  • People who let Claude work on DB-heavy repos and want a confirm step before risky migrations

Requirements

  • Claude Code ≥ 2.1.287
  • Install by cloning into ~/.claude/skills/migration-guard; no marketplace.
  • Rule-based; cannot catch every risk and does not replace backups.