Last reviewed
Correct answer: C. The root CLAUDE.md only; the other two are gone until something reloads them
Explanation
The principle — what survives a compaction depends on how it got into context, not on where it lives or how recently it was said.
Why the key is correct — take the three in turn. Anthropic states that project-root CLAUDE.md survives compaction, because after a compaction Claude re-reads it from disk and re-injects it into the session; that is an active reload rather than the summary having spared it. Rules carrying paths frontmatter behave differently: they enter message history only when their trigger file is read, so a compaction summarises them away with everything else, and they return the next time Claude reads a matching file. Anthropic gives the remedy in the same place — if a rule must persist across compaction, drop the paths frontmatter or move it to the project-root CLAUDE.md. The typed correction has the weakest position of all, since it was only ever a message, and instructions given only in conversation may be lost. Hence one of the three, with the other two recoverable by different routes.
Why the others are wrong — expecting all three to survive treats summarisation as lossless, and also misattributes the root file's survival to the summary rather than to the reload. Grouping by on-disk versus not fails because the path-scoped rule is equally on disk and still does not come back on its own. And recency is not a factor in any of this; the typed correction is the most recent and the most fragile, which is the opposite of what that reasoning predicts.
Remember this — this is why a rule appears to stop working halfway through a long session. Nothing broke; it was summarised, and only the project-root file lets itself back in.
Sources — Anthropic's memory page and the context window page.
Sources
“Project-root CLAUDE.md survives compaction: after /compact, Claude re-reads it from disk and re-injects it into the session.”
“If a rule must persist across compaction, drop the paths: frontmatter or move it to the project-root CLAUDE.md.”
“Put persistent rules in CLAUDE.md rather than relying on conversation history.”
Practise 10 questions on this topic
Take Claude Code Basics — Timed Test 2 (10 questions) — scored instantly, explanation for every question, no login.