nousresearch/hermes-agent/grok
Claude Code and agent skill by nousresearch/hermes-agent
- community
Checking that the SKILL.md file is still in the repository.
Delegate coding to xAI Grok Build CLI (features, PRs).
Install
npx vskill@latest install nousresearch/hermes-agent/grokSKILL.md
The same SKILL.md was published earlier as nousresearch/hermes-agent/grok.
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 | bashalso
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 loginonce → 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,
/logoutsigns 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 supportssetting theXAI_API_KEYenvironment variable for pay-as-you-go billingviaapi.x.ai. Only usethis ifgrok 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.
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).
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 new session ID instead of reusing the original | |
--max-turns <N> | Cap the maximum number of agent turns | |
--cwd <PATH> | Set the working directory | |
--output-format <FMT> | plain (default), json, or streaming-json | |
--always-approve | Auto-approve all tool executions (the --full-auto / --yolo equivalent) | |
--no-alt-screen | Run inline, no fullscreen TUI takeover | |
--no-auto-update | Skip background update checks (use in all automation; hidden from --help but still works) |
Output Formats
plain— human-readable text (default)json— one JSON object at the end of the run (parse the result cleanly)streaming-json— newline-delimited JSON events as they arrive
Background Mode (Long Tasks)
For an interactive (TUI) background session, use pty=true + tmux and monitor with tmux capture-pane, exactly like the claude-code / codex skills.
Session Continuation
Sessions are keyed by UUID, not by name. --session-id assigns a new UUID to a fresh run (it does not resume); --resume takes an existing session's UUID (or omit the value to resume the most recent).
Read-Only Audit → Markdown Note Pattern
To have Grok review local artifacts and return a clean markdown note (for Obsidian or a repo) without mutating anything:
- Prepare stable input files first with Hermes tools (
read_file,
write_file). Snapshot only the relevant context into a temp file rather than dumping raw paths.
- Run Grok headless without
--always-approveso it cannot auto-write, and
demand markdown only, no preamble.
- Save Grok's stdout straight into the destination note with
write_file().
Pitfall (same as Claude Code): for document rewrites, a loose "rewrite this" prompt may return a change summary instead of the full file. Instead: pipe the file in, and demand Return ONLY the full revised markdown document. No intro, no explanation, no code fences. Start immediately with '# Title'. Verify the first lines with read_file() before overwriting the destination.
PR Review Patterns
Quick Review (Headless)
Clone-to-temp Review (safe, no repo mutation)
Post the review
Parallel Issue Fixing with Worktrees
Useful Subcommands & TUI Commands
| Command | Purpose | |
|---|---|---|
grok | Start the interactive TUI | |
grok -p "query" | Headless one-shot | |
grok login / grok logout | Sign in / out (SuperGrok / X Premium+ OAuth) | |
grok inspect | Show what Grok discovered in cwd: config sources, instructions, skills, plugins, hooks, MCP servers | |
grok agent stdio | Run as an ACP agent over JSON-RPC (for IDE/tool integration) | |
grok update | Update the CLI (needs the x.ai host; skip in automation) |
TUI slash commands (interactive only): /model <name>, /always-approve, /plan, /context, /compact, /resume, /sessions, /fork, /usage, /quit. Shift+Tab cycles session modes (including Plan mode, which blocks write tools except the session plan file).
Config (~/.grok/config.toml)
Put global preferences in ~/.grok/config.toml (not project-scoped .grok/config.toml). permission_mode supersedes the legacy approval_mode / yolo = true keys.
Pitfalls & Gotchas
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingoptional-skills/autonomous-ai-agents/grok/SKILL.md
Popularity
- Repository stars
- 195,697
- Repository forks
- 34,381
- 7-day trend score
- 61
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nousresearch/hermes-agent/grok)