Skip to content

docs: clarify safe worktree stacking - #602

Merged
nedtwigg merged 2 commits into
mainfrom
docs/worktrunk-stacking
Sep 9, 2026
Merged

docs: clarify safe worktree stacking#602
nedtwigg merged 2 commits into
mainfrom
docs/worktrunk-stacking

Conversation

@nedtwigg

@nedtwigg nedtwigg commented Sep 9, 2026

Copy link
Copy Markdown
Member

Stacking with git switch -c reuses a worktree that another session may still need. Document creating a separate worktree with wt switch --create --base @, preserving active worktrees, and using an alternate path when the expected path is occupied.

Also clarify explicit working directories for agent commands and pnpm install for fresh worktrees; adjust the AGENTS.md word budget.

Validation: node scripts/spec-lint.mjs and git diff --check pass.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 9, 2026

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 608b11e
Status: ✅  Deploy successful!
Preview URL: https://627d4b88.mouseterm.pages.dev
Branch Preview URL: https://docs-worktrunk-stacking.mouseterm.pages.dev

View logs

@dormouse-bot dormouse-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The merge you just pushed resolves the budget correctly — 3350 covers the merged AGENTS.md at 3323 words, and node scripts/spec-lint.mjs is green on this head. One thing left.

wt isn't named anywhere else in the repo. Grepping the tree for it returns only these two lines — no install step, no link, nothing in Setup. AGENTS.md is the first thing an agent reads, so a Must rule whose verb is a command the reader doesn't have and can't look up is unactionable for exactly the audience the section is written for. Suggestion inline.

The second bullet also has a question in it: --config-set reads as writing persistent configuration, so it isn't clear whether that command permanently repoints worktree-path for every later wt switch in this repo or only for that one invocation — and .REAL carries no explanation, leaving a reader unsure whether it's a literal suffix or a placeholder to substitute. If it's a per-invocation override, saying so is the difference between a safe escape hatch and a change that silently relocates future worktrees.

Comment thread AGENTS.md

## Worktrees

- **Must stack with `wt switch --create <branch> --base @`**, never `git switch -c` in an existing worktree; other sessions need its branch and path intact. Set the GitHub PR base separately.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wt needs an introduction here — it is worktrunk, and nothing else in the repo says so.

Suggested change
- **Must stack with `wt switch --create <branch> --base @`**, never `git switch -c` in an existing worktree; other sessions need its branch and path intact. Set the GitHub PR base separately.
`wt` is [worktrunk](https://github.com/max-sixty/worktrunk), installed separately.
- **Must stack with `wt switch --create <branch> --base @`**, never `git switch -c` in an existing worktree; other sessions need its branch and path intact. Set the GitHub PR base separately.

@nedtwigg
nedtwigg merged commit 61635be into main Sep 9, 2026
10 checks passed
@nedtwigg
nedtwigg deleted the docs/worktrunk-stacking branch September 9, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants