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

@dan-developer/pi-tokensave

v0.1.2

Published

Native Pi extension that makes the agent call the local TokenSave CLI for code intelligence before falling back to grep/find/manual exploration.

Readme

pi-tokensave

Native Pi extension that makes the agent use TokenSave code intelligence before falling back to grep, find, or speculative file reads.

pi-tokensave registers native Pi tools and invokes the local TokenSave CLI directly.

Requirements

  • Pi (@earendil-works/pi-coding-agent), current version.
  • The tokensave binary on PATH (or TOKENSAVE_BIN pointing to it).

Install TokenSave

# see https://tokensave.dev for the current install method
tokensave --version

Initialize the project you want indexed:

tokensave init .

TokenSave keeps its index in .tokensave/. The plugin never initializes a project automatically — it always asks first (/tokensave-init).

Install the plugin

pi install git:github.com/dan-developer/pi-tokensave

Or for local development:

pi -e /path/to/pi-tokensave

Tools exposed to the model

All six tools are read-only. They never expose TokenSave's write/mutation tools (str_replace, replace_symbol, ast_grep_rewrite, etc.) — code changes still go through Pi's normal edit/write tools.

| Tool | Purpose | |---|---| | tokensave_status | Binary/init/graph health check | | tokensave_context | Build task context: entry points, related symbols, snippets | | tokensave_find_symbol | Locate a named class/function/method/... prioritizing exact matches | | tokensave_search | Conceptual/keyword/literal search when no exact name is known | | tokensave_symbol | Compact view of a symbol: signature, body, callers, callees, implementations | | tokensave_impact | Blast-radius analysis before changing shared code |

TokenSave output is always a starting point. Reading the actual source file before making implementation claims or edits remains part of the required workflow — this is stated in every tool's guidelines and in the injected instructions.

Commands

/tokensave-status          Show binary/init/graph status
/tokensave-init            Initialize TokenSave for this project (asks to confirm)
/tokensave-sync            Incremental sync
/tokensave-mode            Show current mode
/tokensave-mode prefer     Switch to prefer mode
/tokensave-mode enforce    Switch to enforce mode (default)
/tokensave-rules-install   Install/update the AGENTS.md instructions block
/tokensave-rules-remove    Remove only the pi-tokensave block from AGENTS.md
/tokensave-doctor          Diagnose binary, init, rules block, and mode

Mode is persisted to ~/.pi/agent/pi-tokensave.json (never inside the project).

Modes

  • enforce (default) — blocks a narrow set of manual searches that look like named-symbol discovery (e.g. rg "WellModel" ., grep -R "class WellModel" ., find . -iname "*wellmodel*") when TokenSave is installed, the project is initialized, and TokenSave has not already been consulted for that symbol in the current session. Everything else — complex regex, pipelines, git grep, logs, config files, migrations, generated code, markdown, JSON/YAML/TOML — is allowed through unmodified. After TokenSave returns no result or errors, the fallback to manual search is allowed for that investigation.
  • prefer — never blocks. Shows the tools, injects the instructions, and may emit a single short notice per session when it sees manual exploration that TokenSave could have served instead.

Instructions block

The plugin manages an idempotent block in ~/.pi/agent/AGENTS.md between <!-- pi-tokensave:start --> / <!-- pi-tokensave:end --> markers. Everything else in that file is left untouched. It is installed on first load and refreshed on every session_start (no-op when already up to date). The same instructions are also injected into the current session's system prompt via before_agent_start, so a fresh install applies immediately without requiring /reload.

Uninstall

pi remove git:github.com/dan-developer/pi-tokensave

Remove the instructions block separately if desired:

/tokensave-rules-remove

Troubleshooting

  • "TokenSave binary not found" — install tokensave and ensure it is on PATH, or set TOKENSAVE_BIN to its absolute path.
  • "TokenSave is not initialized for this project" — run /tokensave-init.
  • Guard blocks a search you believe is legitimate — switch to prefer mode (/tokensave-mode prefer), or run the underlying TokenSave query first (tokensave_find_symbol) so the fallback becomes allowed automatically.