grok

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

Updated Jun 7, 2026
One-click install
npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill grok-chensihakniroth
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: grok
Source: https://github.com/Chensihakniroth/ANAKOT-AGENT/tree/main/optional-skills/autonomous-ai-agents/grok
Command: npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill grok-chensihakniroth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @xai-official/grok.

What problem does it solve? Orchestrating an external autonomous coding agent from within an AI assistant requires knowing the right invocation modes, auth setup, and approval flags. This Skill provides a complete operational guide for delegating feature building, refactoring, PR reviews, and batch issue fixing to the Grok Build CLI without manual trial and error. ## Core Features & Use Cases - Headless One-Shot Execution: Run single coding tasks with grok -p, structured JSON output, and --always-approve for autonomous writes. - Interactive TUI Orchestration: Drive multi-turn Grok sessions through tmux with capture-pane monitoring for long-running work. - Parallel Workflows: Fix multiple issues concurrently using git worktrees, background processes, and automated PR creation. - Use Case: You need two GitHub issues fixed in parallel. The agent creates two git worktrees, launches a headless Grok session in each with auto-approval, monitors completion, then pushes branches and opens pull requests. ## Quick Start Ask the agent to use Grok headless mode to add a dark mode toggle to the settings page of your 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 if Grok should write files autonomously, and use --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, which caches a token in ~/.grok/auth.json. An XAI_API_KEY environment variable works as a pay-as-you-go fallback if subscription login is unavailable.

Does Grok CLI require a git repository to run?▼

No, Grok runs fine outside a git directory, which makes it suitable for scratch or throwaway tasks. For commit and PR workflows you still want a repo, so initialize one with git init in a temporary directory when needed.

Why does my headless Grok run stall without completing?▼

Headless runs stall when tool-approval prompts appear and --always-approve was not passed. Add --always-approve for autonomous builds, or omit it deliberately only for read-only review and audit work.

How do I monitor a long-running interactive Grok session?▼

Launch Grok inside a detached tmux session with pty enabled, send prompts via tmux send-keys, and monitor progress with tmux capture-pane. Kill the tmux session when the work is finished to clean up.

Can Grok CLI use my existing CLAUDE.md or AGENTS.md project files?▼

Yes, Grok automatically reads CLAUDE.md, the .claude directory including skills and MCP configurations, and the AGENTS.md family with zero configuration. Existing project context works without modification.