Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

docs: clarify hook execution order (post-create before post-start) (#1573)

worktrunk-bot5eb7a7617630
diff --git a/docs/content/hook.md b/docs/content/hook.md
index 0a484eca5..f6927f746 100644
--- a/docs/content/hook.md
+++ b/docs/content/hook.md
@@ -18,8 +18,8 @@ Hooks are shell commands that run at key points in the worktree lifecycle — au
| Hook | When | Blocking | Fail-fast |
|------|------|----------|-----------|
| `pre-switch` | Before every switch | Yes | Yes |
-| `post-start` | After worktree created | No | No |
| `post-create` | After worktree created | Yes | No |
+| `post-start` | After worktree created | No | No |
| `post-switch` | After every switch | No | No |
| `pre-commit` | Before commit during merge | Yes | Yes |
| `pre-merge` | Before merging to target | Yes | Yes |
@@ -49,16 +49,6 @@ fi
"""
```
-## post-start
-
-Dev servers, long builds, file watchers, copying caches. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
-
-```toml
-[post-start]
-copy = "wt step copy-ignored"
-server = "npm run dev -- --port {{ branch | hash_port }}"
-```
-
## post-create
Tasks that must complete before `post-start` hooks or `--execute` run: dependency installation, environment file generation.
@@ -69,6 +59,16 @@ install = "npm ci"
env = "echo 'PORT={{ branch | hash_port }}' > .env.local"
```
+## post-start
+
+Dev servers, long builds, file watchers, copying caches. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
+
+```toml
+[post-start]
+copy = "wt step copy-ignored"
+server = "npm run dev -- --port {{ branch | hash_port }}"
+```
+
## post-switch
Triggers on all switch results: creating new worktrees, switching to existing ones, or staying on current. Output logged to `.git/wt-logs/{branch}-{source}-post-switch-{name}.log`.
diff --git a/skills/worktrunk/reference/hook.md b/skills/worktrunk/reference/hook.md
index 561b3055e..f0b0c173c 100644
--- a/skills/worktrunk/reference/hook.md
+++ b/skills/worktrunk/reference/hook.md
@@ -9,8 +9,8 @@ Hooks are shell commands that run at key points in the worktree lifecycle — au
| Hook | When | Blocking | Fail-fast |
|------|------|----------|-----------|
| `pre-switch` | Before every switch | Yes | Yes |
-| `post-start` | After worktree created | No | No |
| `post-create` | After worktree created | Yes | No |
+| `post-start` | After worktree created | No | No |
| `post-switch` | After every switch | No | No |
| `pre-commit` | Before commit during merge | Yes | Yes |
| `pre-merge` | Before merging to target | Yes | Yes |
@@ -40,16 +40,6 @@ fi
"""
```
-## post-start
-
-Dev servers, long builds, file watchers, copying caches. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
-
-```toml
-[post-start]
-copy = "wt step copy-ignored"
-server = "npm run dev -- --port {{ branch | hash_port }}"
-```
-
## post-create
Tasks that must complete before `post-start` hooks or `--execute` run: dependency installation, environment file generation.
@@ -60,6 +50,16 @@ install = "npm ci"
env = "echo 'PORT={{ branch | hash_port }}' > .env.local"
```
+## post-start
+
+Dev servers, long builds, file watchers, copying caches. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
+
+```toml
+[post-start]
+copy = "wt step copy-ignored"
+server = "npm run dev -- --port {{ branch | hash_port }}"
+```
+
## post-switch
Triggers on all switch results: creating new worktrees, switching to existing ones, or staying on current. Output logged to `.git/wt-logs/{branch}-{source}-post-switch-{name}.log`.
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 93de92eee..4fba57a20 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -1105,8 +1105,8 @@ Alias names that match a built-in step command (`commit`, `squash`, etc.) are sh
| Hook | When | Blocking | Fail-fast |
|------|------|----------|-----------|
| `pre-switch` | Before every switch | Yes | Yes |
-| `post-start` | After worktree created | No | No |
| `post-create` | After worktree created | Yes | No |
+| `post-start` | After worktree created | No | No |
| `post-switch` | After every switch | No | No |
| `pre-commit` | Before commit during merge | Yes | Yes |
| `pre-merge` | Before merging to target | Yes | Yes |
@@ -1136,16 +1136,6 @@ fi
"""
```
-## post-start
-
-Dev servers, long builds, file watchers, copying caches. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
-
-```toml
-[post-start]
-copy = "wt step copy-ignored"
-server = "npm run dev -- --port {{ branch | hash_port }}"
-```
-
## post-create
Tasks that must complete before `post-start` hooks or `--execute` run: dependency installation, environment file generation.
@@ -1156,6 +1146,16 @@ install = "npm ci"
env = "echo 'PORT={{ branch | hash_port }}' > .env.local"
```
+## post-start
+
+Dev servers, long builds, file watchers, copying caches. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
+
+```toml
+[post-start]
+copy = "wt step copy-ignored"
+server = "npm run dev -- --port {{ branch | hash_port }}"
+```
+
## post-switch
Triggers on all switch results: creating new worktrees, switching to existing ones, or staying on current. Output logged to `.git/wt-logs/{branch}-{source}-post-switch-{name}.log`.