Skip to content

Where Grok CLI stores GROK.md, settings, and MCP servers

“Grok CLI” is several projects; this page covers the dominant one: superagent-ai/grok-cli (npm grok-dev, formerly @vibe-kit/grok-cli) — the open-source terminal coding agent for xAI’s Grok API, not an official xAI product. Its file layout has churned more than any other tool here: custom instructions changed name and MCP configs changed file between 0.x and 1.x, so what’s on your disk depends on when you installed it. ~ is your home directory.

ArtifactGlobalPer-projectFormat
Custom instructions (0.x)~/.grok/GROK.md.grok/GROK.mdMarkdown
Instructions (1.x)AGENTS.md (git root → cwd), AGENTS.override.mdMarkdown
User settings~/.grok/user-settings.jsonJSON
Project settings.grok/settings.jsonJSON
MCP servers (0.x).grok/settings.jsonmcpServersJSON map
MCP servers (1.x)~/.grok/user-settings.jsonmcp.serversJSON array

Custom instructions: GROK.md, then AGENTS.md

Section titled “Custom instructions: GROK.md, then AGENTS.md”

Through the 0.x releases, custom instructions were GROK.md — global in ~/.grok/GROK.md, per-project in .grok/GROK.md, project winning on conflict. Note the project copy lives inside .grok/, not at the repo root the way CLAUDE.md does.

~/.grok/user-settings.json is the global config: apiKey, baseURL (default https://api.x.ai/v1 — the CLI drives any OpenAI-compatible endpoint), defaultModel, custom subAgents (name + model + instruction), hooks (lifecycle handlers like PreToolUse/PostToolUse), Telegram and sandbox settings. The apiKey field makes this file a plaintext credential store — keep it out of backups you share. GROK_API_KEY, GROK_BASE_URL, and GROK_MODEL environment variables override it for CI.

The per-project file holds what should differ per repo: model (e.g. "grok-code-fast-1") plus sandbox/LSP options, shallow-merged over the user settings with the project winning. In 0.x it also held MCP servers — see below.

MCP servers — which file, depends on the version

Section titled “MCP servers — which file, depends on the version”

Either way, the env and headers values are where API keys end up — both files are secret-adjacent even when the rest is shareable.

~/.grok/workspace-trust.json records per-workspace sandbox/host-mode decisions; project-side, .grok/computer/ (screenshots) and .grok/generated-media/ (image/video output) are working artifacts, not context — safe to gitignore.

Quartermaster’s scanner indexes both generations of this layout — GROK.md rules, .grok/settings.json and ~/.grok/user-settings.json with one record per MCP server — into one searchable registry alongside Claude Code, Cursor, Codex, and 8 more tools, and can convert a stranded GROK.md to AGENTS.md or CLAUDE.md. Secrets are never indexed — the apiKey field is never read, and env/header key names are kept while values are dropped. See the full discovery map or the quickstart.