Files
Maximilian RoosandClaude Opus 5.5 a63c1c3e2a feat(plugin): run every Claude hook through wt config plugins claude hook (#4305)
Routes all eight Claude Code hook events through the existing Rust
dispatcher added in #4304. Hook commands become literal invocations that
pass the plugin directory validator, and the plugin no longer requires
`jq`. The README requires `wt` v0.81.0 or later.

On `wt` v0.80.0 or earlier, worktree creation and removal fail, and
activity markers and EnterWorktree auto-approval stop working. The
latter hooks retain `|| true`, so the failures stay nonblocking and
EnterWorktree falls back to a permission prompt. The dispatcher
preserves existing-branch reopening and safe removal of unmerged work.
Updates the hook layout assertions and the skill's create-or-reopen
guidance, and removes the obsolete shell pipeline explanation.

Local validation: the project gate passed for the corrected skills at
`1a9ebd12c` in an isolated target directory (5,392 tests passed, one
skipped, plus Clippy, formatting, docs, and snapshots). Docs mirror sync
and all five dispatcher integration tests pass. The later
documentation-only follow-ups clarify the README's attribution of
payload parsing and the measured cleanup behavior. `claude plugin
validate plugins/worktrunk` passed its directory checks with the
existing missing-version warning; it excludes the catalog's safety scan
and policy review.

Independent Opus 5.5 review found no code defects and verified the
older-version failure. Further passes reviewed the corrected skills,
mirrors and live cleanup evidence with no remaining findings.

Cleanup was verified live on Claude Code 2.1.308 in an isolated
repository: reopening an existing worktree through both `claude
--worktree` and `EnterWorktree({name})`, then `/exit`, shows Keep /
Remove with Keep selected. Keep leaves its branch and checkout intact
and emits no `WorktreeRemove`. A fresh CLI-created worktree shows the
same prompt; choosing Remove emits `WorktreeRemove` and removes the
synthetic checkout and merged branch. The rationale now reflects that
confirmation instead of claiming automatic cleanup.

Reopening is already present in the [base create
hook](https://github.com/max-sixty/worktrunk/blob/d965d819f226ad7ac853efed8b2a996bb0c880a6/plugins/worktrunk/hooks/hooks.json#L72):
it clears `--create` for an existing local branch. Both the [base remove
hook](https://github.com/max-sixty/worktrunk/blob/d965d819f226ad7ac853efed8b2a996bb0c880a6/plugins/worktrunk/hooks/hooks.json#L82)
and the dispatcher check for `.git` and invoke `wt -C <path> remove
--foreground <path>`, with no force flags. This cutover preserves that
deletion scope and its safeguards.

> _This was written by Codex on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 01:20:20 -07:00
..