Skip to content

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

docs: improve wt remove help text (#792)

Maximilian Roos1f361b6f455f
diff --git a/.claude-plugin/skills/worktrunk/reference/remove.md b/.claude-plugin/skills/worktrunk/reference/remove.md
index 7582ab3a6..275c27c4b 100644
--- a/.claude-plugin/skills/worktrunk/reference/remove.md
+++ b/.claude-plugin/skills/worktrunk/reference/remove.md
@@ -1,6 +1,6 @@
# wt remove
-Remove worktree; delete branch if merged. For finished feature branches. Removes the current worktree by default.
+Remove worktree; delete branch if merged. Defaults to the current worktree.
## Examples
@@ -66,11 +66,15 @@ Without `--force`, removal fails if the worktree contains untracked files. Witho
Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--foreground` to run in the foreground.
+## Hooks
+
+`pre-remove` hooks run before the worktree is deleted (with access to worktree files). `post-remove` hooks run after removal. See [`wt hook`](https://worktrunk.dev/hook/) for configuration.
+
## Command reference
wt remove - Remove worktree; delete branch if merged
-For finished feature branches. Removes the current worktree by default.
+Defaults to the current worktree.
Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <span class=c>[BRANCHES]...</span>
diff --git a/docs/content/remove.md b/docs/content/remove.md
index b1494b97a..e026a1d97 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -8,7 +8,7 @@ group = "Commands"
<!-- ⚠️ AUTO-GENERATED from `wt remove --help-page` — edit cli.rs to update -->
-Remove worktree; delete branch if merged. For finished feature branches. Removes the current worktree by default.
+Remove worktree; delete branch if merged. Defaults to the current worktree.
## Examples
@@ -74,6 +74,10 @@ Without `--force`, removal fails if the worktree contains untracked files. Witho
Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--foreground` to run in the foreground.
+## Hooks
+
+`pre-remove` hooks run before the worktree is deleted (with access to worktree files). `post-remove` hooks run after removal. See [`wt hook`](@/hook.md) for configuration.
+
## See also
- [`wt merge`](@/merge.md) — Remove worktree after merging
@@ -84,7 +88,7 @@ Removal runs in the background by default (returns immediately). Logs are writte
{% terminal() %}
wt remove - Remove worktree; delete branch if merged
-For finished feature branches. Removes the current worktree by default.
+Defaults to the current worktree.
Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <span class=c>[BRANCHES]...</span>
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 39dc6b31d..2eee0b245 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -682,7 +682,7 @@ Missing a field that would be generally useful? Open an issue at https://github.
/// Remove worktree; delete branch if merged
///
- /// For finished feature branches. Removes the current worktree by default.
+ /// Defaults to the current worktree.
#[command(after_long_help = r#"## Examples
Remove current worktree:
@@ -747,6 +747,10 @@ Without `--force`, removal fails if the worktree contains untracked files. Witho
Removal runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--foreground` to run in the foreground.
+## Hooks
+
+`pre-remove` hooks run before the worktree is deleted (with access to worktree files). `post-remove` hooks run after removal. See [`wt hook`](@/hook.md) for configuration.
+
## See also
- [`wt merge`](@/merge.md) — Remove worktree after merging
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 9eb8e5aeb..06413fe1e 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -24,7 +24,7 @@ exit_code: 0
----- stderr -----
wt remove - Remove worktree; delete branch if merged
-For finished feature branches. Removes the current worktree by default.
+Defaults to the current worktree.
Usage: wt remove [OPTIONS] [BRANCHES]...
@@ -120,6 +120,10 @@ Without --force, removal fails if the worktree contains untracked files.
Removal runs in the background by default (returns immediately). Logs are written to .git/wt-logs/{branch}-remove.log. Use --foreground to run in the foreground.
+Hooks
+
+pre-remove hooks run before the worktree is deleted (with access to worktree files). post-remove hooks run after removal. See wt hook for configuration.
+
See also
- wt merge — Remove worktree after merging