Skip to content

Commit 963d666

Browse files
committed
docs: expand AI assistant and editor launch examples
Add Codex, Aider, VS Code, Cursor, and Zed hook examples alongside the existing Claude Code + tmux pattern. Show how to compose them.
1 parent 0edbdf1 commit 963d666

1 file changed

Lines changed: 41 additions & 2 deletions

File tree

docs/examples.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Examples
22

3-
## Claude Code + tmux integration
3+
## AI assistants and editors
44

5-
Launch a [Claude Code](https://docs.anthropic.com/en/docs/claude-code) session in tmux for every worktree automatically:
5+
Launch an AI coding assistant or editor automatically when checking out a worktree.
6+
7+
### Claude Code + tmux
68

79
![wt claude-tmux](wt-claude-tmux.gif)
810

@@ -21,6 +23,43 @@ pre_remove = [
2123

2224
Claude Code also has built-in worktree support via `claude --worktree --tmux`, but it uses a fixed directory layout. The hooks approach lets you keep `wt`'s configurable strategies and naming conventions.
2325

26+
### Other assistants and editors
27+
28+
```toml
29+
[hooks]
30+
# OpenAI Codex CLI in tmux
31+
post_checkout = [
32+
"tmux new-session -d -s \"$WT_REPO_NAME/$WT_BRANCH\" -c \"$WT_PATH\" codex 2>/dev/null"
33+
]
34+
35+
# Aider in tmux
36+
# post_checkout = [
37+
# "tmux new-session -d -s \"$WT_REPO_NAME/$WT_BRANCH\" -c \"$WT_PATH\" aider 2>/dev/null"
38+
# ]
39+
40+
# Open worktree in VS Code
41+
# post_checkout = ["code $WT_PATH"]
42+
43+
# Open worktree in Cursor
44+
# post_checkout = ["cursor $WT_PATH"]
45+
46+
# Open worktree in Zed
47+
# post_checkout = ["zed $WT_PATH"]
48+
```
49+
50+
Mix and match — for example, open VS Code _and_ start Claude Code in tmux:
51+
52+
```toml
53+
[hooks]
54+
post_checkout = [
55+
"code $WT_PATH",
56+
"tmux new-session -d -s \"$WT_REPO_NAME/$WT_BRANCH\" -c \"$WT_PATH\" \"claude -n '$WT_REPO_NAME/$WT_BRANCH'\" 2>/dev/null"
57+
]
58+
pre_remove = [
59+
"tmux kill-session -t \"$WT_REPO_NAME/$WT_BRANCH\" 2>/dev/null || true"
60+
]
61+
```
62+
2463
## Task spanning multiple repositories
2564

2665
When a task or story requires changes across multiple repositories (e.g. a shared library and a main application), you can organize worktrees by feature instead of by repo using a custom pattern:

0 commit comments

Comments
 (0)