Answer: To recover from auto-compaction thrashing errors, ask Claude to read the oversized file in smaller chunks, run `/compact` with a focus that drops the large output, move the large-file work to a subagent, or run `/clear` if the earlier conversation is no longer needed. If the error returns after a `/clear`, run `/context` and compare the `Messages` row with the rows above it. Status: Confirmed Entry: tool/claude-code/troubleshooting/fix-auto-compact-thrashing Revision: 2 Digest: sha256:2ebfb7b643e74ac4 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:06:03Z Last changed: 2026-11-19T12:21:09Z (Error message: — → Autocompact is thrashing: the context refilled to the limit...) Last verified: 2026-11-20T12:26:05Z Next check: 2026-11-21T12:26:05Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Recovery step 1 | read the oversized file in smaller chunks | [1] | 2026-11-20 Recovery step 2 | /compact keep only the plan and the diff | [1] | 2026-11-20 Recovery step 3 | subagent | [1] | 2026-11-20 Recovery step 4 | /clear | [1] | 2026-11-20 Diagnostic command | /context | [1] | 2026-11-20 Error message | Autocompact is thrashing: the context refilled to the limit... | [1] | 2026-11-20 Sources: [1] Anthropic. "Troubleshooting". https://code.claude.com/docs/en/troubleshooting.md Role: primary. Accessed: 2026-11-20T12:26:05Z Quote: "Ask Claude to read the oversized file in smaller chunks" (Supports: Recovery step 1) Quote: "Run `/compact` with a focus that drops the large output, for example `/compact keep only the plan and the diff`" (Supports: Recovery step 2) Quote: "Move the large-file work to a [subagent](https://code.claude.com/docs/en/sub-agents.md) so it runs in a separate context window" (Supports: Recovery step 3) Quote: "Run `/clear` if the earlier conversation is no longer needed" (Supports: Recovery step 4) Quote: "If the error comes back after a `/clear`, run [`/context`](https://code.claude.com/docs/en/debug-your-config) and compare the `Messages` row with the rows above it" (Supports: Diagnostic command) Quote: "If you see `Autocompact is thrashing: the context refilled to the limit...`" (Supports: Error message) Published: 2026-11-20T03:38:58Z Snapshot SHA-256: 2d4ff8345bc6e72a09bccde71014dafbc5be06feeee31d54dfced5f9d477eecc (captured 2026-11-18T12:20:55Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T12:20:55Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:26:05Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:26:05Z Last attempt: 2026-11-20T12:26:05Z Notes and limitations: Extracted automatically from a single official source (section "Auto-compaction stops with a thrashing error"). Related: https://latestn.com/tool/claude-code/troubleshooting/fix-broken-settings-file How do I fix a broken Claude Code settings file? https://latestn.com/tool/claude-code/troubleshooting/fix-cliconnectionerror-failed-to-start What causes a CLIConnectionError: Failed to start Claude Code and how do I resolve it? https://latestn.com/tool/claude-code/troubleshooting/fix-clinotfounderror How do I fix the CLINotFoundError when using the Claude Code Agent SDK? https://latestn.com/tool/claude-code/troubleshooting/file-rewinding-not-enabled-error How do I fix the 'File rewinding is not enabled' error in Claude Code? https://latestn.com/tool/claude-code/troubleshooting/find-plugin-on-disk How do I find where a Claude Code plugin is installed on disk? https://latestn.com/tool/claude-code/troubleshooting/fix-500-internal-server-error How do I fix the Claude Code "API Error: 500 Internal server error"? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T12:21:09Z | changed | Error message: — → Autocompact is thrashing: the context refilled to the limit... | [1] 2026-11-19T12:21:09Z | changed | Diagnostic command: — → /context | [1] 2026-11-19T12:21:09Z | changed | Recovery step 4: — → /clear | [1] 2026-11-19T12:21:09Z | changed | Recovery step 3: — → subagent | [1] 2026-11-19T12:21:09Z | changed | Recovery step 2: — → /compact keep only the plan and the diff | [1] 2026-11-19T12:21:09Z | changed | Recovery step 1: — → read the oversized file in smaller chunks | [1] 2026-11-19T12:21:09Z | changed | diagnostic command: /context → — | [1] 2026-11-19T12:21:09Z | changed | recovery step 4: /clear → — | [1] 2026-11-19T12:21:09Z | changed | recovery step 3: Move the large-file work to a [subagent](https://code.claude.com/docs/en/sub-agents.md) so it runs in a separate context window → — | [1] 2026-11-19T12:21:09Z | changed | recovery step 2: /compact keep only the plan and the diff → — | [1] 2026-11-19T12:21:09Z | changed | recovery step 1: Ask Claude to read the oversized file in smaller chunks, such as a specific line range or function, instead of the whole file → — | [1] 2026-11-19T12:21:09Z | changed | error message: Autocompact is thrashing: the context refilled to the limit... → — | [1] 2026-11-13T03:06:03Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/troubleshooting/fix-auto-compact-thrashing/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/troubleshooting/fix-auto-compact-thrashing POST: https://latestn.com/dispute/tool/claude-code/troubleshooting/fix-auto-compact-thrashing with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/troubleshooting/fix-auto-compact-thrashing?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I resolve auto-compaction thrashing errors in Claude Code? Revision 2, last verified 2026-11-20T12:26:05Z. https://latestn.com/tool/claude-code/troubleshooting/fix-auto-compact-thrashing (accessed 2026-11-21T09:56:41Z). @misc{LatestN_tool_claude_code_troubleshooting_fix_auto_compact_thrashing_r2, title = {How do I resolve auto-compaction thrashing errors in Claude Code?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/troubleshooting/fix-auto-compact-thrashing}}, note = {Revision 2; digest sha256:2ebfb7b643e74ac4; last verified 2026-11-20T12:26:05Z; accessed 2026-11-21T09:56:41Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/troubleshooting/fix-auto-compact-thrashing