When should you use /compact?
Published
I noticed that picking up an AI conversation after a long break can use up a lot of tokens.

What goes into a reply
Picture a debugging thread where you have already pasted pages of test output, and your next message is simply, “Run it again.” Even though you typed three words, the tool may bundle system and project directions, earlier turns, and all that prior test output right alongside your short request.
What actually reaches the model on a given turn is the active context, while the context window is the model’s capacity limit measured in tokens. A tiny prompt can still trigger a massive request if the active context behind it is packed with history.
Your UI history can be even longer than that active context. Most tools keep older turns visible on screen for your reference even after trimming or summarizing what gets sent to the model.
How long caching lasts
When a request begins with an eligible identical input prefix, the provider can reuse earlier computation for as long as the cache stays valid. New input and the model’s new answer still require fresh work, and cached input still takes up room in the context window. After a long break, a cache miss means all the old context carried into your next turn has to be processed again.
| Provider | API | Chat tools |
|---|---|---|
| OpenAI | GPT-5.6 onward defaults to at least 30 minutes. Responses API offers a 12-hour minimum. | No uniform lifetime published for Codex subscriptions. |
| Anthropic | Claude API defaults to 5 minutes, refreshes on hits, and offers 1 hour. | Claude Code defaults to 1 hour for the main chat within the subscription quota and 5 minutes with an API key or credits. |
| No fixed duration published for Gemini automatic caching. Explicit caching defaults to 1 hour on supported older models. | No uniform lifetime published for Antigravity subscriptions. |
What /compact does
/compact is a manual slash command in supported tools that replaces older context in the same thread with a structured summary. In our debugging case, that summary can hold onto your code changes, test results, and next step while dropping the bulk of the raw logs.
Compacting is a trade-off, though: a summary can leave out small details you later wish you had, and generating the summary uses tokens of its own.
The best time to run it is right when a phase of work wraps up, or just before a long break when you expect to resume the thread later and want a lighter payload once the cache expires.
If the tool supports custom thresholds, I set it to compact once the conversation has used 30% of the available context, while still waiting for the current reply to finish. This keeps old content from piling up too much and lets the current task finish.