← all articles

Claude Code compact dropped the approach you rejected? What survives compaction and how to keep it

Claude Code compacted, kept the code, and now it's proposing the approach you shot down an hour ago.

Claude Code compact replaces your conversation with a structured summary as you approach the auto-compact window, or when you run /compact. Anthropic's docs, checked December 3, 2026, say your project-root CLAUDE.md and auto memory come back from disk afterward. What you only said in the chat survives as far as the summary kept it, so an approach you rejected an hour ago can disappear. Put decisions that must stick in CLAUDE.md, or tell /compact what to keep.

If the reason you rejected it was an error that scrolled past in your terminal, and that terminal was the window you were working in after you installed ReMynd, ReMynd can help you find that output again.

Lost the error that ruled the approach out? Download ReMynd

Where did that decision live?

That's the better question to ask. Compaction treats files on disk and words in the conversation differently. A decision you typed into the chat is conversation. A decision written into the project-root CLAUDE.md is a file, and Anthropic's table lists it as re-injected from disk after compaction.

If the agent is already looping back to a dead end, Claude Code keeps suggesting the fix I already tried covers that symptom. This page is about how compaction can cause it.

Diagram with the eyebrow Claude Code compact, titled What survives compaction, subtitled Files on disk come back. The chat becomes a summary. Left card, Reloaded from disk: project-root CLAUDE.md, auto memory, the plan from plan mode, up to five recent files. Right card, highlighted in claret, Only in the summary: what you said in the chat, approaches you rejected, context hooks added earlier, path-scoped rules until needed. A dark bar at the bottom reads: Decided it in chat? Write it in CLAUDE.md so it comes back.

What comes back from disk and what only survives in the summary, per Anthropic's context window docs. Illustration by ReMynd.

The 5 rules of Claude Code compaction

These five rules cover what Anthropic's docs say about compaction.

  • The conversation becomes a summary. Anthropic says that when a long session compacts, Claude Code summarizes the conversation history to fit the context window. The summarization happens without appearing in your terminal.
  • The summary picks what to keep. Anthropic's context engineering post says the model preserves architectural decisions, unresolved bugs and implementation details while discarding redundant tool outputs or messages. Nothing in that list promises to keep an approach you rejected.
  • Files on disk come back. Project-root CLAUDE.md, unscoped rules and auto memory are re-injected from disk. If the session started with a Git status snapshot, Claude Code reads a fresh one.
  • Recent files are re-read, with limits. Claude Code re-reads up to five of the files Claude read or edited, most recently modified first. A file over 5,000 tokens comes back as a path reference without its content.
  • Some instructions get trimmed. Invoked skill bodies come back capped at 5,000 tokens per skill and 25,000 tokens total, oldest dropped first. Rules with paths frontmatter are summarized away, and Claude Code reloads them on demand when Claude reads, writes or edits a matching file.

Claude Code context window full: what should you do?

Nothing, if you're fine with the automatic pass. Claude Code auto compact runs as you approach the auto-compact window, so a long conversation doesn't end your session. Claude Code can also compact a conversation you leave idle.

If you want control, Anthropic lists these options before the automatic pass runs:

  1. Compact with a focus. Run /compact with instructions, like /compact keep the approaches we rejected and why. Anthropic says the summary then keeps what you choose instead of what the automatic pass guesses is important.
  2. Compact part of the conversation. Run /rewind, pick a message and choose Summarize from here or Summarize up to here.
  3. Change when it runs. Run /autocompact with a token count, like /autocompact 500k.
  4. Clear between tasks. Run /clear when you switch to unrelated work.
  5. Check usage. Run /context for a live breakdown of what is using your context window.

What survives Claude Code compaction?

Here is how each kind of context comes through a compaction, from Anthropic's table.

What you hadAfter compactionSource
Project-root CLAUDE.md and unscoped rulesRe-injected from diskClaude Code docs
Auto memoryRe-injected from diskClaude Code docs
The plan Claude wrote in plan modeRe-injected from diskClaude Code docs
Files Claude read or editedUp to five re-read, most recently modified firstClaude Code docs
Rules with paths frontmatter, nested CLAUDE.mdReloaded on demandClaude Code docs
Context that hooks added earlierSummarized with the rest of the conversationClaude Code docs
What you said in the chatKept only as far as the summary keeps itClaude Code docs

A simple decision path

Stop at the first step that fixes it.

  1. Say it again, once. Tell Claude which approach you rejected and why, in one line, so the current conversation has it.
  2. Write it down. Add the rejected approach and the reason to your project-root CLAUDE.md, which is re-injected from disk after compaction. How to update CLAUDE.md walks through keeping it current.
  3. Steer the next compaction. Before a long new task, run /compact with a focus that names the decisions to keep.
  4. Start clean when the task changes. On compact vs clear, Anthropic's docs say to run /clear for unrelated work, so old conversation doesn't crowd out the files you need next.
  5. Find the evidence. If you can't remember what broke, search your screen history for a word from the error, then paste it into the prompt or CLAUDE.md.

A habit worth building: when you reject an approach, write one line in CLAUDE.md right then, with the reason. Anthropic's own advice is that a rule that must persist across compaction belongs in the project-root CLAUDE.md.

Where ReMynd fits

ReMynd is a desktop app that gives your computer local photographic memory, for you and your AI agents. It locally captures your screen history and keeps the searchable index on your computer.

So the failing test output or stack trace that made you reject an approach, if your terminal was the window you were working in after you installed ReMynd, becomes searchable by what it said. ReMynd's Claude switch sets up Claude Code with a ReMynd command and a skill, so Claude Code can search that history instead of you pasting it back in.

That is the idea behind giving an AI coding agent memory of your actual work. If you need to undo files rather than recover a decision, Claude Code rewind covers what /rewind restores. For the wider engineering setup, see ReMynd for engineers.

Your screen history is stored on your computer by default, and nothing is uploaded to us unless you turn on optional cloud sync. You can pause capture or block any app or site. That's how ReMynd's own pages put it, as of December 2026.

Claude Code uses Anthropic's model under your account, so what it retrieves may be sent to that model, the same way anything you paste into it would be. On a Mac, ReMynd needs screen recording permission, which Apple's guide puts in System Settings under Privacy & Security, Screen & System Audio Recording.

Honest limits

These are the limits I'd want to know before installing anything for this.

  • ReMynd doesn't restore Claude Code's conversation or change what compaction keeps. Use CLAUDE.md and /compact with a focus for that.
  • ReMynd captures only what is on your screen, starting from install. It cannot recover past work, and it cannot see background or cloud agents.
  • Text recognition reads the window you're working in, so output in a window behind it won't be searchable by its words.
  • On a Mac, ReMynd needs Apple silicon and macOS 15 or later. ReMynd also runs on Windows 11 (x64 or arm64).

The short version

Compaction keeps what's on disk and summarizes what you said, so decisions that only lived in the chat can go missing. If the session itself crashed instead, recovering a Claude Code session after a crash is the next read.

Want the error that ruled an approach out to stay findable? Download ReMynd

common questions

What does /compact do in Claude Code? +
Anthropic's docs say /compact replaces the conversation with a structured summary, and you see a Conversation compacted message. Most startup content, like your project-root CLAUDE.md and auto memory, reloads from disk afterward.
Why did Claude Code forget what I told it after compacting? +
Compaction summarizes the conversation history to fit the context window. Anything that only lived in the conversation, like an approach you rejected an hour ago, is in that summary only if the summary kept it. Rules in the project-root CLAUDE.md are re-injected from disk instead.
What should I do when the Claude Code context window is full? +
Claude Code compacts automatically as you approach the auto-compact window, so the session keeps going. You can act first with /compact plus a focus, /rewind with Summarize from here, /autocompact to change when it runs, or /clear between unrelated tasks. Run /context to see what is using space.
Should I use /compact or /clear? +
Anthropic's docs say to run /clear when you switch to unrelated work. Use /compact with a focus when you want to keep going on the same task with a shorter conversation.
How do I make a rule survive compaction? +
Anthropic's docs say to drop the paths frontmatter from the rule or move it to the project-root CLAUDE.md, because compaction summarizes path-scoped rules away and Claude Code reloads them on demand when Claude reads, writes or edits a matching file.
Can ReMynd bring back what Claude Code compacted away? +
No. ReMynd doesn't restore Claude Code's conversation. It helps you find what was on your screen in the window you were working in, after you installed it, like the error output that made you reject an approach, so you can put it back in a prompt or CLAUDE.md.