# What does Claude Code lose when it compacts?

Canonical: [What does Claude Code lose when it compacts?](https://contextingo.com/answers/what-does-claude-code-lose-when-it-compacts)

Locale: en

Purpose: Compaction replaces the conversation with a shorter summary. Instruction files in the project root, such as CLAUDE.md, are loaded again afterwards; instructions and findings that existed only in the conversation depend on what the summary kept. Saving them as project records before compaction keeps them available either way.

Content updated: 2026-10-29

Source revision: content.ts 2026-10-29

Maintenance owner: the Contextingo site owner

[Topic map](https://contextingo.com/llm/topics/answers.md) · [Complete scoped map](https://contextingo.com/sitemap.md)

**Short answer.** Compaction replaces the conversation with a shorter summary. Instruction files in the project root, such as CLAUDE.md, are loaded again afterwards; instructions and findings that existed only in the conversation depend on what the summary kept. Saving them as project records before compaction keeps them available either way.

## What is re-read and what is not

- Re-read from disk after compaction: the project instruction files Claude Code loads at the start.
- Kept only if the summary kept it: decisions, findings, the reason you ruled something out, the exact error message.

The details most worth keeping are usually the ones a summary drops first, because they look minor: why an approach failed, which file the problem was really in.

## What to do about it

- Save findings and failed attempts as you go, not at the end. They are then independent of the conversation.
- Let the hook do it. The Contextingo hook saves what the summary would lose after a compaction, and leaves a checkpoint after a commit.
- After compaction, ask for the brief again: your AI reads the requirements first and then only what changed.

Source for the Claude Code behaviour: the Claude Code memory documentation, section on instructions that seem lost after `/compact`, read on 26 October 2026.

## Go deeper

- [Keep what Claude Code found from one session to the next](https://contextingo.com/guides/keep-claude-code-findings-between-sessions)
- [Why long agent chats get worse, and how to restart without losing the thread](https://contextingo.com/blog/context-rot-long-ai-chats)

## Questions

### Should I avoid compaction?

No. Compaction is useful. Just do not make the conversation the only place a finding exists.

### Does the hook run by itself?

Yes, once the setup command has installed it in Claude Code and Codex. It runs locally on your machine.
