{"id":"claude-code-compaction-limits-35978","slug":"claude-code-compaction-limits-35978","title":"Why Claude Code Compacts at 400K Tokens","description":"Claude Code shifted its default auto-compaction trigger on million-token models from nearly a million tokens down to roughly 400,000. Anthropic cites session cost as the reason, but degrading context quality and distractor build-up tell an engineering story. The discussion covers why real-world multi-needle reasoning breaks down before benchmark limits, the risks of lossy summaries forgetting rejected plans, cache-rebuild pauses, and how developers can override the threshold using slash commands.","excerpt":"Claude Code dropped its auto-compaction trigger to 400,000 tokens, filling just 37 percent of its million-token context window.","pubDate":"2026-12-02T12:05:50.354Z","tags":["context-and-memory","ai-inference","ai-coding-assistants","reasoning-models","ai-evaluation"],"heroImage":"https://files.myweirdprompts.com/covers/claude-code-compaction-limits-35978.png","podcastAudioUrl":"https://episodes.myweirdprompts.com/audio/claude-code-compaction-limits-35978.m4a","podcastDuration":"19:29","episodeNumber":6821,"transcript":"Herman: A million tokens of room, and the default now uses about a third of it. I've read that changelog line four times and it hasn't got any less strange.\n\nCorn: Daniel noticed it the day it landed. The release from the first of December moved Claude Code's auto-compaction, on the current one-million-token models, to trigger near four hundred thousand tokens. In practice about three hundred and sixty-seven thousand. Before, it waited until the window was almost full, around nine hundred and sixty-seven thousand. It covers headless runs and the SDK too, and it's rolling out, so not everyone has it yet. His read is that this is an honest step. They have the best model they've ever released, and they're still choosing not to let a session run that long, which fits what he's seen himself: reasoning goes soft well before anything looks wrong. He'll take the extra compaction pauses for it. So what does a vendor moving its own default earlier tell us about how far even the strongest models can hold a long thread?\n\nHerman: Start with what Anthropic actually said, because it's narrower than Daniel's reading. The notice inside the app says the session is on auto, which now compacts near four hundred thousand tokens instead of a million, \"to lower the cost of long sessions.\" That's the stated reason. Cost.\n\nCorn: Not accuracy.\n\nHerman: Not accuracy. And the cost logic is solid. Every request in a session carries the whole conversation so far. Compact at four hundred thousand and every later request is smaller, so a long session gets cheaper per turn. The docs say the setting is tuned per model for \"the best cost and performance,\" and that's the only place quality gets a word.\n\nCorn: So when I call it an admission about reasoning, I'm reading something into a billing note.\n\nHerman: You're inferring. It's a good inference, but it's yours and Daniel's, not theirs. Here's why I'd still back it. The Claude Code team wrote a post in April on session management, and it says plainly that model performance degrades as context grows. Attention spreads over more tokens, old irrelevant material starts to distract. No threshold given, but the mechanism is on the record.\n\nCorn: And that same post was celebrating the million window.\n\nHerman: As room to compact early, on your own terms, instead of being forced into it at the worst moment. Which makes the new default a little funny, because it compacts at roughly thirty-seven percent of the window. The status line even shows thirty-seven percent, since it counts against the full million.\n\nCorn: A million-token window, kept like a hotel minibar. Look, don't touch.\n\nHerman: Ha. But there's a history here that makes it stranger. Earlier releases kept pushing the trigger later. One moved Sonnet on the million window from about nine hundred and thirty-four thousand to about nine hundred and sixty-seven thousand, and another had the biggest models compacting shortly before the limit. Squeeze every last token. Now the direction has flipped.\n\nCorn: Somebody got the graph back from the evals, or the invoices.\n\nHerman: Possibly both. I wouldn't guess which one came first.\n\nCorn: The part that sells it for me is how you'd even notice. When the model gets worse at four hundred thousand, nothing breaks. It's still fluent, it still sounds sure.\n\nHerman: Yes, and that matches the lab results. The model doesn't crash, it answers a bit worse with the same confidence. In one long-memory test, the gap for Claude came largely from the model declining to answer rather than answering wrongly. Quiet failure is the dangerous kind, because you only find out after you've built on it.\n\nCorn: Which is a point for compaction, oddly. A summary is lossy on purpose, and you can read it.\n\nHerman: Two kinds of forgetting. The long window forgets in a way you can't inspect. Compaction forgets in a way that's chosen, and you can at least read what it kept. I'd say that argument is stronger than the cost one.\n\nCorn: Then why do the papers feel so far away? One tested thirteen models that all claimed at least a hundred and twenty-eight thousand tokens, and at thirty-two thousand eleven of them had fallen below half their own short-context score. Those models are gone.\n\nHerman: Twenty twenty-five models, and a test built to need real inference rather than word matching. Another study found one irrelevant distractor hurts, four hurt more, and that models did better on shuffled text than on tidy logical text, which is perverse. My bet is the curve has moved right on the newest models and has not gone flat. Nobody outside the labs can say where it bends for a given task, so four hundred thousand looks to me like a point safely before the bend, not a measured edge.\n\nCorn: Safely before the bend is a decent description of a default.\n\nHerman: It also splits two things that people blur. The window is storage. A million tokens fit. Whether the model can reason across all of them at once is a different question, and the default is quietly answering it: not as well as it can across a third.\n\nCorn: We did the October episode on when to start a new session, and the point there was that performance sags early as input grows, so clear between tasks. This is the vendor agreeing, in its own quiet way, and doing it for you.\n\nHerman: And the August one on cutoff versus compaction was about tuning this very threshold by hand. What's new is the tuning moving out of everyone's settings and into the default.\n\nCorn: Cost I follow. Whether the model itself does better for compacting, I'm less sure.\n\nHerman: There's another reason compaction at that size could help, and it's my own read, not something they've said. A long session is full of junk. Failed attempts, test output from an hour ago, a file read three times. Every bit of it sits in the window competing for attention, and the research on distractors says a wrong-but-plausible thing in context actively hurts.\n\nCorn: So a dead end the model already abandoned is a distractor.\n\nHerman: I'd say so, yes. A good summary throws it out. It's less like shrinking the window and more like clearing the desk, provided the summary keeps what matters.\n\nCorn: That's a big proviso. \"Provided\" carries the whole bet.\n\nHerman: It does. Which is why the stakes are about when the summary gets written, and by whom.\n\nCorn: And the benchmarks everyone quotes are mostly needle tests. Hide a fact, ask for it back. Real coding work is nothing like that.\n\nHerman: Nothing like it. You need the model to hold a dozen scattered facts, a half-finished plan and a convention you set early, and reason across all of them at once. Finding a needle at nine hundred thousand tokens is one skill. Using three needles together is another, and I'd expect it to fall off sooner. That's a guess, but it's the guess that matches how sessions feel.\n\nCorn: Which is Daniel's point, really. The score on the leaderboard and the session at hour six are different animals.\n\nHerman: One more detail, since the rollout is staged. The changelog says it's already on for third-party providers and for people with telemetry off, and rolling out for everyone else. My guess is it's behind a server-side flag, which would also let them watch what happens to real sessions at the new threshold before widening it.\n\nCorn: Herman, a question for you the other way round. Would you trust a vendor more or less for shipping a default that undersells its own headline number?\n\nHerman: More, I think. Selling a million and then defaulting to four hundred thousand is bad marketing and decent engineering. You're the cynic. Do you buy it?\n\nCorn: I buy it because it's the less flattering choice. Nobody ships a worse-looking default to impress anyone. But you love a big window, Herman. Do you think the million is wasted?\n\nHerman: I do love one. No, I think it's useful as headroom and as a ceiling you can choose to reach. A default of thirty-seven percent doesn't mean the rest is wasted. It means most sessions don't need it and pay for it anyway.\n\nCorn: Most of mine hit \"I've forgotten what I was doing\" at about a tenth of the window.\n\nHerman: Same for me. The window was never the limit people met first.\n\nHilbert: Hilbert's Depressing Medieval Facts. In thirteen forty nine Pope Clement the Sixth condemned the flagellants, who had spread across Europe scourging themselves during the plague.\n\nHilbert: Condemned them. Then the plague carried on regardless.\n\nCorn: Grim.\n\nHerman: So the cost to the user, which I'd put in front of the applause. Compaction keeps what to do next and drops why. That was the finding in the April episode on how it works. The earlier it runs, the more often you lose a why.\n\nCorn: Give me one that isn't abstract.\n\nHerman: You spend an hour ruling out approach A, with reasons. The summary says \"using approach B.\" Next morning the model cheerfully proposes approach A, because nothing remembers why you killed it. And the changelog shows lesser losses: summaries that mangled quoted XML tags, uploaded files not reattached afterwards, compactions that failed when the summary got cut off. Those are fixes, so those were bugs.\n\nCorn: And the pauses. It isn't instant.\n\nHerman: It reads the whole conversation to summarise it, so compacting a big context is itself a big request. Then the prompt cache has to be rebuilt, one miss, which the docs call an expected rebuild. So compact more often and you pay for more of those summarising reads.\n\nCorn: But the later requests are smaller, so you come out ahead.\n\nHerman: That's their claim and I'd expect it holds for most sessions. A blog has someone reporting a forty-three percent drop in per-request cost, and I wouldn't lean on that figure. The shape is plausible. The number I can't vouch for.\n\nCorn: What about the person with a giant instruction file and a pile of tool servers?\n\nHerman: Documented bad case. If tools and instructions already eat a huge share of every request, a smaller window can refill straight after each compaction. There's a circuit breaker that stops after three immediate refills, and if your fixed overhead passes about a hundred and eighty thousand tokens a request, the window is raised for you.\n\nCorn: There's a cost on the other side nobody puts on a slide. Compaction pauses break your rhythm. You're deep in something, it stops, thinks, comes back, and you've lost your own thread as much as the model's.\n\nHerman: That's the UX bill Daniel's agreed to pay, and it's real. A compaction every three or four hours of heavy work instead of once a day, say. My suggestion is to treat each pause as a checkpoint. You can tell it what to keep, so that's the moment to say \"remember why we rejected approach A.\"\n\nCorn: Does that actually work, or is it a ritual?\n\nHerman: I'd expect it helps, since the summary is written by a model that follows instructions. I can't tell you by how much.\n\nCorn: People complained before, too. Someone filed an issue on an earlier release calling four hundred thousand a regression on the previous Opus, mostly because nobody had told them.\n\nHerman: Fair, and this time there's a notice, plus a one-time prompt on first run, apply or keep. The override is easy. You type slash autocompact and then one M, and it's back to the old trigger, saved per model. Slash autocompact auto returns you to the new default. There's a settings-file entry, a flag for one launch, and an environment variable, and the variable bites, because a bare number there means tokens. Put two hundred in it and you've asked for compaction at two hundred tokens.\n\nCorn: Whereas in the slash command, two hundred means two hundred thousand.\n\nHerman: With a floor of a hundred thousand, so the command won't let you go silly. Resumed conversations already past four hundred keep running, and scheduled tasks on desktop and cloud stay at a million.\n\nCorn: So what do you do, mid-refactor, a big one, two days of decisions in the thread?\n\nHerman: Override for that job, and keep the decisions in a notes file as I go, because the risk with the late trigger is a bad summary at the bad moment. What would you do? You never override anything.\n\nCorn: Keep the default, clear between tasks. New task, new session, one line. The decisions go in a file instead of in anyone's memory, mine included.\n\nHerman: That's a boring answer.\n\nCorn: It's the one that works. I nap between tasks as well, and I've never lost a why.\n\nHerman: You've lost plenty. You told me last month Mongolia was a short walk from Jerusalem.\n\nCorn: Borders move.\n\nHerman: When would you keep the million, though? You've got a case, I can tell.\n\nCorn: Reading one huge codebase end to end to answer a single question. Everything in view, early detail is the whole point, and I'd accept paying for it. Or a team whose admin has pinned it.\n\nHerman: Those I accept. Even there I'd rather it compacted at four hundred with me telling it what to hold on to than trust it to find a buried detail at nine hundred thousand. My answer is the default plus a notes file.\n\nCorn: Which is my answer with extra files.\n\nHerman: Extra files are how you survive a lossy summary. The thing Daniel's picked up on, I think, is what they didn't do. They didn't sell a smaller window. The million stays available and the default declines to use it. You don't set the default at a third of the flagship's window unless the other two thirds buys little for a typical session. Cost is what they said, but a company doesn't give up recall it believes in just to save on invoices, and it ends up saying something about the limits too.\n\nCorn: There are three readings of this move, I think. It's only cost. It's only quality. Or it's both, and cost is the one they're allowed to say out loud.\n\nHerman: I lean toward both, with cost leading. And I'd note the cost reason doesn't compete with yours. If the long sessions were also getting worse, the saving would be a bonus, and nobody has to say anything. If the long sessions were fine, I think they'd keep the saving and let people choose, the way they do for effort levels. A default at thirty-seven percent is where both stories point.\n\nCorn: So what would change your mind?\n\nHerman: A published comparison. Same tasks, same model, compacting at four hundred thousand against nine hundred and sixty-seven. If the late one were as good, I'd say it's cost, full stop. Until then it's a reasonable bet, not a finding.\n\nCorn: Does the number go up as the models get better?\n\nHerman: My guess is it drifts up, slowly, and every time it does the headline is \"the window is finally usable.\" Which tells you what the previous headline was worth.\n\nCorn: A million tokens was the pitch. Four hundred thousand is the product.\n\nHerman: Roughly, and the gap is shrinking. Each generation seems to put the working limit a bit further right.\n\nCorn: What does the soft reasoning actually look like, in a session? Daniel says it's before it's obvious. I can name mine: it re-asks something I settled, or it stops following a convention I set at the start.\n\nHerman: Mine's a small one. It rewrites a function in a style it was told not to use, and then it's correct about everything else. Tests pass, so you don't stop.\n\nCorn: So you can't use the symptom as the trigger, because by the time the symptom shows you've built on top of it.\n\nHerman: That's the case for a default over a judgement call. If the signal arrives late, you want the rule set early.\n\nCorn: Though the summariser, when it runs, is the sharp version of the model. And the sharp version runs out somewhere nobody's told us.\n\nHerman: The compaction moment is the awkward one. The summary gets written by the model when it's in the worst shape of the whole session, the most...\n\nHilbert: ...awake. It's the one who's been awake longest, so it writes the minutes. Herman, you took the long way round to that, which is fine, I had the levels sorted. Same as my sister's parcel labels. I ran her job on the old setting last month, Monday to Thursday, one session. The bill came to a hundred and twelve dollars. She hasn't paid me back.\n\nCorn: That's a lot of labels.\n\nHilbert: Four hundred a day. In the last twenty minutes I switched the same session to the new default, on the Dell, it's on the ironing board in the back room, plugged into the extension lead. It compacted. Corn, you're clipping on the hard consonants, bring it down a touch. Anyway, the summary said labels face left. It didn't say why. The why is her dispatch table is against the left wall and she packs with her right hand.\n\nHerman: The instruction survives and the reason doesn't, and the day Maureen moves the table, the instruction is wrong and nothing in the summary can tell you.\n\nHilbert: You said it keeps the next step and drops the reason. I've started writing the whys on the box lids in pencil.\n\nCorn: Put the lids into a notes file the session reads and you've got the same trick with worse handwriting. A file would do it.\n\nHilbert: Maureen won't open a file. Pencil stays.\n\nHerman: A pencil doesn't hit a window limit, to be fair.\n\nCorn: People get one thing wrong about all this. A model advertises a million tokens and they assume that's a million it'll reason across, start to finish.\n\nHerman: A million is what fits. The default leans on about a third of it, and the studies on older models say the usable amount is well under the advertised one. How far under, on the newest, nobody has pinned down.\n\nCorn: What I'd watch is whether the four hundred keeps sliding down. If it does, the answer gets louder. Meanwhile the cheap move is writing the why somewhere that isn't the window.\n\nHerman: Thanks to Hilbert Flumingtop for producing the episode.\n\nCorn: This has been My Weird Prompts. You can find every episode at my weird prompts dot com.\n\nHerman: See you tomorrow.\n","showNotes":"Anthropic's December 1 release moved Claude Code's auto-compaction trigger on one-million-token models to roughly 367,000 tokens—about 37 percent of the available window—down from nearly 967,000 tokens. While Anthropic explicitly frames this change around lowering the cost of long sessions, the shift underscores practical realities of large context windows. Attention degrades and distraction from dead ends increases long before hitting token limits, though quiet reasoning failures remain difficult to detect in real-time coding. Compaction clears discarded attempts and reduces per-turn token costs, but it introduces trade-offs: lossy summaries often discard why decisions were made, and rebuilding prompt caches causes distinct working pauses. Users needing uninterrupted thread history can still override the threshold back to one million.","promptSanitized":"Claude Code's latest release (v2.1.334, 1 December 2026) moved the auto-compaction default on 1M-context models to near 400K tokens instead of near the full window. With the best model Anthropic has released, they're choosing not to let sessions run that long. It costs some UX, but it reads as an honest step and fits my experience that reasoning degrades before it's obvious. What does an earlier compaction default tell us about the limits of context maintenance and reasoning, even in very advanced models?","transcriptUrl":"https://episodes.myweirdprompts.com/transcripts/claude-code-compaction-limits-35978.md","url":"https://myweirdprompts.com/episode/claude-code-compaction-limits-35978/","_links":{"self":"https://myweirdprompts.com/api/episodes/claude-code-compaction-limits-35978.json","html":"https://myweirdprompts.com/episode/claude-code-compaction-limits-35978/","audio":"https://episodes.myweirdprompts.com/audio/claude-code-compaction-limits-35978.m4a"}}