Install
Install with PiG
pig install npm:pi-session-sweepInstall with Pi
pi install npm:pi-session-sweepReview before installing
Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./src/index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.2.0 (README.md). PiG does not review it.
pi-session-sweep
Session management and cleanup extension for the Pi coding agent, with built-in support for cleaning up linked Antigravity (agy) conversations and subagent trees.
Features
- Drop Current Session (
/drop,/d):/drop(or/d): Delete the current session and immediately start a fresh session./drop quit(or/d quit,/d q,/sweep quit): Delete the current session and gracefully quit Pi./drop agent [name](or/d agent [name]): Delete the current session and start a new session with a selected target agent.
- Interactive Batch Sweep (
/sweep):/sweep(or/sweep current,/drop list): Open an interactive TUI picker to batch-select and delete previous sessions in the current working directory./sweep all(or/drop all): Open the batch-delete picker across all working directories.
- Trash-First Safety:
- Attempts to move session files to the OS trash first (
trash,trash-put,gio trash,kioclient), falling back tounlinkif no trash provider is available.
- Attempts to move session files to the OS trash first (
- Fork-Safe Antigravity (
agy) Cleanup:- Automatically removes linked Antigravity conversations (
conversations/<id>.db*,annotations/<id>.pbtxt,brain/<id>,conversation_summaries.db, metadata caches, and spawned subagent trees). - Respects session ownership (
data.sessionId === header.id) so dropping a/forked session never deletes the parent session's Antigravity conversation.
- Automatically removes linked Antigravity conversations (
Installation
Add to ~/.pi/agent/settings.json:
{
"packages": [
"git:github.com/teededung/pi-session-sweep"
]
}
Configuration
A config.json file is generated in the extension root on first run:
{
"enabled": true,
"iconMode": "auto"
}
enabled: Enable or disable the extension (true|false).iconMode: Picker icon set ("auto"|"nerd"|"fallback"). Can also be overridden viaPI_SESSION_SWEEP_ICON_MODEorPI_NERD_FONT.
More Pi Extensions
| Package | Description | Install |
|---|---|---|
| pi-agy-provider | Antigravity (agy) provider & multi-agent orchestrator (/swarm, /boost, /teamwork, /btw) | pi install npm:pi-agy-provider |
| pi-md-render | Streaming-first rich Markdown, code, Mermaid & LaTeX rendering for the Pi TUI | pi install npm:pi-md-render |
| pi-session-sweep | Session management & cleanup with native agy conversation cleanup | pi install npm:pi-session-sweep |
License
MIT