r/PiCodingAgent • • 25m ago

Discussion Need some ideas please to properly run PI compaction and Share some Tips/Techniques

Just started using PI.

Now if you see attached. I have been giving it various prompts

also was running various models council, and all other things.

Currently at 40.9% Context size, what should be ideal plan, to have PI Compaction done, so i can better context efficiency and do not burn more tokens.

Now if i close my Laptop (my PI is running in VPS).

Will it forget, or it saves all context somewhere, so once i open Laptop again, i can say a model, to continue or check our previous discussion?

Also i am currently using GLM 5.3 Flash Max.

Now later i use Opus or another Model.. will PI again send all this context, or even the new model would be able to understand Compaction

Being its Day One, so playing with it also getting tasks done

Should i put PI in Herdr or Orca or T3 Code? So i have tabs and parallel all things are running

How can i see more "behind the scenes" of what is happening..

Any tips/techniques so i can save more tokens.

Currently I was just testing all models using OpenRouter API with $5 to see how things go.

0 Upvotes

2 comments sorted by

1

u/Entire-Literature568 13m ago

The context will still be there but if a long pause (Claude 5mins, Codex 10mins) you won't hit your cache anymore.

1

u/adamshand 0m ago

Every session (the context) is saved in a session file. Each time you start a fresh pi or run /new, a new session file is created. On Mac/Linux, session files are stored in your home directory in ~/.pi/agent/sessions/.

In Pi you can change the model mid session whenever you want. You do pay some extra for this because the new model won't have the session cached.

There's no exact science for when to compact. You'll have to experiment and see what works for you and the model you're working with, but usually somewhere between 50-80%. I wrote a Pi tool which allows agents to request compaction themselves, frontier models, especially codex, are really good at this.

There's no need to use Herdr, Orca, T3 etc. If you like the features the add, do it. If you are happy in plain Pi that's a great choice as well.

Personally I recommend starting really simple and only adding things when you have a specific problem you need to solve. Otherwise it's easy to end up with an unnecessarily complex setup that does a bunch of things you never use and costs you money you don't need to spend.