# pi-session-manager

Browse, switch, and delete Pi sessions — all from one interactive browser.

## Commands

| Command | Description |
|---------|-------------|
| `/sessions` | Open interactive session browser |

### Browser shortcuts

| Key | Action |
|-----|--------|
| `↑` / `↓` | Navigate sessions |
| `Enter` | Switch to selected session |
| `i` | Toggle session details (prompt, project, model, file path, ID) |
| `d` (twice) | Delete session |
| `/` | Filter by prompt text, project path, or model |
| `Esc` | Close |

Each row shows: **first user prompt** (or session name if set) · age · message count · model.

The current session name (if set) also appears in the footer status bar.

## Install

```bash
pi install npm:@zzy2357/pi-session-manager
# or from git
pi install git:github.com/zzy2357/pi-session-manager
```

After install, run `/reload` and type `/sessions`.

## Files it reads

- `~/.pi/agent/sessions/**/*.jsonl` — scans all session files
- Uses `PI_CODING_AGENT_SESSION_DIR` env var if set

## Files it deletes

- The `.jsonl` file of any session you confirm deletion for (via `d d`)
