Speed up a slow Grok CLI or Build session
Speed up a slow Grok CLI or Build session
Long Grok Build / CLI runs often spend turns on web search, planning, subagents, or rediscovering project conventions. The CLI exposes flags and files that cut that work without inventing hidden “fast mode” switches.
Put durable rules on disk
Load project conventions once via AGENTS.md (and related rule files) so each turn does not re-ask for build commands and layout. See Make Grok Build follow your AGENTS.md. Confirm discovery with:
grok inspect
Trim what a single run is allowed to do
From the CLI reference, useful one-shot flags:
| Flag | Effect |
|---|---|
--disable-web-search |
Skip built-in web search for that session |
--no-plan |
Disable plan mode for that session |
--no-subagents |
Keep work on the main agent |
--max-turns <n> |
Cap how many agent turns the run may take |
-m, --model <id> |
Pin a model (grok models lists what you can use) |
--effort <level> |
Set reasoning effort for the run |
Example headless pass that stays local and bounded:
grok -p "Summarize src/ and list failing tests" \
--disable-web-search \
--no-plan \
--no-subagents \
--max-turns 20
Interactive TUI sessions can still use /model, /compact, and related slash commands from Modes and Commands when a long thread grows heavy. See Compact a long Grok Build session.
Prefer headless for scripted jobs
For scripts and bots, start with a prompt in headless mode:
grok -p "Explain the architecture" --output-format streaming-json
Headless usage is documented on the Build overview. Pair it with --cwd, and use --always-approve only when you accept auto tool execution. Permission --allow / --deny rules tighten the sandbox when you need them.
Memory and weekly usage
- Cross-session memory is off by default. Turn it on only when you need notes across sessions — see Enable cross-session memory in Grok Build. Extra memory I/O is optional cost, not a free speedup.
- Long coding tasks draw from the shared weekly usage pool on paid plans. Check Settings → Usage if the CLI feels stuck after you hit limits — see Understand Grok Build weekly usage limits.
Pitfalls
- There is no documented consumer toggle that promises a fixed wall-clock latency for every prompt. Use the flags and rule files above.
--always-approve/--yolospeeds approvals by skipping them — only use it when that risk is acceptable.- Consumer Grok chat on grok.com is a different surface from the Build CLI; this page is for
grok/ Grok Build.