---
description: Spawn employee sessions in tmux for parallel autonomous work
allowed-tools: Bash
argument-hint: [employee names...]
---

Launch one or more employees as detached tmux sessions. Each session uses `ensureEmployee()` — checks if alive first, spawns if not.

**Prerequisites:** Must be inside a tmux session. Claude Code CLI must be in PATH.

1. First, verify we're inside tmux:
```bash
# Robust tmux detection — handles su/sudo login shells (env vars stripped)
([ -n "$TMUX" ] || [ -n "$TMUX_PANE" ] || [[ "$TERM" == tmux* ]] || [[ "$TERM" == screen* ]] || tmux display-message -p '#{session_name}' >/dev/null 2>&1) && echo "TMUX_OK" || echo "TMUX_MISSING"
```

If TMUX_MISSING, tell the user:
```
tmux is required. Start a tmux session first:
  tmux new-session -s work
  claude
  /exe
```

2. Load the employee roster and validate all names from $ARGUMENTS:
```bash
cat ~/.exe-os/exe-employees.json 2>/dev/null || echo "NO_ROSTER"
```

For each name in $ARGUMENTS, verify it exists in the roster. If any name is not found, report it and skip that name.

3. For each validated employee name, ensure they're running via `ensureEmployee()`:
```bash
NAME="<employee>"
EXE_SESSION=$(tmux display-message -p '#{session_name}' 2>/dev/null)
RESULT=$(node -e "const {ensureEmployee}=require('$(npm root -g)/@askexenow/exe-os/dist/lib/tmux-routing.js'); const r=ensureEmployee('${NAME}','${EXE_SESSION}','$(pwd)'); console.log(JSON.stringify(r));")
echo "${NAME}: ${RESULT}"
```

4. After all sessions are spawned, show a summary:

```
## Launched Sessions

| Employee | Session | Log |
|----------|---------|-----|
| engineer | engineer-atlas1 | ~/.exe-os/session-logs/engineer-1234567890.log |
| reviewer | reviewer-atlas1 | ~/.exe-os/session-logs/reviewer-1234567890.log |

Use `/exe-sessions` to monitor, `/exe-logs <name>` to tail output, `/exe-kill <name>` to stop.
Switch sessions: Ctrl-b s (session picker)
```
