Replies: 1 comment
|
While I posted it here, I also tried to find the cause with Claude and we got through! This turned out not to be a headroom issue at all, and the fix is a one-line change on the client side. TL;DR: Claude Code was giving itself a 180,000-token context window instead of 880,000. Adding a headroom-side requirement: headroom must tolerate the suffix. PR #3073 fixed How to see itclaude -p "Reply with exactly the word: pong" --debug-file /tmp/x.log \
--output-format text --no-session-persistence
grep -aoE 'effectiveWindow=[0-9]+|dispatching to [a-zA-Z]+ model=[^ ]+' /tmp/x.logAlways read the two values together. The Root causeClaude Code decides its own context window client-side, before any request leaves the process - so headroom never gets a say in it. The bundled JS inside the native CLI binary is stored as plaintext, so effectiveWindow = window − min(maxOutputTokens, 20000) // reserve capped at 20000
// the ceiling:
wE(model, betas):
if (/\[1m\]/i.test(model)) return 1e6 // ← the fix
if (betas.includes("context-1m-2025-08-07")
&& supports_1m_beta(model)) return 1e6
if (Vo(model)) return 1e6 // native_1m_3p[provider] === true
…
return 200000 // the default ceiling
Vo → QI(provider, ctx): switch (provider) {
case "bedrock": case "vertex": case "foundry":
return ctx.native_1m_3p?.[provider] === true
case "gateway": return all three true
default: return false } // ← no "firstParty" case, ever
Why headroom triggers it. To route through headroom you drop |
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to use headroom together with claude at our company.
The setup is a bit specific, we are connected to AWS Bedrock and not straight to Anthropic.
Secondly, I'm using the headroom docker setup, because I can't local install and use the wrap command.
Everything is configured in such a way that headroom will make the Bedrock connection and claude points to headroom.
It 'works', but I get almost instant compacting events. Making the setup not usable, because often I will even get a compacting failed event.
Anyone has any clever idea? Or maybe pointers on trying to find a possible solution?
All reactions