pi-diagnostics

Prompt-cache diagnostics, expiry reminders, and smarter cache warming for pi

Packages

Package details

extension

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

$ pi install npm:pi-diagnostics
Package
pi-diagnostics
Version
0.4.0
Published
Oct 27, 2026
Downloads
307/mo · 225/wk
Author
tianrendong
License
MIT
Types
extension
Size
82.1 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts",
    "./src/expiry.ts",
    "./src/warming.ts"
  ]
}

Security note

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

README

pi-diagnostics

Know why your prompt cache missed, and when it's gone.

  • Cache-miss reasons. When a turn re-bills cached tokens, see the provider's explanation (Anthropic, OpenAI):

    Cache miss: 42k tokens re-billed (~$0.12)
    ↳ Provider diagnostics reason: tools_changed
  • Expiry reminders. A note appears when your cache has likely expired, so you know it's a cheap moment to /compact, switch models, or change tools.

  • Smarter cache warming. With cacheWarming: "idle", keeps the cache warm when you're likely to reply soon: text in the editor, a queued message, or the agent's last message asks you something. It only ever adds warms that clear Pi's savings bar; it never cancels warming Pi chose.

Diagnostics and reminders are display-only and never add to model context.

Install

pi install npm:pi-diagnostics

Run /diagnostics to see recent results.

License

MIT