{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "max-sixty-worktrunk--automate-worktree-setup-with-hooks",
 "repo": "max-sixty/worktrunk",
 "repo_url": "https://github.com/max-sixty/worktrunk",
 "repo_slug": "max-sixty-worktrunk",
 "title": "Automate setup in every new worktree with hooks",
 "page_title": "How to automate setup in every new worktree with hooks with Worktrunk",
 "summary": "Run commands on create and merge so each worktree installs dependencies and gets its own dev server port.",
 "who": "A developer who needs each parallel worktree ready to run without manual setup.",
 "problem": "Every new worktree needs dependencies and a dev server, and ten of them collide on ports and rebuilds.",
 "outcome": "New worktrees that set themselves up, share build caches and use a unique port each.",
 "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_port` template 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"
 ],
 "agent_prompt": "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.",
 "agents": [
  "claude-code",
  "codex"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "Shared build caches need APFS, btrfs or XFS, and the README points to the docs for hook syntax.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "rust",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/max-sixty-worktrunk/automate-worktree-setup-with-hooks/",
 "md": "https://dedupedai.com/use-cases/max-sixty-worktrunk/automate-worktree-setup-with-hooks/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/max-sixty-worktrunk--automate-worktree-setup-with-hooks.json",
 "api_version": "v1"
}
