Who it is forA developer who needs each parallel worktree ready to run without manual setup.
The problemEvery new worktree needs dependencies and a dev server, and ten of them collide on ports and rebuilds.
The outcomeNew worktrees that set themselves up, share build caches and use a unique port each.
What you need first
- git
- Homebrew or Cargo to install
- Shell integration via `wt config shell install` so commands can change directories
- An agent such as Claude Code or Codex
Steps
- Read the Hooks docs at Worktrunk.dev/hook for the hook types such as post-start
- Add a post-start hook that installs dependencies and starts your dev server
- Use the
hash_porttemplate filter to give each worktree a unique port - Use Share build caches so ten worktrees get
target/,node_modules/, etc without building or copying them
Prompt for your agent
Using worktrunk, set up a post-start hook for this repo that installs dependencies and starts the dev server on a `hash_port` port, and share build caches between worktrees. Show me the config before saving.
Caveat. Shared build caches need APFS, btrfs or XFS, and the README points to the docs for hook syntax.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for max-sixty/worktrunk and "Automate setup in every new worktree with hooks"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer