Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
9be3764
fix: use cross-platform wrapper for wt CLI in plugin hooks
lucaspimentel Mar 26, 2026
7908858
fix: prefer git-wt.exe on Windows, fall back to wt
worktrunk-bot Mar 26, 2026
5e46cc0
refactor: condense wt.sh Windows detection into single if-statement
lucaspimentel Mar 26, 2026
b24c364
fix: skip Windows Terminal alias when resolving wt on Windows
lucaspimentel Mar 26, 2026
faa0f7c
Apply suggestion from @worktrunk-bot
lucaspimentel Mar 26, 2026
e93b4bd
fix: remove duplicate wt invocation and clarify error message
lucaspimentel Mar 26, 2026
987af81
bump plugin's patch version
lucaspimentel Mar 26, 2026
78f85b8
fix: simplify wt.sh binary resolution and improve error messages
lucaspimentel Mar 26, 2026
c706a17
docs: update wt.sh header comments to match simplified logic
lucaspimentel Mar 26, 2026
64d4c92
refactor: restore OS check in wt.sh for fast path on non-Windows
lucaspimentel Mar 26, 2026
f531f04
fix: skip wt.sh early when not inside a git repository
lucaspimentel Mar 26, 2026
31e2fb1
Merge branch 'max-sixty:main' into main
lucaspimentel Mar 27, 2026
5645394
feat: honor WORKTRUNK_BIN env var in wt.sh wrapper
lucaspimentel Mar 27, 2026
36a84dd
don't check in bash script for git repository
lucaspimentel Apr 21, 2026
a3407ae
tweak comment and error message
lucaspimentel Apr 21, 2026
d3da440
Merge remote-tracking branch 'origin/main' into lucaspimentel-main-merge
worktrunk-bot Apr 28, 2026
de3cd47
fix(plugin): wrap WorktreeCreate and WorktreeRemove hooks in wt.sh
worktrunk-bot May 5, 2026
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
6 changes: 3 additions & 3 deletions .claude-plugin/hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"hooks": [
{
"type": "command",
"command": "wt config state marker set 🤖 || true"
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/.claude-plugin/hooks/wt.sh\" config state marker set 🤖 || true"
}
]
}
Expand All @@ -16,7 +16,7 @@
"hooks": [
{
"type": "command",
"command": "wt config state marker set 💬 || true"
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/.claude-plugin/hooks/wt.sh\" config state marker set 💬 || true"
}
]
}
Expand All @@ -27,7 +27,7 @@
"hooks": [
{
"type": "command",
"command": "wt config state marker clear || true"
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/.claude-plugin/hooks/wt.sh\" config state marker clear || true"
}
]
}
Expand Down
38 changes: 38 additions & 0 deletions .claude-plugin/hooks/wt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# Cross-platform wrapper for the worktrunk CLI.
# On Windows (MSYS/Cygwin), prefers git-wt.exe over wt and rejects wt if
# it resolves to Windows Terminal (WindowsApps/wt.exe).
# On other platforms, uses wt directly.
# Exits silently if git is unavailable or not inside a git repository.
# Usage: wt.sh [args...]

# bail early if git is not available or not inside a git repository
if ! command -v git >/dev/null 2>&1 || ! git rev-parse --git-dir >/dev/null 2>&1; then
exit 0
fi
Comment thread
lucaspimentel marked this conversation as resolved.
Resolved

# check for bash on Windows (on Windows, Claude Code defaults to Git Bash)
if [[ "$(uname -o 2>/dev/null)" =~ ^(Msys|Cygwin)$ ]]; then
if command -v git-wt.exe >/dev/null 2>&1; then
# prefer git-wt over wt if available
WT=git-wt.exe
elif command -v wt >/dev/null 2>&1; then
# reject wt if it's the Windows Terminal alias
if [[ "$(command -v wt)" == *WindowsApps* ]]; then
echo "worktrunk: 'wt' resolves to Windows Terminal; install worktrunk as git-wt.exe or remove the Windows Terminal alias — see https://worktrunk.dev/worktrunk/#install" >&2
exit 1
fi

WT=wt
fi
else
# non-Windows, always use wt
WT=wt
fi

if [[ -z "$WT" ]] || ! command -v "$WT" >/dev/null 2>&1; then
echo "worktrunk: could not find 'wt' in PATH" >&2
exit 1
fi

"$WT" "$@"
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "worktrunk",
"description": "Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows. This plugin provides configuration guidance (LLM commit messages, project hooks, worktree paths) and automatic activity tracking (🤖/💬 indicators in `wt list` showing active Claude sessions).",
"version": "1.0.0",
"version": "1.0.1",
"author": {
"name": "Worktrunk"
},
Expand Down
Loading