Skip to content

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

docs: update hook examples and descriptions

Maximilian Roos504c9c2d87ad
diff --git a/.claude-plugin/skills/worktrunk/reference/hook.md b/.claude-plugin/skills/worktrunk/reference/hook.md
index adc9c29dd..ed899e13a 100644
--- a/.claude-plugin/skills/worktrunk/reference/hook.md
+++ b/.claude-plugin/skills/worktrunk/reference/hook.md
@@ -21,31 +21,30 @@ Hooks are shell commands that run at key points in the worktree lifecycle — au
### post-create
-Installing dependencies, database migrations, copying environment files.
+Copying caches, installing dependencies, generating environment files.
```toml
[post-create]
+copy = "wt step copy-ignored"
install = "npm ci"
-migrate = "npm run db:migrate"
-env = "cp .env.example .env"
```
### post-start
-Long builds, dev servers, file watchers, downloading large assets. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
+Dev servers, long builds, file watchers. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
```toml
[post-start]
-build = "npm run build"
-server = "npm run dev"
+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. Useful for terminal tab renaming, tmux window names, IDE notifications. Output logged to `.git/wt-logs/{branch}-{source}-post-switch-{name}.log`.
+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`.
```toml
-post-switch = "echo 'Switched to {{ branch }}'"
+[post-switch]
+tmux = "[ -n \"$TMUX\" ] && tmux rename-window '{{ branch | sanitize }}'"
```
### pre-commit
diff --git a/docs/content/hook.md b/docs/content/hook.md
index 7bed7f4a1..b0df91cf6 100644
--- a/docs/content/hook.md
+++ b/docs/content/hook.md
@@ -29,31 +29,30 @@ Hooks are shell commands that run at key points in the worktree lifecycle — au
### post-create
-Installing dependencies, database migrations, copying environment files.
+Copying caches, installing dependencies, generating environment files.
```toml
[post-create]
+copy = "wt step copy-ignored"
install = "npm ci"
-migrate = "npm run db:migrate"
-env = "cp .env.example .env"
```
### post-start
-Long builds, dev servers, file watchers, downloading large assets. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
+Dev servers, long builds, file watchers. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
```toml
[post-start]
-build = "npm run build"
-server = "npm run dev"
+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. Useful for terminal tab renaming, tmux window names, IDE notifications. Output logged to `.git/wt-logs/{branch}-{source}-post-switch-{name}.log`.
+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`.
```toml
-post-switch = "echo 'Switched to {{ branch }}'"
+[post-switch]
+tmux = "[ -n \"$TMUX\" ] && tmux rename-window '{{ branch | sanitize }}'"
```
### pre-commit
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index c3c31d779..911d579e1 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -1017,31 +1017,30 @@ wt step push
### post-create
-Installing dependencies, database migrations, copying environment files.
+Copying caches, installing dependencies, generating environment files.
```toml
[post-create]
+copy = "wt step copy-ignored"
install = "npm ci"
-migrate = "npm run db:migrate"
-env = "cp .env.example .env"
```
### post-start
-Long builds, dev servers, file watchers, downloading large assets. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
+Dev servers, long builds, file watchers. Output logged to `.git/wt-logs/{branch}-{source}-post-start-{name}.log`.
```toml
[post-start]
-build = "npm run build"
-server = "npm run dev"
+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. Useful for terminal tab renaming, tmux window names, IDE notifications. Output logged to `.git/wt-logs/{branch}-{source}-post-switch-{name}.log`.
+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`.
```toml
-post-switch = "echo 'Switched to {{ branch }}'"
+[post-switch]
+tmux = "[ -n \"$TMUX\" ] && tmux rename-window '{{ branch | sanitize }}'"
```
### pre-commit