Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/src/content/docs/claude-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ Claude Code agents can run in isolated worktrees (`isolation: "worktree"`). By d

`/wt-switch-create [<branch>] [<repo>] [-- <task>]` starts a task in a fresh worktree without leaving the session: it creates the worktree, switches into it, and runs the task (all arguments optional). The worktree shows up in `wt list`; merge or remove it with `wt merge` / `wt remove`.

Claude Code asks for confirmation before a session enters an existing worktree by path outside `.claude/worktrees/`, which in worktrunk's default layout is every worktree. The plugin's `PermissionRequest` hook answers yes for a worktree of the repository the session is working in that sits where `worktree-path` puts its branch, so a background session doesn't stop at that prompt. Entering any other worktree still asks.

## Statusline (Claude Code only)

`wt list statusline --format=claude-code` outputs a single-line status for the Claude Code statusline. Claude Code runs it in the background, which is what makes the occasional 1–2 second CI fetch invisible.
Expand Down
2 changes: 2 additions & 0 deletions plugins/worktrunk/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ The Claude hooks track activity via git config (`worktrunk.state.{branch}.marker
- `Notification`, `PreToolUse`(`AskUserQuestion`), `PermissionRequest`, `Stop` → 💬 (waiting for input)
- `SessionEnd` → clears status

An `EnterWorktree` that `wt config plugins claude approve-enter-worktree` approves shows no dialog, so it leaves the marker alone; the approval and the marker share one `PermissionRequest` command because Claude Code runs matching hooks in parallel (skills/wt-switch-create/rationale.md, "The confirmation hook").

The 💬 transitions overlap deliberately: `Notification` covers the documented permission/idle path, but on platforms where it doesn't fire (VS Code extension, Windows CLI) `PermissionRequest` and `Stop` still mark the wait; `PreToolUse`(`AskUserQuestion`) catches the built-in question picker, which fires no `Notification` on any platform ([claude-code#13024](https://github.com/anthropics/claude-code/issues/13024)). There is currently no transition back to 🤖 once a turn-end/permission marker is set except a fresh `UserPromptSubmit`, so 💬 can persist into resumed work after a permission grant (the original symptom in [#2916](https://github.com/max-sixty/worktrunk/issues/2916)).

**Problem**: If the user interrupts Claude Code (Escape/Ctrl+C), the 🤖 status persists because there's no `UserInterrupt` hook. The `Stop` hook explicitly does not fire on user interrupt.
Expand Down
2 changes: 1 addition & 1 deletion plugins/worktrunk/hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/wt.sh\" -C \"$CLAUDE_PROJECT_DIR\" config state marker set 💬 || true"
"command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/wt.sh\" config plugins claude approve-enter-worktree || bash \"$CLAUDE_PLUGIN_ROOT/hooks/wt.sh\" -C \"$CLAUDE_PROJECT_DIR\" config state marker set 💬 || true"
}
]
}
Expand Down
2 changes: 2 additions & 0 deletions plugins/worktrunk/skills/worktrunk/reference/claude-code.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 19 additions & 12 deletions plugins/worktrunk/skills/wt-switch-create/SKILL.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 81 additions & 21 deletions plugins/worktrunk/skills/wt-switch-create/rationale.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions skills/worktrunk/reference/claude-code.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading