Install
Install with PiG
pig install npm:pi-prompt-refineInstall with Pi
pi install npm:pi-prompt-refinePackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./src/extension.ts"
]
}README
Written by the package's publisher, shown as published in version 0.3.0 (README.md). PiG does not review it.
Pi Prompt Refine
Refine your prompt without leaving Pi Coding Agent. The rewrite model uses your current conversation to clarify the draft. You can preview it above the editor, ask for changes, and decide what to send.

Press Ctrl+\ on “fix it and test it” to see which fix the conversation points to. Press a to accept, then keep typing in the editor. The recordings use scripted replies from an offline model. Timings are illustrative.
Installation
Use Pi Coding Agent in its interactive terminal UI with a model configured in Pi. Refine requires Node.js 22.19+ and has been tested with Pi 1.6.0.
pi install npm:pi-prompt-refine
Start Pi, or run /reload in an existing Pi session.
Features
Context-aware rewriting

The conversation identifies the merged commits and their destination. Refine turns “push to GitHub” into a request to push local main to origin/main.
Iterative refinement

Press f in the preview to narrow “review my code” to a performance review. Submit the extra instructions with Ctrl+S to get another draft.
Structured rewrites

The expanded preview lays out the baseline comparison, the public API constraint, and the profiling evidence the agent should report.
Models and Preferences
- Independent rewrite model. Pick any available model in Pi for rewrites and keep your main agent's model.
- Model comparison. Try multiple models in parallel on the same draft and context, then compare their rewrites and response times.
- Reusable Preferences. Save instructions you often use and apply them to future rewrites.
Quick start
- Run
/refine modelin Pi and choose your rewrite model. - Type a draft in the Pi editor. For example, “Look at the error handling we just discussed. Suggest improvements, but leave the code as it is.”
- Press
Ctrl+\to rewrite the draft and open its quick preview. The same shortcut reopens a matching result in the current round. Usevfor the full preview orwfor the workspace. - Review a completed result and press
ato accept it into the Pi editor. Edit it if needed, then submit it yourself when you're ready.
Essential commands
| Command or key | Action |
|---|---|
/refine | Open the Refine workspace without a model call. |
/refine optimize <text> | Request a rewrite if the editor shortcut is unavailable. |
? in Refine | See the shortcuts for your current selection. |
Important notes
- Cost. A rewrite is a separate model request and may use quota or incur charges.
- Privacy. The rewrite provider receives your draft, submitted editing instructions, and enabled context. By default, that includes selected recent messages. See what is sent and how to limit it.
- Local history. By default, Refine saves submitted drafts, results, and editing instructions alongside your Pi session file when one exists. Manage or clear saved history.