summarize-up-to
A Claude Code mod that summarizes only the oldest part of a conversation and keeps the rest verbatim. It works at any point you choose, including inside long turns that agents drive on their own. It can also make every auto-compaction work this way.
Claude Code's own /compact and auto-compaction summarize the whole conversation. /rewind → Summarize up to here keeps the newest part, but it only lets you cut at a prompt you typed. In sessions driven by other agents, subagents or background tasks, there is often no such prompt anywhere near where you want to cut.
Install
At the prompt of a terminal session:
/plugin install summarize-up-to --marketplace groundnuty/claude-summarize-up-to
From a shell (for example, to set up a remote machine that runs agents):
claude plugin install summarize-up-to --marketplace groundnuty/claude-summarize-up-to
In the desktop app, where /plugin does not run: click + next to the prompt box, then Plugins, Add marketplace with groundnuty/claude-summarize-up-to, then Add plugin.
Installed at user scope, the mod is active in every session you start afterwards on that machine. It needs python3 on the machine to keep each cut across restarts (see below); /summarize-up-to status says whether it is there.
Use
Set the share once; every /compact then summarizes that much of the oldest conversation and keeps the rest verbatim, until you set another share. The setting is per project, so each agent keeps its own, and it outlives restarts.
❯ /summarize-up-to 20%
Set: every /compact in this project now summarizes the oldest 20%, until you set another share.
Now that is everything before the step at 21% ("calls Bash: make test").
21% is the nearest point to 20% that keeps tool calls whole.
Summarized: 128 messages (21%, about 37k tokens). Kept verbatim: 520 messages (79%, about 139k tokens).
Shares are of what the model reads: about 176k tokens of conversation by Claude Code's count.
Type /compact to compact now; /compact full summarizes everything, this once.
❯ /compact
summarize-up-to: summarized everything before the step at 21% ("calls Bash: make test"). That message and everything after it are kept verbatim. Every /compact here summarizes the oldest 20%, until you set another share.
summarize-up-to: saved the cut so that a restart or resume keeps it (corrected 37 links Claude Code wrote to before the compaction).
| Command | What it does |
|---|
/summarize-up-to 20% [notes] | Every /compact in this project summarizes the oldest 20%, until you set another share. The reply shows what that comes to now. Notes go to the next summary |
/summarize-up-to 0% | Every /compact summarizes the whole conversation again, as without the mod |
/compact | Summarizes the share set for this project; until you set one, the /config option Share to summarize on /compact (65% unless changed) |
/compact full | Summarizes the whole conversation, this once |
/summarize-up-to | Lists the cut points: your prompts and the notifications between turns |
/summarize-up-to #12 [notes] | The next /compact only: summarize everything before listed point 12 |
/summarize-up-to cancel | Drops a cut armed with #n |
/summarize-up-to status | Shows the share /compact uses and where it comes from, partial auto-compaction, and when Claude Code auto-compacts |
A cut falls at a prompt or notification, or at a step between two tool round-trips, so long agent-driven turns can be cut too. It never separates a tool call from its result, or a prompt from the reply it asked for. Notes are passed to the summarizer together with any you give /compact <notes>. The mod keeps each project's share in its own store, under the project's folder.
The percentage is a share of what the model reads. That includes what the mod's view of the conversation leaves out: messages from other sessions, attached files, and queued commands. The token figures split Claude Code's own count of the conversation (not the system prompt or tools) by that share. In the end-to-end runs on Claude 5 models, they came within about 15% of what then left the model's input. On Claude 4.x models they ran up to 1.6× high. The percentage is a target. The cut snaps to the nearest point that keeps tool calls whole, which can be some way off when single messages are large. The confirmation says where it landed.
The mod never starts a compaction itself. Claude Code doesn't run a mod's compaction hook on a compaction that same mod started, so the cut would be lost and the whole conversation summarized.