r/PiCodingAgent • • Sep 27 '26

Question OMP and Opus 5.5 Usage

Why is it that Opus 5.5 usage starts out great in OMP, and then for one reason or another starts draining usage like crazy? Am I hitting some sort of caching issues? Do I need to compact at 400k? Or what?

I am pretty sure the cache is being kept warm for an hour, but I don't know for sure how this stuff works. It's compacting at 850k. If i've left it for awhile and context is >35% I will use /handoff and that seems to help.

10 Upvotes

15 comments sorted by

19

u/sugarfreecaffeine Sep 27 '26

I never let a session pass 250k let alone 400 and 850? That’s insane

8

u/Twiggled Sep 27 '26

400k context is wild, not surprised your burning through usage like that! I try not to let any single conversation go past 150k because the usage starts to become really noticeable past that point.

Even if the cache works, most of the cost is going to come from cache reads because every single tool call resends the entire conversation history and that adds up even if cache reads are 1/20th the price of a one hour cache write.

Worth checking though that you’re actually getting 1 hour cache writes and not 5 min cache writes. 5 mins is the default on API, and 1 hour is the default on subscription when you use Claude’s harness. Worth confirming how OMP handles it. Could be a combination of your crazy conversation lengths and 5 min caching.

6

u/bad_detectiv3 Sep 28 '26

I’m learning something new now. Isn’t the point of cache to reduce look up, if people are not letting context go beyond 100k, won’t it be more expensive to keep starting new session from scratch? Is hitting new session frequently the way to save on token?

I recently began playing with code after opencode zen disallowed pi using free model, I’m seeing my weekly usage being eaten up quick.

Now while I type this, I wonder if I can my ChatGPT $20 plan on pi hmm

2

u/schmurfy2 Sep 28 '26

I use got 5.6 at work with openspec, one session for exploration, one for implementation and I rarely have session bigger than 250k.

2

u/Twiggled Sep 28 '26

You need a way of to get your agent up to speed quickly in a new session. There are various ways of doing that. For example, the most basic one js an AGENTS.md file containing a short set of instructions you want your agent to follow every session.

Or like OP mentioned, you might have a /handoff skill that generates a brief summary of your current session and next steps for a new session. It’s more or less the same as compacting.

Personally, I use a variant of matt pocock’s skills that I tweaked to my liking. The basic idea is to separate planning and doing over multiple sessions, while recording the important details needed across sessions in markdown files. The workflow is plan -> convert plan into tickets -> do one ticket per session. And certain important details may get recorded in a CONTEXT.md file, or ADRs.

The problem with trying to do too much in one session is that most of the context window gets filled up with tool calls and chains of thought. Most of that isn’t needed later, but you keep paying for it with cache reads as the conversation continues. So from time to time you want to reset with just the important bits saved in some durable way like a markdown file.

4

u/amelech Sep 27 '26

Do you have idle compaction on?

0

u/[deleted] Sep 27 '26

[deleted] — view deleted comment

1

u/coronafire Sep 28 '26

Fwiw I've got mine set to 100k threshold and 10min (to be under the 30min codex sub and 1hr claude sub times) - that works well for me. I'm also pretty pushy about my agent writing plans with enough detail to survive compacting, so I'm happy for it to compact often.

4

u/nitinmms1 Sep 28 '26

Compaction at 250k is what works quite well. Keeps context in sweet spot of llm quality coding

2

u/TheKillerScope Sep 28 '26

I had this issue too, with Astra and Luna, this was my result.

Did a little digging with GPT as I burned through my weekly quota in 16h (5x Plan) plus some credits too.

"Yes. The audit we did showed that cached context reads were overwhelmingly the biggest source of traffic, not the new prompts or model output. Model / role Requests Fresh input Cache reads Output Total traffic GPT 6 Luna, Max 613 2.72M 253.29M 862.1K 256.86M GPT 6 Astra, advisor 609 2.43M 159.19M 243.6K 161.87M GPT 5.6 Terra, Max 618 2.13M 269.98M 189.4K 272.30M The important part was the ratios: Luna: about 98.6% of all token traffic was cache reads. Astra: about 98.3% was cache reads. Combined Astra + Luna processed roughly: 412.48 million cached tokens versus only approximately: 5.15 million fresh input tokens and 1.11 million output tokens. So about 98.5% of Astra + Luna traffic was cached context."

Formatting is bad cause I'm on mobile...

1

u/hancengiz Sep 28 '26 edited Sep 28 '26

Prompt cache times differ for API consjmption and ClUde Code subscriptions consumptions.Subs 1hr. api 5min. Never used pi on claude sub, if pi is going to API, API has 5mins cache subs has 1hr. That could be the reason you see different consumption for same usage patterns you have.

ephemeral_5m_input_tokens ephemeral_1h_input_tokens

ask pi to check its (or claude's log to find if it sees any of these in the messsages to antrophic servers)

So, assuming pi connects to API if that's the case it would be 5-minute cache so long story short if you wait more than 5 minutes between two prompts the next prompt would be processed with no cache reads (whole chat history from scratch)

https://platform.claude.com/docs/en/build-with-claude/prompt-caching#1-hour-cache-duration

1

u/pilibitti Sep 27 '26

since each turn sends the entire history, each message in a conversation costs more than the previous one.

cache read says $0.1 per million tokens. if you have 500k tokens in history, each turn reads the entire history from cache, that means each turn costs ~$0.05 just for reading from the cache. When you approach 1 million history each turn's just cache read cost approaches $0.1. You add to that the output cost.

most people assume they pay the cache / history cost once. Like if the history grows to 1 million tokens, it will in total cost $0.1 but that is not the case. you pay for that at each turn. each message you send, each tool call by itself incurs that cache read cost calculated from the entire history.

3

u/Equivalent_Idea8839 Sep 28 '26

claude cache ttl is very short too, i think 5m

2

u/hancengiz Sep 28 '26

Subs 1hr. api 5min

1

u/pilibitti Sep 28 '26

then it is ridiculous pricing no? I don't use anthropic models but their pricing page says 5min cache write is $5 per 1 million tokens. so if you have 500k context, leave for 5 mins then send a new message it automatically is an additional $2.5?

0

u/Equivalent_Idea8839 Sep 27 '26

you need to examine the session logs manually and see whats going on

are you using sdk bridge?