Grok
Grok CLI is xAI's command-line tool. This page covers the global instructions file and how Grok loads rule files.
Configuration#
Grok keeps its global config in the ~/.grok directory.
Global instructions#
Put the following in ~/.grok/AGENTS.md:
Rule file load order#
Grok reads rule files as follows:
- It loads
~/.grok/AGENTS.mdas global rules in every session. - Inside a git repository, it walks from the repo root down to the current working directory and reads
AGENTS.mdin each directory, plus compatible names such asAGENT.mdandCLAUDE.md. - On conflicts, files in deeper directories take precedence.
- Files ignored by
.gitignoreare skipped.
Run grok inspect to see which rule files were picked up.