summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiFiPHile <[email protected]>2026-09-01 10:49:45 +0200
committerHiFiPHile <[email protected]>2026-09-01 10:50:03 +0200
commit1886201632dab617b1bcaeb6a814ef6b2842f79a (patch)
tree8a2986d426872c524afcd4d7523810020cf2518c
parentf4697a0626ffa81617c457c93b64e3c3816c1af0 (diff)
Clarify worktree reuse workflowdocs/worktree-reuse-workflow
-rw-r--r--CLAUDE.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
index d3ab995bf..f567717dc 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -12,7 +12,7 @@ Bias toward caution over speed. For trivial tasks, use judgment.
- **Simplicity** — no features, abstractions, flexibility, or error handling beyond what was asked. If 200 lines could be 50, rewrite.
- **Surgical changes** — touch only what the task requires; match existing style; don't refactor working code; mention unrelated dead code rather than deleting it. Remove only orphans *your* changes created.
- **Goal-driven** — turn tasks into verifiable goals ("write failing test, make it pass"). For multi-step work, state a brief `step → verify` plan.
-- **Worktrees** — default to a git worktree for any branch or multi-step work; never switch the shared primary checkout's branch. Sessions run concurrently: switching the primary checkout mid-flight disrupts other sessions and can silently point a review, build, or commit at the wrong diff. Only trivial one-shot fixes may skip this. Standard location: `.worktrees/<branch-name>` at the repo root (gitignored), e.g. `git worktree add .worktrees/my-branch -b my-branch`. In a new worktree, symlink the dependency dirs (`lib/*`, `hw/mcu/*`, `tools/linkermap` — the keys of `deps_all` in `tools/get_deps.py`) to the primary checkout instead of re-cloning them; only if the branch needs a different dep revision, replace that one symlink with a real dir and run `get_deps.py` for it.
+- **Worktrees** — default to a git worktree for any branch or multi-step work; never switch the shared primary checkout's branch. Before creating a branch or worktree, inspect the active branch and existing worktrees. If the target branch is already checked out, or the target changes already exist in an active checkout, ask the user whether to reuse that checkout before creating another branch or worktree. Sessions run concurrently: switching the primary checkout mid-flight disrupts other sessions and can silently point a review, build, or commit at the wrong diff. Only trivial one-shot fixes may skip this. Standard location: `.worktrees/<branch-name>` at the repo root (gitignored), e.g. `git worktree add .worktrees/my-branch -b my-branch`. In a new worktree, symlink the dependency dirs (`lib/*`, `hw/mcu/*`, `tools/linkermap` — the keys of `deps_all` in `tools/get_deps.py`) to the primary checkout instead of re-cloning them; only if the branch needs a different dep revision, replace that one symlink with a real dir and run `get_deps.py` for it.
## Ground Rules