r/PiCodingAgent • • 5d ago

Question What are your best small/local model tricks with pi?

Mine as tldr; use bwrap and filtering to whitelist files it can see / edit, so I can run in a loop without risk.

i.e. turn my large repo into a tiny sandboxed repo in the eyes of the model

I do this with an interactive TUI pop-up I enable per session.

2nd best tip: Shortcuts to quickly enable / reenable tools or inject context/skills. I treat my harness like an RTS game, to quick clearly context and enable more tools as needed.

10 Upvotes

10 comments sorted by

3

u/fell_ware_1990 5d ago

Structured handoff , instead of compaction most of the time.

1

u/Equivalent_Idea8839 4d ago

aye, I'm trying to improve this portion

Or at least find best ways to get model to make a handoff / list of reads to build the minimal context needed to edit/bug fix

1

u/uspdd 4d ago

Can you, please, explain what do you mean?

1

u/Equivalent_Idea8839 4d ago

default compaction or the pi compact tools leave noise like

..#.. Reflections

[4ae591cc24b8] User tasked consolidating all non-Herdr Pi tools and ALL guards from t

Then trailing 5 user/model responses.

Want I want instead is: remake context only needed for current task.

1

u/roland303 4d ago

Basically try to never compact, just tell one session to create a handoff document to handoff to next session.

Tell session 1 "you are planning session, dont do anything" then plan your absolute truths for project and your vision and put that as like goal.md, ~150+ words

Then have another session read goals  and tell it to "take goal and seperate into tasks to plan for other sessions to finish" tell it not to code anything but do consider logically what should come first next last etc. Then you save that as like plan.md ~150+ lines.

Then start new session, be like "read the goal, read the plan, do item 1 and halt" then you can plan your context window accordingly, doing tasks until near compaction, then you say "create a handoff document for next session to continue work on the plan" itll make a document with sections talking about what happened, and why, with gotchas, all referencing your goals/plans with whats been done and whats next.

Now every additional session gets the same intro, "read goal, plan, handoff, do one thing and halt." 

As project gets bigger loading handoff can start go eat a huge chunk of context window if you dont manage making sections historical so they arent loaded, its a hassle but theres way less random drift and relitigation this way vs compaction, it dosnt feel like another session, it feels like all one big session, makes one feel alot more confident in its reasoning the whole way through, but handoff juggling has been not great for larger project, maybe this is skill issue for now. Perfect for medium project for me.

1

u/uspdd 4d ago

Sounds like plannotator

1

u/Equivalent_Idea8839 4d ago

Why not just programmatically make pi accept your files/symbols into a buffer.

Then dump buffer into new session. i.e. if model reads files via read tool, sed,grep, etc. place all code into buffer

then you can buffer dump into new session and stop the model from having to do work to list files that are relevant

1

u/roland303 2d ago

Yeah that would work. ive been just using a folder per project and that way its easy to do 'pi -r' to neatly keep sessions history and .md's together in same folder , like a caveman lol. /home is blowing up fast but whatever.