pi-workspace-context
Pi extension for adding extra local workspace roots to the agent context.
Package details
Install pi-workspace-context from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-workspace-context- Package
pi-workspace-context- Version
0.1.0- Published
- May 13, 2026
- Downloads
- 16/mo · 16/wk
- Author
- conangh
- License
- MIT
- Types
- extension
- Size
- 30.6 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./extensions/workspace-context.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-workspace-context
Pi extension that lets you add extra local directories as part of the current workspace context.
Useful when a task spans multiple repositories, for example a frontend repo plus a backend repo.
Install
pi install npm:pi-workspace-context
Try without installing permanently:
pi -e npm:pi-workspace-context
Local development
pi -e .
Commands
/ctx-add <path> [alias]— add an extra directory to the current session context./ctx-list— list extra directories currently in context./ctx-remove <alias|path>— remove one extra directory./ctx-clear— remove all extra directories./ctx-persist [on|off|status]— persist the extra directories for future pi sessions started in the same workspace.
Alias usage
After adding a directory, pi will show an alias such as @backend.
The extension expands aliases in tool calls:
@backend/src/file.ts$backend/src/file.tsbackend:src/file.ts
For bash commands, simple @alias/path and $alias/path tokens are expanded to the absolute path.
Context behavior
The extension injects the added roots into pi's system prompt and asks the model to treat them as part of the workspace.
If an added root contains AGENTS.md or CLAUDE.md, the model is instructed to read it before editing that root.
Skill directories under added roots are discovered on reload from:
.pi/skills.agents/skills
Security
This extension runs locally inside pi and can influence tool paths/commands by expanding aliases. Review the source before installing, as with any pi package.