← Catalog

pi-session-sweep

Session management and cleanup extension for the Pi coding agent with native Antigravity (agy) conversation cleanup.

Extension

Install

Install with PiG

pig install npm:pi-session-sweep

Install with Pi

pi install npm:pi-session-sweep
Review 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 to unlink if no trash provider is available.
  • 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.

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 via PI_SESSION_SWEEP_ICON_MODE or PI_NERD_FONT.

More Pi Extensions

PackageDescriptionInstall
pi-agy-providerAntigravity (agy) provider & multi-agent orchestrator (/swarm, /boost, /teamwork, /btw)pi install npm:pi-agy-provider
pi-md-renderStreaming-first rich Markdown, code, Mermaid & LaTeX rendering for the Pi TUIpi install npm:pi-md-render
pi-session-sweepSession management & cleanup with native agy conversation cleanuppi install npm:pi-session-sweep

License

MIT