git-worktrees 0.10.0__tar.gz → 0.11.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/AGENTS.md +39 -15
  2. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/CHANGELOG.md +64 -0
  3. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/PKG-INFO +75 -47
  4. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/README.md +74 -46
  5. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/completions/gw.fish +6 -5
  6. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/conf.d/worktrees.fish +1 -1
  7. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/docs/REFERENCE.md +52 -23
  8. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/docs/commands/branch-prune.md +8 -5
  9. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/docs/commands/branch-status.md +16 -10
  10. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/docs/commands/fast-forward.md +20 -0
  11. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/.claude-plugin/plugin.json +2 -2
  12. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/.codex-plugin/plugin.json +4 -4
  13. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/README.md +23 -6
  14. git_worktrees-0.11.0/plugin/hooks/codex.json +16 -0
  15. git_worktrees-0.11.0/plugin/hooks/hooks.json +16 -0
  16. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/plugin.json +2 -2
  17. git_worktrees-0.11.0/plugin/session.md +32 -0
  18. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/skills/prune/SKILL.md +30 -25
  19. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/skills/ship-it/SKILL.md +26 -22
  20. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/pyproject.toml +1 -1
  21. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/branch_cli.py +9 -9
  22. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/branches.py +90 -24
  23. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/cli.py +145 -75
  24. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/fast_forward.py +13 -6
  25. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/merged.py +146 -10
  26. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/new_branch.py +40 -10
  27. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/prune.py +133 -31
  28. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/render.py +1 -1
  29. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/verdicts.py +126 -50
  30. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/worktree.py +3 -5
  31. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/conftest.py +7 -1
  32. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_assessment.py +197 -41
  33. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_branch_forge.py +22 -1
  34. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_branches.py +7 -4
  35. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_cli.py +155 -86
  36. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_completions.py +18 -18
  37. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_fast_forward.py +8 -0
  38. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_forge.py +10 -9
  39. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_gates.py +33 -38
  40. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_new_branch.py +153 -2
  41. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_partial_clone.py +11 -8
  42. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_plugin.py +63 -25
  43. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_removal.py +19 -22
  44. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_sync.py +19 -10
  45. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_worktree.py +40 -44
  46. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/uv.lock +1 -1
  47. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/completions/_gw +6 -5
  48. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/worktrees.plugin.zsh +1 -1
  49. git_worktrees-0.10.0/plugin/skills/new-branch/SKILL.md +0 -51
  50. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/.claude/settings.json +0 -0
  51. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/.codex/config.toml +0 -0
  52. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/.github/workflows/codeql.yml +0 -0
  53. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/.github/workflows/publish.yml +0 -0
  54. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/.github/workflows/testpypi.yml +0 -0
  55. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/.github/workflows/tests.yml +0 -0
  56. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/.gitignore +0 -0
  57. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/.pre-commit-config.yaml +0 -0
  58. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/.python-version +0 -0
  59. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/.releasetools.yaml +0 -0
  60. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/LICENSE +0 -0
  61. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/Makefile +0 -0
  62. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/completions/worktrees.fish +0 -0
  63. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/docs/BENCHMARK.md +0 -0
  64. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/docs/DEVELOPMENT.md +0 -0
  65. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/docs/commands/ci-checks.md +0 -0
  66. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/docs/commands/merge.md +0 -0
  67. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/docs/plans/2026-11-05-worktree-pruning-design.md +0 -0
  68. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gw.fish +0 -0
  69. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwa.fish +0 -0
  70. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwbc.fish +0 -0
  71. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwbp.fish +0 -0
  72. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwbs.fish +0 -0
  73. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwff.fish +0 -0
  74. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwl.fish +0 -0
  75. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwm.fish +0 -0
  76. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwp!.fish +0 -0
  77. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwp.fish +0 -0
  78. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwpa!.fish +0 -0
  79. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwpa.fish +0 -0
  80. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwr!.fish +0 -0
  81. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gwr.fish +0 -0
  82. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/functions/gws.fish +0 -0
  83. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/hatch_build.py +0 -0
  84. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/skills/ci-checks/SKILL.md +0 -0
  85. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/skills/describe-pr/SKILL.md +0 -0
  86. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/skills/describe-pr/format.md +0 -0
  87. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/skills/fast-forward/SKILL.md +0 -0
  88. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/skills/preflight/SKILL.md +0 -0
  89. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/skills/preflight/agents/openai.yaml +0 -0
  90. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/skills/preflight/rules.json +0 -0
  91. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/plugin/skills/ship-it/rights.md +0 -0
  92. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/renovate.json +0 -0
  93. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/scripts/README.md +0 -0
  94. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/scripts/benchmark.py +0 -0
  95. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/scripts/bump_version.py +0 -0
  96. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/scripts/verify-publish.bash +0 -0
  97. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/__init__.py +0 -0
  98. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/branch_forge.py +0 -0
  99. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/ci.py +0 -0
  100. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/errors.py +0 -0
  101. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/forge.py +0 -0
  102. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/git.py +0 -0
  103. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/layout.py +0 -0
  104. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/pick.py +0 -0
  105. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/pr_merge.py +0 -0
  106. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/progress.py +0 -0
  107. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/repo.py +0 -0
  108. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/src/worktrees/sync.py +0 -0
  109. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_benchmark.py +0 -0
  110. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_ci.py +0 -0
  111. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_command_defaults.py +0 -0
  112. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_fixture.py +0 -0
  113. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_git_records.py +0 -0
  114. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_path_boundaries.py +0 -0
  115. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_pr_merge.py +0 -0
  116. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_render.py +0 -0
  117. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_shims.py +0 -0
  118. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_spec.py +0 -0
  119. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/tests/test_version.py +0 -0
  120. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gw +0 -0
  121. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwa +0 -0
  122. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwbc +0 -0
  123. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwbp +0 -0
  124. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwbs +0 -0
  125. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwff +0 -0
  126. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwl +0 -0
  127. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwm +0 -0
  128. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwp +0 -0
  129. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwp! +0 -0
  130. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwpa +0 -0
  131. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwpa! +0 -0
  132. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwr +0 -0
  133. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gwr! +0 -0
  134. {git_worktrees-0.10.0 → git_worktrees-0.11.0}/zsh/plugins/worktrees/functions/gws +0 -0
@@ -86,7 +86,11 @@ of the line alone, so no shortcut meets history expansion. `!!` would.
86
86
  `gw branch create` and `gw fast-forward` start branches, not worktrees.
87
87
  `gw branch create NAME` starts NAME off the head ref, as `origin new-branch`
88
88
  does, and keeps argparse's 2 for a usage error where `origin` has a single
89
- non-zero exit code.
89
+ non-zero exit code. On a terminal, standing on a branch other than the head
90
+ branch, it asks whether to stack NAME on that branch, and the sync it runs
91
+ first runs on a thread meanwhile: `_refresh` starts the spinner only once
92
+ the answer is in, so nothing draws over the question. `--here` starts NAME
93
+ from the commit this checkout is on and syncs nothing.
90
94
 
91
95
  `gw fast-forward` starts a branch only when the one you stand on is proved
92
96
  finished, by the same `merged.branch_proof` that `gw prune` reads, or when
@@ -187,14 +191,13 @@ watching. A shortcut has no completion file of its own.
187
191
 
188
192
  ## The agent plugin reads `--json`
189
193
 
190
- `plugin/` ships with the CLI: seven skills, each a directory under
194
+ `plugin/` ships with the CLI: six skills, each a directory under
191
195
  `plugin/skills/` named as its command is, `/worktrees:<name>` in Claude Code
192
196
  and `$worktrees:<name>` in Codex. Skills call `gw` from `$PATH`; nothing
193
197
  assumes a plugin root or a checkout at a known path.
194
198
 
195
199
  | skill | runs |
196
200
  | --- | --- |
197
- | `new-branch` | `gw sync`, then `gw branch create` |
198
201
  | `fast-forward` | `gw fast-forward --autostash --json`, then each rebase conflict until the branch is level |
199
202
  | `ci-checks` | `gw ci-checks --json`, `--wait` to wait without polling |
200
203
  | `describe-pr` | checks a review's title and body against its diff, and edits them |
@@ -224,8 +227,8 @@ skill's commands to never writing `--force`, `--admin`, `--auto` or
224
227
  `--delete-branch`.
225
228
 
226
229
  The prune skill reads `gw prune --json` and
227
- `gw branch status --json`, preserving head/sync state and full rows for eligible, empty,
228
- stash-blocked and ignored-file cases. `tests/test_plugin.py` extracts the
230
+ `gw branch status --json`, preserving head/sync state and full rows for eligible, empty
231
+ and stash-blocked cases, and each worktree's ignored paths. `tests/test_plugin.py` extracts the
229
232
  actual jq filters and applies them to real CLI output. Checked-out branches
230
233
  are absent from the loose-branch list. Paths and restore commands must retain
231
234
  exact quoting.
@@ -239,6 +242,14 @@ and explicit deletion categories. Each worktree goes through
239
242
  branches through `command gw branch prune`. The plugin never targets its current checkout. It reports
240
243
  partial checkout, branch and stash outcomes and actual restore commands.
241
244
 
245
+ Both clients hand each session `plugin/session.md` when it starts: a
246
+ `SessionStart` hook in `plugin/hooks/hooks.json` for Claude Code and
247
+ `plugin/hooks/codex.json`, which the Codex manifest names, wraps the file
248
+ in the `additionalContext` JSON with `jq`. The rules say how a session uses
249
+ its worktree, including the check it makes before editing: changes it did
250
+ not make, or another process's lock, mean another session works there.
251
+ Nothing locks a worktree for a session.
252
+
242
253
  The plugin carries the release version in three manifests, and
243
254
  `scripts/bump_version.py` stamps all three. `plugin/plugin.json` is the
244
255
  portable manifest, the Claude one with only the fields Agent Plugins v1 names;
@@ -586,11 +597,20 @@ and asserts it.
586
597
  ## Verdicts and deletion are separate
587
598
 
588
599
  `merged.branch_proof` checks matching cached forge proof, first-parent
589
- membership, local completion proof, then remaining commits or absent evidence.
590
- The verdicts are `remove`, `empty`, `keep` and `unknown`. A branch merged by
591
- fast-forward without forge proof is `empty`, because Git cannot distinguish
592
- it from an unused branch. First-parent history belongs to the assessed head,
593
- not a divergent local counterpart.
600
+ membership, local completion proof, absent evidence, the cached request's
601
+ state, then whether a remote-tracking ref holds the tip. It returns a reason:
602
+ `merged`, `unused`, `closed`, `open`, `pushed`, `unpushed` or `unknown`.
603
+ `gw fast-forward` reads it as it is; prune's assessments split `unused` by
604
+ the branch's reflog into `merged`, `unused` and `stale`, and put the
605
+ checkout facts first, `uncommitted` among them. A row's verdict is `remove`
606
+ for `merged` and `stale` and `keep` for every other reason. First-parent
607
+ history belongs to the assessed head, not a divergent local counterpart.
608
+
609
+ Removing a worktree deletes its HEAD reflog and deleting a branch its
610
+ reflog. `merged.reflog_only` lists the commits only those reach, by
611
+ `rev-list --not --all`, and keeps each whose own patch-id the head lacks;
612
+ they hold the row back until `--delete reflog`, which `--delete all`
613
+ includes and which is the one value `--keep-branch` takes.
594
614
 
595
615
  Content proof compares changed paths, modes and deletions against the head.
596
616
  It cannot settle a stacked branch whose intermediate content the head later
@@ -605,12 +625,16 @@ unmerged requests are never proof.
605
625
  head branch are protected. Locked or dirty worktrees, untracked files,
606
626
  initialized submodules and a submodule store left by `deinit` block removal;
607
627
  `git worktree remove` refuses each. A locked worktree whose directory is away
608
- is assessed from its record. Ignored paths, empty branches and
609
- matching stashes require their own permission. `--yes` grants none.
628
+ is assessed from its record. Empty branches and matching stashes require
629
+ their own permission; ignored paths go with the worktree, listed in the
630
+ disclosure first. `--yes` grants neither. A protection a value lifts ends
631
+ with every value its row needs, and only when those values make the row
632
+ eligible, so one hint followed alone frees it; the prune skill's jq reads
633
+ that wording, and `tests/test_plugin.py` runs it.
610
634
  `gw prune` also protects the current worktree; `gw remove` needs a second terminal
611
635
  confirmation for it. `--keep-branch` retains the branch and its stashes,
612
- needs no completion proof for an attached checkout, and combines only with
613
- `--delete ignored-files`.
636
+ needs no completion proof for an attached checkout, and combines with no
637
+ `--delete` value.
614
638
 
615
639
  The removal snapshot pins the branch and head SHAs, exact path, ignored
616
640
  paths and stash identities. Recheck after confirmation precedes plain
@@ -618,7 +642,7 @@ worktree removal, full-SHA ref deletion and approved stash drops. Ignored
618
642
  paths are what an ignore pattern names, so a matched directory is one entry;
619
643
  the snapshot is a path listing, not a recursive content fingerprint, and a
620
644
  file created inside a listed directory after assessment goes with it. The
621
- disclosure, the protection's count and the JSON `ignored` field list each
645
+ disclosure and the JSON `ignored` field list each
622
646
  path as git does, from the top level, sorted, so a tracked directory above
623
647
  an ignored one never reads as ignored. A path whose pattern, found with
624
648
  `git check-ignore -v`, ends in a bare `*` or `**` reads as its directory,
@@ -17,6 +17,70 @@ not in here, whatever it cost to build.
17
17
  A release closes with a `### Choices` section when a decision in it is worth
18
18
  the reader's time: what was chosen, and what the alternative failed to do.
19
19
 
20
+ ## 0.11.0 - 2026-11-14
21
+
22
+ ### Changed
23
+
24
+ `gw prune`, `gw remove` and `gw branch status` give each row a verdict of
25
+ `remove` or `keep` and a reason naming the fact that decides it, such as
26
+ `merged`, `uncommitted`, `closed`, `unpushed` or `in-progress`, in a new
27
+ REASON column and as `reason` and `needs` in the JSON. Scripts that read
28
+ the `empty` or `unknown` verdicts, or pass `--only empty` or
29
+ `--only unknown`, must read `reason` instead; `--only` takes `remove` or
30
+ `keep`.
31
+
32
+ A worktree with uncommitted changes or untracked files reads `keep`. A
33
+ branch whose own commits went into the head branch by fast-forward reads
34
+ `merged`, and one with nothing of its own and no reflog left reads `stale`;
35
+ both are removed without `--delete empty`. Removal holds back a row whose
36
+ deleted reflogs hold a commit the head branch lacks, printing `git show`
37
+ for each, until `--delete reflog`. A branch whose pull request closed
38
+ without merging is kept until `--delete closed`.
39
+
40
+ A `pass --delete` hint appears only where those values free the row, and
41
+ the `--yes` command a preview prints keeps the flags that made the row
42
+ eligible; following either used to leave the row where it was. The
43
+ confirmation lists each worktree, ignored path, reflog commit, branch and
44
+ stash it deletes, and asks with their counts.
45
+
46
+ `gw prune` and `gw remove` delete a worktree's ignored files without a
47
+ permission, listing each ignored path before the confirmation. Drop
48
+ `--delete ignored-files` from scripts: it is now a usage error, and
49
+ `--keep-branch` takes no `--delete` value.
50
+
51
+ ### Removed
52
+
53
+ The agent plugin's `new-branch` skill is removed; agents start branches
54
+ with `gw branch create` or `git switch --create`.
55
+
56
+ ### Added
57
+
58
+ `gw branch create NAME`, on a terminal and standing on a branch other
59
+ than the head branch, asks whether to stack NAME on that branch while
60
+ its sync runs. `--here` starts NAME from the commit this checkout is
61
+ on without syncing.
62
+
63
+ The agent plugin hands each Claude Code and Codex session the rules for
64
+ how it uses its worktree, through a SessionStart hook that needs `jq`.
65
+ Before editing, a session checks whether another one works in its
66
+ worktree, from uncommitted changes it did not make or another process's
67
+ lock, and moves to a worktree of its own when one does. The rules say to
68
+ ship a change the user decided on once its checks pass, through
69
+ `/worktrees:ship-it`, without being asked, merge included.
70
+
71
+ ### Fixed
72
+
73
+ `gw add`, `gw branch create` and `gw fast-forward NAME` refuse a branch
74
+ name that nests with an existing branch, such as `codex` beside
75
+ `codex/plan`, and name the branch in the way. Git's own refusal named
76
+ refs and lock files, and `gw add` left an empty directory behind.
77
+
78
+ `/worktrees:ship-it BRANCH ...` ships each named branch from the
79
+ worktree you run it in, switching to each in turn, and creates no
80
+ worktree. A branch checked out in another worktree is reported and
81
+ left alone. In the main checkout, ship-it switches back to the head
82
+ branch after each push.
83
+
20
84
  ## 0.10.0 - 2026-11-13
21
85
 
22
86
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: git-worktrees
3
- Version: 0.10.0
3
+ Version: 0.11.0
4
4
  Summary: Git worktree commands that refuse to lose work.
5
5
  Project-URL: Bug reports, https://github.com/MihaiBojin/worktrees/issues/new
6
6
  Project-URL: Source, https://github.com/MihaiBojin/worktrees
@@ -58,7 +58,7 @@ repositories under the same worktree root are outside their scope.
58
58
  | `gw branch status [NAME ...]` | `gwbs` | assess local branches without worktrees |
59
59
  | `gw branch prune [NAME ...]` | `gwbp` | confirm and delete eligible loose branches |
60
60
  | `gw add NAME [BASE]` | `gwa` | create or enter a worktree |
61
- | `gw branch create NAME` | `gwbc` | start a branch from the assessed head ref |
61
+ | `gw branch create NAME` | `gwbc` | start a branch from the head ref, or stack it on this branch |
62
62
  | `gw fast-forward [NAME]` | `gwff` | rebase this branch onto the head ref, or move a merged one, and what came after its merge, to a new branch |
63
63
  | `gw merge NUMBER --match-head-commit SHA` | | squash one checked GitHub PR, respecting native stacks and merge queues |
64
64
  | `gw ci-checks [NUMBER]` | | read a pull request's checks from GitHub or GitLab; `gw ci` for short |
@@ -104,7 +104,7 @@ the plugin's tag to the same release, as each manager below describes.
104
104
  ### fish
105
105
 
106
106
  ```console
107
- fisher install MihaiBojin/worktrees@v0.10.0
107
+ fisher install MihaiBojin/worktrees@v0.11.0
108
108
  ```
109
109
 
110
110
  Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
@@ -121,7 +121,7 @@ the untagged one holds the files.
121
121
  Antidote takes a `path:` into the repository, and `branch:` takes a tag:
122
122
 
123
123
  ```
124
- MihaiBojin/worktrees branch:v0.10.0 path:zsh/plugins/worktrees # in zsh_plugins.txt
124
+ MihaiBojin/worktrees branch:v0.11.0 path:zsh/plugins/worktrees # in zsh_plugins.txt
125
125
  ```
126
126
 
127
127
  The plugin puts its own `functions/` and `completions/` on `fpath` and
@@ -196,8 +196,8 @@ its stdout stays the version alone for a script to read.
196
196
  An excerpt of `gw --help`'s release lines with matching CLI and shell releases:
197
197
 
198
198
  ```console
199
- worktrees 0.10.0: git worktree commands that refuse to lose work
200
- The shell plugin here is 0.10.0, the same release as these commands.
199
+ worktrees 0.11.0: git worktree commands that refuse to lose work
200
+ The shell plugin here is 0.11.0, the same release as these commands.
201
201
  ```
202
202
 
203
203
  A shell without the variable has no plugin loaded, or one older than the
@@ -246,20 +246,38 @@ A checked-out branch appears only as its worktree, never as a loose branch.
246
246
  [Branch status](docs/commands/branch-status.md) describes the proofs;
247
247
  [branch prune](docs/commands/branch-prune.md) covers selection and recovery.
248
248
 
249
- | Verdict | Evidence |
250
- | --- | --- |
251
- | `remove` | a matching cached merged request, or local ancestry, squash or content proof |
252
- | `empty` | the tip is on the head ref's first-parent history |
253
- | `keep` | commits remain outside the head ref |
254
- | `unknown` | the CLI lacks valid evidence |
255
-
256
- `empty` includes unused branches and branches merged by fast-forward without
257
- forge proof. Git cannot distinguish them. A verdict describes completion;
258
- `eligible` also checks protections and the deletion permissions you supplied.
259
- After the table, `gw prune` lists every worktree it holds back with each
260
- reason, and `gw remove` does the same for its target. The main checkout is
261
- left out, since nothing removes it. The `keep` and `unknown` evidence counts
262
- as a reason; the evidence for `remove` and `empty` does not.
249
+ A row's verdict is `remove` or `keep`, and its `reason` names the fact that
250
+ decides it, the first in this table that applies:
251
+
252
+ | Reason | Verdict | When |
253
+ | --- | --- | --- |
254
+ | `main-checkout` | `keep` | it is the main checkout |
255
+ | `current` | `keep` | `gw prune` runs inside it |
256
+ | `locked` | `keep` | the worktree is locked |
257
+ | `missing` | `keep` | its directory is gone and its record locked |
258
+ | `submodule` | `keep` | it has an initialized submodule or a submodule store |
259
+ | `in-progress` | `keep` | a rebase, merge, cherry-pick, revert or bisect waits in it |
260
+ | `uncommitted` | `keep` | it has uncommitted changes or untracked files |
261
+ | `protected` | `keep` | its branch is `main`, `master` or the head branch |
262
+ | `merged` | `remove` | a matching cached merged request, local ancestry, squash or content proof, or commits made on the branch that now sit on the head ref's first-parent history |
263
+ | `closed` | `keep` | a request closed unmerged at this tip; `--delete closed` removes it |
264
+ | `open` | `keep` | a request open at this tip |
265
+ | `unused` | `keep` | the tip is on the head ref's first-parent history and its reflog records no commit made on it; `--delete empty` removes it |
266
+ | `stale` | `remove` | the same, with no reflog left to say whether it was used |
267
+ | `pushed` | `keep` | commits outside the head that a remote-tracking ref holds |
268
+ | `unpushed` | `keep` | commits outside the head that only this repository holds |
269
+ | `unknown` | `keep` | the CLI lacks valid evidence |
270
+
271
+ Deleting a branch deletes its reflog, and removing a worktree deletes the
272
+ worktree's own. A commit nothing else reaches goes with them, so a row whose
273
+ deleted reflogs hold a commit whose patch the head lacks is held back, and
274
+ the protection names `git show SHA` for each one. `eligible` also checks
275
+ protections and the deletion permissions you supplied. The WHY column gives
276
+ the evidence, then each protection that stands. A protection that `--delete`
277
+ values lift ends with every value its row needs, such as
278
+ `pass --delete empty --delete stashes`, and only where those values make
279
+ the row eligible. For a target it keeps, `gw remove` prints every reason, and
280
+ names a command with `--keep-branch` when only that removes the worktree.
263
281
 
264
282
  The CLI never deletes `main`, `master` or the head branch. It never removes
265
283
  the main checkout, locked or dirty worktrees, worktrees with untracked files,
@@ -277,38 +295,44 @@ Repeat `--delete` to combine categories:
277
295
 
278
296
  | Value | `gw prune`, `gw remove` | `gw branch prune` |
279
297
  | --- | --- | --- |
280
- | `empty` | permit an empty branch and its worktree | permit an empty branch |
281
- | `ignored-files` | permit the worktree's ignored paths | usage error |
298
+ | `empty` | permit an `unused` branch and its worktree | permit an `unused` branch |
282
299
  | `stashes` | permit the branch's stashes | same |
283
- | `all` | all categories above | empty branches and stashes |
300
+ | `closed` | permit a branch whose request closed unmerged at its tip | same |
301
+ | `reflog` | permit dropping commits only the deleted reflogs hold | same |
302
+ | `all` | every value above | same |
284
303
 
285
304
  `gw branch status` rejects `--delete`. An unknown or unsupported value is a
286
- usage error before mutation. `--delete empty` changes eligibility, not the
287
- verdict. Ignored files have no recovery command: Git never recorded their
288
- contents. When only missing values hold worktrees back, `gw prune` names
305
+ usage error before mutation. A `--delete` value changes eligibility, not the
306
+ verdict. When only missing values hold worktrees back, `gw prune` names
289
307
  the command that grants them, keeping the values you passed:
290
- `gw prune --delete ignored-files makes fix-parser eligible`.
308
+ `gw prune --delete empty makes fix-parser eligible`. Without a terminal,
309
+ the line that names `--yes` carries the `--delete` values and
310
+ `--keep-branch` you passed, so running it removes what was counted.
291
311
 
292
312
  ```console
293
- gw prune --delete empty --delete ignored-files
313
+ gw prune --delete empty --delete stashes
294
314
  gw remove old-checkout --keep-branch
295
- gw remove old-checkout --keep-branch --delete ignored-files
296
315
  ```
297
316
 
298
317
  `--keep-branch` removes an otherwise unprotected checkout without completion
299
318
  proof and retains its branch and stashes, including a protected branch.
300
319
  A detached checkout has no branch to keep its commits, so it still needs
301
- proof.
302
- It grants no ignored-file permission. Only `--delete ignored-files` combines
303
- with it; `empty`, `stashes` and `all` are usage errors with `--keep-branch`.
320
+ proof. It keeps the branch's reflog but not the worktree's, so it takes
321
+ `--delete reflog`, and every other `--delete` value is a usage error with it.
304
322
 
305
323
  ### Removal and recovery
306
324
 
307
- Before confirmation, the CLI discloses the path and branch, the branch
308
- restore command, stashes with their restore commands, and ignored paths it
309
- will delete, sorted by name. Each ignored path reads as the pattern that
310
- ignores it names it, from the top level, with a trailing `/` on a
311
- directory: `__pycache__` lists `src/pkg/__pycache__/`, never the tracked
325
+ Removal deletes a worktree's ignored files: build output, caches and
326
+ virtual environments are what most of them are. They have no recovery
327
+ command, since Git never recorded their contents. Before confirmation, the
328
+ CLI discloses each thing it deletes or keeps, one line each, led by what
329
+ happens to it: `delete worktree` with its path, `delete ignored` for each
330
+ ignored path, sorted by name, `delete branch` and `delete stash` with their
331
+ restore commands, or `keep branch` under `--keep-branch`. The question
332
+ counts each kind: `delete 1 worktree, 1 ignored path and 1 branch? [y/N]`.
333
+ Each ignored path reads as the pattern that ignores it names it, from the
334
+ top level, with a trailing `/` on a directory: `__pycache__` lists
335
+ `src/pkg/__pycache__/`, never the tracked
312
336
  `src/` above it. A pattern for a directory's contents, such as
313
337
  `path/to/ignored/*`, lists that directory once as `path/to/ignored/`.
314
338
  Below the list, `git -C PATH ls-files --others --ignored --exclude-standard`
@@ -353,10 +377,9 @@ JSON carries it in `path` and `outcome.destination`.
353
377
  | `gwpa!` | `gw prune --delete all --yes` |
354
378
  | `gwr!` | `gw remove --yes` |
355
379
 
356
- `gwpa` permits deleting empty branches, ignored files and branch stashes, and
357
- still asks at a terminal. `gwpa!` and `gwr!` skip that question, as `gwp!`
358
- does. `gwr!` grants no deletion category: ignored files still need
359
- `gw remove --delete ignored-files`.
380
+ `gwpa` permits deleting empty branches and branch stashes, and still asks
381
+ at a terminal. `gwpa!` and `gwr!` skip that question, as `gwp!` does.
382
+ `gwr!` grants no deletion category.
360
383
 
361
384
  ## Head and synchronization
362
385
 
@@ -546,8 +569,8 @@ parseable. Passing both is a usage error.
546
569
  | `gw merge` | no | yes |
547
570
 
548
571
  Other commands retain their own flags; use `--help`. Help, version and
549
- completion work without an assessment. `--only` filters assessment verdicts
550
- and can be repeated, including `--only empty`.
572
+ completion work without an assessment. `--only` filters assessment verdicts,
573
+ `remove` or `keep`, and can be repeated.
551
574
 
552
575
  Every JSON result is an object with `lastSync` and `head`:
553
576
 
@@ -582,14 +605,14 @@ gw list --json | jq -r '.worktrees[].path'
582
605
  | `gwp --dry-run` | `gw prune --json` or `gw prune --table` |
583
606
  | `gw list --list`, `gw list -l`, `gw prune --list` | `gw list --table`, `gw prune --table` |
584
607
  | `gwp --branch NAME` | `gw remove NAME` or a quoted exact path |
585
- | `--delete-ignored` | `--delete ignored-files` |
608
+ | `--delete-ignored`, `--delete ignored-files` | none; removal deletes ignored files and lists them first |
586
609
  | `gwr --force`, `gwr -f` | `gw remove --keep-branch` |
587
610
  | `--no-fetch`, `--no-forge`, `--force-refresh`, refresh `-f` | `WORKTREES_OFFLINE=1` to stay offline; `gw sync` to refresh now |
588
611
  | `gw ls`, `gw NAME` | `gw list`, `gw list NAME` |
589
612
  | `gwh`, `gw help`, `gw h` | `gw --help` or `gw -h` |
590
613
  | a `--json` listing as an array, `.[]` | `gw list --json` object, `.worktrees[]` |
591
614
 
592
- `empty` requires explicit permission. `main` and `master` always remain
615
+ An `unused` or `closed` row requires explicit permission. `main` and `master` always remain
593
616
  protected. Update scripts that assume a `remove` verdict alone permits
594
617
  deletion to check `eligible` too.
595
618
 
@@ -609,14 +632,19 @@ an update-ref delete that names no full sha
609
632
 
610
633
  ## Agent plugin
611
634
 
612
- [The agent plugin](plugin/README.md) gives Claude Code and Codex seven skills
613
- over these commands: start a branch, bring a branch level with the head
635
+ [The agent plugin](plugin/README.md) gives Claude Code and Codex six skills
636
+ over these commands: bring a branch level with the head
614
637
  branch through its rebase conflicts, read CI, keep a pull request's
615
638
  description true to its diff, ship a change or an open pull request
616
639
  through CI to its merge, prune finished worktrees and branches after
617
640
  asking, and add the permission rules shipping needs to Claude Code's
618
641
  settings.
619
642
 
643
+ The skills handle branches, pull requests and merges in the checkout the
644
+ session runs in, and never create a worktree. Creating and choosing
645
+ worktrees is for a person, through `gw add` and `gw list`, or for the
646
+ agent's client, as `claude --worktree` and `codex --worktree` do.
647
+
620
648
  ## Contributing
621
649
 
622
650
  See [DEVELOPMENT.md](docs/DEVELOPMENT.md) for checks and release commands,
@@ -31,7 +31,7 @@ repositories under the same worktree root are outside their scope.
31
31
  | `gw branch status [NAME ...]` | `gwbs` | assess local branches without worktrees |
32
32
  | `gw branch prune [NAME ...]` | `gwbp` | confirm and delete eligible loose branches |
33
33
  | `gw add NAME [BASE]` | `gwa` | create or enter a worktree |
34
- | `gw branch create NAME` | `gwbc` | start a branch from the assessed head ref |
34
+ | `gw branch create NAME` | `gwbc` | start a branch from the head ref, or stack it on this branch |
35
35
  | `gw fast-forward [NAME]` | `gwff` | rebase this branch onto the head ref, or move a merged one, and what came after its merge, to a new branch |
36
36
  | `gw merge NUMBER --match-head-commit SHA` | | squash one checked GitHub PR, respecting native stacks and merge queues |
37
37
  | `gw ci-checks [NUMBER]` | | read a pull request's checks from GitHub or GitLab; `gw ci` for short |
@@ -77,7 +77,7 @@ the plugin's tag to the same release, as each manager below describes.
77
77
  ### fish
78
78
 
79
79
  ```console
80
- fisher install MihaiBojin/worktrees@v0.10.0
80
+ fisher install MihaiBojin/worktrees@v0.11.0
81
81
  ```
82
82
 
83
83
  Fisher copies `functions/`, `completions/` and `conf.d/` from the repository
@@ -94,7 +94,7 @@ the untagged one holds the files.
94
94
  Antidote takes a `path:` into the repository, and `branch:` takes a tag:
95
95
 
96
96
  ```
97
- MihaiBojin/worktrees branch:v0.10.0 path:zsh/plugins/worktrees # in zsh_plugins.txt
97
+ MihaiBojin/worktrees branch:v0.11.0 path:zsh/plugins/worktrees # in zsh_plugins.txt
98
98
  ```
99
99
 
100
100
  The plugin puts its own `functions/` and `completions/` on `fpath` and
@@ -169,8 +169,8 @@ its stdout stays the version alone for a script to read.
169
169
  An excerpt of `gw --help`'s release lines with matching CLI and shell releases:
170
170
 
171
171
  ```console
172
- worktrees 0.10.0: git worktree commands that refuse to lose work
173
- The shell plugin here is 0.10.0, the same release as these commands.
172
+ worktrees 0.11.0: git worktree commands that refuse to lose work
173
+ The shell plugin here is 0.11.0, the same release as these commands.
174
174
  ```
175
175
 
176
176
  A shell without the variable has no plugin loaded, or one older than the
@@ -219,20 +219,38 @@ A checked-out branch appears only as its worktree, never as a loose branch.
219
219
  [Branch status](docs/commands/branch-status.md) describes the proofs;
220
220
  [branch prune](docs/commands/branch-prune.md) covers selection and recovery.
221
221
 
222
- | Verdict | Evidence |
223
- | --- | --- |
224
- | `remove` | a matching cached merged request, or local ancestry, squash or content proof |
225
- | `empty` | the tip is on the head ref's first-parent history |
226
- | `keep` | commits remain outside the head ref |
227
- | `unknown` | the CLI lacks valid evidence |
228
-
229
- `empty` includes unused branches and branches merged by fast-forward without
230
- forge proof. Git cannot distinguish them. A verdict describes completion;
231
- `eligible` also checks protections and the deletion permissions you supplied.
232
- After the table, `gw prune` lists every worktree it holds back with each
233
- reason, and `gw remove` does the same for its target. The main checkout is
234
- left out, since nothing removes it. The `keep` and `unknown` evidence counts
235
- as a reason; the evidence for `remove` and `empty` does not.
222
+ A row's verdict is `remove` or `keep`, and its `reason` names the fact that
223
+ decides it, the first in this table that applies:
224
+
225
+ | Reason | Verdict | When |
226
+ | --- | --- | --- |
227
+ | `main-checkout` | `keep` | it is the main checkout |
228
+ | `current` | `keep` | `gw prune` runs inside it |
229
+ | `locked` | `keep` | the worktree is locked |
230
+ | `missing` | `keep` | its directory is gone and its record locked |
231
+ | `submodule` | `keep` | it has an initialized submodule or a submodule store |
232
+ | `in-progress` | `keep` | a rebase, merge, cherry-pick, revert or bisect waits in it |
233
+ | `uncommitted` | `keep` | it has uncommitted changes or untracked files |
234
+ | `protected` | `keep` | its branch is `main`, `master` or the head branch |
235
+ | `merged` | `remove` | a matching cached merged request, local ancestry, squash or content proof, or commits made on the branch that now sit on the head ref's first-parent history |
236
+ | `closed` | `keep` | a request closed unmerged at this tip; `--delete closed` removes it |
237
+ | `open` | `keep` | a request open at this tip |
238
+ | `unused` | `keep` | the tip is on the head ref's first-parent history and its reflog records no commit made on it; `--delete empty` removes it |
239
+ | `stale` | `remove` | the same, with no reflog left to say whether it was used |
240
+ | `pushed` | `keep` | commits outside the head that a remote-tracking ref holds |
241
+ | `unpushed` | `keep` | commits outside the head that only this repository holds |
242
+ | `unknown` | `keep` | the CLI lacks valid evidence |
243
+
244
+ Deleting a branch deletes its reflog, and removing a worktree deletes the
245
+ worktree's own. A commit nothing else reaches goes with them, so a row whose
246
+ deleted reflogs hold a commit whose patch the head lacks is held back, and
247
+ the protection names `git show SHA` for each one. `eligible` also checks
248
+ protections and the deletion permissions you supplied. The WHY column gives
249
+ the evidence, then each protection that stands. A protection that `--delete`
250
+ values lift ends with every value its row needs, such as
251
+ `pass --delete empty --delete stashes`, and only where those values make
252
+ the row eligible. For a target it keeps, `gw remove` prints every reason, and
253
+ names a command with `--keep-branch` when only that removes the worktree.
236
254
 
237
255
  The CLI never deletes `main`, `master` or the head branch. It never removes
238
256
  the main checkout, locked or dirty worktrees, worktrees with untracked files,
@@ -250,38 +268,44 @@ Repeat `--delete` to combine categories:
250
268
 
251
269
  | Value | `gw prune`, `gw remove` | `gw branch prune` |
252
270
  | --- | --- | --- |
253
- | `empty` | permit an empty branch and its worktree | permit an empty branch |
254
- | `ignored-files` | permit the worktree's ignored paths | usage error |
271
+ | `empty` | permit an `unused` branch and its worktree | permit an `unused` branch |
255
272
  | `stashes` | permit the branch's stashes | same |
256
- | `all` | all categories above | empty branches and stashes |
273
+ | `closed` | permit a branch whose request closed unmerged at its tip | same |
274
+ | `reflog` | permit dropping commits only the deleted reflogs hold | same |
275
+ | `all` | every value above | same |
257
276
 
258
277
  `gw branch status` rejects `--delete`. An unknown or unsupported value is a
259
- usage error before mutation. `--delete empty` changes eligibility, not the
260
- verdict. Ignored files have no recovery command: Git never recorded their
261
- contents. When only missing values hold worktrees back, `gw prune` names
278
+ usage error before mutation. A `--delete` value changes eligibility, not the
279
+ verdict. When only missing values hold worktrees back, `gw prune` names
262
280
  the command that grants them, keeping the values you passed:
263
- `gw prune --delete ignored-files makes fix-parser eligible`.
281
+ `gw prune --delete empty makes fix-parser eligible`. Without a terminal,
282
+ the line that names `--yes` carries the `--delete` values and
283
+ `--keep-branch` you passed, so running it removes what was counted.
264
284
 
265
285
  ```console
266
- gw prune --delete empty --delete ignored-files
286
+ gw prune --delete empty --delete stashes
267
287
  gw remove old-checkout --keep-branch
268
- gw remove old-checkout --keep-branch --delete ignored-files
269
288
  ```
270
289
 
271
290
  `--keep-branch` removes an otherwise unprotected checkout without completion
272
291
  proof and retains its branch and stashes, including a protected branch.
273
292
  A detached checkout has no branch to keep its commits, so it still needs
274
- proof.
275
- It grants no ignored-file permission. Only `--delete ignored-files` combines
276
- with it; `empty`, `stashes` and `all` are usage errors with `--keep-branch`.
293
+ proof. It keeps the branch's reflog but not the worktree's, so it takes
294
+ `--delete reflog`, and every other `--delete` value is a usage error with it.
277
295
 
278
296
  ### Removal and recovery
279
297
 
280
- Before confirmation, the CLI discloses the path and branch, the branch
281
- restore command, stashes with their restore commands, and ignored paths it
282
- will delete, sorted by name. Each ignored path reads as the pattern that
283
- ignores it names it, from the top level, with a trailing `/` on a
284
- directory: `__pycache__` lists `src/pkg/__pycache__/`, never the tracked
298
+ Removal deletes a worktree's ignored files: build output, caches and
299
+ virtual environments are what most of them are. They have no recovery
300
+ command, since Git never recorded their contents. Before confirmation, the
301
+ CLI discloses each thing it deletes or keeps, one line each, led by what
302
+ happens to it: `delete worktree` with its path, `delete ignored` for each
303
+ ignored path, sorted by name, `delete branch` and `delete stash` with their
304
+ restore commands, or `keep branch` under `--keep-branch`. The question
305
+ counts each kind: `delete 1 worktree, 1 ignored path and 1 branch? [y/N]`.
306
+ Each ignored path reads as the pattern that ignores it names it, from the
307
+ top level, with a trailing `/` on a directory: `__pycache__` lists
308
+ `src/pkg/__pycache__/`, never the tracked
285
309
  `src/` above it. A pattern for a directory's contents, such as
286
310
  `path/to/ignored/*`, lists that directory once as `path/to/ignored/`.
287
311
  Below the list, `git -C PATH ls-files --others --ignored --exclude-standard`
@@ -326,10 +350,9 @@ JSON carries it in `path` and `outcome.destination`.
326
350
  | `gwpa!` | `gw prune --delete all --yes` |
327
351
  | `gwr!` | `gw remove --yes` |
328
352
 
329
- `gwpa` permits deleting empty branches, ignored files and branch stashes, and
330
- still asks at a terminal. `gwpa!` and `gwr!` skip that question, as `gwp!`
331
- does. `gwr!` grants no deletion category: ignored files still need
332
- `gw remove --delete ignored-files`.
353
+ `gwpa` permits deleting empty branches and branch stashes, and still asks
354
+ at a terminal. `gwpa!` and `gwr!` skip that question, as `gwp!` does.
355
+ `gwr!` grants no deletion category.
333
356
 
334
357
  ## Head and synchronization
335
358
 
@@ -519,8 +542,8 @@ parseable. Passing both is a usage error.
519
542
  | `gw merge` | no | yes |
520
543
 
521
544
  Other commands retain their own flags; use `--help`. Help, version and
522
- completion work without an assessment. `--only` filters assessment verdicts
523
- and can be repeated, including `--only empty`.
545
+ completion work without an assessment. `--only` filters assessment verdicts,
546
+ `remove` or `keep`, and can be repeated.
524
547
 
525
548
  Every JSON result is an object with `lastSync` and `head`:
526
549
 
@@ -555,14 +578,14 @@ gw list --json | jq -r '.worktrees[].path'
555
578
  | `gwp --dry-run` | `gw prune --json` or `gw prune --table` |
556
579
  | `gw list --list`, `gw list -l`, `gw prune --list` | `gw list --table`, `gw prune --table` |
557
580
  | `gwp --branch NAME` | `gw remove NAME` or a quoted exact path |
558
- | `--delete-ignored` | `--delete ignored-files` |
581
+ | `--delete-ignored`, `--delete ignored-files` | none; removal deletes ignored files and lists them first |
559
582
  | `gwr --force`, `gwr -f` | `gw remove --keep-branch` |
560
583
  | `--no-fetch`, `--no-forge`, `--force-refresh`, refresh `-f` | `WORKTREES_OFFLINE=1` to stay offline; `gw sync` to refresh now |
561
584
  | `gw ls`, `gw NAME` | `gw list`, `gw list NAME` |
562
585
  | `gwh`, `gw help`, `gw h` | `gw --help` or `gw -h` |
563
586
  | a `--json` listing as an array, `.[]` | `gw list --json` object, `.worktrees[]` |
564
587
 
565
- `empty` requires explicit permission. `main` and `master` always remain
588
+ An `unused` or `closed` row requires explicit permission. `main` and `master` always remain
566
589
  protected. Update scripts that assume a `remove` verdict alone permits
567
590
  deletion to check `eligible` too.
568
591
 
@@ -582,14 +605,19 @@ an update-ref delete that names no full sha
582
605
 
583
606
  ## Agent plugin
584
607
 
585
- [The agent plugin](plugin/README.md) gives Claude Code and Codex seven skills
586
- over these commands: start a branch, bring a branch level with the head
608
+ [The agent plugin](plugin/README.md) gives Claude Code and Codex six skills
609
+ over these commands: bring a branch level with the head
587
610
  branch through its rebase conflicts, read CI, keep a pull request's
588
611
  description true to its diff, ship a change or an open pull request
589
612
  through CI to its merge, prune finished worktrees and branches after
590
613
  asking, and add the permission rules shipping needs to Claude Code's
591
614
  settings.
592
615
 
616
+ The skills handle branches, pull requests and merges in the checkout the
617
+ session runs in, and never create a worktree. Creating and choosing
618
+ worktrees is for a person, through `gw add` and `gw list`, or for the
619
+ agent's client, as `claude --worktree` and `codex --worktree` do.
620
+
593
621
  ## Contributing
594
622
 
595
623
  See [DEVELOPMENT.md](docs/DEVELOPMENT.md) for checks and release commands,