Herdr plugin that dispatches worktree lifecycle events to repo-owned wrappers:
worktree.createdandworktree.openedrunscripts/worktree-setup.worktree.removedrunsscripts/worktree-teardown.- setup output is captured to private logs under
HERDR_PLUGIN_STATE_DIR. - setup reports
setup...while running, clears it on success, and leavessetup failedon failure when Herdr can attach metadata to the worktree pane. - setup completion shows one Herdr notification with the result and duration.
Install:
herdr plugin install qdentity/herdr-worktree-lifecycleEach onboarded repo must expose executable wrappers with this positional ABI:
scripts/worktree-setup <branch> <worktree> <primary>
scripts/worktree-teardown <branch> <worktree> <primary>branch may be empty. Resource identity belongs to the repo wrappers and must be
derived from the lexical worktree path hash, not the branch.
Wrappers inherit cwd from the plugin root (Herdr's install dir), not the
worktree or primary checkout; use only the explicit <branch> <worktree> <primary> args, never cwd or $PWD.
Herdr runs plugin hooks asynchronously and concurrently. This plugin serializes
events per worktree path and writes setup status markers under
HERDR_PLUGIN_STATE_DIR, but a newly opened worktree may still be setting up
when an agent starts.
Open the setup log for the current worktree:
herdr plugin action invoke open-setup-log --plugin io.qdentity.worktree-lifecycleThe action opens a new Herdr tab using less +F when available, with a
hold-open fallback. If there is no current worktree log, it opens the latest
failed setup log. The plugin keeps the latest 20 setup logs per worktree.