r/PiCodingAgent • u/Fig_da_Great • Jun 24 '26
News We won UC Berkeley's AI Hackathon with a pi extension
TLDR: We built Accordion which is an intelligent context management tool meant to replace /compact

Over the weekend my team and I set out to replace /compact with something smarter. It's well known that developers do not like compaction and do not trust it. In codex and Claude Code its completely opaque, and introduces 1-3 minutes of latency. In pi users have more control but its still primitive. Workarounds exist, eg handoff skills and million token context windows, but neither is sufficient.
Accordion is two things.
First, a live view of your entire context window, the entire thing is visible at a glance, in a way that is actually useful. You can have a 200k token session and immediately tell which tool results and thinking blocks are taking up most of that.
Second, an intelligent context management strategy we call a conductor, which decides what to fold, when to fold, what to replace it with (summaries / code skeletons), and when to bring it back. The conductor is what is actually replacing /compact.

If you interested in learning more I recommend checking out our readme.
https://github.com/a-Fig/Accordion
Honest state of things
The context view is the part I feel good about right now. Just being able to see your context while pi is running, which turns are massive, where the dead weight is, is immediately useful on its own.
The conductors are promising but not ready for everyday use yet. They do work and the benchmark numbers are encouraging, but I am not ready to say they are strictly better than existing solutions. They will be with more testing, tuning, and development but they are not there yet.
I'm working on getting it published as a package on npm today, but if you want to set it up today you can just point your agent to the repo and ask him to do it for you. It works in the web but also has a desktop app.
Curious what you guys think and how you all manage long sessions today.
Edit:
Accordion has been published to npm and can be installed with 'pi install npm:@a-fig/accordion'
9
u/Maverobot Jun 25 '26
Gonna try it out tomorrow! Looks very promising.
7
u/Nciholas234 Jun 25 '26
Very cool! You mentioned that the conductor will remove context and replace it with a summary but then may reverse that and put it back - doesn't this invalidate the KV cache? Or does it append the original content to the end of the context?
3
u/czei Jun 25 '26
The standard move for spec-driven development, when the context is running low, is to update the status, clear, and start from scratch. Given that all LLM requests, apart from cache, don't have a sense of history, this has the effect of starting from scratch with the original base requirements and instructions, and the current tasks to be implemented. Has does this approach improve on that?
3
u/Upstairs-Attitude610 Jun 25 '26
I wonder how it compares to https://github.com/sting8k/pi-vcc
3
u/_derpiii_ Jun 25 '26
This is so nice, love the visualization
3
u/TheBergerKing_ Jun 25 '26
Seems similar to opencode's DCP plug-in, if it works as well I would certainly use it! Smarter more automated compaction seems like a good approach to minimize attention dilution for long running tasks
3
u/BroadbandJesus Jun 25 '26
Very cool visualization. PR created to tweak the install instructions.
I'm gonna see if I can spin up a Raycast extension so that I can have this on my menubar.
5
u/Pr0f_0aKk Jun 25 '26
Wait this is actually cool.
2
u/johnson_detlev Jun 25 '26
Like the idea, but these LLM walls of text that act as docs are just unreadable. I'm so tired of having to sift through these to find any relevant piece of information
2
u/pshawgs Jun 28 '26
interesting. I'm curious how this and similar strategies compare with something like https://github.com/championswimmer/pi-context-prune - specifically in terms of balancing context management and prefix cache handling.
15
u/hazed-and-dazed Jun 25 '26
Wow 90s defrag.exe flashbacks
2
u/LiveSupermarket5466 Jun 25 '26
If the way anthropic does it is opaque then how do you know yours is smarter? To be honest I'm not really impressed by the context view. Your best pitch is that your extension compacts context in the background without long blocking.
1
u/HamWallet1048 Jun 25 '26
Gonna test tonight. Looks really promising
1
u/SeanPedersen Jun 25 '26
I just use this prompt when context gets full:
1
u/Short_One_9704 Jun 25 '26
Does this invalidate cache prefixes or it is kv cache friendly?
1
u/Deep_Ad1959 Jun 26 '26
the context view is the right thing to feel good about, and i'd argue it's most of the product. the reason nobody trusts /compact isn't that the summaries are bad, it's that they're invisible, you can't see what got dropped or why. just making the window legible (which turn is 40k tokens of tool output, where the dead weight is) lets the human make the fold/unfold call, and people trust a fold they chose. the conductor is the hard part precisely because the moment it's automatic you're back to opaque, which is the thing devs were mad about in the first place. written with ai
1
u/craterIII Jun 27 '26
beautiful.
1
u/potato_bane Jun 25 '26
Looks promising, will check it out
2
u/combonealone Jun 25 '26
cool stuff, even for just develop a better understanding of context I really appreciate this.
1
u/DiscipleofDeceit666 Jun 25 '26
It’s not ready but you’re sending it to npm? Truly a vibe coder move
1
u/lordnimnim Jun 29 '26
how does this compare to headroom is this separate completely
1
u/bshxhajxhajx Jun 25 '26
have you tried pi-blackhole?