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

@quartermaster-labs/pi-on-demand-context

v0.1.3

Published

Pi extension. Auto-loads CLAUDE.md / AGENTS.md context when the model works in a dir — via bash `cd` or any file tool (read/edit/write/grep/ls/find). Injected once, durably; deduped against pi's own loader.

Readme

On-Demand Context Extension

Loads CLAUDE.md and AGENTS.md context files when the model works in a directory — by cd-ing into it, or by touching a file there with read/edit/write/grep/ls/find.

How it works

  • pi auto-loads context files for the launch dir + parents at startup (unchanged)
  • Model cd some/dir, or reads/edits/greps a file anywhere — no special tool needed
  • Extension resolves the target directory and injects context from it (+ parents)
  • A read/edit/write loads the file's directory; grep/ls/find load the searched directory; these do not move the bash working dir
  • Context is injected once, durably the moment a dir is touched (via sendMessage with deliverAs: "steer"), so a dir's CLAUDE.md is in view before the model acts there — same agent loop, no per-call re-send
  • Files pi already loaded (or a shared parent) are not re-sent
  • Multiple directories can be visited — context accumulates across the session

Install

Formerly published as @radu0120/pi-on-demand-context. Same package, republished under the @quartermaster-labs scope.

npm install -g @quartermaster-labs/pi-on-demand-context

Setup

Register the extension in ~/.pi/agent/settings.json:

{
  "extensions": ["@quartermaster-labs/pi-on-demand-context"]
}

Or use the local path:

{
  "extensions": ["~/.npm-global/lib/node_modules/@quartermaster-labs/pi-on-demand-context"]
}

No --no-context-files / noContextFiles needed — the extension complements pi's default loader instead of replacing it, deduping against what pi already injected via systemPromptOptions.contextFiles.

After modifying index.ts, run /reload.

Usage

For the model

cd some/dir          # plain cd works — new dir is resolved from the path
cd some/dir && pwd   # recommended — pwd gives the exact dir, no guessing

A plain cd <path> is enough for ordinary relative/absolute paths; the new directory is resolved against the last known one. Append && pwd when the path can't be computed from the string alone — cd -, cd ~user, cd $VAR, or cd $(...) — so pwd reports the real directory. Either way context files are injected before the next turn; no special tool needed.

For the user

  • /list-context — show all loaded context files
  • Context resets on /new, /resume, /fork

Notes

  • Context files are loaded from the target directory and all parent directories
  • Files are not re-loaded if you cd back to a visited directory
  • Uses && pwd (or ; pwd) to reliably detect the actual new working directory
  • Works on Windows (WSL/bash) and Unix systems