plans-and-roadmaps
Skill0 starsChanged 7 days agoMITView on GitHub
Rules for plan documents and roadmaps: where plan files live, whether a plan runs in a worktree, which session a plan is written in, progress stamps, state directories, phased plans, multi-session roadmaps. Load before writing, executing, stamping, or moving a plan: the plan-mode file, any .md under .claude/plans/, or a PLAN*.md / TODO.md being executed. Also load to resume a paused or shelved plan, to list plans by state, or to outline where a roadmap stands.
- Commits and pushes
In this repository18 other files it gives its agents.
- claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- auto-commitSkill
- auto-prSkill
- commit-messagesSkill
- handle-pr-commentsSkill
- issue-trackerSkill
- lint-skillsSkill
- post-merge-cleanupSkill
- pr-summarySkill
- readme-badgesSkill
- releaseSkill
- roadmap-progressSkill
- session-recapSkill
- session-syncSkill
- terseSkill
- unicode-diagramsSkill
- windows-screenshotsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
79 rules. About 0 are common, 29 are distinctive, and 50 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈29
Distinctive · estimate
This author's own choices. Worth a look.
50
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Never move or rename the plan-mode plan file.
- Very specific: line 34
Worktree plans live in the main checkout: When the plan runs in a linked worktree, <target> is the main checkout, not the worktree.
- Distinctive: line 39
Never move or rename it while active.
- Very specific: line 40
Plan-mode directory is the state root: If the plan-mode file sits directly in <target>/.claude/plans/ or one of its state directories, its …
- Very specific: line 50
On
taken: if the name is already a link to this same plan-mode file, the step is done. - Very specific: line 71
In-repo plan-mode directory: When the plan-mode file is inside the target repo but outside .claude/plans/, check its directory too.
- Distinctive: line 105
One line each: Never wrap a header line; the label must open it.
- Distinctive: line 119
At plan approval,: before calling ExitPlanMode, so the answer goes into the plan.
- Distinctive: line 122
While planning a roadmap: Ask once; every phase uses the answer (see Roadmap plans).
- Very specific: line 134
The question: Ask in the same AskUserQuestion call as the auto-commit run-mode question, never as a second prompt.
- Distinctive: line 150
Last: No worktree, without the default mark.
- Very specific: line 177
No
jq: read the three files instead. - Distinctive: line 179
Base detection: Prefer the repo's default branch, without fetching (plan mode cannot write refs).
- Very specific: line 185
Ask GitHub,: only when step 1 fails: gh repo view --json defaultBranchRef -q .defaultBranchRef.name prints <b>.
- Distinctive: line 191
Fallback,: when no step found a ref:
- Very specific: line 209
Hide the option: when nothing matches or there is no origin remote, and say so in one line, e.g.
- Very specific: line 213
Built-in or git: Use the built-in EnterWorktree name=<topic> when the chosen base is what worktree.baseRef gives it:
- Very specific: line 219
Every other case uses git worktree add, such as a fallback base, or an origin base under head.
- Distinctive: line 236
Dirty tree: Only when git status --short is not empty and the user may pick a worktree, add a question to the same call: what happens to …
- Very specific: line 251
Recording: Write the answer as a line under the title, below the stop line and the run-mode line.
- Distinctive: line 265
Creating and entering: After approval, before the first edit:
- Very specific: line 270
Built-in line: call EnterWorktree name=<topic>, with any carry around it (step 4).
- Very specific: line 279
The tool refuses: when the session is already in a worktree, or was launched outside the repo.
- Distinctive: line 285
Git line: create the worktree with git:
- Very specific: line 302
Copy
.worktreeincludefiles,: only if <main>/.worktreeinclude exists. - Very specific: line 334
Link
symlinkDirectories,: after the copy. Claude Code symlinks these directories only into worktrees it creates. - Very specific: line 357
Refused: if the session refuses ln, give the commands in the final report, for the user to run with !
- Very specific: line 417
Fallback: if the exit fails, or a write is still refused, skip it and go on.
- Distinctive: line 420
Re-entry fails: stop and ask. The session is now in the main checkout, so going on would put the worktree's edits there.
- Very specific: line 422
No shell workarounds: Never write <main> paths with sed -i, cat >> or cp to get past the guard.
- Very specific: line 429
Never call ExitWorktree or remove the worktree unless asked, apart from the round trip in Main-checkout writes.
- Very specific: line 453
The session registry says
bg: Run echo $CLAUDE_PID, then jq -r .kind ~/.claude/sessions/<pid>.json with the printed PID, as two plain … - Very specific: line 468
Skip the round trip: Never call ExitWorktree for them.
- Very specific: line 504
When: before entering plan mode, or as soon as it shows up.
- Distinctive: line 509
Skip: when the work does not need the tool, or the current session already has it.
- Distinctive: line 514
Setup only: Do only what the new session needs to start.
- Very specific: line 528
Not a plan: Never put the brief under .claude/plans/, or write it as an approvable plan.
- Distinctive: line 531
Already in plan mode: when this shows up: plan mode can only write the plan file, so write the brief there, under this stop line:
- Very specific: line 537
In the new session: read the brief and confirm the tool is loaded.
- Distinctive: line 551
When a step is finished *and verified*, edit the plan document and append a completion stamp to that step's heading:
- Distinctive: line 563
Never back-date a step you did not just finish.
- Very specific: line 565
Re-read the plan file: before starting or stamping a step, and trust its stamps over the conversation.
- Very specific: line 585
On unblock,: remove the ⛔ and the — Blocked… part, and add the answer to the step's body when later steps rely on it.
- Very specific: line 606
When to show it: when starting a step, and at every stop: a phase boundary, a blocked step, and the finish.
- Very specific: line 624
Wave phases: run their steps side by side, so they show a done count instead: Phase 2/3 · wave, 2/5 steps done.
- Very specific: line 650
Keep the filename: Use git mv if the file is tracked, so history follows it.
- Very specific: line 693
Name collision: if the destination already holds that name (common for a bare PLAN.md), append today's date: PLAN-2026-09-30.md.
- Distinctive: line 696
Update any references to the old path in other documents.
- Very specific: line 697
Legacy names: when you find an untracked PLAN_IN_PROGRESS-<topic>.md or PLAN_COMPLETED-<topic>.md, name it and propose migrating it: strip …
- Distinctive: line 714
Leave the link, and do not write a new plan unless asked.
- Very specific: line 745
Every plan ends with a suggested commit message, either as a final ## Commit message section or inside the last step.
- Distinctive: line 751
After execution, revise it to match what actually changed (check git diff --stat).
- Distinctive: line 771
A phase is one logical change: Keep commits small by sizing phases, not by splitting a phase's commit: if a phase's commit body would list …
- Very specific: line 779
Phase outcome: When a phase finishes, write ### Phase N outcome after its commit message: what actually changed (git diff --stat), …
- Distinctive: line 786
Stop at every phase boundary, after writing the outcome.
- Distinctive: line 788
Do not start the next phase until the user says so.
- Very specific: line 789
Auto-commit run mode: When the plan carries > Run mode: Auto-commit under its title, commit the phase with its message and continue to the …
- Distinctive: line 816
Earlier phase left uncommitted: When the plan starts, record the output of git status --short in the plan as its baseline.
- Very specific: line 830
Squash merge: Only when the user asks, or the repository squash-merges its PRs, add a final ## Squash commit message built from the phase …
- Very specific: line 834
Plan changes mid-way: Never renumber phases or steps, because stamps and conversation refer to the numbers.
- Very specific: line 836
Keep a dropped phase and strike it through: ## ~~Phase 3.
- Distinctive: line 865
Has no open questions: Ask them before approval.
- Very specific: line 880
Do not use the Agent tool's isolation: "worktree".
- Very specific: line 894
Add its shared-file edits,: run the checks, and commit with the step's message, following auto-commit's Before each commit.
- Very specific: line 905
Pause, or no
auto-commitskill: Run the steps in order in the main tree, with no subagents. - Distinctive: line 908
Leftover worktrees: Never remove the step worktrees or branches unless asked.
- Distinctive: line 920
Keep one directory per roadmap:
- Very specific: line 960
Frontmatter: Every roadmap.md opens with YAML frontmatter:
- Very specific: line 975
Writing the roadmap: After it is approved, copy the plan-mode file into <topic>/roadmap.md, never over an existing file or link:
- Distinctive: line 994
Stop. Do not start Phase 1 in the same session.
- Very specific: line 998
Read roadmap.md: Decisions and every earlier outcome.
- Distinctive: line 1000
Run the baseline check from Phased plans before planning.
- Very specific: line 1001
Write the phase plan: under the title, the line below with real paths.
- Very specific: line 1011
If the phase is too big for one commit, propose splitting it into Phase 2a and Phase 2b and plan only the first.
- Very specific: line 1013
After approval, symlink it as phase_N_<subject>.md, link to it under the Phase N heading in roadmap.md, then implement.
- Very specific: line 1021
Write ### Phase N outcome in roadmap.md.
- Distinctive: line 1032
Stop, show the phase's commit message, and wait, per Phased plans.
- Very specific: line 1045
When the user asks where a roadmap stands, as /roadmap-progress does, outline it from the files.
- Very specific: line 1110
Waiting on me: only when something needs the user: blocked steps with their question, a broken phase link, or a > Roadmap: after approval … …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Plans and Roadmaps v1.22.0
These rules apply to the plan-mode plan file, any .md under a
.claude/plans/ directory, and any PLAN*.md or TODO.md you are executing
against. Do not commit them unless asked. Bugs and ideas found while planning
or executing a plan go to the issue-tracker skill, not into the plan.
Plan file location
Never move or rename the plan-mode plan file. It stays at the path plan
mode gives you, by default ~/.claude/plans/<slug>.md; move it and a later
turn reports that no plan exists and offers to write a new one. Below,
~/.claude/plans/<slug>.md stands for that path, wherever it is. Once a
plan is approved, symlink it into the repository, worktree, or sub-repo
that the plan targets, under a name that means something (a roadmap is
copied instead; see Roadmap plans). Never overwrite what is already there:
mkdir -p <target>/.claude/plans
link=<target>/.claude/plans/<topic>.md
if test -e "$link" || test -L "$link"; then
echo "taken: $link"
else
ln -s ~/.claude/plans/<slug>.md "$link"
fi- Choose the target by which files the plan edits. A plan spanning several repos, or touching only workspace-level tooling, belongs at the workspace root instead.
- Worktree plans live in the main checkout. When the plan runs in a
linked worktree,
<target>is the main checkout, not the worktree. See Worktrees. - Link wherever the plan-mode file lives. A
plansDirectorysetting can put it inside the repo; link it the same way, with its absolute path. Never move or rename it while active. - Plan-mode directory is the state root. If the plan-mode file sits
directly in
<target>/.claude/plans/or one of its state directories, its slug files mix with the plans and never get cleaned up. Tell the user once and suggest a separate directory, such as"plansDirectory": ".claude/plan-mode", or removing the setting. If they keep it, still link: slug-named files there are plan-mode files, and only topic-named entries count as plans. <topic>is the plan's subject in snake_case. The generated<slug>may start with words from the prompt, but it is not a topic name; choose<topic>yourself and do not transliterate the slug.- On
taken: if the name is already a link to this same plan-mode file, the step is done. Otherwise ask the user; with their OK, use the date suffix from Plan states (<topic>-2026-09-30.md). Do not add-ftoln: it would replace a real file and lose it. - The link target must be absolute; the unquoted
~form expands to one. A relative target breaks as soon as the link moves into a state directory (see Plan states below). - The link is read-only by construction. Read,
cat, andgrepfollow it, but Write and Edit refuse withRefusing to write through symlink. Always edit~/.claude/plans/<slug>.mdand let the link show the change. Do not try to defeat this with a hard link: the first write replaces the inode and the two paths silently diverge. - Git-ignore
.claude/plans/by default; the symlinks inside are local pointers and never belong in a commit. Unlessgit check-ignore -q <target>/.claude/plans/already succeeds, append.claude/plans/togit rev-parse --git-path info/exclude, not the tracked.gitignore, sogit add -Acannot sweep it into a commit. Use that command rather than a literal.git/info/excludepath: in a linked worktree.gitis a file, andinfo/excludeis shared with the main checkout. Track it only when asked. Skip theinfo/excludestep when the target is not inside a git repo. - In-repo plan-mode directory. When the plan-mode file is inside the
target repo but outside
.claude/plans/, check its directory too. Ifgit ls-filesshows it tracked, leave it alone. If it is untracked andgit check-ignore -qfails, ask before adding it toinfo/exclude. - Nothing travels with the branch. A reviewer, CI, or a fresh clone sees nothing. Moving a plan out of the top level replaces its link with a real copy (see Plan states below); that copy is a record, not the plan. An idle link is also frozen into a real file in place, before cleanup (see Check the link first).
- A project
CLAUDE.mdmay pin the exact destination directory. Where one does, it wins over this section.
Header lines
Lines under a plan's title, such as the stop line, the run-mode line and
the > Worktree: line, form one blockquote. The approval dialog shows it
first, so format it for reading:
- Bold the label: the leading words that name the line, with their
colon, as in
> **Run mode:** Auto-commit. …. A label that runs on to a path bolds only its name:> **Roadmap phase N** of <path>: …. State lines such as> Completed 2026-09-30 14:02.have no label and stay plain. A lone
>between lines, so each starts on its own line:> **Phased plan:** stop after each phase, write its outcome, show its commit message, and wait. Plan file: ~/.claude/plans/<slug>.md > > **Run mode:** Auto-commit. Commit each phase with its message and continue; stop on any gap. See the auto-commit skill. > > **Worktree:** none.Without it, Markdown joins the lines into one paragraph. Never use
<br>, which the terminal may show as text, or trailing spaces or a trailing backslash, which editors strip and renderers treat differently.- One line each. Never wrap a header line; the label must open it.
- Reading: a skill that names a line, such as
> Run mode:, means the line with that label, bold or not. Older plans have plain labels and no separators; leave them as they are, and use this format for any line you add or rewrite.
Worktrees
Claude uses EnterWorktree on its own only when asked, so it never offers
isolation. Ask instead, so the user decides whether a plan runs in a linked
worktree or in the current checkout.
When to ask:
- At plan approval, before calling ExitPlanMode, so the answer goes into the plan.
- Before executing a plan that has no
> Worktree:line yet. - While planning a roadmap. Ask once; every phase uses the answer (see Roadmap plans).
Skip the question, and write no line, when:
- Already in a linked worktree:
git rev-parse --absolute-git-dirdiffers fromgit rev-parse --path-format=absolute --git-common-dir. - Not in a git repo.
- Nothing tracked changes: the plan edits only ignored files or files outside the repo. A plan that adds new tracked files still asks.
- One file: the plan edits exactly one file.
The question. Ask in the same AskUserQuestion call as the auto-commit
run-mode question, never as a second prompt. Offer:
- No worktree (default): run in the current checkout. First, with two exceptions: on a protected branch it comes last, and a background fork leaves it out (see Background forks).
- Worktree from HEAD: a new branch at
.claude/worktrees/<topic>, based on the current local HEAD. - Worktree from origin/
<base>: the same path, based on the detected remote base branch, e.g. "Worktree from origin/main".
On a protected branch (the auto-commit skill's Protected branches:
the default branch, main, master), recommend a worktree instead:
- First: the worktree option that
worktree.baseRefputs first, labelled "(Recommended)". - Last: No worktree, without the default mark.
- Elsewhere, such as on
devor a topic branch, the order above stands.
Show the real base, branch and path in each option. The branch is
worktree-<topic> when the option uses the built-in tool, else
<type>/<topic> (e.g. feat/<topic>); see Built-in or git below.
Option order follows worktree.baseRef. It is the setting that picks
the base of the built-in EnterWorktree name=: fresh (the default)
branches from origin/<default-branch>, head from local HEAD. Read it
from the main checkout; the first file that sets it wins, and none means
fresh. Run one command per file, in this order, skipping a missing file:
jq -r '.worktree.baseRef // empty' .claude/settings.local.json
jq -r '.worktree.baseRef // empty' .claude/settings.json
jq -r '.worktree.baseRef // empty' ~/.claude/settings.jsonfresh: Worktree from origin/<base>comes before Worktree from HEAD.head: Worktree from HEAD comes first.- Two keys only. The skill reads
worktree.baseRefhere, andworktree.symlinkDirectorieson the git line (see LinksymlinkDirectories). No other setting. - One file per command.
jqstops at the first missing file, so one call over all three would hide a later file's value. - No
jq: read the three files instead.
Base detection. Prefer the repo's default branch, without fetching (plan mode cannot write refs). Run each step as its own plain command; the first step that finds a base wins:
- Default branch:
git symbolic-ref --short refs/remotes/origin/HEADprintsorigin/<b>; drop theorigin/. - Ask GitHub, only when step 1 fails:
gh repo view --json defaultBranchRef -q .defaultBranchRef.nameprints<b>. Skip it whenghis missing or not logged in. - Check the ref from step 1 or 2:
git rev-parse --verify --quiet refs/remotes/origin/<b>. A SHA means the base is<b>, adefaultbase. Fallback, when no step found a ref:
git for-each-ref --format='%(refname:short)' refs/remotes/origin/dev refs/remotes/origin/development refs/remotes/origin/main refs/remotes/origin/masterThe first line that is exactly
origin/dev,origin/development,origin/mainororigin/masteris afallbackbase. Output is sorted by name, which matches this priority order. Skip longer names such asorigin/dev/x: each pattern also matches the refs below it.
defaultmeans the base is the default branch;fallbackmeans the default branch is unknown, so the base may not be it.- Plain commands only. A worktree-isolated session refuses compound
shell forms, such as loops,
ifor$(git …), so never join the steps into one script. - Missing
origin/HEADfalls through togh, then the fallback. Outside plan mode,git remote set-head origin -asets it. - Hide the option when nothing matches or there is no
originremote, and say so in one line, e.g. "Worktree from origin is hidden: no origin/HEAD, and no origin/dev, development, main or master ref."
Built-in or git. Use the built-in EnterWorktree name=<topic> when
the chosen base is what worktree.baseRef gives it:
freshand Worktree from origin/<base>, with adefaultbase.headand Worktree from HEAD.
Every other case uses git worktree add, such as a fallback base, or
an origin base under head. Use git for a matching case too when the repo
or the user requires <type>/<topic> branch names, for example in
CLAUDE.md or a branch-name check in CI.
- What the built-in does:
name=<topic>creates the branchworktree-<topic>at.claude/worktrees/<topic>, with no upstream. A/in the name becomes+in both, so use a plain<topic>. - Why prefer it: a worktree created with
name=gets the exit-time keep-or-remove prompt,ExitWorktree action=remove, and theWorktreeCreate/WorktreeRemovehooks. One entered withpath=gets none of these. worktree.sparsePathsis built-in only. Claude Code applies it only to worktrees it creates, so the git line checks out the full tree. The skill does not mirror it: that would turn onextensions.worktreeConfigin the shared.git/config.
Dirty tree. Only when git status --short is not empty and the user
may pick a worktree, add a question to the same call: what happens to the
uncommitted changes. Untracked files count; ignored files do not.
- Leave behind (default): the worktree starts clean.
- Copy: the changes stay in the main checkout and also appear in the worktree.
- Move: the changes leave the main checkout.
- How: see Carrying changes below, in Creating and entering.
- Carried edits are the user's. In the worktree,
auto-commit's dirty-tree check reports them like any other uncommitted change. - Remote base: the changes were made against HEAD, so applying them in
a worktree from origin/
<base>may conflict. On conflict, stop and report. Nothing is lost:stash applykeeps the stash in the list.
Recording. Write the answer as a line under the title, below the stop
line and the run-mode line. Write none too, so execution does not ask
again:
> **Worktree:** feat/<topic> from <sha> at <main>/.claude/worktrees/<topic>; carry: copy. Create it if missing, then EnterWorktree with path. See the plans-and-roadmaps skill.
> **Worktree:** feat/<topic> from origin/dev at <main>/.claude/worktrees/<topic>; carry: leave. Create it if missing, then EnterWorktree with path. See the plans-and-roadmaps skill.
> **Worktree:** built-in worktree-<topic> from origin/main at <main>/.claude/worktrees/<topic>; carry: leave. EnterWorktree name=<topic>, or path= if it exists. See the plans-and-roadmaps skill.
> **Worktree:** none.<sha> is the HEAD at approval, <main> the absolute main-checkout path,
and carry is leave, copy or move. A remote base is recorded as its
ref, not a SHA, because the SHA is only known after the fetch. A built-in
line under head reads from <sha>, like the first example.
Creating and entering. After approval, before the first edit:
- Git-ignore
.claude/worktrees/: unlessgit check-ignore -q .claude/worktrees/succeeds, append it togit rev-parse --git-path info/exclude, as for.claude/plans/. Built-in line: call
EnterWorktree name=<topic>, with any carry around it (step 4). No fetch and nogit worktree add; the tool picks the base itself. No.worktreeincludecopy and no symlink step either; Claude Code makes both for worktrees it creates.- Check the base right after entering: for
from origin/<base>,git merge-base --is-ancestor origin/<base> HEAD; forfrom <sha>,git rev-parse HEADmust equal<sha>. On a mismatch (the setting or HEAD changed since approval), stop and ask. - The tool refuses when the session is already in a worktree, or
was launched outside the repo. Fall back to the git commands below,
with the recorded branch name
worktree-<topic>, thenEnterWorktree path=. Say so in the final report: this worktree gets no exit prompt.
- Check the base right after entering: for
Git line: create the worktree with git:
git worktree add -b <type>/<topic> <main>/.claude/worktrees/<topic> <sha>For a remote base, fetch it first and never track it:
git fetch origin <base> git worktree add --no-track -b <type>/<topic> <main>/.claude/worktrees/<topic> origin/<base>--no-trackis required. With the defaultbranch.autoSetupMerge, a remote-tracking start point becomes the new branch's upstream, so a latergit pushor Auto-PR would targetdevormain.- Fetch fails (offline, auth): stop and ask. Offer to use the
existing
origin/<base>ref as is, or to switch to Worktree from HEAD.
Copy
.worktreeincludefiles, only if<main>/.worktreeincludeexists. Claude Code copies them into worktrees it creates, not into one made withgit worktree add. From the main checkout, copy every untracked file that.worktreeincludematches and git ignores, in one command:git ls-files -z --others --ignored --exclude-from=.worktreeinclude | git check-ignore -z --stdin | tar --null -T - -cf - | tar -xkf - -C <main>/.claude/worktrees/<topic>- Same set as Claude Code:
git check-ignore --stdindrops a matched file that git does not ignore. - One command, not one per file:
tarkeeps the directories, so a pattern such asnode_modules/costs no extra commands. This pipeline is the one exception to Plain commands only. - Never overwrite:
-kskips a file that already exists in the worktree. - Skip or failure: GNU tar exits 2 both for a skip and for a real
failure, such as a full disk, so read its stderr instead. Each
tar: <path>: Cannot open: File existsline is a skip, andtar: Exiting with failure status due to previous errorsfollows any of them. Any other line, or an exit code other than 0 or 2, is a failure: stop and report tar's message. BSD tar skips silently and exits 0, so there any stderr or nonzero exit is a failure. Report the copied files, and any skipped, in the final report. The skipped files are the paths in the
File existslines; the copied files are the rest of this display list. BSD tar names no skips, so there report each file as copied or already present:git ls-files --others --ignored --exclude-from=.worktreeinclude | git check-ignore --stdin- Refused: a worktree-isolated session or a background fork may
refuse this compound command. Skip the copy and give the command in
the final report, for the user to run with
!.
Link
symlinkDirectories, after the copy. Claude Code symlinks these directories only into worktrees it creates. From the main checkout, read the list from each settings file, one plain command each, in the same order asworktree.baseRef, skipping a missing file:jq -r '.worktree.symlinkDirectories // [] | .[]' .claude/settings.local.json jq -r '.worktree.symlinkDirectories // [] | .[]' .claude/settings.json jq -r '.worktree.symlinkDirectories // [] | .[]' ~/.claude/settings.json- Union of the lists. Assumed: the lists merge across files, as
the docs say for
sparsePaths. No output from any file means no links. Per directory, as plain commands with absolute paths: skip it when
test -e <main>/<dir>fails, or when<wt>/<dir>already exists (test -eortest -Lsucceeds), such as a tracked directory or a rerun. Otherwise:ln -s <main>/<dir> <main>/.claude/worktrees/<topic>/<dir>- Absolute target, as Claude Code makes them. Never add
-f: it would replace what is already there. - Report the linked and the skipped directories in the final report, like the copy.
- Refused: if the session refuses
ln, give the commands in the final report, for the user to run with!.
Then call
EnterWorktreewithpath=<main>/.claude/worktrees/<topic>, with any carry around it (step 4).Carrying changes, for Copy or Move, on either line. The stash list is shared by every worktree and session, so tag the entry and apply it by SHA; never run a bare
git stash pop. BeforeEnterWorktree, in the main checkout:git stash push -u -m "carry-<topic>" git stash list --format='%H %gs'Note the SHA on the
carry-<topic>line. For Copy, also rungit stash apply <sha>there, which restores the main checkout. AfterEnterWorktree, in the worktree:git stash apply <sha>Then drop the entry: find the
carry-<topic>line ingit stash list --format='%gd %gs', and rungit stash drop stash@{<n>}. On a conflict, keep it (see Dirty tree).- Why before entering: once inside the worktree, the guard refuses
git -C <main>, so the main checkout gets its changes back first.
- Why before entering: once inside the worktree, the guard refuses
A fresh session, such as after a context clear, follows the line: if the
path exists, enter it with path=, for a built-in line too; if not,
create it first. Carry changes, copy .worktreeinclude files and link
symlinkDirectories only when creating it.
- Only this session's
name=worktree gets the exit prompt andExitWorktree action=remove. Re-entered withpath=, a built-in worktree behaves like a git one.
Plan files stay in the main checkout. The link, completed/ copies and
roadmap directories go to <main>/.claude/plans/, so removing the worktree
cannot delete them. Find <main> with git worktree list --porcelain:
the path on its first worktree line is the main checkout, from any
worktree and from the main checkout itself.
Main-checkout writes from a worktree. A session isolated in a worktree
cannot write to <main>: Claude Code's guard refuses Edit and Write on
its paths, and git -C <main>, without a permission prompt. For a stamp,
a completed/ move or a roadmap edit:
- Leave:
ExitWorktree action=keep. The session returns to the main checkout and the guard lifts. - Write there, with Edit or Write as usual.
- Return:
EnterWorktree path=<main>/.claude/worktrees/<topic>. The guard is back, and work in the worktree goes on.
- Group the writes that fall together, such as a stamp and its
completed/move, into one exit. - A round trip, not a leave. Finishing forbids leaving the worktree unasked; this exit is allowed, because the session returns at once and the worktree stays.
- A
name=worktree re-entered withpath=loses its exit prompt andExitWorktree action=remove. Say so in the final report. - Fallback: if the exit fails, or a write is still refused, skip it
and go on. List each skipped write in the final report, with the exact
change, for the user to make with
!or from a main-checkout session. - Re-entry fails: stop and ask. The session is now in the main checkout, so going on would put the worktree's edits there.
- No shell workarounds. Never write
<main>paths withsed -i,cat >>orcpto get past the guard. - In a background fork, skip the round trip and hand the writes to the parent instead (see Background forks).
Finishing. Stay in the worktree. The final report names its path and
branch, and points to the post-merge-cleanup skill for after the merge.
Never call ExitWorktree or remove the worktree unless asked, apart from
the round trip in Main-checkout writes.
- Auto-PR: a new worktree branch has no upstream, from
git worktree add --no-trackand from the built-in alike, soauto-pris offered on its no-upstream path and createsorigin/<branch>at the first clean finish (see theauto-prskill). - Removal: a worktree entered with
path=is never removed byExitWorktreeor the exit prompt. After the merge,post-merge-cleanupremoves it, built-in or not.
Background forks
A /fork session runs as a background (bg) process. Under the
worktree.bgIsolation setting (default "worktree"), Claude Code's guard
refuses its Edit and Write in the main checkout, and git -C <main>. The
round trip in Main-checkout writes does not help:
ExitWorktree action=keep only lands the fork back in the guarded
checkout.
Detect a fork by either sign:
- A
<fork-source>task notification in the conversation. It names the parent session. - The session registry says
bg. Runecho $CLAUDE_PID, thenjq -r .kind ~/.claude/sessions/<pid>.jsonwith the printed PID, as two plain commands.bgmeans a fork.
Worktree question in a fork:
- Leave out No worktree, and say why in one line: the guard blocks every edit in the main checkout. Offer only the worktree options.
- A plan with
> Worktree: nonestops before its first edit. Offer to enter a worktree now, which records a new> Worktree:line, or to run the plan from/branchor a foreground session.
Main-checkout writes: the plan link, state moves, completed/
copies, roadmap stamps and outcomes, and the phase-link freeze.
- Skip the round trip. Never call
ExitWorktreefor them. - Hand them to the parent with
SendMessagewhenListAgentsshows it. Name each path and the exact change; the parent is a foreground session, so it can write them. - No parent listed: list each write, with the exact change, in the final report, for a foreground session to make.
- Plan-mode file edits go ahead.
~/.claude/plans/<slug>.mdis outside the checkout, so stamps and commit messages still go there. If the guard refuses one, report it as unverified and hand it off like the others. - No shell workarounds, as in Main-checkout writes.
Parallel sessions: a fork always loads session-sync, even when no
sessions file exists yet (see Parallel sessions).
Parallel sessions
These rules assume one session per plan. Before executing a plan or
roadmap phase that carries a > Sessions: line under its title, whose
branch has another active session, or when the session is a background
fork (see Background forks), load the session-sync skill and run its
sync step first. It owns the sessions file, forks and merging
back; this skill still owns the plan.
/branch is sequential: it pauses the original session instead of
running beside it. Back in the original, after /resume, re-read the
plan as Progress marking says; it needs no session-sync flow.
Plan where the tools load
Some tools load only in a session started in a given directory, and only
at startup. For example, a project .mcp.json loads only from the launch
directory. Nothing loads them mid-session, so a plan written elsewhere is
drafted without them, and its approval prompt appears in a session that
must not run it.
When: before entering plan mode, or as soon as it shows up. The
trigger is work that needs such a tool while this session does not have
it: it is missing from /mcp, or its .mcp.json sits in another
directory.
Skip when the work does not need the tool, or the current session already has it.
Hand off instead of planning:
- Setup only. Do only what the new session needs to start. If the directory does not exist yet, for example a new worktree, ask the worktree question now and create it as Worktrees describes. Nothing else.
- Write a brief to
<main>/.claude/handoffs/<topic>.md. It holds the goal, the decisions so far with their reasons, findings with paths, open questions, and what the new session must check with the tool. Git-ignore.claude/handoffs/viainfo/exclude, as for.claude/plans/. - End the turn with the launch command and the first prompt. The
command is one line, with absolute paths and
--add-dirfor every other directory the work edits. The prompt is: "Enter plan mode and plan from<brief path>."
- Not a plan. Never put the brief under
.claude/plans/, or write it as an approvable plan. A fresh session could otherwise treat it as approved and start executing. Already in plan mode when this shows up: plan mode can only write the plan file, so write the brief there, under this stop line:
> **Handoff brief:** do not execute here. After approval, copy it to <brief path> and give the launch command.Then call ExitPlanMode, and after approval do only that.
- In the new session: read the brief and confirm the tool is loaded.
Then plan as usual, which asks the worktree and run-mode questions.
Quote the brief in the plan's
## Context. Once the plan is approved, delete the brief; the plan now holds its content. - Roadmaps: record the launch directory under
## Decisions, so every phase session starts there. - Do not claim the tool is loaded in the current session.
Progress marking
A plan's name never encodes its state; the directory it sits in does. An active plan sits at the top level of its directory, so starting a plan moves and renames nothing.
When a step is finished and verified, edit the plan document and append a completion stamp to that step's heading:
## ✅ Step 3. Wire up the loader (2026-07-28 09:47)- Get the timestamp by running
date '+%Y-%m-%d %H:%M'. Never write a time from memory — you have no clock, only today's date. - Stamp on completion, not on start. Do not add ⏳ / 🚧 / in-progress markers; an unstamped heading already means "not done".
- One
datecall can stamp several steps finished in the same batch. - For checklist items, use
- [x] ✅ Item (2026-07-28 09:47), matching the heading format. - Never back-date a step you did not just finish. If a step was already done before this session, leave it alone.
- Re-read the plan file before starting or stamping a step, and trust
its stamps over the conversation. A
/branchor another session may have advanced it; skip a step it already stamps.
Blocked steps
A step that cannot go on until a question is answered gets a blocked
mark, in Pause and Auto-commit alike. Put ⛔ where ✅ would go, and the
question after the title, with the time from date:
## ⛔ Step 3. Wire up the loader — Blocked: which API key? (2026-11-04 10:12)
### ⛔ Step 4. Add tests — Blocked by Step 3
- [ ] ⛔ Item — Blocked: which API key? (2026-11-04 10:12)- Keep the word.
Blocked:andBlocked bystay next to the glyph, sogrep -n Blockedfinds every blocked step. - Dependents get
Blocked by <step>, with no time; they wait on the step, not on a question. - Blocked is not in progress. It marks a step that needs the user; the ban on ⏳ / 🚧 markers still holds.
- On unblock, remove the
⛔and the— Blocked…part, and add the answer to the step's body when later steps rely on it. Stamp✅on completion as usual. - Whether to go on is the
auto-commitskill's Gaps rule in Auto-commit runs; in Pause, stop and ask. - Stopping with blocked steps leaves the plan at the top level; it is not complete.
Progress line
A step ID alone, such as Step 2.3, says nothing about how much is done
and how much is left. So every chat message that starts a step, and every
stop, opens with a bold progress line: position over total, outer level
first.
**Phase 2/3 · Step 3/5**: Route callers through it- Flat plan:
**Step 3/5**: <title>. - Phased plan or roadmap:
**Phase 2/3 · Step 3/5**: <title>. In a roadmap the phase countsroadmap.md's phases, and the step counts the current phase plan's steps. - When to show it: when starting a step, and at every stop: a phase
boundary, a blocked step, and the finish. At a stop, say what the
numbers point at:
**Phase 2/3** done; next **Phase 3/3 · Step 1/4**: Add tests. - Count from the live headings, re-read from the plan file each time, never from memory. Leave dropped (struck-through) phases and steps out of both the position and the total.
- Positions, not IDs. The step count is the position within its
phase, so
Step 2.3shows asStep 3/5, neverStep 2.3/5. Normally the position equals the ID's last number. - Add the ID only when it differs from the position, after an
inserted or dropped item: with headings
1, 2, 2a, ~~3~~, 4, Phase 2a shows as**Phase 3/4 (2a)**. An inserted step shows as**Step 4/6 (2.3a)**. - The current item is the step being worked on; at a stop, the next open one. Blocked steps count as open, not done.
- No step total yet: a roadmap phase whose phase plan is not written
shows only
**Phase 2/4**. - Wave phases run their steps side by side, so they show a done count
instead:
**Phase 2/3 · wave, 2/5 steps done**. - Never write the line into the plan file. A total in a heading goes stale as soon as a phase is inserted; it lives only in chat.
Plan states
State directories are siblings of the plan, inside the directory it
currently sits in: .claude/plans/completed/, docs/completed/, or
./completed/ for a plan at the repository root.
| Directory | Meaning | When to move |
| top level | active | default; move back here on resume |
completed/ | every step stamped and verified | after the last completion stamp |
paused/ | started, deliberately on hold | when the user shelves it for now |
superseded/ | replaced by a newer plan | when the replacement is written |
archived/ | abandoned or obsolete, not replaced | when the user drops it |
A plan that is a real file just moves, unless it is the plan-mode file itself (see Plan file location):
mkdir -p <dir>/paused && mv <dir>/<topic>.md <dir>/paused/- Untracked plans only. State moves apply to untracked plans. For a tracked plan, ask before moving it.
- Keep the filename. Use
git mvif the file is tracked, so history follows it; else plainmv. Plans are usually untracked, andgit mvfails on untracked files. Leaving the top level makes a real file. Claude Code deletes files in
~/.claude/plans/once they are older thancleanupPeriodDays(default 30), so a link in any state directory would soon dangle. AplansDirectoryinside the repo is not cleaned up, but copy anyway, so the record never depends on a file the user may prune. On every move out of the top level, replace a link with a real copy of its target, then remove the link:mkdir -p <dir>/<state> src=$(readlink -f <dir>/<topic>.md) cp "$src" <dir>/<state>/<topic>.md && rm <dir>/<topic>.md- After copying, never edit the old plan-mode file. The copy is the
plan now. Edits to
~/.claude/plans/<slug>.mdshow up nowhere and are lost at cleanup. - Completed means stamped. Move to
completed/only after the last step has its completion stamp; a plan with any unstamped heading is not done. - The user decides
paused/,superseded/andarchived/. Move there only when asked. Add a state line under the title on every move out of the top level, with the time from
date. Write it into the copy, after copying. When the plan was a link, end the line with its source path; omit that part for a plan that was already a real file:> Completed 2026-09-30 14:02. Copied from ~/.claude/plans/<slug>.md > Paused 2026-09-30 14:02: waiting on the API key. Copied from ~/.claude/plans/<slug>.mdFor
paused/,superseded/andarchived/, give the reason. Forsuperseded/, name the replacement's path, and link back from the new plan.- Resume a plan by moving its copy back to the top level as a real
file, and edit it directly from then on; it has no plan-mode file any
more. A frozen plan (see Check the link first) is already a real file
at the top level, so it simply continues. To re-plan it in plan mode
instead, first move the old copy to
superseded/with a state line naming the new plan, then link the new plan-mode file as Plan file location describes. - List plans by state when asked: the top-level plans as active,
then each state directory (
completed/,paused/,superseded/,archived/), one group per state. - Name collision: if the destination already holds that name (common for
a bare
PLAN.md), append today's date:PLAN-2026-09-30.md. TODO.mdnever moves, whatever its state.- Update any references to the old path in other documents.
- Legacy names: when you find an untracked
PLAN_IN_PROGRESS-<topic>.mdorPLAN_COMPLETED-<topic>.md, name it and propose migrating it: strip the prefix, and move a completed one intocompleted/(barePLAN_COMPLETED.mdbecomescompleted/PLAN.md). Migrate only after the user agrees. Leave tracked ones alone.
Check the link first
Cleanup also reaches active plans: a linked plan, or a running roadmap phase link, left idle for a month loses its plan-mode file. So whenever you start work on, stamp, or resume a plan that is a link, check it first:
- Broken link (
test -Ltrue,test -efalse): the plan-mode file was cleaned up. Tell the user the plan text is gone, and that session transcripts age out under the same rule, so they cannot restore it. Leave the link, and do not write a new plan unless asked. Offer to re-plan it in plan mode, then replace the dangling link with the new one. Old link or target: freeze the plan in place into a real file, and tell the user once:
link=<dir>/<topic>.md src=$(readlink -f "$link") if test -n "$(find "$link" "$src" -mtime +20)"; then cp "$src" "$link.tmp" && mv "$link.tmp" "$link" fiThe docs do not say which timestamp cleanup uses.
findwithout-Ltests the link's own mtime, set at approval and never changed, since edits go through to the target; the target's mtime covers the last edit. Checking both covers either clock.mvreplaces the link itself, not its target. Works with GNU and BSDfind.Add a state line under the title of a frozen plan, with the time from
date. Edit the frozen file directly from then on, as after Resume; never edit the old plan-mode file again.> Frozen 2026-10-13 14:02 before plan-mode cleanup. Copied from ~/.claude/plans/<slug>.md- Threshold: 20 days leaves margin under the default
cleanupPeriodDaysof 30. If the user's setting is known to differ, freeze at two thirds of it. Do not parse settings files to find out. - Skip both checks for a link whose target is inside the repo: an
in-repo
plansDirectoryis never cleaned up.
Commit message in plans
Every plan ends with a suggested commit message, either as a final
## Commit message section or inside the last step. Use a fenced block so it
can be copied verbatim. Write every message, phase messages included, in the
format of the commit-messages skill.
- Draft it when writing the plan, from the intended changes.
- After execution, revise it to match what actually changed (check
git diff --stat); a plan-time draft often drifts from the real diff. - The message is a suggestion, not an instruction to commit. Never run
git commitunless the user explicitly asks, or the plan's run-mode line says Auto-commit or Auto-PR (see theauto-commitandauto-prskills); plan approval, "proceed" and "go ahead" are not requests to commit. - Skip the commit message when the plan's changes land outside any git repo.
Phased plans
A plan with phases gets one commit per phase:
## Phase 1. Extract loader interface
### ✅ Step 1.1 Add Loader type (2026-09-26 10:02)
### Step 1.2 Route callers through it
### Phase 1 commit message
### Phase 1 outcome- A phase is one logical change. Keep commits small by sizing phases, not by splitting a phase's commit: if a phase's commit body would list unrelated changes, make them separate phases. Independent changes that can run side by side form a wave phase instead (see Wave phases).
- Headings:
## Phase N, with### Step N.Munder it. Stamp each step on completion. Stamp the phase heading only when all its steps are stamped. - Each phase ends with its own
### Phase N commit message. That replaces the single message at the end of the plan. - Phase outcome. When a phase finishes, write
### Phase N outcomeafter its commit message: what actually changed (git diff --stat), deviations from the plan, surprises, and new decisions, in a few bullets. A session that resumes after a context clear reads it instead of the lost chat. WriteNone.for a phase that went as planned. A(no separate commit)phase shares the next phase's outcome. Roadmaps write the outcome inroadmap.mdinstead (see Roadmap plans). - Stop at every phase boundary, after writing the outcome. Show the phase's commit message and wait. Do not start the next phase until the user says so.
- Auto-commit run mode. When the plan carries
> Run mode: Auto-commitunder its title, commit the phase with its message and continue to the next one, stopping only as theauto-commitskill says. The> Phased plan:stop line stays; the run-mode line sits under it and overrides only the waiting. If theauto-commitskill is not installed, treat the line as Pause: stop and wait as usual, and tell the user once why. Its safeguards live only in that skill. - Auto-PR run mode. The line
> Run mode: Auto-PR (upstream: …)runs as Auto-commit, then follows theauto-prskill at a clean finish: push the branch and open or update a draft PR. Ifauto-pris not installed, treat the line as Auto-commit whenauto-commitis installed, else as Pause, and tell the user once why. Write the stop rule into the plan. Approval can clear the context and start work from the plan alone, without this skill. So every phased plan carries this line under its title, with the real plan-mode path (a roadmap and its phase plans use their own lines; see Roadmap plans):
> **Phased plan:** stop after each phase, write its outcome, show its commit message, and wait. Plan file: ~/.claude/plans/<slug>.mdThe line stays true for the plan's whole life; never remove it. The run-mode line and the
> Worktree:line (see Worktrees) follow it, in that order, formatted as Header lines says.- Move the plan to
completed/only when every phase is stamped.
Handle these cases:
- Earlier phase left uncommitted. When the plan starts, record the
output of
git status --shortin the plan as its baseline. Before starting a phase, run it again. If it shows changes beyond the baseline, the previous phase was not committed. Stop and ask the user to either commit it now, or continue and combine the two phases. To combine, merge the messages into the later phase's section, with a body that lists both phases, and mark the earlier section(merged into Phase N). The extra changes may instead be the user's unrelated edits, so ask; never assume which it is. In Auto-commit or Auto-PR run mode, such changes are a hard gap: stop and ask the same way, and never commit them. - Phase too small for its own commit. Mark the heading
(no separate commit)when writing the plan, and omit its message section. The next phase's message covers both, and its body names each one. Do not stop at that phase's boundary. - Squash merge. Only when the user asks, or the repository squash-merges
its PRs, add a final
## Squash commit messagebuilt from the phase messages, in the format of thecommit-messagesskill. Otherwise leave it out. - Plan changes mid-way. Never renumber phases or steps, because stamps
and conversation refer to the numbers. Insert a new phase as
Phase 2a. Keep a dropped phase and strike it through:## ~~Phase 3. ...~~ (dropped: <reason>).
Wave phases
A wave phase runs its steps in parallel, one subagent per step, and commits each step on its own. Use it for independent changes, such as one fix applied to several skill folders.
## Phase 2. Add trigger phrases (wave)
> **Wave:** parallel subagents only under Auto-commit or Auto-PR; one commit per step. See plans-and-roadmaps, Wave phases.
### Step 2.1 auto-pr triggers
Files: skills/auto-pr/
Shared: root README row for auto-pr
#### Step 2.1 commit message
### Step 2.2 session-sync triggers
...
### Phase 2 outcomeWriting one. Mark a phase (wave) only when every step:
- Depends on no other step in the phase. Dependent work goes in the next phase.
- Owns its files. List them on a
Files:line; no two steps share a file. - Leaves shared files to the main agent. Root README rows, index
tables, changelogs and lockfiles go on a
Shared:line, never inFiles:. - Can be checked alone with the repo's tests or lint.
- Has no open questions. Ask them before approval.
A wave holds 3 to 5 substantial steps. Two small steps run faster in
order; split more than five into two wave phases. Each step gets its own
#### Step N.M commit message, which replaces the phase's message. The
phase still gets one outcome, and still stops at its boundary in Pause.
The > Wave: line under the heading keeps the rule with the plan after
a context clear.
Running one under Auto-commit or Auto-PR, from the main agent:
- Start clean. The tree must match the run's baseline, so the wave
builds on the committed previous phase. Record
HEADas the wave base. - Create one worktree per step yourself, under
.claude/worktrees/:git worktree add -b wave/<slug>-<N.M> <main>/.claude/worktrees/<slug>-<N.M> <wave base>. Do not use the Agent tool'sisolation: "worktree"; its base may not beHEAD. - Launch the subagents in one message, with the Agent tool, not the
Workflow tool. A plan's
(wave)mark plus its Auto-commit or Auto-PR run mode is the opt-in. Brief each one with its step, its worktree path, itsFiles:line, the shared files it must not touch, and the checks to run. It commits its work on its step branch, which is never pushed. - Wait for all of them. That is the barrier.
- Commit the steps in step order. For each finished step:
- Check its files with
git diff --name-only <wave base> wave/<slug>-<N.M>. A file outside itsFiles:line is a hard gap. - Bring it in with
git merge --squash wave/<slug>-<N.M>. A conflict is a hard gap:git merge --abortand stop. - Add its shared-file edits, run the checks, and commit with the
step's message, following
auto-commit's Before each commit. - Stamp the step.
- Check its files with
- Write the phase outcome once, listing each step's commit.
Handle these cases:
- A step fails or blocks. Mark it
⛔as in Blocked steps, keep its worktree for inspection, and still commit the steps that finished; their edits never touched the main tree. Then stop after the phase, since later phases may depend on the blocked step. - Pause, or no
auto-commitskill. Run the steps in order in the main tree, with no subagents. At the phase boundary, show each step's message with its files, so the user can commit them one by one. - Leftover worktrees. Never remove the step worktrees or branches
unless asked. List them in the stop or finish report. Squash merges
leave the branches looking unmerged, so removing one takes
git worktree removeandgit branch -D, on request.
Roadmap plans
A roadmap is a phased plan whose phases each get their own plan-mode session. Use this when the user asks for a roadmap. The user starts every session and every plan mode; never plan or start the next phase on your own.
Keep one directory per roadmap:
<target>/.claude/plans/<topic>/roadmap.md
<target>/.claude/plans/<topic>/phase_2_<subject>.mdroadmap.mdis a real file, copied from its plan-mode file on approval. It never depends on~/.claude/plans/after that.phase_N_<subject>.mdis a link to its plan-mode file while the phase runs, per Plan file location, and a real copy once the phase finishes.- Plan states apply to the whole
<topic>/directory, not single files:mv .claude/plans/<topic> .claude/plans/completed/. Finished phases are already copies, so nothing is left to copy. If a phase link remains (the roadmap is paused or dropped mid-phase), replace it with a copy first, as Plan states describes. Add the state line toroadmap.mdonly.
The roadmap is the only memory a fresh session gets. The chat is gone, so the roadmap must hold:
Under the title, the line that makes approval safe without this skill (see Phased plans), with the real paths:
> **Roadmap:** after approval, copy ~/.claude/plans/<slug>.md to <target>/.claude/plans/<topic>/roadmap.md and stop. Do not start Phase 1.## Goaland## Decisions: each choice, its reason, and the options rejected. Write these while planning the roadmap, not afterwards.- The
git status --shortbaseline from Phased plans. - One topic branch for all phases, recorded under
## Decisions, unless the roadmap says its phases merge on their own. Under Auto-PR the phases then share one draft PR. - The worktree answer, recorded under
## Decisionsnext to the topic branch: its branch, base (a SHA ororigin/<base>) and path, or none (see Worktrees). Phase 1 creates it; later phases enter it. - One
## Phase N. <title>per phase, one commit each, with scope and done-criteria. NoStep N.Mitems yet; the phase plan writes those. - Under each finished phase,
### Phase N outcome: what actually changed (git diff --stat), deviations from the plan, surprises, and any new decisions. Later phases rely on this instead of the old chat.
Frontmatter. Every roadmap.md opens with YAML frontmatter:
---
created: 2026-10-06 09:47
updated: 2026-10-06 09:47
---- Set both when the roadmap is first written. Get the time from
date '+%Y-%m-%d %H:%M', never from memory. - Refresh
updatedon every edit to the roadmap: completion stamps, outcomes, links to phase plans, and state notes. Onedatecall covers a batch of edits. - Never change
created. roadmap.mdis a real file; edit it directly.
Writing the roadmap. After it is approved, copy the plan-mode file
into <topic>/roadmap.md, never over an existing file or link:
dir=<target>/.claude/plans/<topic>
mkdir -p "$dir"
if test -e "$dir/roadmap.md" || test -L "$dir/roadmap.md"; then
echo "taken: $dir/roadmap.md"
else
cp ~/.claude/plans/<slug>.md "$dir/roadmap.md"
fi- On
taken, ask the user what to do; never overwrite. - In
roadmap.md, replace the> Roadmap: after approval …line with> Copied from ~/.claude/plans/<slug>.md. Left in place, it would tell every later session to copy and stop again. - Git-ignore
.claude/plans/as Plan file location describes. - From now on, edit
roadmap.mddirectly. Re-entering plan mode in this session rewrites only the old plan-mode file, which nothing reads any more; never edit it, as Plan states describes. - Stop. Do not start Phase 1 in the same session.
Planning phase N (user asks, in plan mode, in a fresh session):
- Read
roadmap.md: Decisions and every earlier outcome. Read an earlier phase plan only when an outcome points to it. - Run the baseline check from Phased plans before planning.
Write the phase plan: under the title, the line below with real paths; then a
## Contextsection quoting the decisions and outcomes it depends on, then### Step N.Mitems, then### Phase N commit message.> **Roadmap phase N** of <target>/.claude/plans/<topic>/roadmap.md: after approval, link this plan as phase_N_<subject>.md, implement, write the Phase N outcome there, and stop. Plan file: ~/.claude/plans/<slug>.mdBelow it, copy the run-mode line and a
> Worktree:line built from the roadmap's Decisions, so a fresh session re-enters the same worktree. Do not ask the worktree question again.- If the phase is too big for one commit, propose splitting it into
Phase 2aandPhase 2band plan only the first. - After approval, symlink it as
phase_N_<subject>.md, link to it under the Phase N heading inroadmap.md, then implement. Plan mode can only write the plan file, so roadmap edits wait until after approval.
Finishing phase N:
- Stamp each step in the phase plan (through its plan-mode file, while
it is still a link), then the Phase N heading in
roadmap.md. - Write
### Phase N outcomeinroadmap.md. Replace the phase link with a real copy, in place. This is the freeze from Check the link first, without the age test:
p=<target>/.claude/plans/<topic>/phase_N_<subject>.md src=$(readlink -f "$p") cp "$src" "$p.tmp" && mv "$p.tmp" "$p"mvreplaces the link itself, not its target. Replace the> Roadmap phase N …line with> Copied from ~/.claude/plans/<slug>.md. Later edits, such as a revised commit message, go to the copy.- Stop, show the phase's commit message, and wait, per Phased plans. In
Auto-commit run mode, commit the phase with its message first, then
stop. In Auto-PR run mode, commit, write the outcome, push and open or
update the PR (see the
auto-prskill), then stop. When that push created the upstream, drop, to createfrom the run-mode line in the phase plan and in the roadmap's Decisions. Never plan or start the next phase.
Phase plans stay in <topic>/, as real files, until the whole roadmap is
complete.
Roadmap progress
When the user asks where a roadmap stands, as /roadmap-progress does,
outline it from the files. This is read-only: never stamp, edit, link,
copy or move anything, and never plan or start a phase.
Find the roadmaps in the main checkout, whose path is the first
worktree line of git worktree list --porcelain, so a session inside a
worktree still finds them:
- Active: each
<main>/.claude/plans/<topic>/roadmap.mddirectly under.claude/plans/. The state directories (completed/,paused/,superseded/,archived/) are not topics. - Paused: each
<main>/.claude/plans/paused/<topic>/roadmap.md. Not outlined unless asked for by topic, but named in one closing line:Paused: <topic>, <topic>. - Ignored: roadmaps under
completed/,superseded/andarchived/, unless asked for by topic. - This repo only. A roadmap for another repo lives in that repo.
Choose which to show:
| Request | Situation | Show |
| a topic | its folder name matches exactly | that roadmap's outline, with its state if not active |
| a topic | no exact match | the near matches, one line each; pick none |
| none | no active roadmap | say so, and name the paused ones |
| none | one active | its outline |
| none | several, one on this branch | its outline, then Other roadmaps: <topic>, <topic> |
| none | several, none or many on this branch | the overview, then stop |
- On this branch means the current branch, from
git branch --show-current, appears as a whole word in that roadmap's## Decisions. The match is best-effort: no match or several matches give the overview. Never guess. - Same topic in two states: show the active one, and name the other state in one line.
The overview is one line per active roadmap, using the progress line
and the frontmatter updated time:
- **postgres**: Phase 2/4 · Step 3/5 (updated 2026-11-18 16:20)
- **auth-revamp**: Phase 1/3, not planned yet (updated 2026-11-02 09:12)End it with: Run /roadmap-progress <topic> for one roadmap's outline.
The outline of one roadmap:
**Roadmap postgres**: next **Phase 2/4 · Step 3/5**: Route callers
- ✅ Phase 1. Extract loader interface
- ▶ Phase 2. Add pg adapter: 2/5 steps done, 1 blocked
- ○ Phase 3. Dual-write: not planned yet
- ○ Phase 4. Cut over: not planned yet
Last outcome (Phase 1): 1 deviation: kept the sync loader for tests
Waiting on me: Step 2.4 is blocked: which pool size?
Next, in this session or a new one:
"Continue phase 2 of /abs/path/.claude/plans/postgres/roadmap.md."- Header: the roadmap's title, then the progress line per Progress
line: count phases from
roadmap.md's## Phaseheadings and steps from the current phase plan's### Stepheadings, from the live files, leaving dropped (struck-through) items out. - One line per phase:
✅stamped,⛔has a blocked step,▶the current phase,○not started. Add the step count for a phase with a phase plan, ornot planned yetfor one without. - Last outcome: the latest
### Phase N outcome, in one line. Writeas plannedwhen it saysNone.; skip the line before Phase 1 ends. - Waiting on me: only when something needs the user: blocked steps
with their question, a broken phase link, or a
> Roadmap: after approval …line still inroadmap.md(the copy step never finished). - Next: the prompt to paste, with the roadmap's absolute path:
- Current phase has a plan with open steps:
"Continue phase N of <path>." - Current phase has no plan: in a fresh session, in plan mode,
"Plan phase N of <path>." - Every phase stamped:
"/plans-and-roadmaps move the finished <topic> roadmap to completed."
- Current phase has a plan with open steps:
- Broken phase link: a
phase_N_<subject>.mdthat is a link (test -L) whose target is gone (test -efails) lost its plan-mode file to cleanup. Show only**Phase N/M**, say the link is broken, and never count its steps as zero.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

