3 ms·
Aside from the minimal system prompt, how does it handle context better than other agents? It still has to send the system prompt (which includes AGENTS.md and
by swingboy 2mo ago
Aside from the minimal system prompt, how does it handle context better than other agents? It still has to send the system prompt (which includes AGENTS.md and skill definitions) along with the full conversation every request, no?
- TheRoque 2mo agoA lot of harnesses compress the context when it becomes massive, Pi doesn't do that out of the box (EDIT: that's wrong, as pointed out below). It can be both good and bad. Also since it doesn't have a lot of tools out of the box, the context is not polluted with external tool call descriptions that the agent has to be aware of. Basically, it doesn't handle the context "better", it barely does anything special to it, which can actually be better for cost efficiency.
- the_duke 2mo agoThat's not true, pi auto-compacts when getting close to the context window limit?
- rahimnathwani 2mo agoPi has auto compaction enabled by default: https://pi.dev/docs/latest/compaction https://pi.dev/docs/latest/compaction
- TheRoque 2mo agoOk my bad. I remember hearing that it was a criticism of common harnesses and that the creator of Pi wanted more control over that feature, so I assumed it wasn't enabled by default. Thank for pointing it out !
- rahimnathwani 2mo agoIt was introduced in late 2025: https://github.com/earendil-works/pi/issues/92 https://github.com/earendil-works/pi/issues/92
- alfiedotwtf 2mo agoIt’s failed every single time I’ve tried, and yes I’ve tried all the auto-compaction extensions :( So unless it’s been fixed or someone knows a work around, Pi is DOA - I’ve found that on a MULTI tool call (ie one prompt firing off multiple tool calls until it prompts you again) that’s close to hitting the auto-compaction limit (default compactor or extension) it will either keep going until your context spills over and you OOM, or it interrupts itself to compact but then loses the context. From reading issue after issue on GitHub, I think it’s because Pi doesn’t let extension writers (nor the built-in compactor) hook in between each tool call and so the only place to check if it can compact is when it finishes a request and is about to wait for the next prompt - too late by then
- kadoban 2mo agoIt's really just the minimal prompt and the minimal built-in skills. And ~full control I guess if you wire up something custom (I haven't).
- tosh 2mo agoa few examples: 1) system prompt in pi is quite small (way smaller than the one from OpenCode) 2) when your agents.md file changes pi does not re-spam it (preserves cache, good trade-off!) 3) only 4 tools, every tool comes with a description for how to use it and causes reasoning overhead (fewer tools is good) all of these things add up here are pi, opencode and smol working on the same tasks in 9 fresh runs https://smolenv.com/t/nested-template-includes-60636/ https://smolenv.com/t/nested-template-includes-60636/ you can step through the traces and see how the system prompt + tools steer the agent in a certain way with GPT 5.6 Sol you can even get away without a system prompt (see smol) and only 1 tool (sh)
- deleted 2mo ago[deleted]
- timwis 2mo agoThe /tree feature is incredible for context management. It's really surprising the other harnesses haven't slurped it up yet. It lets you rewind back to any previous message and fork the conversation from there, removing your 'side quest' (e.g. where you dig into something the agent said) from the context. Some other harnesses have a 'rewind' feature, but this lets you maintain the previous conversation history in a separate thread, and even jump between them.
- anon7000 2mo agoI think cursor has this where you can fork a thread from a previous message
- newtwilly 2mo agoYes, pi's works a bit better since it exposes the whole tree to you, but in the simple case of forking to a new conversation it is about the same as Cursor and probably other coding agents. One thing you can do in pi that you can't in Cursor: Have a 5-prompt conversation, jump back to prompt 3 and have a new conversation [call this convo2], then jump back to the original point 5, then jump back to convo2. So fork is really only needed for when you need to interact with the conversation tree in two separate processes.
- paldepind2 2mo agoYou can do that in Copilot in VSCode. There’s a fork icon before every message that creates a new session from that point. The relationships are not maintained in a tree though (not sure if Pi does that).
- wongarsu 2mo agoClaude code in the cli also has /fork to clone the current session state. But if you use it more than once or twice that quickly becomes hard to manage. Actual tracking in a tree sounds like an awesome feature (and one that I love in conversational UIs like openwebui as well)
- 2mo ago
- Szpadel 2mo agothe compaction does not compact whole context, but keeps last ~20k tokens as is, I believe this helps a lot to model to not get confused what it is doing right now. it also have soft/soft compaction limit, it tries to compact on turn boundary when possible. with combining with above this can get you about 35% more context (at least it looks like this with the sol) codex when shell command is executed, will pull output with hard cap at max 30s, so for running compilation it will burn tokens without any benefit. I have some tasks where agent will have to run some suite that can take over an hour, and codex burns about $20/h just waiting and reasoning every 30s "yep, that's still running". And what is going to happen after compaction, when whole context was just waiting? it will loose the plot and when I'm back it just does completely different thing that I asked it to do. codex also have a bug, that opening refuses to resolve that adds your last steer after compaction, so imagine that you asked it to cleanup some tmp files or refactor/simplify something. it will do that again and again after each compaction, best case it just burns tokens and figures out, this is already done, or worse do it again and mess up everything and forget about it's task
- alansaber 2mo agoIt doesn't do anything unique WRT context management. It's just much less opinionated.