Compact a long Grok Build session
Compact a long Grok Build session
A long Grok Build TUI session fills context with turns, tool output, and file reads. Official Modes and Commands lists slash commands to check usage, compact history, rewind a turn, or start clean while you stay in the CLI.
This page is Build’s TUI. API compaction is Use context compaction. Bot Reset chat is Reset Grok Bot chat without cloning.
Check context fill
- Start or resume Build in your repo (
grokafter install; see Start a Grok Build session in your repo). - Run
/contextto view current context usage. - Keep coding while there is room. When replies degrade or the meter climbs, compact or rewind before the window is full.
Compact history
/compact
/compact keep the auth bug thread and the failing test names
/compact [context] folds conversation history so the session can continue with a smaller working set. The optional text steers what matters to keep.
Run /context again after compacting to confirm usage dropped.
Rewind or start clean
| Command | What it does |
|---|---|
/rewind |
Rewind to a previous turn |
/new (alias /clear) |
Start a new session |
/resume |
Resume a previous session |
/sessions |
Switch, rename, or close active sessions |
/export |
Export the conversation to a file or clipboard |
/transcript |
View the full transcript in your pager ($PAGER) |
Use /rewind when recent turns went wrong and you want an earlier point. Use /new / /clear for a blank session in the same TUI. Use /resume or /sessions to bring an older session back.
Pitfalls
/compactis a Build TUI command. It does not call the API compaction endpoint and does not Reset a Grok Bot chat.- Compacting shrinks history for the active session. It does not mint a new Bot or a new cloud computer.
/newand/cleardrop the live thread. Export or copy anything you still need before you clear./usageopens credit usage / billing./contextshows session fill. Read both on a long coding day.