A Herdr plugin that copies gitignored files (like .env)
into newly created git worktrees, driven by a .worktreeinclude file — the
same convention used by Claude Code.
A fresh worktree checkout contains only tracked files, so local configuration
such as .env or .env.local is missing. This plugin hooks Herdr's
worktree.created event and copies those files over automatically, whether
the worktree is created from the sidebar (prefix+shift+g) or via
herdr worktree create.
Put a .worktreeinclude file at your repository root. It uses .gitignore
syntax:
.env
.env.local
config/secrets.json
When Herdr creates a worktree, the plugin copies every file that:
- matches a pattern in
.worktreeinclude, and - is gitignored in the source repository.
Tracked files are never copied (the checkout already has them), so sharing
one .worktreeinclude between Claude Code and Herdr is safe.
Files under node_modules/ and files belonging to other worktree checkouts
of the same repository are always skipped.
From GitHub:
herdr plugin install tanshio/herdr-worktreeincludeOr link a local clone:
git clone https://github.com/tanshio/herdr-worktreeinclude.git
herdr plugin link ./herdr-worktreeinclude- Herdr >= 0.7.0
bash,gitjqorpython3(for parsing the event payload)
Inspect what the plugin did for recent worktrees:
herdr plugin log list --plugin tanshio.worktreeincludeEach run logs the event payload and every file it copied.
MIT