Command
/worktree-check
Check current worktree status, branch, and assigned task
One command from claude-code-templates.
shell
$ npx -y skills add davila7/claude-code-templates --agent claude-codeShips with claude-code-templates. Installing the plugin gets this command.
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/worktree-check
Context preview
What this command does when you run it.
Check current worktree status, branch, and assigned task
Stats
Stars29,852
Forks3,189
LanguagePython
LicenseMIT
Ships with claude-code-templates
Command definition
worktree-check.md
--- allowed-tools: Bash(git:*), Bash(cat:*), Bash(pwd:*), Bash(ls:*) description: Check current worktree status, branch, and assigned task --- # Worktree Status Check Verify the current worktree environment and show task details. ## Instructions You are inside a worktree (or the main repo). Gather and display the current status clearly. ### Step 1: Detect Worktree 1. Get the current directory: `pwd` 2. List all worktrees: `git worktree list` 3. Determine if the current directory is a worktree (not the main working tree). The main working tree is listed first in `git worktree list` output — if the current path matches the first entry, this is the main repo, not a worktree. If this is **not** a worktree, inform the user: > You're in the main repository, not a worktree. Use `/worktree-init` to create worktrees. Then list any existing worktrees and exit. ### Step 2: Show Branch Info 1. Get current branch: `git branch --show-current` 2. Verify it follows the `claude/*`, `claude-daniel/*`, or `review/*` naming convention 3. Show how many commits ahead of origin/main: `git rev-list --count origin/main..HEAD` ### Step 3: Read Task 1. Check if `.worktree-task.md` exists in the worktree root
