grok

Delegate coding tasks to the xAI Grok Build CLI via headless or interactive terminal sessions.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/loteiron/ZeusAgent --skill grok-loteiron
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: grok
Source: https://github.com/loteiron/ZeusAgent/tree/main/optional-skills/autonomous-ai-agents/grok
Command: npx skills add https://github.com/loteiron/ZeusAgent --skill grok-loteiron

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Orchestrating an external autonomous coding agent from ZeusAgent requires knowing the right invocation modes, auth setup, and flags; this Skill encodes the operational patterns for driving the Grok Build CLI reliably. ## Core Features & Use Cases - Headless one-shot delegation: Run single coding tasks with grok -p, structured JSON output, and --always-approve for autonomous writes. - Interactive TUI sessions: Drive multi-turn Grok sessions through tmux with capture-pane monitoring, mirroring the claude-code and codex patterns. - PR reviews and parallel issue fixing: Review diffs in throwaway clones and run concurrent fixes across git worktrees with background process monitoring. - Use Case: Ask the agent to fix two GitHub issues at once; it creates worktrees, launches background headless Grok runs in each, monitors completion, then pushes branches and opens PRs. ## Quick Start Use the grok skill to run a headless task that adds a dark mode toggle to the settings page of my project.

Frequently Asked Questions about grok

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Grok CLI headless for a one-shot coding task?▼

Run grok with the -p flag followed by your prompt, plus --no-auto-update to skip update checks. Add --always-approve for autonomous writes and --output-format json when you need to parse the result programmatically.

How do I authenticate the Grok Build CLI?▼

Run grok login once to complete browser OAuth with a SuperGrok or X Premium+ subscription; the token is cached in ~/.grok/auth.json. An XAI_API_KEY environment variable works as a pay-as-you-go fallback.

Grok CLI vs Codex vs Claude Code for delegated coding?▼

All three follow the same orchestration pattern: prefer headless one-shots and use tmux for interactive sessions. Grok additionally runs outside git repositories and auto-reads CLAUDE.md and AGENTS.md project context with zero configuration.

Does the Grok CLI require a git repository to run?▼

No, Grok runs fine outside a git directory, which suits scratch or throwaway tasks. For PR and commit workflows you still want a repo, so use mktemp -d with git init for temporary commit work.

Why does my headless Grok run stall without finishing?▼

Headless runs stall when tool-approval prompts appear without --always-approve, or when background update checks cannot reach x.ai. Pass --always-approve for autonomous builds and always include --no-auto-update in automation.

How do I resume a previous Grok CLI session?▼

Sessions are keyed by UUID: use grok -r <UUID> to resume a specific session or grok -c to continue the most recent one in the current directory. The --session-id flag only assigns a new UUID and does not resume.