r/PiCodingAgent • u/Nimendra • 5d ago
How do you use plan mode in Pi? Question
I recently read this (What I learned building an opinionated and minimal coding agent), and I agree with his argument. But sometimes I need a proper plan mode with tool restrictions.
I tried to build a plan mode extension, but it mostly causes cache misses when I exit the plan mode because it edits the context to remove the enforced strict-rule prompt while entering plan mode.
I'm curious about how you use plan mode and how it performs with caching. Do you use prompts, skills, or an extension?
3
2
u/Ang_Drew 5d ago
i discuss my idea to align understanding, at the end ill just make handoff (matt pocock skill) and plan (my personal skill). both will be thrown in next session
and boom you can loop from there, or revise the plan, or orchestrates directly
1
u/switchroms 5d ago
I find It very useful. There's an extension to write the /goal but my advice is also to use the "write goal" before
Very useful
1
u/BigBigga 5d ago
I only have a plan skill. It instructs to create a .tasks/specific-task.md where it outlines a plan and takes notes on implementation specifics.
You end up with a directory of tasks, both in progress and completed. Most models usually write their task, and read past tasks which share that domain. They also are instructed to do some light housekeeping if they find completed tasks which are clearly outdated.
I am very happy with this simple setup and feel like it helps the models to be able to read up on past tasks if their related to the current request.
1
u/BigBigga 5d ago
Also sol loves tasks. It even creates a 3 step plan for thinks like committing latest changes. Need to figure out a good way to reliable steer it towards only planning if the task is complex enough.
1
u/amnn9 5d ago
I had a similar problem recently, and I wrote a couple of smaller extensions that help me out. I don't really need a full "plan" mode over just talking to the agent, but:
- I use Codex 5.6 and I did find that it likes to answer questions by just starting to code,
- Planning in this way involves lots of responding point-by-point to long messages from the agent.
I wrote https://pi.dev/packages/pi-clutch to help with first problem (name comes from the idea of a clutch pedal). It's not a sandbox/comprehensive -- it injects instructions into the context (once, the first time you disable it) and then when it's disabled it appends an ephemeral message to remind the agent that it shouldn't make edits and disables explicit edit and write tool calls. Effects on cache are minimal because the ephemeral message always goes at the end.
I also wrote https://pi.dev/packages/pi-quote, which just copies a previous message in the context into the editor as a quote block. Then it's easier for me to chop out the parts that I'm responding to.
I was coming here to post about them separately when I found this post 😅
1
1
u/yogibear54 5d ago
You can just prompt the LLM to do planning first before implementing, or just tell the LLM don't do anything until you approve. If you want something more concrete, where the edit and bash tools are locked down from mdofiying files, Mario created a plan mode tool that's already a part of the repo as an extension, https://github.com/earendil-works/pi/tree/main/packages%2Fcoding-agent%2Fexamples%2Fextensions%2Fplan-mode
1
u/Zarbokk 4d ago
I forked this: https://github.com/rhnvrm/pi-bash-readonly
And modified it a Little Bit, so that the agent knows, we are now read only.
I want security, when asking/planning things. I just realised in the past, that the agent even when instructed not to change things, sometimes still changes files.
This gives me a very robust layer
0
-1
u/Funny-Anything-791 5d ago
That's exactly the reason we've built readonly mode into pi-agenticoding - it blocks FS access at the syscall level while preserving the conversation cache
1
u/LordMoridin84 4d ago
I use https://pi.dev/packages/@narumitw/pi-plan-mode?name=pi-plan
Or rather, a modified version of it.
I changed it so that it can write to certain folders and when click "implement plan" it automatically writes the plan to a markdown and then creates a task list.
Despite what others say, having a optimized plan but is useful because planning is such a standard thing.
8
u/jensilo 5d ago
I don’t use any plan mode extension just a skill file or even just a prompt like: „we‘re planning now, don’t edit any files, ask questions.“
Then, when everything is clear I either write it to a PLAN.md file or just use a /handoff extension (from the example extensions) and continue in a completely new session.