worktree-status — Claude Code command: what it does and install
worktree-status is a Claude Code command that reports the branch, path, commit hash, and modified-file count for each active git worktree.
CC-BY-SA-4.0 ★ 6,529 updated 2026-10-22
.claude/commands/worktree-status.mdWhat worktree-status does
This command inspects linked working trees using git worktree list and prints a structured summary for each. You see the associated branch, folder path, short commit hash, and whether working files are clean or modified.
A bash script handles the collection under the hood. For non-main branches, it counts commits ahead of main and flags missing directories where worktree folders were removed manually.
Running this command outside a git repository halts execution immediately with an error. The definition runs on the Haiku model by default.
What it helps with
- Inspect all active git worktrees across the repository
- Spot uncommitted file modifications inside secondary trees
- Check how many commits a branch is ahead of main
- Identify stale worktree records pointing to deleted folders
Example prompts for the agent
- /worktree-status
- /worktree-status feature/pr-9
How to install worktree-status
Manually: put the files in place
.claude/commands/worktree-status.mdCall it with /worktree-status. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/worktree-status.mdCall it with /prompts:worktree-status. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/worktree-status.prompt.mdManually: put the files in place
.gemini/commands/worktree-status.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about worktree-status
How to install worktree-status in Claude Code?
Place the command specification file into .claude/commands/worktree-status.md inside your repository.
What does worktree-status display?
It lists each git worktree alongside its branch, directory, commit hash, uncommitted change tally, and commit count ahead of main.
Does worktree-status require an active git repository?
Yes. The script checks git rev-parse --git-common-dir on startup and exits with an error if no git context exists.