{
 "topic": "claude-code-compaction-and-stalls",
 "url": "https://stacks.jakubdudek.com/claude-code-compaction-and-stalls",
 "title": "When to compact a Claude Code session with a 1M window, and where the unanswered messages come from",
 "description": "At what context size to set auto-compact in Claude Code (Opus 5.5, 1M window), and what is known about hung requests, where the message has to be sent a second time.",
 "aliases": [
  "compact",
  "compaction",
  "autocompact",
  "auto-compact",
  "context rot",
  "context window",
  "1M",
  "hang",
  "ECONNRESET",
  "no response",
  "idle compaction",
  "CLAUDE_CODE_AUTO_COMPACT_WINDOW"
 ],
 "domain": "ai",
 "created": "2026-11-18",
 "last_checked": "2026-11-18",
 "claims": [
  {
   "ref": "claude-code-compaction-and-stalls#c1",
   "url": "https://stacks.jakubdudek.com/claude-code-compaction-and-stalls/c1",
   "card": "claude-code-compaction-and-stalls",
   "id": "c1",
   "status": "valid",
   "claim": "With no window set, Claude Code compacts sessions with a 1M window at about 967K tokens.",
   "quote": "With no window set, Claude Code auto compacts at the model's context limit: about 967K tokens on 1M-context models and 200K on 200K models.",
   "source_url": "https://www.its-tahir.com/blog/claude-code-keeps-compacting",
   "tier": "T4",
   "checked": "2026-11-18",
   "valid_until": "2026-12-18"
  },
  {
   "ref": "claude-code-compaction-and-stalls#c2",
   "url": "https://stacks.jakubdudek.com/claude-code-compaction-and-stalls/c2",
   "card": "claude-code-compaction-and-stalls",
   "id": "c2",
   "status": "valid",
   "claim": "Idle compaction summarises a conversation above 200K before the one-hour cache expires, and idleCompaction: false turns it off.",
   "quote": "that's idle compaction, not a lower threshold: it summarises a 200K+ token conversation before its one-hour cache expires, and `\"idleCompaction\": false` turns it off.",
   "source_url": "https://www.its-tahir.com/blog/claude-code-keeps-compacting",
   "tier": "T4",
   "checked": "2026-11-18",
   "valid_until": "2026-12-18"
  },
  {
   "ref": "claude-code-compaction-and-stalls#c3",
   "url": "https://stacks.jakubdudek.com/claude-code-compaction-and-stalls/c3",
   "card": "claude-code-compaction-and-stalls",
   "id": "c3",
   "status": "valid",
   "claim": "A measurement of agent calls: below ~200K compactions eat working time, above ~600K no gain is visible.",
   "quote": "Below about 200k the post-compaction fog starts eating your working time. Above about 600k you are paying a large premium for a benefit I could not find in any of these measurements",
   "source_url": "https://langwatch.ai/blog/context-tax-when-to-compact",
   "tier": "T2",
   "checked": "2026-11-18",
   "valid_until": "2026-12-18"
  },
  {
   "ref": "claude-code-compaction-and-stalls#c4",
   "url": "https://stacks.jakubdudek.com/claude-code-compaction-and-stalls/c4",
   "card": "claude-code-compaction-and-stalls",
   "id": "c4",
   "status": "valid",
   "claim": "After a compaction the share of user corrections rises from 17.7% to 41.9%.",
   "quote": "In the five steps after a compaction, **41.9% of my messages contain a correction against a steady-state baseline of 17.7%**",
   "source_url": "https://langwatch.ai/blog/context-tax-when-to-compact",
   "tier": "T2",
   "checked": "2026-11-18",
   "valid_until": "2026-12-18"
  },
  {
   "ref": "claude-code-compaction-and-stalls#c5",
   "url": "https://stacks.jakubdudek.com/claude-code-compaction-and-stalls/c5",
   "card": "claude-code-compaction-and-stalls",
   "id": "c5",
   "status": "valid",
   "claim": "The Opus 5.5 test ended with the auto-compact window set to 400K, with a band of 300–500K.",
   "quote": "We set the auto-compact window to 400,000 tokens: 40% of the window, with a defensible band from 300K to 500K",
   "source_url": "https://www.dashecorp.com/codi-e/context-rot-opus-5-5/",
   "tier": "T2",
   "checked": "2026-11-18",
   "valid_until": "2026-12-18"
  },
  {
   "ref": "claude-code-compaction-and-stalls#c6",
   "url": "https://stacks.jakubdudek.com/claude-code-compaction-and-stalls/c6",
   "card": "claude-code-compaction-and-stalls",
   "id": "c6",
   "status": "valid",
   "claim": "A hung session uses no tokens, and Esc followed by sending again unblocks it at once.",
   "quote": "the spinner keeps spinning, no tokens are consumed, and no progress is made. Pressing Escape and re-prompting immediately unsticks it",
   "source_url": "https://github.com/anthropics/claude-code/issues/26224",
   "tier": "T4",
   "checked": "2026-11-18",
   "valid_until": "2026-12-18"
  },
  {
   "ref": "claude-code-compaction-and-stalls#c7",
   "url": "https://stacks.jakubdudek.com/claude-code-compaction-and-stalls/c7",
   "card": "claude-code-compaction-and-stalls",
   "id": "c7",
   "status": "valid",
   "claim": "Since 11 November 2026 requests from sessions above ~200K tokens fail with ECONNRESET.",
   "quote": "Starting around 22:50 UTC on 2026-11-11, every request from a session with more than ~200K tokens of context fails with:",
   "source_url": "https://github.com/anthropics/claude-code/issues/109170",
   "tier": "T4",
   "checked": "2026-11-18",
   "valid_until": "2026-12-18"
  },
  {
   "ref": "claude-code-compaction-and-stalls#c8",
   "url": "https://stacks.jakubdudek.com/claude-code-compaction-and-stalls/c8",
   "card": "claude-code-compaction-and-stalls",
   "id": "c8",
   "status": "valid",
   "claim": "The ECONNRESET workaround is an auto-compact window of 150K; it does not rescue sessions that are already too large.",
   "quote": "keeps new sessions under the failing size. It doesn't help sessions that are already too large; those have to be abandoned",
   "source_url": "https://github.com/anthropics/claude-code/issues/109170",
   "tier": "T4",
   "checked": "2026-11-18",
   "valid_until": "2026-12-18"
  }
 ],
 "as_of": "2026-12-04",
 "note": "A claim says what its source said on the day it was checked. \"valid_until\" is the date by which it should be checked again, not a promise that it is true today.",
 "license": "CC BY 4.0",
 "author": "Jakub Dudek",
 "conclusions": "With no window set, Claude Code compacts sessions with a 1M window only at about 967K tokens [c1]. The author's compactions at ~500K are most likely idle compaction: Claude Code summarises a conversation above 200K before the one-hour cache expires, and the setting `idleCompaction: false` turns that off [c2]. This is a hypothesis; the compaction metadata in the transcripts does not tell this case apart.\n\nThere is no single right threshold; the sources differ. A measurement over 287 thousand calls points to a range of 200–600K: below ~200K frequent compactions eat working time, above ~600K no gain is visible [c3]. After a compaction the share of user corrections rises from 17.7% to 41.9% and stays there for at least 30 steps, so compacting too often does harm as well [c4]. A test of Opus 5.5 up to 928K showed no drop in information retrieval, but the published curves for multi-step tasks do fall, so its authors set 400K, with a defensible band of 300–500K [c5]. For the author's work (long, complex projects, building things) 400K is a reasonable setting.\n\nUnanswered messages are a known, open problem on the connection side: the session hangs without using tokens, and Esc followed by sending again unblocks it at once [c6]. Since 11 November 2026 there is also a reported bug in which every request from a session above ~200K fails with ECONNRESET [c7]. The reporter works around it with an auto-compact window of 150K, which does not rescue sessions that are already too large [c8]. The author has had `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS=30000` set since 10 November, and manual resends have been clearly fewer since then, but the causal link has not been checked.",
 "history": []
}
