migrate-project-template

A project-template migration command that updates a project's CLAUDE.md file when it no longer matches the installed template. It runs automatically through /catchup.

In plain words
What is it for?
Use it when /catchup finds a missing or different template version in CLAUDE.md.
Why use it?
It helps keep project instructions aligned with the shared template and creates a backup before changes are made.

Command

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/b33eep/claude-code-setup/migrate-project-template
Clone the repo
git clone --depth 1 https://github.com/b33eep/claude-code-setup
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 795 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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 $0.00000 $0.00795
Opus 5 $0.00000 $0.00398
Sonnet 5 $0.00000 $0.00159
Haiku 4.5 $0.00000 $0.00080

Measured 2d ago against content hash e79b53388c0d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

migrate-project-template 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 2d 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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

**Preservation:** Never modify content between `<!-- PROJECT INSTRUCTIONS START -->` and `<!-- PROJECT INSTRUCTIONS END -->` markers.
commands/migrate-project-template.md · 91 lines

How it starts

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

Migrate Project Template

Triggered by /catchup when it detects a version mismatch between the project CLAUDE.md and the installed template.

Do NOT run this command directly. It is invoked automatically by /catchup.

Prerequisites

  • Project CLAUDE.md exists in the current working directory
  • Template exists at ~/.claude/templates/CLAUDE.template.md (expand ~ to absolute path)
  • Version mismatch detected (or no version marker in project CLAUDE.md)

Steps

1. Create backup

Copy CLAUDE.md to CLAUDE.md.bak in the project root. This is a safety net for solo-mode users without Git.

2. Read both files

  • Read full project CLAUDE.md
  • Read full template from ~/.claude/templates/CLAUDE.template.md (expand ~ to absolute path)
  • Extract template version from first line: <!-- project-template: N -->

3. Compare sections

Compare ## level headings by text (flat match, ignore nesting/position):

  • Missing: heading exists in template but NOT in project → candidate to add
  • Extra: heading exists in project but NOT in template → candidate to ask about
  • Present in both: no action needed

Also compare ### level headings the same way.

4. Special case: ### Future re-parenting

If ## Records exists in the project and is being removed, check if ### Future is a child of ## Records:

  1. Extract ### Future and all its content (table, entries)
  2. After removing ## Records, re-insert ### Future under ## Current Status (after the "Next Step" line)

5. Present changes to user

Show all proposed changes at once. For each change, ask the user:

For missing sections:

Template v{N} has new sections for your project CLAUDE.md:

- [ ] Add "## Project Instructions" (with preservation markers)
- [ ] Add "## Files" (project structure overview)

Add these sections?

For extra sections:

These sections are no longer in the template:

- [ ] "## Records" — Records on disk in docs/records/ are the source of truth. Remove table from CLAUDE.md?
- [ ] "## Repository" — Still needed?

Remove marked sections?

Read the full file on GitHub · 91 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. 2d ago First seen · 91 lines · 0 tokens per session scan C e79b53388c0d

Subscribe to this mod's changes

migrate-project-template is a command published in the GitHub repository b33eep/claude-code-setup (56 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 795 tokens. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.