home-manager's worktrunk module writes outdated Claude Code hooks
home-manager's programs.worktrunk module (modules/programs/worktrunk.nix) writes its own Claude Code hooks instead of using the plugin's. Its copy predates the single wt config plugins claude hook entry point that plugins/worktrunk/hooks/hooks.json now registers for every event, so users who set claudeCodeIntegration.enable get older behavior than plugin users:
WorktreeCreatealways passes--create. Claude Code fires this hook again whenclaude --worktree <name>reopens a kept worktree; the branch then exists,wt switch --createrefuses it, and the reopen fails. Worktrunk's hook switches to an existing branch without--create(#4487, released in 0.81.0).WorktreeCreateprints the path unresolved. Claude Code 2.1.325 refuses aWorktreeCreateanswer that goes through a symlink inside the project. Worktrunk's hook now prints the real path (#4814, onmain, not yet released), so aworktree-pathtemplate under a symlinked directory in the repository fails only for module users once a release ships.- Activity markers follow the shell's cwd. The module runs
wt config state marker set …with no directory, so acdduring a turn marks whichever repository the shell is in. Worktrunk's hook resolves markers againstCLAUDE_PROJECT_DIR(#3921). - No
EnterWorktreeapproval. Worktrunk'sPermissionRequesthook approves anEnterWorktreeinto a Worktrunk-managed worktree, which/wt-switch-createrelies on to enter without a confirmation dialog; the module'sPermissionRequestentry only sets 💬.
The statusline and skill entries match.
Fix, in nix-community/home-manager: replace the module's per-event commands (and its jq dependency) with ${wt} config plugins claude hook for each event in hooks.json, keeping the module's split between worktreeHooks and activityTrackingHooks. The marker events keep || true, as hooks.json does. nixpkgs unstable ships 0.81.0, which has the subcommand; nixpkgs 26.05 ships 0.50.0, which does not, so the change suits home-manager's master and not its 26.05 branch. That would also stop the copy drifting again, since each later change to the hooks' behavior lands inside wt.
Opening the PR or an issue on home-manager needs a maintainer's go-ahead here first; the module's maintainers are eveeifyeve and yzx9.
Opened nix-community/home-manager#10180, which switches every hook in the module to ${wt} config plugins claude hook, keeping its options. This issue can close when it merges.
This was written by Claude Code on behalf of max-sixty
nix-community/home-manager#10180 merged on 2026-11-17 as 6e4bcf6. The module now runs ${wt} config plugins claude hook for all eight events plugins/worktrunk/hooks/hooks.json registers, with the same matchers and the same || true on the marker events. Module users therefore get the plugin's WorktreeCreate behavior from whatever wt they have installed, including the resolved-path fix from #4814 once it ships in a release. Closing.