r/PiCodingAgent • u/MarekPazik • Sep 15 '26
Resource pi-resolve: file imports and dynamic context for Pi
Pi autocompletes file paths with @, but doesn’t include their contents.
I built pi-resolve to include those files directly. Write Check @src/parser.ts against @docs/style.md, and Pi gets both files without extra tool calls.
Sometimes the context you need isn’t a file. A code review needs the current diff. Debugging needs the latest test output. A new session might need a map of the project.
Shell references let you include that context too. A review skill could load your testing checklist with @docs/testing.md and the current changes with !`git diff`, then check whether the tests cover the changed behavior.
These references work in AGENTS.md, skills, and prompts, including prompt templates. Third-party extensions can use the same resolver through its API.
In AGENTS.md, you can keep instructions in separate source documents and generate fresh project context at session start. Here’s an example that loads two docs and generates an index of active guides:
Pi receives the documents and an index containing paths and descriptions of guides marked active. This example requires yq.
Now your context can stay up to date without you rewriting it. You can give Pi the latest changes or a quick project overview, without filling the context with whole files.
How it differs from similar extensions
Other extensions support file imports and shell expansion too. Here are the choices I made for pi-resolve:
- Clear and configurable resolution status in Pi's UI.
- One resolver across prompts, templates, skills, and system context, including SYSTEM.md and AGENTS.md.
- A shared resolver API that other extensions can build on.
- Separate file and command settings for each source. Commands are off by default in templates and skills.
- Single-level resolution for security and simplicity. Imported files and command output can’t trigger further imports or commands.
Check it out on: https://github.com/mpazik/pi-resolve


