npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-context-budget

v0.1.2

Published

Switch Pi context-window budgets without changing the upstream model ID.

Readme

Context Budget

A lightweight Pi extension for selecting the effective context window Pi uses for footer reporting, overflow handling, and automatic compaction.

The bundled configuration defines two profiles for openai-codex/gpt-5.6-sol:

  • short: 272,000 tokens
  • full: 1,050,000 tokens

Both profiles keep the real provider and model ID. The selected budget is local Pi metadata and is not sent to OpenAI.

Installation

pi install npm:pi-context-budget

Restart Pi after installation. The extension works immediately with its bundled Sol profiles; a configuration file is optional.

Usage

/context-budget
/context-budget short
/context-budget full
/context-budget status

The default shortcut is Alt+Shift+C. It cycles through the configured profiles.

If Pi is streaming, a selection is recorded as pending and applied automatically on agent_settled; the in-flight request is not changed or interrupted. Only the latest pending selection is applied.

When a smaller budget is selected and current usage exceeds contextWindow - 16,384, the extension starts Pi compaction without prompting.

Configuration

Global configuration:

~/.pi/agent/context-budget.json

Trusted projects may override model profile definitions and defaults with:

<project>/.pi/context-budget.json

Example:

{
  "shortcut": "alt+shift+c",
  "models": {
    "openai-codex/gpt-5.6-sol": {
      "defaultProfile": "short",
      "profiles": {
        "short": 272000,
        "full": 1050000
      }
    }
  }
}

Each configured model must define at least two lowercase profiles with integer token budgets greater than 16,384. The name status is reserved, and the default profile must name one of the configured profiles.

The shortcut is read only from the global file because Pi resolves project trust after extension shortcuts are registered. Project-local shortcut values are ignored. Run /reload after changing profile definitions or the global shortcut.

Profile selections are stored as custom session entries. They are branch-aware, survive compaction, and are not included in model context. New sessions use the configured default.

Acknowledgments

Inspired by @diegopetrucci/pi-context-cap, an MIT-licensed Pi extension that demonstrated how local contextWindow metadata controls footer reporting and automatic compaction.

License

MIT