Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Consolidate path-first lookup docs to reference switch section

Maximilian Roos30e6db5a0135
diff --git a/README.md b/README.md
index 28540d5da..21fac520d 100644
--- a/README.md
+++ b/README.md
@@ -756,7 +756,7 @@ Force-delete an unmerged branch:
wt remove -D experimental
```
-### When Branches Are Deleted
+### Branch Cleanup
Branches delete automatically when their content is already in the target branch (typically main). This works with squash-merge and rebase workflows where commit history differs but file changes match.
@@ -766,17 +766,7 @@ Use `-D` to force-delete unmerged branches. Use `--no-delete-branch` to keep the
Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--no-background` to run in the foreground.
-### Path-First Lookup
-
-Arguments resolve by checking the expected path first, then falling back to branch name:
-
-1. Compute expected path from argument (using configured path template)
-2. If a worktree exists there, remove it (regardless of branch name)
-3. Otherwise, treat argument as a branch name
-
-If `repo.foo/` exists on branch `bar`, both `wt remove foo` and `wt remove bar` remove the same worktree.
-
-**Shortcuts**: `@` (current), `-` (previous), `^` (main worktree)
+Arguments resolve by path first, then branch name—see [wt switch](@/switch.md#path-first-lookup). Shortcuts: `@` (current), `-` (previous), `^` (main worktree).
### See Also
diff --git a/docs/content/remove.md b/docs/content/remove.md
index f5aaa0377..fba963cf0 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -37,7 +37,7 @@ Force-delete an unmerged branch:
wt remove -D experimental
```
-## When Branches Are Deleted
+## Branch Cleanup
Branches delete automatically when their content is already in the target branch (typically main). This works with squash-merge and rebase workflows where commit history differs but file changes match.
@@ -47,17 +47,7 @@ Use `-D` to force-delete unmerged branches. Use `--no-delete-branch` to keep the
Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--no-background` to run in the foreground.
-## Path-First Lookup
-
-Arguments resolve by checking the expected path first, then falling back to branch name:
-
-1. Compute expected path from argument (using configured path template)
-2. If a worktree exists there, remove it (regardless of branch name)
-3. Otherwise, treat argument as a branch name
-
-If `repo.foo/` exists on branch `bar`, both `wt remove foo` and `wt remove bar` remove the same worktree.
-
-**Shortcuts**: `@` (current), `-` (previous), `^` (main worktree)
+Arguments resolve by path first, then branch name—see [wt switch](@/switch.md#path-first-lookup). Shortcuts: `@` (current), `-` (previous), `^` (main worktree).
## See Also
diff --git a/src/cli.rs b/src/cli.rs
index 7fe324a76..2130ddc2b 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1103,7 +1103,7 @@ Force-delete an unmerged branch:
wt remove -D experimental
```
-## When Branches Are Deleted
+## Branch Cleanup
Branches delete automatically when their content is already in the target branch (typically main). This works with squash-merge and rebase workflows where commit history differs but file changes match.
@@ -1113,17 +1113,7 @@ Use `-D` to force-delete unmerged branches. Use `--no-delete-branch` to keep the
Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--no-background` to run in the foreground.
-## Path-First Lookup
-
-Arguments resolve by checking the expected path first, then falling back to branch name:
-
-1. Compute expected path from argument (using configured path template)
-2. If a worktree exists there, remove it (regardless of branch name)
-3. Otherwise, treat argument as a branch name
-
-If `repo.foo/` exists on branch `bar`, both `wt remove foo` and `wt remove bar` remove the same worktree.
-
-**Shortcuts**: `@` (current), `-` (previous), `^` (main worktree)
+Arguments resolve by path first, then branch name—see [wt switch](@/switch.md#path-first-lookup). Shortcuts: `@` (current), `-` (previous), `^` (main worktree).
## See Also
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
index 01dafca66..db31576a6 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -68,7 +68,7 @@ Force-delete an unmerged branch:
wt remove -D experimental
-When Branches Are Deleted
+Branch Cleanup
Branches delete automatically when their content is already in the target branch (typically main). This works with squash-merge and rebase workflows where commit history differs but file changes match.
@@ -78,17 +78,7 @@ Use -D to force-delete unmerged branches. Use --no-delete-branch
Removal runs in the background by default (returns immediately). Logs are written to .git/wt-logs/{branch}-remove.log. Use --no-background to run in the foreground.
-Path-First Lookup
-
-Arguments resolve by checking the expected path first, then falling back to branch name:
-
-1. Compute expected path from argument (using configured path template)
-2. If a worktree exists there, remove it (regardless of branch name)
-3. Otherwise, treat argument as a branch name
-
-If repo.foo/ exists on branch bar, both wt remove foo and wt remove bar remove the same worktree.
-
-Shortcuts: @ (current), - (previous), ^ (main worktree)
+Arguments resolve by path first, then branch name—see wt switch. Shortcuts: @ (current), - (previous), ^ (main worktree).
See Also