pi-model-system-prompt
Per-model system prompt for pi: appends the prompt file whose name is the longest case-insensitive prefix of the active model id
Package details
Install pi-model-system-prompt from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-model-system-prompt- Package
pi-model-system-prompt- Version
0.2.1- Published
- Oct 9, 2026
- Downloads
- 255/mo · 255/wk
- Author
- jokerx001
- License
- MIT
- Types
- extension
- Size
- 178.2 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-model-system-prompt
Lets different large models use different system prompts. When you switch models, the system prompt specific to that model is appended to the context, keyed on the currently active model id.
Why this extension
Large models need more than different capabilities — they need different harnesses.
The level of the harness matters enormously to how well a large model performs, which is by now a given across the industry.
This shows up in agents such as Claude Code, Codex, and the pi agent, where each loads a system prompt tailored to a specific model at startup.
In the course of using the pi agent we mix and match large models from several different sources. That kind of use is exactly the charm of a coding agent as free-form as pi.
So when switching between models inside the pi agent, the ideal is that each model gets to use its own independent system prompt — but the pi agent itself has no such capability.
This extension provides exactly that.
Install
pi install npm:pi-model-system-prompt
Restart Pi after installing.
Quick start
It takes effect as soon as it is installed. The extension picks the Markdown file in ~/.pi/agent/model-system-prompt/ whose name is the longest prefix of the current model id, and appends its contents to the pi agent's system prompt. For model glm-5.3-flash that is glm-5.3-flash.md if it exists, otherwise glm-5.3.md, otherwise glm.md. Case is ignored, and a model with no matching file is untouched.
To write your own system prompt for a specific model, add a Markdown file in ~/.pi/agent/model-system-prompt/ named after that model — or after the family it belongs to, which then serves every model id starting with that name — and write the prompt in it. It is loaded automatically when you open pi.
The extension ships well-tuned preset prompts. Note that open-source models come in different quantizations and fine-tunes, so every preset prompt is tuned against its own official model, and no guarantee is made for unofficial builds. You are encouraged to tune the system prompt yourself to match the model you actually run.
Models with preset system prompts
- MiniMax-M3
- MiniMax-M3.1-Flash-Preview
- claude-sonnet-5, claude-haiku-5 (Claude Code's full system prompt)
- claude-opus-5, claude-fable-5 (Claude Code's shorter system prompt)
- deepseek-flash
- glm-5.3-flash
- glm-5.3
- gpt-5.6 (gpt-5.6-luna, gpt-5.6-sol, gpt-5.6-terra — Codex ships one prompt for all three)
- gpt-6-luna, gpt-6-sol, gpt-6-astra, gpt-6.1-sol (Codex rewrites the prompt per tier, so one file each)
- kimi (kimi-k3 and the rest of the family)
Matching and override rules
Which file wins is decided by its name
- The longest prefix wins. When several files match the same model id, the one with the longest name takes effect. For id
glm-5.3-flash, withglm-5.3-flash.md,glm-5.3.mdandglm.mdall present, onlyglm-5.3-flash.mdapplies. - A file named exactly after the id always wins.
- Case is ignored.
- No wildcards, literal prefixes only.
glm.mdalso matches an unrelated id likeglmish-2. So do not pick too short a name:g.mdswallows every id starting with g. The prefix counts from the start of the id, so a file namedclaude-opus-5.mddoes not match a provider-prefixed id such asanthropic.claude-opus-5.
Turning a model off
- Recommended: empty the file that would win. The file exists but is empty = the model gets no dedicated prompt, and it does not fall back to a shorter file of the same family.
- Deleting a file is not turning it off. It only counts while no shorter name still matches: delete
glm-5.3.mdandglm-5.3is still served byglm.md. - To turn off a whole family, emptying the family file only covers ids with no more specific file — empty
glm.mdandglm-4gets nothing, but as long asglm-5.3.mdis there,glm-5.3-flashstill goes throughglm-5.3.md. To really kill a family, empty every relevantglm*.md.
Where the preset prompts come from
Each comes from the official coding agent tool of that model itself
minimax from minimax code
glm from zcode
deepseek from deepseek harness
kimi from kimi code (one harness for the whole model family, so one family file)
claude from claude code (2.1.285, stable channel — it ships a full and a shorter system prompt and picks by model; both are mirrored, one family file each)
gpt from codex (openai/codex, tag rust-v0.161.0; the text for a model id is the instructions_template field in codex-rs/models-manager/models.json, and the shipped @openai/codex@0.161.0 binary carries the same bytes. Codex gives one prompt to the whole gpt-5.6 family and a rewritten one to each gpt-6 tier, so 5.6 is a single family file while each gpt-6 tier has its own — a later generation ships its own text and needs its own file.)
New preset model prompts are welcome
To verify generality, the source must be stated clearly and the prompt must be tuned against the official model
What happens on first run
| You already have… | What happens |
|---|---|
| Nothing | The preset model system prompts are copied into ~/.pi/agent/model-system-prompt/. |
Your own ~/.pi/agent/model-system-prompt/<modelId>.md |
None of them is touched. |
☕ Support the project
If you find this project useful, consider supporting its development.