Claude
Skills
Sign in
Back

list-sessions

Included with Lifetime
$97 forever

List all running ai-* Claude Code tmux sessions with their current status

AI Agents

What this skill does


# List Claude Code Sessions

List all running `ai-*` prefixed tmux sessions and show their current status.

## Instructions

1. **Get all ai-* sessions:**
   ```bash
   tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -E '^ai-' || echo ""
   ```

2. **For each session, capture recent output:**
   ```bash
   "$PLUGIN_DIR/bin/capture-session" "<session_name>" 15
   ```

3. **Analyze each session's output** to determine status:
   - `working` - Has `✢`, `⏺`, or `Thinking…`
   - `idle` - At `❯` prompt with no activity
   - `permission-prompt` - Waiting for permission approval
   - `waiting-input` - Waiting for user input (y/n, choice, text)
   - `stuck` - In editor, pager, or hanging

4. **Output a table:**
   ```
   Session                Status              Details
   ───────────────────────────────────────────────────
   ai-worker-001          working             Editing src/api.ts
   ai-worker-002          permission-prompt   Bash: npm install
   ai-brainstorm-design   idle                At prompt
   ```

5. **If no sessions found:**
   ```
   No ai-* sessions found.

   To create one: /session-tools:spawn-session worker
   ```

Related in AI Agents