BUILD / clear-grok-build-memory-from-the-cli

Build

Clear Grok Build memory from the CLI

When stored notes are wrong, stale, or mixed across projects, wipe them with the Build CLI instead of guessing which markdown file to delete by hand. Official CLI Reference documents grok memory clear with workspace, global, and all scopes.

Pick the scope first

Flag What it clears
--workspace Memory for the current project only
--global Preferences that apply everywhere
--all Both workspace and global stores

Workspace notes are the usual target after a messy project. Use --global when a preference you saved for every repo is wrong. Use --all only when you want a full clean slate.

Clear from a shell

  1. cd into the project whose workspace memory you want to wipe (for --workspace).
  2. Confirm memory is the Build store you mean — this command does not touch grok.com chat memory or Grok Bot memory files.
  3. Run one of:
grok memory clear --workspace
grok memory clear --global
grok memory clear --all
  1. Start a new Build session (/new or fresh grok) with memory still enabled if you want capture to begin again after the first completed turn.

Check before and after

grok inspect

Use grok inspect to confirm which config sources and discovery paths the client sees for this directory. Inside the TUI, /memory should show an empty or reduced list for the scope you cleared — Browse memories with /memory.

When to clear vs edit

  • Clear a scope when many notes are wrong or you switched projects and the store is polluted.
  • Edit a single markdown topic when one fact is wrong and the rest should stay — open /memory, find the file, then edit it on disk (What Grok Build memory keeps).
  • Force pending writes with /flush before you quit a session you still want to keep — Flush conversation memory.

Pitfalls

  • --all removes both scopes. Confirm before you run it.
  • Clearing does not disable memory. [memory] enabled = true / GROK_MEMORY=1 still applies to new sessions until you turn it off.
  • Project .grok/config.toml does not own the memory store; clearing still runs against the user Build home under ~/.grok/ (or $GROK_HOME).