Skip to main content
command CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/worktree-status.md
Open on GitHub

What 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.md

Call it with /worktree-status. For all projects use ~/.claude/commands/

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.

Similar slash commands

All slash commands for Git and GitHub →

From the same set45

The whole set →
remove-worktree remove-worktree deletes a worktree by branch name: the directory, the git entry and the local branch. Useful when merged branches leave copies behind. CX Codex +1 ★ 6,529repo stars clean-worktrees clean-worktrees cleans up Git worktrees for branches already merged into main. Useful after landing pull requests to reclaim disk space without prompt fatigue. CX Codex +1 ★ 6,529repo stars park park stores the active session in a Markdown file so work can resume after a restart. It is made for Claude Code and Codex workflows. CX Codex +1 ★ 6,529repo stars worktree Creates a separate git worktree folder for feature or fix branches. Useful when you need to work on multiple tasks in parallel without conflicts in your main branch. CX Codex +1 ★ 6,529repo stars track-mentions track-mentions finds fresh web references to the Claude Code Ultimate Guide and updates its tracker. Use it when you need a repeatable mention audit. CX Codex +1 ★ 6,529repo stars audit-quiz-coverage The audit-quiz-coverage command for Claude Code and Codex compares recent releases and guide changes with quiz questions, then drafts questions for topics not yet covered. CX Codex +1 ★ 6,529repo stars retex retex logs technical incidents, rollbacks, and mistakes into project memory so Claude Code retains prevention rules across sessions. CX Codex +1 ★ 6,529repo stars guide-recap guide-recap is a Claude Code skill that turns CHANGELOG.md entries into draft posts for LinkedIn, Twitter/X, newsletters, and Slack. Run it after a release or for a weekly recap. CX Codex +1 ★ 6,529repo stars

Project sponsors

Companies that keep this analytics open