@burneikis/pi-plan

Plan mode for pi - explore read-only, review a written plan, then execute it in a fresh session

Packages

Package details

extension

Install @burneikis/pi-plan from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@burneikis/pi-plan
Package
@burneikis/pi-plan
Version
2.0.0
Published
Aug 22, 2026
Downloads
343/mo · 33/wk
Author
burneikis
License
MIT
Types
extension
Size
18.6 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-plan

Plan mode for pi. Run /plan, the agent explores your codebase without being able to change it, writes a plan file, you review it, and then execution starts in a fresh session seeded with the plan.

Install

pi install npm:@burneikis/pi-plan

Try it without installing:

pi -e npm:@burneikis/pi-plan

Use

/plan add retry with backoff to the http client
/plan                 # reopen the review menu for the current plan

How it works

  1. Plan. /plan <goal> puts the session in planning mode:

    • edit tools are disabled via setActiveTools()
    • write is allowed only for the plan file itself
    • bash is gated - anything that writes to disk, installs packages, mutates git, or shells out to an inline interpreter is blocked. This stops accidents, not a model that is deliberately trying to escape.
    • the agent writes the plan to ~/.pi/agent/plans/<session-id>/plan-<timestamp>.md
  2. Review. Once the agent settles, you get a menu:

    Option Effect
    Execute Restores tools and starts a new session seeded with the plan
    Refine You describe changes, the agent rewrites the plan, menu reopens
    Edit You edit the plan text in pi's editor; rejected if it loses its steps
    Cancel Deletes the plan file and returns to normal mode
  3. Execute. The new session is named Plan: <title>, records the parent session, and starts with the plan as its first message. Old planning context is filtered out of the LLM context.

Plans are plain markdown on disk, so they survive restarts and can be reused or diffed.

Plan format

# Plan: <title>

## Goal
What changes and why.

## Steps

1. First step
2. Second step

## Notes
Constraints, open questions, decisions.

Steps are parsed from the ## Steps section only, numbered lines inside fenced code blocks are ignored, and the steps are renumbered sequentially so a mis-numbered plan still works.

Development

node --test utils.test.ts

All parsing and the bash gate live in utils.ts as pure functions, so they are covered by tests; index.ts only wires them to pi's API.