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-filter

v1.0.0

Published

A pi extension that provides .gitignore-style control over which context files and skills appear in the system prompt

Readme

Context Filter

A pi extension that gives you .gitignore-style control over which context files, agent instructions, and skills are included in the system prompt.

Why?

Pi automatically loads AGENTS.md / CLAUDE.md files from your home directory, ancestor directories, and the current project. It also loads all discovered skills into the prompt. Sometimes you want to override this — exclude a parent project's instructions when working in a subfolder, skip the global AGENTS.md, or inject your own context files.

Setup

Place a .context file in your project's .pi/ directory:

your-project/
├── .pi/
│   └── .context
└── ...

Pi reads this file on session start. Use /reload to pick up changes without restarting.

Syntax

# Lines starting with # are comments
# Blank lines are ignored

# Exclude files with ! (supports globs)
!~/.pi/agent/AGENTS.md

# Include files with + (resolved relative to project root)
+.pi/MYCONTEXT.md

Exclusions (!)

Exclude AGENTS.md / CLAUDE.md sections and skill entries from the system prompt. Patterns are matched against absolute file paths using picomatch glob syntax.

# Exact path (~ expands to home directory)
!~/.pi/agent/AGENTS.md

# All AGENTS.md files from any ancestor directory
!**/AGENTS.md

# A specific skill
!**/skills/brainstorm/SKILL.md

# All skills under a directory
!**/skills/**

Inclusions (+)

Add arbitrary files to the system prompt. Paths are resolved relative to the project root. Files are read fresh on every prompt, so edits are picked up immediately.

# Add a custom context file
+.pi/MYCONTEXT.md

# Absolute paths work too
+~/shared-context/team-guidelines.md

Examples

Use only the local project's AGENTS.md, ignore everything else:

# .pi/.context
!~/.pi/agent/AGENTS.md
!../**/AGENTS.md

Swap in your own context file:

# .pi/.context
!**/AGENTS.md
+.pi/my-instructions.md

Keep everything but drop a noisy skill:

# .pi/.context
!**/skills/brainstorm/SKILL.md

How It Works

The extension hooks into pi's before_agent_start event to modify the system prompt before each LLM call:

  1. Exclusions — Strips ## /path/to/AGENTS.md sections from the Project Context block and removes matching <skill> entries from the available skills list.
  2. Inclusions — Reads the specified files and appends them to the Project Context section.

On startup, a widget above the editor shows all active rules (auto-hides after 15 seconds), and a persistent footer status displays the filter summary (e.g., [.context] ✕ 5 excluded).

Note: Pi's own [Context] and [Skills] startup display still shows all discovered files — that's pi's internal display and can't be changed by extensions. The widget and footer make it clear what's actually being filtered from the prompt.

Limitations

  • Extensions cannot be filtered. Extension loading happens before any extension code runs, so this tool can only control what appears in the system prompt (AGENTS.md content and skill listings).
  • Format-dependent. The extension parses the system prompt structure that pi generates. If pi significantly changes its prompt format in the future, the filtering may need updating.