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-prompt-control

v0.1.2

Published

Manage and minimize Pi's system prompt — config-driven patches, interactive skill toggle, and probe-based prompt capture.

Readme

pi-prompt-control

Manage and minimize Pi's system prompt — config-driven patches, interactive skill toggle, and probe-based prompt capture.

Install

pi install npm:pi-prompt-control

Features

/prompt-dump [path] — Capture the real system prompt

Fires a probe turn so every before_agent_start handler runs (pi-slim, your own extensions, anything). Captures the fully-chained system prompt in turn_start, writes it to a file, and aborts before the LLM call.

/prompt-dump                      # → ./pi-system-prompt-patched.md
/prompt-dump my-prompt.md         # → ./my-prompt.md

Works at fresh start — no prior message needed.

/skills — Interactive skill toggle

Opens a TUI checklist of every loaded skill. Toggle with Space. Unchecked skills are stripped from the system prompt before each turn, saving context tokens.

Skills remain explicitly invokable via /skill:<name> — only their automatic inclusion is toggled off.

/skills           # open the TUI checklist
/skills:reset     # re-enable all skills

State is persisted to:

  • ~/.pi/agent/disabled-skills.json (user scope)
  • .pi/disabled-skills.json (project scope, overrides user)

Config-driven patches — prompt-patches.json

Place a config file at .pi/prompt-patches.json (project) or ~/.pi/agent/prompt-patches.json (global):

{
  "patches": [
    {
      "name": "remove bash guidance",
      "op": "remove",
      "find": "- Use bash for file operations like ls, rg, find\n"
    },
    {
      "name": "soften a rule",
      "op": "replace",
      "find": "You must always",
      "replace": "Prefer to",
      "regex": false
    },
    {
      "name": "add house rule",
      "op": "append",
      "text": "\n\nPrefer rg over grep.\n"
    },
    {
      "name": "strip a block (regex)",
      "op": "replace",
      "find": "\\n\\nSome block[\\s\\S]*?end of block",
      "replace": "",
      "regex": true
    }
  ]
}

Patch operations

| op | Required fields | Description | |------|----------------|-------------| | remove | find | Remove the first occurrence of find | | replace | find, replace | Replace the first occurrence of find with replace | | append | text | Append text to the end of the prompt |

All remove and replace patches support "regex": true and an optional "flags" string (e.g. "gi").

Live reload

The config file is watched — edits take effect on the next message without /reload. Parse errors and validation issues are surfaced via notifications.

How /prompt-dump works

Unlike ctx.getSystemPrompt() (which returns the base prompt), /prompt-dump captures the prompt after all extensions have modified it:

  1. Sets a capture flag
  2. Sends a probe user message (.)
  3. All before_agent_start handlers chain naturally
  4. In turn_start, captures ctx.getSystemPrompt() (now fully chained)
  5. Writes to file and calls ctx.abort() — no LLM call, no cost

This means it works with any combination of extensions (pi-slim, custom patches, skill-toggle, future extensions) without knowing about them.

Publish through GitHub Actions

This package publishes to npm through .github/workflows/publish.yml.

  1. In npm, create a granular access token with publish access and 2FA bypass enabled.

  2. In GitHub, add it as repository secret NPM_TOKEN.

  3. Bump the package version:

    npm version patch
    git push --follow-tags
  4. The workflow publishes when a v*.*.* tag is pushed, when a GitHub Release is published, or when run manually from the Actions tab.

The workflow runs npm pack --dry-run, skips versions that are already published, and publishes with npm provenance.

License

MIT