igerber

Worktree Ls — Git skill for Claude Code

Git community

List all active git worktrees with status.

How to install Worktree Ls

Installs to ~/.claude/commands/igerber-diff-diff-worktree-ls.md

Terminal
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/igerber/diff-diff/HEAD/.claude/commands/worktree-ls.md -o ~/.claude/commands/igerber-diff-diff-worktree-ls.md

Restart Claude Code, or start a new session, for it to be picked up.

What Worktree Ls does


description: List all active git worktrees with status argument-hint: ""

List Git Worktrees

Instructions

1. Get Worktree List

Use porcelain format for reliable, machine-parseable output:

git worktree list --porcelain

2. Parse and Check Status

Parse the porcelain output into records. Each worktree is a block of lines separated by a blank line, with fields:

  • worktree — the absolute path
  • HEAD — the full commit hash
  • `branch refs/heads/<na

Alternatives in Git

  • 使用 Git Worktrees — 创建孤立的 Git worktrees,带有智能目录选择与安全验证 115.1k ★
  • Git Worktree Setup — Create isolated git worktrees with instant feedback and background Rust verification 25.5k ★
  • Worktree Parallel Init — Create multiple git worktrees for parallel development: $ARGUMENTS 23.4k ★

Full documentation available on GitHub

View Source Repository