Sessions & Memory

A session is one saved chat. Learn how to resume, rename, free space, and (optionally) use memory.

Finish at least one real Grok chat

Sessions in everyday language

A session is one saved conversation with Grok: your messages, its answers, and tool history. Sessions are stored on your machine (under a folder like ~/.grok/sessions/) so you can close the laptop and continue tomorrow.

You want to…Do thisWhat it means
Start clean/newNew conversation, same project folder
Continue yesterdaygrok -c in that folderReopens the most recent session there
Pick an old chat/resumeShows a picker list
Name it/rename boss-fightEasier to find later
Free space in a long chat/compact keep important decisionsSummarizes older turns (also auto-compacts near full context—default ~85%, tunable)
See what is filling the desk/contextCategory breakdown of context use
Quick summary without compacting/recapSummarize the session so far
Try a side idea safely/forkStarts a side chat from this point (keeps history so far; original chat stays intact)
Undo recent turns/rewindRolls the session timeline back
Search the transcript/find keywordsSearch the message history above the typing box
Context window (simple version)

Grok can only pay attention to a limited amount of text at once—like a desk that holds a fixed number of pages. When the desk is full, old pages must be summarized or removed (/compact) or you start a new session and keep notes in project files. Grok also auto-compacts once usage hits the configured threshold (default 85% in the official session docs).

Memory (optional)

Memory tries to remember facts across sessions (your preferences, project decisions). It is experimental and off by default. Many people instead write an AGENTS.md file in the project (later lesson)—that is often clearer.

Always available: /remember the build command is npm run build saves one note immediately.

Require memory enabled (--experimental-memory or GROK_MEMORY=1, plus backend where needed):

  • /memory (alias /mem) — browse/manage; /memory on|off
  • /flush — write session knowledge to memory now
  • /dream — consolidate/reorganize memories

Details are in the official memory guide; skip until you need cross-session recall.

Habit to build

After each meaningful milestone, /rename the session and write two bullet notes into a project file called DECISIONS.md. Future-you (and future Grok) will thank you.

Quick check

1. A “session” is…
2. Which memory command is always available without enabling experimental memory?