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

@d3ara1n/pi-context-include

v2.0.1

Published

@path syntax for AGENTS.md — include files by reference with recursive resolution

Readme

@d3ara1n/pi-context-include

@path syntax for AGENTS.md — include files by reference.

Features

  • Line-start only: @path sits at the start of a line, optionally after a Markdown list marker (-, *, +, or 1.) — prevents false positives from emails/code
  • Fenced block safe: @path lines inside triple-backtick blocks are ignored
  • Relative paths: @CODEGRAPH.md, @./docs/rules.md, @../shared/AGENTS.md
  • Absolute paths: @/absolute/path/to/file.md
  • Home directory: @~/.pi/agent/includes/shared-rules.md
  • Recursive includes: included files can themselves contain @ references
  • Cycle detection: prevents infinite include loops
  • Size guard: 500KB total limit, 10 levels deep (configurable)
  • Path safety fence: includes are confined to allowed roots; out-of-scope paths are blocked by default

Installation

pi install npm:@d3ara1n/pi-context-include

Or add to ~/.pi/agent/settings.json:

{
  "extensions": [
    "/absolute/path/to/pi-extensions/packages/pi-context-include"
  ]
}

Dependencies

None.

Usage

In any AGENTS.md file:

# Project Rules

@./docs/api-conventions.md
@~/.pi/agent/includes/team-conventions.md

On each turn, the extension reads the referenced files and injects their content into the system prompt.

Important: @path must be at the start of a line, optionally after a Markdown list marker (-/*/+/1.). It will not be recognized mid-sentence or inside code blocks.

Supported file types

.md only. Structured formats (.json/.yaml/.toml) are intentionally excluded — they typically hold config or credentials, not instructions, and are better read on demand.

Configuration

Optional. Read from ~/.pi/agent/settings.json (global) or {project}/.pi/settings.json (project). A present project contextInclude block replaces the global block; omitted fields then use defaults. maxDepth and maxBytes must be finite, non-negative numbers; invalid values use the defaults. maxBytes is measured as UTF-8 bytes. Optional allowedRoots / deniedRoots configure the path safety fence.

{
  "contextInclude": {
    "maxDepth": 15,
    "maxBytes": 1000000
  }
}

Settings files must be valid JSON (no comments). Settings are loaded on session start — run /reload or restart pi after editing.

Path safety fence

Included files are injected into the system prompt inside pi's high-trust <project_instructions> tag, so an accidental @secrets.json or @../sibling/secret.md would leak secrets on every turn. Includes are therefore confined to an allow-set of roots, with a deny-set that always wins:

{
  "contextInclude": {
    "allowedRoots": ["./docs", "~/.pi/agent/includes"],
    "deniedRoots": ["./secrets", "node_modules"]
  }
}
  • allowedRoots — roots that may be included. Relative entries resolve against the project root. (This is separate from @-reference resolution: a @path inside an AGENTS.md still resolves relative to that file, as always.) An explicit allowedRoots fully replaces the defaults below; an empty array [] blocks everything.
  • deniedRoots — roots that may never be included, always evaluated first and taking precedence over allowedRoots.

Default allow-set (used when allowedRoots is omitted, so existing setups keep working):

  • each context file's own directory tree (so in-repo @docs/rules.md works zero-config), and
  • ~/.pi/agent/includes/ — a shared home for cross-repo rules.

Anything else (@/etc/..., @../sibling/..., @~/credentials.json) is blocked by default and reported by /context-include:status as "outside allowed roots".

The fence guards against accidents and misconfiguration, not adversaries — anyone who can edit settings.json controls the policy.

Command

/context-include:status — shows the effective allow/deny roots, resolved includes, and any files that were skipped (missing, empty, over size/depth limits, outside the allowed roots, denied by deniedRoots, duplicates, or unreadable). Run this to diagnose why a referenced file wasn't included.