← Claude Code Hub
Jul 9, 2026 · 4 min read ✦ Tip #129

Free up context in Claude Code without losing what matters

Your session crosses 50% context and `/compact` summarizes all of it, including the fix you just landed. There's a way to compress only the exploratory past and keep the recent work in full detail.

A session before and after Summarize up to here: the exploration collapses into a summary and the recent messages stay intact

TL;DR You've spent half a session exploring, trying things, going back and forth, and you finally land the solution. Context is already past 50% and you reach for /compact, but /compact summarizes the whole conversation right when the one thing you want to keep intact is the last stretch. In the Rewind menu, Summarize up to here does the opposite: it compresses everything before the point you pick and leaves the recent messages untouched. Context surgery instead of demolition.

Restore is not the same as summarize

The Rewind menu (/rewind, or Esc twice on an empty prompt) lists every prompt you've sent this session. On the message you pick, the three restore options revert state: code, conversation, or both. The two summarize options don't touch your files. They compress part of the conversation into an AI-generated summary to free up context-window space. It's like /compact, but targeted: instead of summarizing the whole session, you choose which side of the message to compress.

What it looks like

> /rewind        (or Esc Esc on an empty prompt)

┌─ Rewind ──────────────────────────────────────────┐
│ ○ Message 3:  "what if we extract a hook here"    │
│ ● Message 8:  "ok, this is the right solution"    │ ← boundary
│ ○ Message 12: "add the test and document it"      │
│                                                   │
│   Restore code and conversation                   │
│   Restore conversation                            │
│   Restore code                                    │
│   Summarize from here                             │
│ ▸ Summarize up to here                            │ ← compresses what came before
│   Never mind                                      │
└───────────────────────────────────────────────────┘

Setup

1. Open the Rewind menu

/rewind, or press Esc twice on an empty prompt. If the prompt has text, Esc Esc clears it instead of opening the menu; the text is saved to your history, so press Up to bring it back.

2. Pick the boundary message

Select the first message you want to keep intact, usually the one where you landed the solution. Everything before it gets summarized; that message and everything after it stays exactly as is.

3. Choose Summarize up to here

It compresses everything before that point into a summary. You land at the end of the conversation with an empty prompt and a lighter context window, without having undone any of your work.

4. (Optional) Steer the summary

You can type instructions to guide what it focuses on, the same way you would with /compact Focus on the API changes.

up to here vs from here

The one real point of confusion is which is which. The boundary is always the message you select:

Option What it compresses What it keeps intact Use it to
Summarize up to here Everything before the message The message and everything after Compress the exploratory start, keep the recent work
Summarize from here The message and everything after Everything before Drop a side discussion, keep the early context

Either way, the original messages stay in the session transcript, so Claude can reference them if it needs to. And not a single file on disk is touched.

When to reach for this over /compact or fork

  • Versus /compact: /compact summarizes the whole conversation and leaves you at the mercy of what it decides to keep. You could ask it to prioritize the last stretch with instructions, but now it's native and targeted: you pick the exact boundary.
  • Versus fork: Summarize up to here compresses in the same session. If what you want is to branch off and try a different approach without touching the original, start with --fork-session.
  • It's the natural companion to classic Rewind: that one undoes state; this one compresses history without undoing anything.

Official docs: Checkpointing

If the context already filled up and you get "Prompt is too long", the end of the message tells you whether compacting will help: "Prompt is too long": when /compact can't fix it.

Found this useful? See more of wmedia.es in your Google results.

Add wmedia.es as a preferred source on Google
FREE GUIDE

From the terminal to Desktop, as a guide.

Moving from the terminal to Claude Code Desktop is easy to start and easy to leave half done. 8 pages to keep beside you: day one, the map of the window, the shortcuts and your first cloud routine.

  • 1. Day one import your sessions
  • 2. The window map and shortcuts
  • 3. Conversations which to open and two prompts
  • 4. Panels which to use for what
  • 5. Routines your first in the cloud
Are you a professional Web developer?

You'll receive the guide by email · Unsubscribe anytime

of 8
#

Wmedia · 8 pages
FREE GUIDE · 8 pages · 2 prompts

From the terminal to Desktop, as a guide.

Moving from the terminal to Claude Code Desktop is easy to start and easy to leave half done. 8 pages to keep beside you: day one, the map of the window, the shortcuts and your first cloud routine.

Are you a professional Web developer? · Unsubscribe anytime

Moving from the terminal to Claude Code Desktop?