Skip to content
Skillpedia
General coding260k Β· #442

grok

What it does

It guides your agent to run the Grok Build command line tool on coding tasks. It is for developers who want Grok to be the coding agent for a job.

When to use it

  • βœ“When you want Grok to build a feature or refactor part of your code.
  • βœ“When you want Grok to review a pull request.
  • βœ“When you want a batch of issues fixed by Grok instead of another coding agent.

Skill link

https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/autonomous-ai-agents/grok/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/autonomous-ai-agents/grok/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œHave Grok review the open pull request for the payment module and tell me what it finds.”

5 new skills a week. 1 minute to read.

How it works

The agent runs Grok in headless mode for one-off tasks, or in an interactive terminal for longer sessions. The skill says sign-in uses a SuperGrok or X Premium subscription.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Grok Build CLI β€” Hermes Orchestration Guide

Delegate coding tasks to Grok Build (xAI's autonomous coding agent CLI, the grok command) via the Hermes terminal. Grok can read files, write code, run shell commands, spawn subagents, and manage git workflows. It runs three ways: an interactive TUI, headless (-p), and as an ACP agent over JSON-RPC.

This is the third sibling to codex and claude-code. The orchestration pattern is nearly identical β€” prefer headless -p for one-shots, use a PTY for interactive sessions.

When to use

  • Building features
  • Refactoring
  • PR reviews
  • Batch issue fixing
  • Any task where you'd otherwise reach for Codex / Claude Code but want Grok

Prerequisites

  • Install (preferred): npm install -g @xai-official/grok
    • The official installer curl -fsSL https://x.ai/cli/install.sh | bash also works, but the x.ai host is Cloudflare-walled in some environments. The npm path avoids that dependency entirely.
  • Auth β€” SuperGrok / X Premium+ subscription (primary path):
    • Run grok login once β†’ opens a browser for OAuth β†’ token cached in ~/.grok/auth.json. This uses your SuperGrok or X Premium+ subscription (no per-token API billing).
    • Check sign-in state by looking for ~/.grok/auth.json, or run a cheap headless smoke test: grok --no-auto-update -p "Say ok."
    • In the TUI, /logout signs out and /login (or relaunching) signs back in.
  • No git repo required β€” unlike Codex, Grok runs fine outside a git directory (good for scratch/throwaway tasks).
  • Claude Code / AGENTS.md compatible with zero config β€” Grok auto-reads CLAUDE.md, .claude/ (skills, agents, MCPs, hooks, rules), and the AGENTS.md family. Existing project context just works.

API-key fallback (not the default for this user): Grok also supports setting the XAI_API_KEY environment variable for pay-as-you-go billing via api.x.ai. Only use this if grok login / SuperGrok auth is unavailable. The subscription path (grok login) is the intended setup here.

Two Orchestration Modes

Mode 1: Headless (-p) β€” Non-Interactive (PREFERRED)

Runs a one-shot task, prints the result, and exits. No PTY, no interactive dialogs to navigate. This is the cleanest integration path β€” the analog of claude -p and codex exec.

terminal(command="grok --no-auto-update -p 'Add a dark mode toggle to settings'", workdir="/path/to/project", timeout=180)

Always pass --no-auto-update in automation to skip background update checks.

When to use headless:

  • One-shot coding tasks (fix a bug, add a feature, refactor)
  • CI/CD automation and scripting
  • Structured output parsing with --output-format json
  • Any task that doesn't need multi-turn conversation

Mode 2: Interactive PTY β€” Multi-Turn TUI Sessions

The TUI is a fullscreen, mouse-interactive app. Drive it with pty=true. For robust monitoring/input use tmux (same pattern as the claude-code skill).

# Launch in a tmux session for capture-pane monitoring
terminal(command="tmux new-session -d -s grok-work -x 140 -y 40")
terminal(command="tmux send-keys -t grok-work 'cd /path/to/project && grok' Enter")

# Wait for startup, then send a task
terminal(command="sleep 5 && tmux send-keys -t grok-work 'Refactor the auth module to use JWT' Enter")

# Monitor progress
terminal(command="sleep 15 && tmux capture-pane -t grok-work -p -S -50")

# Exit when done
terminal(command="tmux send-keys -t grok-work '/quit' Enter && sleep 1 && tmux kill-session -t grok-work")

Tip for headless-but-inline output: if you want TUI-style output without the fullscreen alt-screen takeover (e.g. for cleaner logs), add --no-alt-screen. For pure automation, headless -p is still cleaner than the TUI.

Headless Deep Dive

Common Flags

Flag Effect
-p, --single <PROMPT> Send one prompt, run headless, exit
-m, --model <MODEL> Choose a model
-s, --session-id <UUID> Assign a NEW valid UUID to a fresh conversation (must not already exist). Does not resume β€” use --resume/--continue for that. Only valid with --resume/--continue when paired with --fork-session
-r, --resume [<UUID>] Resume an existing session by its UUID (or the most recent if omitted)
-c, --continue Continue the most recent session in the current directory
--fork-session When resuming, create a n
FAQ

How do I sign in?

Run grok login once. It opens a browser for sign-in and saves the token in your user folder.

Which plan does it use?

The skill says it uses a SuperGrok or X Premium subscription rather than per-token API billing.

How is it installed?

The skill prefers installing it with npm, using the official package name.

Details

Original description by the author

Delegate coding to xAI Grok Build CLI (features, PRs).

repo: NousResearch/hermes-agent

Popularity

GitHub stars
260k
Ranking position
#442
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills