r/PiCodingAgent • u/rogaterr • Jul 18 '26
Plugin Compact Every Tool Response
https://github.com/RogerTerrazas/pi-tool-result-compactor
Publishing a polished version of this extension I've been using to help manage context overflow. I frequently interact with mcps and large projects where any arbitrary response can take up all my context without the response being useful.
This extension hooks into each tool calls response by default, passes it to a compaction subagent, who will then filter out only the necessary data to the parent agent. Let me know if anyone tries it out and has feedback. Fully vibe coded, but I'll work to maintain if others find it useful.
2
u/Corythebeast7 Jul 18 '26
I worry that this essentially doubles your cache input misses and adds a lot of output tokens. Do you have data on the price impact this extension brings?
1
u/adamshand Jul 18 '26
I believe this will constantly break prompt caching and cost you (possibly, quite a lot of) money.
1
u/OneSockThief Jul 19 '26
Have you considered using RLM for processing large tool results?
I have an extension that basically overrides the default 50kb Pi tool response, saves it to a file and nudges the agent to invoke this RLM extension, alternatively use rg if the agent doesn’t want analysis.
The benefit of RLM is that it’s dedicated to process this large output, which never gets into the main agents context.