I stopped spawning a second Pi just to switch sessions A developer created pisesh, a Node-based session picker for the Pi coding agent, to address the problem of managing many similar sessions. The tool adds favorites, search, custom names, and a current-project view. In version 0.3.0, the developer integrated it with Pi's ctx.switchSession() extension API, allowing the picker to switch sessions within the same Pi process instead of spawning a nested Pi process, fixing runtime lifecycle issues. I use the Pi coding agent from several project folders. After a while, pi --resume became a long list of sessions with similar first prompts. I kept reopening the wrong one. I made pisesh https://github.com/Blue-B/pisesh to add the things I wanted in that list: favorites, search, custom names, a current-project view, and optional title generation. It is a single Node script with no runtime dependencies. /sesh implementation The first version took a direct route. It paused Pi's TUI, opened the pisesh picker, then started another Pi process for the selected session. That was useful because leaving the child process returned me to the original session. It also meant the process tree looked like this: Pi session A pisesh Pi session B The nested process eventually became the problem. Tools were running in session B, but anything watching the outer Pi process could still see session A as idle. The terminal looked right while the runtime lifecycle was wrong. Pi already exposes ctx.switchSession to extensions. In pisesh 0.3.0, the picker no longer starts Pi when it was opened through /sesh . The picker writes one small JSON selection to a private file descriptor. It includes the absolute session path and the selected model behavior. The extension reads that result and asks Pi to switch the current runtime: Pi session A /sesh picker ctx.switchSession sessionB Pi session B Standalone pisesh still starts pi --session , so the shell command keeps its old behavior. Only the extension path changed. There were two details I did not want to lose. Enter still resumes with the current default model and thinking level, while o restores the values recorded in the selected session. Interrupted tool calls are also repaired before the handoff when Pi would otherwise load an incomplete transcript. pi install npm:pisesh Then run /sesh inside Pi. The package is MIT licensed and works on Node 18 or newer.