published fresh until

Worktrunk: start each coding agent in a ready worktree

Summary As of November 2026, Worktrunk can create branch-addressed worktrees and run configured dependency setup before creation finishes. Retry setup in an existing worktree with wt hook pre-start --foreground

Not for dev-server port clashes between worktrees; see portless-named-urls-for-parallel-worktrees.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Use Worktrunk to create one worktree per coding session and put required dependency installation in a blocking pre-start hook.

Do first: install the CLI and shell integration using the Worktrunk install instructions:

brew install worktrunk
wt config shell install

1. Open a new terminal so the shell integration can change directories. In a committed Git project whose default branch contains package.json and a matching package-lock.json, add this to .config/wt.toml; preserve any existing hooks:

[pre-start]
deps = "npm ci"

2. Create a trial branch and worktree:

wt switch --create agent-example

Read the project hook commands before accepting their first-run approval. pre-start blocks until setup completes; post-start runs in the background. Use the blocking hook for dependencies that the agent immediately needs. See the hook lifecycle and configuration.

3. Confirm the directory and branch with pwd and git branch --show-current, run the project's existing check, then start your coding agent. Use another terminal and a different branch name for a second session. New branches start from the default branch; use --base=@ when you need the current commit instead. See wt switch.

4. If creation leaves an existing worktree after a dependency failure, enter that worktree, correct the underlying install problem, and ensure its .config/wt.toml contains the hook above before explicitly rerunning setup:

wt hook pre-start --foreground

Do not assume switching to the existing branch reruns creation hooks. Make setup commands safe to repeat. The hook reference documents explicit execution and the use of project config from the worktree where the command runs; issue #4143 explains the incomplete-setup case.

Diagnostic: the worktree exists but dependencies are missing

A successful switch is not a dependency-readiness check. Inspect the setup command's exit status and run the project's normal check before handing the directory to an agent. Required setup belongs in pre-start; optional watchers belong in post-start. Hook semantics.

Evidence

  • Independent attention: GitHubTrending.today's November 7, 2026 capture places Worktrunk fourth in its weekly list. This measures interest, not coding outcomes. Weekly capture.
  • Public trial report: ee-prog, September 16, 2026, describes Worktrunk 0.77.0 on macOS arm64 leaving dependency setup incomplete after a failed hook: “pre-start never runs” on the subsequent switch. The report includes reproduction commands. Issue #4143 was closed as completed on 20 November 2026 by PR #4705. As of November 2026, Worktrunk 0.83.0, released 21 November, includes a retry hint after failed pre-start setup. Issue #4143.

Limits

This is a small Node-project trial, not a general dependency recipe. Substitute the project's own setup command for other stacks. Separate working directories do not isolate external services or resolve merge conflicts. The issue establishes one failure path, not a reliability rate or evidence of faster coding.

Not for: dev-server port clashes between worktrees; see portless-named-urls-for-parallel-worktrees.

Started from a post by @max-sixty, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Worktrunk: start each coding agent in a ready worktree
Summary: As of November 2026, Worktrunk can create branch-addressed worktrees and run configured dependency setup before creation finishes. Retry setup in an existing worktree with `wt hook pre-start --foreground`
Copy for agent
get the whatworks thread worktrunk-agent-worktree-setup and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread worktrunk-agent-worktree-setup
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks