Borrowing it
Nothing to install: this file belongs to design-and-deliver/claude-code-autoconfig. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/design-and-deliver/claude-code-autoconfig/main/.claude/commands/migrate-new-session.mdgit clone --depth 1 https://github.com/design-and-deliver/claude-code-autoconfigWrote 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.
[](https://agentmods.dev/commands/design-and-deliver/claude-code-autoconfig/migrate-new-session)<a href="https://agentmods.dev/commands/design-and-deliver/claude-code-autoconfig/migrate-new-session"><img src="https://agentmods.dev/badge/commands/design-and-deliver/claude-code-autoconfig/migrate-new-session.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01395 |
| Opus 5 | $0.00000 | $0.00698 |
| Sonnet 5 | $0.00000 | $0.00279 |
| Haiku 4.5 | $0.00000 | $0.00139 |
Grade A, and why
migrate-new-session 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 7d 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.
How it starts
The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Run this in the new session. It completes the cutover — no manual /recover-context args, no
manual handoff read. Two modes, auto-detected in Step 1.
Step 1: Resolve the keyword — manifest first, else self-package
The keyword is: $ARGUMENTS (trim whitespace/flags). Look for .claude/handoff/<keyword>.manifest.json.
-
It exists → MANIFEST MODE. Read its fields (
sid8,boundaryIso,handoffFile) and use them for Steps 2–4 exactly as written. -
It doesn't → SELF-PACKAGE MODE. The keyword is a scope slug (e.g. the one a scope-drift nudge printed). There is no pre-written prep — derive it from the old session's terminal-title ledger (
.titles/{sid}.history.jsonl, one line per title change). Run this to find the source session + boundary (collapses each ledger into scope tenures — scope = segment 1 of the title — and matches the keyword against them, slugified the same way the guard emits it; a just-born session whose first ledger line is under 10 minutes old is skipped, so the session you're running this in never matches its own baseline title):node -e " const fs=require('fs'),path=require('path'); const kw=process.argv[1]; const slug=s=>String(s||'').toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-+|-+\$/g,'').slice(0,40).replace(/-+\$/g,'')||'session'; const dir=path.join(process.cwd(),'.claude','hooks','.titles'); let out=[]; try{for(const f of fs.readdirSync(dir).filter(f=>f.endsWith('.history.jsonl'))){ const tenures=[]; for(const line of fs.readFileSync(path.join(dir,f),'utf8').split(/\r?\n/)){ if(!line.trim())continue; let e;try{e=JSON.parse(line)}catch(_){continue} const scope=String(e.title||'').split(' — ')[0].trim(); if(!scope)continue; const last=tenures[tenures.length-1]; if(!last||last.scope!==scope)tenures.push({scope,enteredIso:e.ts}); } if(!tenures.length||Date.now()-Date.parse(tenures[0].enteredIso)<10*60000)continue; const hit=[...tenures].reverse().find(t=>slug(t.scope)===kw); if(hit)out.push({sid8:f.slice(0,8),boundaryIso:hit.enteredIso,scope:hit.scope,mtime:fs.statSync(path.join(dir,f)).mtimeMs}); }}catch(_){} out.sort((a,b)=>b.mtime-a.mtime); console.log(JSON.stringify(out,null,2)); " "<keyword>"- One match → that's
sid8andboundaryIso(the matched tenure's first title write). Continue. - Several matches → list them (
sid8+scope+ recency) and ask which to migrate; stop. - No match / no
.titlesdir (terminal-title module off or ledger absent) → fall back: take the newest*.jsonlin~/.claude/projects/<cwd-slug>/that isn't this session assid8, leaveboundaryIsounset, and use recover-context's own 15-min window. Note the degraded mode in Step 4.
- One match → that's
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.
- 7d ago First seen · 83 lines · 0 tokens per session scan A 47cf81ffe4e1
migrate-new-session is a command published in the GitHub repository design-and-deliver/claude-code-autoconfig (2 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,395 tokens. 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-08-31.
Other commands, from other repositories
cancel-ralph
Cancel active Ralph Loop.
obsidian-recap
Summarize a time period from the vault - today, week, or month.
setup-pm-skills
Onboard a new user — find out what they do, recommend the right bundles & top skills, and set up a project CONTEXT.md so every skill is tailored to them.
statusbar-style
Switch the status-bar style (classic / capsule / hairline).
engage.actions
Execute Phase 7 - Actions on Objectives and Goal Achievement.
superpowers-execute
Execute the current GSD phase plan with Superpowers instead of gsd-execute-phase.