/compact in Verboo Code: how to compact context without losing what matters
Back to the blog
Articleinteligência artificialtecnologiaautomação

/compact in Verboo Code: how to compact context without losing what matters

MafraSeptember 30, 20264 min read

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.

Flowchart of /compact in Verboo Code: check usage with /context, compact with instructions using /compact, turn auto-compact on or off in /config, and use /clear when the task changed for good
The three steps to control context in Verboo Code, and the alternative when the topic changed. Verified in the source code on 2026-09-30.

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.

CommandWhat happens
/compactTries session memory compaction; if it cannot, a traditional summary
/compact <instructions>Traditional summary, guided by what you asked to keep
/clearWipes 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:

VariableEffect
DISABLE_AUTO_COMPACTTurns off automatic compaction only; manual /compact keeps working
DISABLE_COMPACTTurns off all compaction, including the /compact command
CLAUDE_CODE_AUTO_COMPACT_WINDOWCaps 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:

MessageWhat 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 issuesNetwork 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.

Enjoyed this article?
Share knowledge with your network.
// Read also

Related articles