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

@henryqw/pi-add-dir

v3.4.1

Published

Add external directories to a Pi session with context, skills, and file search.

Readme

@henryqw/pi-add-dir

Use external context, external skills, and searchable files in Pi without copying or linking external directories.

Pi using added external directories by name

Install

pi install npm:@henryqw/pi-add-dir

Use

Type /dir-add to see described scope flags: --project saves a directory for the repository, and --global saves it for every workspace. Completion does not suggest paths.

Run /dir-add, enter a directory, then run /dir-ls to verify it. Humans use commands; agents use tools.

| Surface | Type | Purpose | | --- | --- | --- | | /dir-add [--project\|--global] [path] | command | Add to this session by default. Use --project for this repository and linked worktrees, or --global for every workspace. Omit the path for interactive input. Supports ~. | | /dir-ls | command | List directories and scopes; select one to remove it from that scope. | | /dir-reload | command | Reload external directory resources. | | add_directory(path) | tool | Add session-only context and return instructions. Model-only: scripts and other tools cannot call it. | | search_external_files(pattern, maxResults?) | tool | Search added directories with a glob. Default: 50 results; maximum: 1,000. Codemode receives structured results. | | @ file autocomplete | ui | Find external files and insert absolute paths. | | External directory widget | ui | Show directories; use /dir-ls to manage them. |

Pi adds root AGENTS.md, CLAUDE.md, .pi/AGENTS.md, and .pi/CLAUDE.md to later prompts. External skills come from .pi/skills, .agents/skills, and .claude/skills.

/dir-add reloads only when discovered external skill paths change, not merely because skills exist. Directory commands wait until the agent is idle before they reload. If add_directory asks for /reload, run it to update skills.

Child repository context

From a parent directory, run /dir-add first repo or call add_directory with path: "first repo". The path is relative to the session directory. Absolute paths also work.

Session-only additions can load an explicitly selected child directory. Pi does not scan or load child repositories automatically. Only add directories whose instructions and skills you trust. This does not change the session directory or select a project for CodeGraph or other tools.

Project and global additions still reject child directories that overlap the session directory. These persistent overlap protections also apply when you promote a session addition.

Search results

In search_external_files results, truncated: true means more matches may exist.

Config

Package-owned: ~/.pi/agent/config/pi-add-dir/config.json

| Name | Description | Values | Default | | --- | --- | --- | --- | | directories | Directories for every workspace. /dir-add --global updates this list. | Array of unique absolute paths without control characters. | [] |

Pi skips invalid or duplicate entries and loads the valid directories. Global additions and removals fail until you fix reported config problems. Reload Pi after manual edits. For the shared rules, see Config files.

State and storage

Session directories belong to the current session branch. New session additions accept child directories but reject the session directory itself, its ancestors, and overlaps with active external directories. Restored session entries do not repeat overlap checks when the working directory changes.

Project directories use repeatable local Git config key pi-add-dir.directory, shared by linked worktrees. This machine-local config cannot come from a clone. /dir-add --project requires a Git repository.

Select persistent scopes explicitly: external directories can inject AGENTS.md, CLAUDE.md, and skills.

Limits and recovery

Search uses Node and supports basename and relative-path globs. It skips .git, node_modules, and symbolic links.

Missing or overlapping project and global directories stay configured but are skipped with warnings. Restore missing paths, or remove an incorrect path with /dir-ls and add the corrected path with /dir-add; then run /dir-reload.