Agent

Terminal

View as Markdown

Grok Build runs shell commands directly in your terminal. Your Run Mode controls when commands run, when Grok Build asks, and when terminal commands enter the sandbox.

Sandbox

The sandbox runs terminal commands in a restricted environment that blocks unauthorized file access and network activity. For platform requirements, network modes, environment variables, and sandbox.json configuration, read Run Modes > Sandboxing.

Troubleshooting

Some shell themes (for example, Powerlevel9k/Powerlevel10k) can interfere with the inline terminal output. If your command output looks truncated or misformatted, disable the theme or switch to a simpler prompt when Grok Build runs.

Disable heavy prompts for Grok Build sessions

Use the CURSOR_AGENT environment variable in your shell config to detect when Grok Build is running and skip initializing fancy prompts/themes.

Bash

# ~/.zshrc - disable Powerlevel10k when Grok Build runs
if [[ -n "$CURSOR_AGENT" ]]; then
  # Skip theme initialization for better compatibility
else
  [[ -r ~/.p10k.zsh ]] && source ~/.p10k.zsh
fi

Bash

# ~/.bashrc - fall back to a simple prompt in Grok Build sessions
if [[ -n "$CURSOR_AGENT" ]]; then
  PS1='\u@\h \W \$ '
fi

Last updated: November 23, 2026