---
seed: SEED-001
created: 2026-05-09
title: Capsule interactive agent selector when no agent name given
area: capsule
milestone: v1.9
status: planted
---

## Idea

When `capsule.bat` (or `capsule.exe`) is invoked without an agent-name argument, present an interactive CLI selector populated with all previous agents launched for the current project, sorted by **date last active** (descending). Append a sentinel **"new agent"** option at the end; selecting it switches to inline text input for a new agent name. UX shape mirrors Claude Code's `AskUserQuestion` tool (arrow-key nav + inline "Other" capture).

## Why this matters

Capsule's launch ergonomics today force the user to remember/type an agent name every invocation. For a returning user on a project they've worked in before, the right agent name is discoverable from prior perch metadata — friction we're inflicting unnecessarily. Selector also doubles as a discoverability surface: shows "what agents have I run here before?" without a separate `list` command.

## Trigger conditions (when to plant → todo/phase)

Promote out of seed status when **any** of:

1. **v1.9 Capsule milestone enters active planning** — Phase 19/20/21/22 work begins; this slots cleanly into Phase 19 (Sendkeys Foundation & Capsule Launch) ergonomics work.
2. **Multi-agent capsule usage observed** — user reports running ≥3 distinct agents in a single project; friction becomes painful.
3. **AskUserQuestion-equivalent CLI lib evaluated** — once we know what TUI prim we'd use (e.g. `dialoguer`, `inquire`, hand-rolled), implementation cost drops.

## Open design questions

- **Source of truth for "previous agents":** scan `%LOCALAPPDATA%\spt\owlery\<project>\` for perch dirs? Or maintain explicit history file? Perch dirs are GC'd — history file preserves past identities.
- **Project scoping:** what defines "this project"? cwd? git repo root? psmux winname?
- **Sort key:** "last active" = perch info.json mtime? last commune timestamp? last successful poll?
- **Selector lib:** `dialoguer` (mature, MIT) is the obvious pick; check binary-size impact (zero-deps constraint).
- **Headless / non-TTY fallback:** if stdin not a TTY, error with a hint (`capsule <agent_name>` usage), don't hang.
- **Auto-launch shortcut:** Enter on the top item (most recently active) launches immediately — no extra confirmation step.

## Related

- 2026-04-13 todo: capsule reattach existing psmux session — same "what's already here?" theme.
- 2026-04-13 todo: capsule psmux winname `repo/branch` — selector display could use winname format.
- v1.9 Phase 19: Sendkeys Foundation & Capsule Launch — natural home.
