Bible Network Crypto DeFi Onchain RWA AI Agent Stablecoin Chain SAFU CryptoTax DeFAI AGI Claude Me Claude Skill Claude Design Claude Cowork
Independent Media
Not affiliated with any project
Learn Claude Skills. Do Everything Better.
claudeskill-me.com
LATEST
Watching Claude Code Compaction and Hooks Through OpenTelemetry: Reading the compaction, hook_execution_complete and precompute_reuse Fields  ·  Blind Spots in Bash Permission Rules: deny Misses /bin/rm, bash -c and git -C, and devbox run * Lets Any Inner Command Through  ·  CLAUDE.md Too Long? Use .claude/rules/ and paths So Rules Load Only When Claude Touches Matching Files  ·  Chromium Says No usable sandbox! Inside Claude Code's Sandbox: What --no-sandbox, excludedCommands and allowNestedUserNamespaces Each Give Up  ·  Claude Code v2.1.309 Fixes a Batch of Sandbox and Permission Gaps: Startup Files Outside the Sandbox, denyWrite Through Symlinks and More  ·  The auto mode $defaults Trap: Leave One String Out of autoMode.soft_deny and the Built-In Force-Push Rules Disappear
Glossary · Workflow

Compaction

Workflow intermediate

30-Second Version · For the impatient
When the Context Window nears its limit, Claude Code replaces earlier conversation with a shorter summary and continues, trading detail for room; what survives depends on whether it is reloaded from disk or lived only in the conversation.
Full Explanation +
01 · What is this?

What is Compaction?

Compaction is what Claude Code does when the Context Window nears its limit: it swaps earlier conversation for a shorter summary and keeps working on top of it. It happens automatically and can be triggered by hand with /compact; related controls include /autocompact and the environment variable CLAUDE_CODE_AUTO_COMPACT_WINDOW. After compaction Claude sees the summary, not the original word-for-word conversation.

02 · Why does it exist?

Why does Compaction exist?

The model can only read so much at once, so a long session eventually fills up. Without compaction you would have to start over or let old content crowd out new. Compaction is the compromise: keep the gist, regain space. The cost is lost detail, and the official Auto Mode page warns about it: a one-off boundary you stated in conversation, such as "don't push until I review", can be lost if compaction removes that message, so use an ask or deny rule for a durable guarantee.

03 · How does it affect your decisions?

How does it work, and what survives?

Points from the official changelog: since v2.1.304 Compaction re-sends the Skill list to Claude afterwards, and /reload-skills sends only new or changed skills; since v2.1.309 an oversized nested CLAUDE.md loads only its start, stopping repeated compaction after reading under it; v2.1.307 fixed "Autocompact is thrashing" errors in turns that read many PDF pages or images; since v2.1.296 Subagent frontmatter can set autoCompactWindow (100000 to 1000000). A third-party writeup (claudefa.st) says the project-root CLAUDE.md is re-injected from disk while nested ones are not, and invoked skill bodies are capped at 5,000 tokens each and 25,000 total; its other claim that the startup skill listing does not reload contradicts the official v2.1.304 note and should be treated as out of date.

04 · What should you do?

So what does this mean for me?

Three practical points: put long-lived rules in CLAUDE.md or Permission Rules rather than only in conversation; an oversized CLAUDE.md or heavy tool output makes Compaction more frequent, so keep them lean; and when Claude seems to forget something you just said, first ask whether compaction just happened. These three points are my reading of the official information, not official operating advice.

Sources: Claude Code changelog - Claude Code Docs, Configure auto mode - Claude Code Docs, What survives compaction - ClaudeFast
Real-World Example +

A publicly checkable example: the Claude Code v2.1.309 release notes say sessions compacted repeatedly after reading files under a very large nested CLAUDE.md, so a nested CLAUDE.md over the size limit now loads only its start. It shows compaction is not only the result of a full window: the size of what you feed in can push it into a loop.

Common Misconceptions +
✕ Misconception 1
× Misconception: compaction just shortens the conversation and keeps its content, when actually: after compaction Claude sees a summary, so detail and one-off boundaries you stated can disappear; durable rules belong in CLAUDE.md or permission rules
✕ Misconception 2
× Misconception: everything loaded gets reloaded the same way after compaction, when actually: sources behave differently (the skill list is re-sent since v2.1.304, nested CLAUDE.md files do not come back automatically according to a third-party writeup), and I could verify only what the official changelog mentions
The Missing Link +
Direct Impact

Pros: long sessions can continue without starting over. Cons: detail and one-off instructions can be lost, and oversized inputs can cause repeated compaction.

Ask a Question
Please enter at least 10 characters
More Related Topics