pi-scratch

Pi extension that opens an isolated /scratch session for side-questions, so quick asks don't pollute your main thread.

Packages

Package details

extension

Install pi-scratch from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-scratch
Package
pi-scratch
Version
0.1.0
Published
Jun 23, 2026
Downloads
175/mo · 14/wk
Author
ishironin
License
MIT
Types
extension
Size
7.3 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

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

README

pi-scratch

A Pi extension that opens an isolated /scratch session for side-questions, so quick asks don't pollute your main thread.

A side-question — "what's the syntax for X?" or "is this lib Y or Z?" — shouldn't drag your main session off-topic. /scratch drops you into a brand-new session in its own timestamped folder; /resume brings you back.

Install

pi install npm:pi-scratch

Usage

# Each /scratch session lives in its own folder:
$ ls ~/.pi/scratch/
2026-06-23T19-02-44_7e8f9a0b/
2026-06-23T19-15-22_c3d4e5f6/
2026-06-23T19-32-11.612Z_a3f9b2c1/

# Hit a syntax question deep in a feature branch:
pi
> /scratch
you: how do I revoke a JWT before exp?
pi:  shortlist: blacklist, refresh-token rotation, short-lived tokens …
> /resume           # back to your real session, untouched

How it works

/scratch creates a new session at ~/.pi/scratch/<timestamp>_<id>/ and switches to it. If composer text is present, /scratch asks before discarding it.

Compared to

  • pi --no-session (built-in flag) — disables persistence for the whole run. /scratch is a per-command switch inside any session.
  • pi-ephemeral (npm) — toggles persistence on the current session file. /scratch always opens a brand-new isolated folder.
  • Claude Code /btw — a side-question that overlays onto your current session. /scratch opens a full session with its own folder, so the side-question can be revisited later.

Limitations

  • Scratch sessions are real files — old ones stay on disk until you rm -rf ~/.pi/scratch/*
  • No automatic naming or tagging (zero-config by design)

License

MIT