grok_run
Execute a natural-language task using Grok, with foreground and background modes, configurable model, effort, and file edit permissions.
Instructions
Run a Grok Build task via bridge (run). background=true: bridge enqueues detached worker and exits; this tool only waits for that enqueue JSON (jobId), default max 60s — not the full agent run. Poll grok_show / report files for completion. write=false default (read-only). Prompt via --prompt-file under tmpdir. Foreground default timeout 900000ms (15 min). Pass cwd for project paths.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Project working directory (absolute path recommended) | |
| fresh | No | Force a fresh session (conflicts with resume_last) | |
| model | No | Model id, e.g. grok-4.5 | |
| write | No | If true, allow file edits (default false — read-only) | |
| effort | No | Reasoning effort | |
| prompt | Yes | Natural-language task for Grok | |
| background | No | If true, enqueue detached worker and return jobId JSON (does not wait for agent finish) | |
| timeout_ms | No | Kill timeout ms. Foreground: whole run (default 900000). Background: enqueue only (default 60000, hard cap 120000). Do NOT pass 900000 for background. | |
| resume_last | No | Continue last task session (--resume-last) |