@agnishc/edb-quit-summary

Pi extension: prints a session summary to the terminal when you hit /quit

Packages

Package details

extension

Install @agnishc/edb-quit-summary from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@agnishc/edb-quit-summary
Package
@agnishc/edb-quit-summary
Version
0.15.1
Published
Jun 9, 2026
Downloads
862/mo · 166/wk
Author
agnishc
License
MIT
Types
extension
Size
15.2 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

edb-quit-summary

A pi extension that prints a session summary to your terminal when you quit pi.

When you hit /quit (or Ctrl+C twice), pi exits and you'll see a compact summary like:

  Session Summary / quit
  ─────────────────────────────────────────────────────
    /\_/\      Session   Refactor auth module
   < ▓ ▓ >     Duration  23m 45s
     \___/     Model     anthropic/claude-sonnet-4-5

               Messages  8 user / 8 assistant
               Tools     24 · edit 12× · bash 6× · read 4×

               Tokens    101.4k total  45.2k in  12.8k out
               Cost      $0.34

How It Works

Pi uses an alternate screen buffer for its TUI. When pi exits, the terminal restores the original buffer, wiping anything printed during the session. This extension works around that by:

  1. Collecting stats on the session_shutdown event (when reason === "quit")
  2. Registering a process.on('exit') callback that fires after the TUI is torn down
  3. Writing the formatted summary directly to process.stdout

Installation

As a pi package (recommended)

pi install npm:@agnishc/edb-quit-summary

Manual

Copy src/index.ts to ~/.pi/agent/extensions/quit-summary.ts.

Configuration

No configuration needed — it just works. The summary only prints on quit, not on /new, /resume, /fork, or /reload.