| name | flow-status |
| description | Flow: Status of Active Worktrees - Show all active worktrees with their issue, branch, dirty state, and PR status. |
Codex harness adaptations
Generated from a Claude Code command. Where the procedure references these Claude-only surfaces, adapt as follows:
- Codex worktrees: use the bundled resolver and plain git. Worktrees live at
$FLOW_WORKTREE_BASE/<repo>-<branch> when configured, otherwise as a visible sibling ../<repo>-<branch>; enter with cd and clean up with git worktree remove. Never use Claude's hidden worktree directory.
Flow: Status of Active Worktrees
Show all active worktrees with their issue, branch, dirty state, and PR status.
Instructions
When the user invokes /flow-status, perform these steps:
Step 1: Detect Repository
REPO=$(basename "$(git rev-parse --show-toplevel)")
Step 2: List Worktrees
git worktree list
Step 3: For Each Worktree, Gather State
For each worktree (skip the main repo entry):
BRANCH=$(git -C "$WORKTREE_PATH" branch --show-current 2>/dev/null)
ISSUE_NUM=$(echo "$BRANCH" | grep -oP 'issue-\K[0-9]+' || echo "")
DIRTY=$(git -C "$WORKTREE_PATH" status --porcelain 2>/dev/null | wc -l)
UNPUSHED=$(git -C "$WORKTREE_PATH" rev-list --count origin/main..HEAD 2>/dev/null || echo "0")
if [[ -n "$BRANCH" ]]; then
PR_INFO=$(gh pr list --head "$BRANCH" --json number,url,state --jq '.[0]' 2>/dev/null || echo "")
fi
Step 4: Fetch Issue Titles
For each detected issue number:
ISSUE_TITLE=$(gh issue view "$ISSUE_NUM" --json title --jq '.title' 2>/dev/null || echo "Unknown")
Step 5: Output
## Flow Status - {repo}
| Worktree | Issue | Branch | Status | PR |
|----------|-------|--------|--------|----|
| ../<repo>-<branch>/issue-42-fix-login | #42 Fix login bug | issue-42-fix-login | 3 dirty files, 2 unpushed | - |
| ../<repo>-<branch>/issue-55-add-tests | #55 Add tests | issue-55-add-tests | Clean | PR #78 (OPEN) |
### Suggestions
- **#42**: Has uncommitted work - commit or stash before switching
- **#55**: PR is open - check for reviews, then `/flow-merge`
Step 6: Detect Stale Branches
Check for local branches that may need cleanup:
WORKTREE_BRANCHES=$(git worktree list --porcelain | grep "^branch " | sed 's|branch refs/heads/||')
STALE_COUNT=0
for branch in $(git branch | grep 'issue-' | sed 's/^[ *]*//'); do
echo "$WORKTREE_BRANCHES" | grep -q "^${branch}$" && continue
STALE_COUNT=$((STALE_COUNT + 1))
done
PRUNABLE=$(git worktree list --porcelain | grep -c "prunable" || echo "0")
If stale branches or prunable references exist, append to output:
### Cleanup Available
- {N} local issue branches with no active worktree
- {M} stale worktree references
Run `/flow-cleanup` to remove stale branches and references.
Notes
- Worktrees on
main or non-issue branches are listed but marked as "(not issue-linked)"
- If no worktrees exist besides main, report "No active worktrees. Run
/flow-start <issue> to begin."
- Keep output concise - this is a quick status check
- Stale branch detection helps identify cleanup opportunities