Long session, the agent starts forgetting what you agreed on an hour ago, and then the warning shows up: context is running out. The answer is not to restart from scratch and lose everything. It is to compact. /compact replaces the conversation history with a summary, and you decide what that summary must keep. This guide covers the commands, when Verboo Code compacts on its own, and what to do when compaction fails.
What does /compact do in Verboo Code?
It clears the conversation history and leaves a summary of what happened in the context. The session goes on, same project and same agent, just taking far fewer tokens of the context window.
The command's description in the source is literal: "Clear conversation history but keep a summary in context. Optional: /compact [instructions for summarization]". It also works in non-interactive mode, and Ctrl+O opens the full summary.
How do I see how much context is used?
Run /context. In an interactive session it shows current usage as a colored grid; in non-interactive mode it prints usage as text.
/context
Check before compacting. Compacting at 20% usage just spends a model call to summarize very little.
How do I compact and say what to keep?
Write the instructions after the command. They go into the summary request, so the summary keeps what you named instead of deciding on its own.
/compact keep the list of changed files, the new schema of the orders table and the decision not to use Redis
Without instructions, Verboo Code first tries session memory compaction, which does not accept custom instructions. If that does not apply, it falls back to traditional compaction, which builds the summary with a model call. With instructions, it goes straight to the traditional path. In practice: use instructions whenever there is a decision or a file name you cannot lose.
| Command | What happens |
|---|---|
/compact | Tries session memory compaction; if it cannot, a traditional summary |
/compact <instructions> | Traditional summary, guided by what you asked to keep |
/clear | Wipes the conversation, no summary |
When does Verboo Code compact on its own?
When context gets close to the limit and Auto-compact is on. The trigger is the model's effective window minus 13,000 tokens of headroom. The effective window already subtracts the space reserved for the summary, up to 20,000 tokens.
To turn it on or off, open /config and toggle Auto-compact. You can also control it with environment variables:
| Variable | Effect |
|---|---|
DISABLE_AUTO_COMPACT | Turns off automatic compaction only; manual /compact keeps working |
DISABLE_COMPACT | Turns off all compaction, including the /compact command |
CLAUDE_CODE_AUTO_COMPACT_WINDOW | Caps the window used in the calculation, so it compacts earlier |
export DISABLE_AUTO_COMPACT=1
Can I run something before compaction?
Yes. Verboo Code fires the PreCompact and PostCompact hooks, and the pre hook is told whether the compaction is manual or auto. A PreCompact hook can also return extra instructions, which are appended after yours. To set up hooks, see the Verboo Code hooks guide.
What to do when /compact fails?
Three messages appear in the source, each with a different way out:
| Message | What to do |
|---|---|
Not enough messages to compact. | The conversation is still short. Keep working; there is nothing to summarize |
Compaction interrupted · This may be due to network issues | Network failure or incomplete response. Run /compact again |
Conversation too long. Press esc twice to go up a few messages and try again. | Even the summary does not fit. Press Esc twice, go back a few messages and try again |
Automatic compaction stops trying after 3 consecutive failures, so it does not burn calls on a session that already blew past the limit. If you got there, compact manually with /compact or start fresh with /clear.
When to use /clear instead of /compact?
When the next task does not depend on the previous one. /compact keeps a summary in context, and that summary still costs tokens and can pull the agent back to the old topic. /clear starts clean.
A long session stops being a problem when you control what the agent remembers. Verboo Code runs this workflow in the terminal with unlimited tokens on the plan: create your account at verboo.ai, install the CLI and run /compact in your first long session.



