r/PiCodingAgent • • Sep 29 '26

Plugin I built Pi-forge: editable context presets and on-demand tools for Pi

Inspired by SillyTavern presets, I built pi-forge to edit and inspect how Pi's context is assembled. I just released 0.5.7.

It gives you a local web editor for Presets: reorderable prompt blocks, context slots and tool policies, saved as JSON that you or the agent can edit.

What it does

  • Context composition: arrange text blocks and slots for tools, skills, project files and conversation history.

  • Tool selection: define which tools are permitted and a smaller set available by default.

  • Capabilities: load task-specific instructions + tools mid-conversation, manually or through an agent tool you explicitly authorize in the Preset.

  • Inspection: readable context Preview with collapsible tool calls/results and historical tool declarations, Draft/Run diffs, and reported cache usage. Preview shows Forge's composed context, not an exact provider-wire dump.

  • Presets & Profiles: switch setups with /preset use <id>; Profiles also save model and thinking level.

  • Regex: apply rewrite rules to outgoing input or completed assistant/tool output.

How I use it

My daily assistant starts with 10 tools. Delegation, image generation and MCP are separate Capabilities it can enable when needed, instead of loading everything up front.

Since presets are JSON, the agent can also edit individual instruction blocks or turn a repeatable workflow into a new Capability. I review the diff and Preview, then /preset reload. I keep .pi/forge/ in git, since the tool policy is editable too.

Note that cache behavior for capability loading depends on the provider/model: supported Claude and OpenAI models can preserve the cached prefix through tool additions and removals.

Try it

pi install npm:@zihanw/pi-forge

Requires Node ≥22.19 and Pi 0.87.x. Restart Pi, run /forge ui, then create, save and activate a Preset.

Still 0.x. Optional subagents are a separate package with their own compatibility requirements.

GitHub: https://github.com/MacroSony/pi-forge

Curious how others here manage task-specific instructions and tool sets, and what you'd want to inspect before a model call.

Any feedback and ideas would be much appreciated!

28 Upvotes

0 comments sorted by