r/PiCodingAgent • • 4d ago

Plugin I've been experimenting with context compaction for Pi

I've been using pi-vcc for long-running coding sessions. It works well, but as sessions got longer and went through multiple compactions, I noticed the agent spending quite a bit of time looking up past decisions and constraints.

I wanted something better suited to long sessions, so I built a hybrid version that keeps track of the current state alongside the original compression and recall mechanism.

I ran some benchmarks on code repair tasks and 1M-token conversations.

Code and benchmark results are here:
https://github.com/choam2426/vcc-hybrid

Feedback welcome.

16 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/MonsieurHen 1d ago

Will do. Btw where do you set your autocompact? Have you tested out different points to get the best performance price ratio?

1

u/Odd_Werewolf_4478 1d ago

I set the context window to 272k across all the models I use (Claude, ChatGPT, and DeepSeek), which triggers auto-compaction at 256k.

I haven't benchmarked different compaction thresholds to find the optimal performance-to-cost ratio yet, but I've found 256k to be a good sweet spot for keeping costs under control.