/clear in Verboo Code: what it erases and what it keeps
Back to the blog
Articleverboo codedev toolshow totutorial

/clear in Verboo Code: what it erases and what it keeps

MafraNovember 30, 20265 min read

You type /clear to start a new task and the prompt goes blank. Then the doubt hits: what exactly was erased? The conversation, the tasks that were running, the plan you had built, the edit history? The short answer is that /clear wipes the session, not the project. It opens a new session, and the old one stays on disk, ready to be resumed. This guide goes through, item by item, what the command erases and what it keeps in Verboo Code.

What does /clear do in Verboo Code?

It wipes the conversation messages and frees up the context window, without killing the process or leaving the project. The description in the source is literal: "Clear conversation history and free up context". The command also answers to the aliases /reset and /new.

Before clearing, Verboo Code runs the SessionEnd hooks with reason clear. After clearing, it runs the SessionStart hooks with source clear. In other words: you can save something from the session that is leaving and inject context into the one being born.

Flowchart of /clear in Verboo Code: wipes the conversation, runs session-end hooks, keeps background tasks, clears caches and opens a new session, with the old conversation still available to /resume
What happens at each step of /clear and why the old conversation is not lost. Verified in the source code on 2026-11-30.

What does /clear erase?

Everything it erases lives in the session memory. None of it is a project file on disk.

ItemAfter /clear
Conversation messagesErased
Foreground tasksKilled
Context, read-file and suggestion cachesReset, so files must be read again
MCP connectionsRestarted and reconnected
/rewind snapshot historyReset
Working directoryBack to the project's original directory
Session title, tag, name and colorCleared on the new session

Two items on that list catch people off guard. The first is /rewind: because the snapshot history is reset, an edit made before /clear no longer shows up in the new session's /rewind. If you are going to need to undo something, do it before clearing. The second is the directory: if you had cd'd elsewhere or added a folder with /add-dir, /clear puts you back in the directory where the project was opened.

What does /clear keep?

Files, configuration and history stay intact. The command does not touch what is on disk.

ItemAfter /clear
Project filesIntact
Memory files, such as CLAUDE.md and AGENTS.mdKept; only the cache is re-read from disk
Background tasksPreserved and still running
Model, theme, permissions and settingsKept
Current worktreeKept
Transcript of the old conversationKept on disk

Background tasks are the most useful detail. When you send a command to the background with Ctrl+B and then run /clear, that task keeps running. /clear only kills what is in the foreground holding the prompt.

How do you get the conversation back after /clear?

With /resume. /clear does not delete the previous conversation file: it creates a new session and records the old one as the parent session, to keep the lineage. The old transcript stays on disk, and you go back to it whenever you want.

/resume

The command takes a search term, handy when you do not remember the session id:

/resume migration

From the terminal, the same path has its own flag. -r opens the picker or resumes an id, and -c resumes the most recent conversation in the directory:

verboo -r "migration"
verboo -c

How do you make /clear open with the context you want?

With a SessionStart hook that only fires when the source is clear. Whatever the hook prints is attached to the new session's context, so the agent starts clean but already knows what you decided it needs to know.

Add this to the project's .verboo/settings.json:

{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "clear",
        "hooks": [
          { "type": "command", "command": "cat .verboo/base-context.md" }
        ]
      }
    ]
  }
}

The matcher receives the SessionStart source, and clear is one of them. The same file also accepts startup, resume and compact, so you can tell apart what loads when the session starts from scratch and what loads when it is resumed.

On the other side, the SessionEnd hook with reason clear runs before the cleanup and is there to record a summary of what was going on. A command that dumps the state into a file and the SessionStart that reads that file handle the handoff between the session that dies and the one that is born.

There is a limit: SessionEnd on /clear runs on a short time budget, 1.5 seconds by default, adjustable through the CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS variable. A script that scans the whole repository will not finish in time. Save only what is fast: the list of changed files, the last decision, the next step.

Does /clear work in non-interactive mode?

Not as a command. In the source, /clear is marked as not supported in non-interactive mode, on the grounds that there each run already creates its own session. If you run Verboo Code with -p, every call starts from scratch by definition, and there is no accumulated conversation to clear.

When should you use /clear instead of /compact?

When the next task does not depend on the previous one. /compact swaps the history for a summary and keeps the session alive, which is better when you are in the middle of the same work. /clear starts with no summary at all, which is better when the old summary would only get in the way. For the compaction walkthrough, see the /compact in Verboo Code guide.

Clearing context without losing the history is what makes long sessions sustainable. Verboo Code runs this flow in the terminal with unlimited tokens on the plan: create your account at verboo.ai, install the CLI and run /clear on your next topic switch.

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

Related articles