Settings

Reference

Environment variables

Paths and auth

VariableDefaultDescription
GROK_HOME~/.grokHome for config, auth, sessions, skills, plugins, and logs.
XAI_API_KEYAPI key when not using browser/session login (CI and headless).

Models and updates

VariableDefaultDescription
GROK_DEFAULT_MODELcatalog / configSession default model (same idea as -m / --model).
GROK_WEB_SEARCH_MODELbuilt-inModel used by the web_search tool.
GROK_MODELS_BASE_URLCustom inference base URL; model list from {base}/models.
GROK_MODELS_LIST_URL{GROK_MODELS_BASE_URL}/modelsOverride model-list URL when it differs from the default.
GROK_XAI_API_BASE_URLhttps://api.x.ai/v1xAI API base for API-key auth.
GROK_DISABLE_AUTOUPDATERunset (updates allowed)If set, suppress auto-updater for this process (CI/containers).

Tools, sandbox, and features

VariableDefaultDescription
GROK_SANDBOXoffSandbox profile: off, workspace, read-only, strict (or a custom profile name). Same as --sandbox.
GROK_SANDBOX_AUTO_ALLOW_BASH0Auto-allow bash inside an active sandbox (1/0).
GROK_RESPECT_GITIGNOREuse config if unsetForce gitignore filtering for search/read tools (1/0); overrides [tools] respect_gitignore.
GROK_WEB_FETCH0Enable the web_fetch tool (1/0). Off by default for security.
GROK_WEB_FETCH_PROXYEgress proxy URL for web_fetch.
GROK_MEMORY0Enable cross-session memory (1/0).
GROK_SUBAGENTS0Enable subagents / the task tool (1/0).
GROK_AGENTgrok-buildBuilt-in agent name, profile, or absolute path to an agent definition.
GROK_WRITE_FILE1Disable the write tool with 0 (read-only sessions).
GROK_TOOL_SEARCH1On-demand MCP tool discovery for large toolsets (1/0).
GROK_LSP_TOOLS0Enable the LSP code-intel tool (1/0).

UI and appearance

VariableDefaultDescription
GROK_THEMEbuilt-inColor theme.
GROK_SHOW_THINKING_BLOCKS1Show thinking/reasoning blocks in the TUI (1/0).
GROK_GROUP_TOOL_VERBS1Fold consecutive read/search/list tool rows (1/0).
GROK_COLLAPSED_EDIT_BLOCKS0Collapse edits to one-line +N/-M summaries (1/0).
GROK_PROMPT_SUGGESTIONS1Next-prompt ghost text after each turn (1/0).
GROK_SCROLL_SPEED50Mouse/trackpad scroll speed (1100).
GROK_SCROLL_MODEautoScroll input: auto, wheel, or trackpad.
GROK_SCROLL_LINESuse config if unsetLines per scroll tick (110).
GROK_INVERT_SCROLL0Reverse vertical scroll direction (1/0).
GROK_DEFAULT_SELECTED_PERMISSIONalways_allow_all_sessionsPreselected row on the first permission prompt.
GROK_REMEMBER_TOOL_APPROVALS0Show per-tool "Always allow …" options (1/0).
GROK_MOUSE_REPORTING_TOGGLE0Ctrl+R in scrollback toggles terminal mouse capture (1/0).
GROK_DISPLAY_REFRESH_AUTO_CADENCE0Match stream/scroll cadence to display refresh rate (1/0).

MCP, logging, and proxy

VariableDefaultDescription
GROK_MCP_STARTUP_TIMEOUT_SECS30Global MCP startup handshake timeout in seconds. Per-server startup_timeout_sec still wins.
MCP_TIMEOUTsame stackClaude-compatible MCP startup timeout in milliseconds (checked before GROK_MCP_STARTUP_TIMEOUT_SECS).
GROK_LOG_FILEWrite logs to this path (useful when the TUI captures stderr).
RUST_LOGLog filter for GROK_LOG_FILE and headless stderr (for example debug).
GROK_CRASH_HANDLER0On panic, write a report under $GROK_HOME/crash/ (1/0).
HTTPS_PROXY / HTTP_PROXY / NO_PROXYsystemStandard HTTP(S) proxy variables for outbound traffic.

Cursor / Claude compatibility scanners

All default on (true / 1 or false / 0):

VariableDescription
GROK_CURSOR_SKILLS_ENABLEDScan Cursor skills directories.
GROK_CURSOR_RULES_ENABLEDScan .cursor/rules/.
GROK_CURSOR_AGENTS_ENABLEDScan Cursor agent definitions.
GROK_CURSOR_MCPS_ENABLEDScan Cursor mcp.json.
GROK_CURSOR_HOOKS_ENABLEDScan Cursor hooks.
GROK_CLAUDE_SKILLS_ENABLEDScan Claude skills.
GROK_CLAUDE_RULES_ENABLEDScan Claude rules.
GROK_CLAUDE_AGENTS_ENABLEDScan CLAUDE.md / CLAUDE.local.md.
GROK_CLAUDE_MCPS_ENABLEDScan Claude MCP config.
GROK_CLAUDE_HOOKS_ENABLEDScan Claude hooks.

TOML Values

Project .grok/config.toml only contributes [mcp_servers], [plugins], and [permission]. Other sections belong in user config (~/.grok/config.toml or $GROK_HOME/config.toml).

[models]

SettingValues / defaultDescription
defaultmodel id (for example "grok-build")Model used for new sessions.
web_searchmodel idModel used by the client web_search tool.
default_reasoning_efforteffort level if supportedDefault reasoning effort for the default model.
session_summarymodel idModel used for session summaries.
image_descriptionmodel idModel used for image description.
extra_headersmapHeaders applied to every model (per-model keys win).
temperature / top_p / max_completion_tokensnumbersGlobal sampling defaults.
max_retriesnumberGlobal inference retry default.
stream_tool_callstrue / falseGlobal tool-call streaming request shape (some BYOK endpoints need false).
allowed_modelsglob listRestrict model picker / default / -m selection.
hidden_modelsid listHide from the picker (still usable via -m).
disabled_modelsid listRemove from the catalog (wins over hidden).

[model.<id>]

Custom / BYOK models (OpenAI-compatible or Anthropic Messages). Prefer env_key over hardcoding api_key.

SettingValues / defaultDescription
modelstringModel id sent to the API.
base_urlURLProvider endpoint.
namestringLabel in the model picker.
descriptionstringOptional description.
api_keystringInline API key (prefer env_key).
env_keyenv var nameEnvironment variable holding the API key.
api_backendchat_completions | responses | messagesProtocol.
temperature / top_p / max_completion_tokensnumbersSampling.
context_windowtokensContext window size (drives auto-compact timing).
extra_headersmapPer-request headers.
supports_backend_searchtrue / falseWhether the endpoint supports Grok-hosted server-side search tools.
supports_reasoning_effort / reasoning_effortbool / effortReasoning controls when supported.
stream_tool_callstrue / falsePer-model tool-call streaming.
max_retries / inference_idle_timeout_secsnumbersReliability.

[mcp_servers.<name>]

String fields such as url, command, args, env, and headers support ${VAR} expansion. Headers may also use {{session_id}}.

stdio

SettingValues / defaultDescription
commandstringExecutable (for example npx).
argsstring arrayArguments.
envmapProcess environment.
cwdpathWorking directory for the process.

HTTP / remote

SettingValues / defaultDescription
urlURLHTTP/SSE MCP endpoint.
headersmapRequest headers.
bearer_token_env_varenv var nameInject Authorization: Bearer from an environment variable.

Common

SettingValues / defaultDescription
enabledtrueEnable or disable the server.
startup_timeout_sec30Startup handshake timeout (seconds).
tool_timeout_sec6000Default per-tool-call timeout (seconds).
tool_timeoutsmap name → secondsPer-tool timeout overrides.

[tools] and [toolset.*]

SettingSectionValues / defaultDescription
respect_gitignore[tools]true / false (default false)When true, search and read tools skip gitignored files.
disable_zdr_incompatible_tools[tools]true / false (default false)Restrict tools needing xAI-hosted output (video) under ZDR; without a configured output bucket they return setup guidance instead of generating.
zdr_video_output_s3[tools.zdr_video_output_s3]tableUser-supplied S3 bucket for ZDR video output — see Video Output Storage under ZDR.
file_toolset[toolset]standard (default) | hashlineFile edit tool scheme.
timeout_secs[toolset.bash]seconds (default 120)Foreground bash command timeout.
output_byte_limit[toolset.bash]bytes (default 20000)Max captured bash output.
max_timeout_secs[toolset.bash]seconds (default 36000)Cap on model-requested foreground timeouts.
auto_background_on_timeout[toolset.bash]true / false (default true)Auto-background the command on timeout.
proxy_endpoint[toolset.web_fetch]URLEgress proxy for web_fetch.
allowed_domains[toolset.web_fetch]string arrayDomain allowlist override for web_fetch.

[sandbox] (config.toml)

SettingValues / defaultDescription
profileoff (default) | workspace | read-only | strict (or custom)Filesystem sandbox profile. Custom profile names are defined in sandbox.toml.
auto_allow_bashtrue / false (default false)Skip bash permission prompts when a sandbox profile is active.

sandbox.toml custom profiles

Define custom profiles in ~/.grok/sandbox.toml (user) or .grok/sandbox.toml (project). Activate with [sandbox] profile = "…" in config.toml, --sandbox, or GROK_SANDBOX. Built-in names (off, workspace, read-only, strict, devbox) cannot be redefined as custom profiles.

TOML

[profiles.project]
extends = "workspace"
restrict_network = false
read_only = ["/data"]
read_write = ["/tmp/scratch"]
# Kernel-enforced deny (read + write/rename). Entries with *, ?, or [ are globs.
deny = ["/data/shared-secrets", "**/.env", "**/*.pem"]
SettingValues / defaultDescription
extendsworkspace (default if omitted) | devbox | read-only | strictBuilt-in profile to inherit.
restrict_networktrue / falseRestrict network access (Linux seccomp when enforced).
read_onlypath listAdditional read-only paths.
read_writepath listAdditional read-write paths.
denypath or glob listKernel-enforced deny for read and write/rename. An entry is a glob if it contains *, ?, or [ (for example **/.env, **/*.pem).

A non-empty deny list is enforced at the kernel level when the sandbox can be applied. On Linux, read-deny requires bubblewrap. Operator guide: Sandbox. Managed pins: Enterprise Deployments.

[session], [cli], and [hints]

SettingSectionValues / defaultDescription
auto_compact_threshold_percent[session]0–100 (default 85)Auto-compact when context usage reaches this percent.
load_envrc[session]true / false (default true)Inject .envrc variables into bash.
auto_update[cli]true / false (default on when unset)Check for CLI updates on launch.
channel[cli]stable | alphaRelease channel preference.
show_tips[cli]true / falseStartup tips.
new_session_worktree_mode[hints]ask | always | never (default never)Whether /new offers a worktree.
fork_worktree_mode[hints]ask | always | never (default ask)Whether /fork offers a worktree.

[ui], [ui.display_refresh], and [ui.contextual_hints]

SettingSectionValues / defaultDescription
compact_mode[ui]true / false (default false)Denser message padding. Also /compact-mode.
screen_mode[ui]fullscreen (default when unset) | minimalDefault render mode for plain grok. Restart required.
show_timestamps[ui]true / false (default true)Clock time next to messages. Also /timestamps.
show_timeline[ui]true / false (default false)Per-turn tick rail instead of the scrollbar.
page_flip_on_send[ui]true / false (default true)Snap the sent prompt to the top of the viewport.
max_thoughts_width[ui]40500 (default 120)Column width for the thoughts panel.
combine_queued_prompts[ui]true / false (default false)Merge consecutive plain follow-ups into one turn.
theme[ui]theme name or auto / system (default Grok Night)Color theme. auto follows OS light/dark. Also /theme.
auto_dark_theme[ui]theme name (default groknight)Theme when theme = "auto" and the OS is dark.
auto_light_theme[ui]theme name (default grokday)Theme when theme = "auto" and the OS is light.
simple_mode[ui]true / false (default true)Readline prompt editing when true; experimental vim prompt keys when false.
vim_mode[ui]true / false (default false)Vim keys in the scrollback (not the prompt). Also /vim-mode.
prompt_suggestions[ui]true / false (default true)Next-prompt ghost text after each turn (Tab to accept).
mouse_reporting_toggle[ui]true / false (default false)Ctrl+R in scrollback toggles terminal mouse capture.
keep_text_selection[ui]flash (default) | hold | word_selectIn-app selection: brief flash, hold, or double-click word select.
cursor_blink[ui]true / false (unset inherits terminal)Force blinking (true) or steady (false) block cursor.
show_thinking_blocks[ui]true / false (default true)Show thinking/reasoning blocks while streaming.
group_tool_verbs[ui]true / false (default true)Fold consecutive read/search/list tool rows into one summary.
collapsed_edit_blocks[ui]true / false (default false)Show edits as one-line +N/-M summaries.
render_mermaid[ui]auto (default) | on | offMermaid diagrams: clickable open row (auto/on) or raw source (off).
scroll_speed[ui]1100 (default 50)Mouse/trackpad scroll speed multiplier.
scroll_mode[ui]auto (default) | wheel | trackpadForce wheel vs trackpad when auto-detection is wrong.
scroll_lines[ui]110 (unset uses terminal profile)Lines per scroll tick for wheel and trackpad.
invert_scroll[ui]true / false (default false)Reverse vertical scroll direction.
permission_mode[ui]default | ask | auto | always-approveDefault tool-permission behavior. Enterprise locks use requirements.toml.
default_selected_permission[ui]always_allow_all_sessions (default) | allow_command_always | allow_once | rejectPreselected approval row on the first prompt of a session.
remember_tool_approvals[ui]true / false (default false)Show per-tool "Always allow …" options. Restart required.
cancel_subagents_on_turn_cancel[ui]ask (default when unset) | always_stop | always_continueWhen cancelling a turn with running subagents.
hunk_tracker_mode[ui]agent_only (default) | all_dirty | offFile-change hunk tracking. Restart required.
fork_secondary_model[ui]model id (default: main default)Model for the secondary agent when forking.
voice_keybind_enabled[ui]true / false (default true)Enable Ctrl+Space / F8 for voice dictation (/voice still works when off).
voice_capture_mode[ui]hold (default) | toggleHold-to-talk or press-to-toggle voice capture.
voice_stt_language[ui]language code or auto (default en / [voice].language)Speech-to-text language for dictation.
auto_cadence_enabled[ui.display_refresh]true / false (default false)Match stream/scroll cadence to display refresh rate. Restart required.
undo[ui.contextual_hints]true / false (default true)Ctrl+Z restores a wiped prompt draft.
plan_mode[ui.contextual_hints]true / false (default true)Suggest plan mode (Shift+Tab) for planning-style prompts.
image_input[ui.contextual_hints]true / false (default true)Clipboard image paste tip when the model accepts images.
send_now[ui.contextual_hints]true / false (default true)After queuing a mid-turn follow-up, Enter on empty prompt sends now.
small_screen[ui.contextual_hints]true / false (default true)Suggest /compact-mode on short terminals.
word_select[ui.contextual_hints]true / false (default true)After double-click with fold/nav selection, point at Word select in settings.
ssh_wrap[ui.contextual_hints]true / false (default true)Recommend grok wrap when SSH lacks a clipboard sink.

[permission]

Project-scoped and user-scoped. Evaluation order: deny > ask > allow.

SettingValuesDescription
allow / deny / askrule string arraysCompact rules, for example Bash(git *), Read(src/**), Edit(**/*.rs), MCPTool(server__*).
rulesarray of { action, tool, pattern? }Verbose form. action: allow | deny | ask. tool: any | bash | edit | read | grep | mcp | webfetch.

[features], [subagents], and [memory]

SettingSectionValues / defaultDescription
web_fetch[features]true / falseEnable the web_fetch tool.
lsp_tools[features]true / false (default off)Expose the LSP tool.
write_file[features]true / false (default on)Enable the write tool.
tool_search[features]true / false (default on)MCP tool search / discovery.
enabled[subagents]true / falseSubagent / task tool master switch.
toggle[subagents.toggle]map of subagent → boolEnable or disable individual subagent types.
models[subagents.models]map of subagent → model idPer-subagent model routing.
enabled[memory]true / false (default off)Cross-session memory master switch.

[skills], [plugins], and [compat.*]

SettingSectionValuesDescription
paths[skills] / [plugins]path listsExtra skill or plugin directories.
disabled[skills] / [plugins]name listsDiscover but do not activate.
enabled[plugins]name listsExplicitly enable plugins (project plugins may default off).
skills / rules / agents / mcps / hooks[compat.cursor] / [compat.claude]true / false (default true)Scan Cursor or Claude harness directories.

Last updated: August 10, 2026