[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7378ZGPFCS8Q3CMC5EFEKT4":3,"skill-same:01M7378ZGPFCS8Q3CMC5EFEKT4":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":48,"install":49,"resources":62},"01M7378ZGPFCS8Q3CMC5EFEKT4","grok",null,"Delegate coding to xAI Grok Build CLI (features, PRs).","ashneil12\u002Fvanilla-hermes-agent-canary","ashneil12","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F49880658?v=4","01M7378BQ9W161EPENEWBYAQNN","01M7378BRDJG8SFS93FG4V6BWY",1,"MIT","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Foptional-skills\u002Fautonomous-ai-agents\u002Fgrok\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: grok\ndescription: \"Delegate coding to xAI Grok Build CLI (features, PRs).\"\nversion: 0.1.1\nauthor: Matt Maximo (MattMaximo), Hermes Agent\nlicense: MIT\nplatforms: [linux, macos, windows]\nmetadata:\n  hermes:\n    tags: [Coding-Agent, Grok, xAI, Code-Review, Refactoring, Automation]\n    related_skills: [codex, claude-code, hermes-agent]\n---\n\n# Grok Build CLI — Hermes Orchestration Guide\n\nDelegate coding tasks to [Grok Build](https:\u002F\u002Fdocs.x.ai\u002Fbuild\u002Foverview) (xAI's\nautonomous coding agent CLI, the `grok` command) via the Hermes terminal. Grok\ncan read files, write code, run shell commands, spawn subagents, and manage git\nworkflows. It runs three ways: an interactive TUI, **headless** (`-p`), and as\nan **ACP agent** over JSON-RPC.\n\nThis is the third sibling to `codex` and `claude-code`. The orchestration\npattern is nearly identical — **prefer headless `-p` for one-shots**, use a PTY\nfor interactive sessions.\n\n## When to use\n\n- Building features\n- Refactoring\n- PR reviews\n- Batch issue fixing\n- Any task where you'd otherwise reach for Codex \u002F Claude Code but want Grok\n\n## Prerequisites\n\n- **Install (preferred):** `npm install -g @xai-official\u002Fgrok`\n  - The official installer `curl -fsSL https:\u002F\u002Fx.ai\u002Fcli\u002Finstall.sh | bash` also\n    works, but the `x.ai` host is Cloudflare-walled in some environments. The\n    npm path avoids that dependency entirely.\n- **Auth — SuperGrok \u002F X Premium+ subscription (primary path):**\n  - Run `grok login` once → opens a browser for OAuth → token cached in\n    `~\u002F.grok\u002Fauth.json`. This uses your **SuperGrok or X Premium+** subscription\n    (no per-token API billing).\n  - Check sign-in state by looking for `~\u002F.grok\u002Fauth.json`, or run a cheap\n    headless smoke test: `grok --no-auto-update -p \"Say ok.\"`\n  - In the TUI, `\u002Flogout` signs out and `\u002Flogin` (or relaunching) signs back in.\n- **No git repo required** — unlike Codex, Grok runs fine outside a git\n  directory (good for scratch\u002Fthrowaway tasks).\n- **Claude Code \u002F AGENTS.md compatible with zero config** — Grok auto-reads\n  `CLAUDE.md`, `.claude\u002F` (skills, agents, MCPs, hooks, rules), and the\n  `AGENTS.md` family. Existing project context just works.\n\n> **API-key fallback (not the default for this user):** Grok also supports\n> setting the `XAI_API_KEY` environment variable for pay-as-you-go billing\n> via `api.x.ai`. Only use\n> this if `grok login` \u002F SuperGrok auth is unavailable. The subscription path\n> (`grok login`) is the intended setup here.\n\n## Two Orchestration Modes\n\n### Mode 1: Headless (`-p`) — Non-Interactive (PREFERRED)\n\nRuns a one-shot task, prints the result, and exits. No PTY, no interactive\ndialogs to navigate. This is the cleanest integration path — the analog of\n`claude -p` and `codex exec`.\n\n```\nterminal(command=\"grok --no-auto-update -p 'Add a dark mode toggle to settings'\", workdir=\"\u002Fpath\u002Fto\u002Fproject\", timeout=180)\n```\n\nAlways pass `--no-auto-update` in automation to skip background update checks.\n\n**When to use headless:**\n- One-shot coding tasks (fix a bug, add a feature, refactor)\n- CI\u002FCD automation and scripting\n- Structured output parsing with `--output-format json`\n- Any task that doesn't need multi-turn conversation\n\n### Mode 2: Interactive PTY — Multi-Turn TUI Sessions\n\nThe TUI is a fullscreen, mouse-interactive app. Drive it with `pty=true`. For\nrobust monitoring\u002Finput use tmux (same pattern as the `claude-code` skill).\n\n```\n# Launch in a tmux session for capture-pane monitoring\nterminal(command=\"tmux new-session -d -s grok-work -x 140 -y 40\")\nterminal(command=\"tmux send-keys -t grok-work 'cd \u002Fpath\u002Fto\u002Fproject && grok' Enter\")\n\n# Wait for startup, then send a task\nterminal(command=\"sleep 5 && tmux send-keys -t grok-work 'Refactor the auth module to use JWT' Enter\")\n\n# Monitor progress\nterminal(command=\"sleep 15 && tmux capture-pane -t grok-work -p -S -50\")\n\n# Exit when done\nterminal(command=\"tmux send-keys -t grok-work '\u002Fquit' Enter && sleep 1 && tmux kill-session -t grok-work\")\n```\n\n**Tip for headless-but-inline output:** if you want TUI-style output without the\nfullscreen alt-screen takeover (e.g. for cleaner logs), add `--no-alt-screen`.\nFor pure automation, headless `-p` is still cleaner than the TUI.\n\n## Headless Deep Dive\n\n### Common Flags\n\n| Flag | Effect |\n|------|--------|\n| `-p, --single \u003CPROMPT>` | Send one prompt, run headless, exit |\n| `-m, --model \u003CMODEL>` | Choose a model |\n| `-s, --session-id \u003CUUID>` | Assign a **NEW** valid UUID to a fresh conversation (must not already exist). Does **not** resume — use `--resume`\u002F`--continue` for that. Only valid with `--resume`\u002F`--continue` when paired with `--fork-session` |\n| `-r, --resume [\u003CUUID>]` | Resume an existing session by its UUID (or the most recent if omitted) |\n| `-c, --continue` | Continue the most recent session in the current directory |\n| `--fork-session` | When resuming, create a new session ID instead of reusing the original |\n| `--max-turns \u003CN>` | Cap the maximum number of agent turns |\n| `--cwd \u003CPATH>` | Set the working directory |\n| `--output-format \u003CFMT>` | `plain` (default), `json`, or `streaming-json` |\n| `--always-approve` | Auto-approve all tool executions (the `--full-auto` \u002F `--yolo` equivalent) |\n| `--no-alt-screen` | Run inline, no fullscreen TUI takeover |\n| `--no-auto-update` | Skip background update checks (use in all automation; hidden from `--help` but still works) |\n\n### Output Formats\n\n- `plain` — human-readable text (default)\n- `json` — one JSON object at the end of the run (parse the result cleanly)\n- `streaming-json` — newline-delimited JSON events as they arrive\n\n```\n# Structured result for parsing\nterminal(command=\"grok --no-auto-update -p 'List all TODO comments in src\u002F' --output-format json\", workdir=\"\u002Fproject\", timeout=120)\n\n# Auto-approve for autonomous building\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the database layer and run the tests'\", workdir=\"\u002Fproject\", timeout=300)\n```\n\n### Background Mode (Long Tasks)\n\n```\n# Start headless in background\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the auth module'\", workdir=\"\u002Fproject\", background=true, notify_on_complete=true)\n# Returns session_id\n\n# Monitor\nprocess(action=\"poll\", session_id=\"\u003Cid>\")\nprocess(action=\"log\", session_id=\"\u003Cid>\")\n\n# Kill if needed\nprocess(action=\"kill\", session_id=\"\u003Cid>\")\n```\n\nFor an interactive (TUI) background session, use `pty=true` + tmux and monitor\nwith `tmux capture-pane`, exactly like the `claude-code` \u002F `codex` skills.\n\n### Session Continuation\n\nSessions are keyed by **UUID**, not by name. `--session-id` assigns a *new* UUID\nto a fresh run (it does **not** resume); `--resume` takes an existing session's\nUUID (or omit the value to resume the most recent).\n\n```\n# Start a session with a self-assigned UUID (must be a valid, unused UUID)\nSID=$(uuidgen)\nterminal(command=\"grok --no-auto-update -s $SID -p 'Start refactoring the database layer' --always-approve\", workdir=\"\u002Fproject\", timeout=240)\n\n# Resume that exact session later by its UUID\nterminal(command=\"grok --no-auto-update -r $SID -p 'Now add connection pooling' --always-approve\", workdir=\"\u002Fproject\", timeout=180)\n\n# Or just continue the most recent session in this directory (no UUID needed)\nterminal(command=\"grok --no-auto-update -c -p 'What did you change last time?'\", workdir=\"\u002Fproject\", timeout=60)\n```\n\n## Read-Only Audit → Markdown Note Pattern\n\nTo have Grok review local artifacts and return a clean markdown note (for\nObsidian or a repo) without mutating anything:\n\n1. Prepare stable input files first with Hermes tools (`read_file`,\n   `write_file`). Snapshot only the relevant context into a temp file rather\n   than dumping raw paths.\n2. Run Grok headless **without** `--always-approve` so it cannot auto-write, and\n   demand `markdown only, no preamble`.\n3. Save Grok's stdout straight into the destination note with `write_file()`.\n\n```\ngrok --no-auto-update -p \"Read ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fcurrent.md and ~\u002F.hermes\u002Fcache\u002Fscratch\u002Finventory.md. Produce markdown only, no preamble. Output a clean note titled 'Cleanup Review'.\" --output-format plain\n```\n\n**Pitfall (same as Claude Code):** for document rewrites, a loose \"rewrite this\"\nprompt may return a change summary instead of the full file. Instead: pipe the\nfile in, and demand `Return ONLY the full revised markdown document. No intro,\nno explanation, no code fences. Start immediately with '# Title'.` Verify the\nfirst lines with `read_file()` before overwriting the destination.\n\n## PR Review Patterns\n\n### Quick Review (Headless)\n\n```\nterminal(command=\"cd \u002Fpath\u002Fto\u002Frepo && git diff main...feature-branch | grok --no-auto-update -p 'Review this diff for bugs, security issues, and style problems. Be thorough.'\", timeout=120)\n```\n\n### Clone-to-temp Review (safe, no repo mutation)\n\n```\nterminal(command=\"REVIEW=$(mktemp -d) && git clone https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo.git $REVIEW && cd $REVIEW && gh pr checkout 42 && grok --no-auto-update -p 'Review the changes vs origin\u002Fmain. Check bugs, security, race conditions, missing tests.'\", pty=true, timeout=300)\n```\n\n### Post the review\n\n```\nterminal(command=\"gh pr comment 42 --body '\u003Creview text>'\", workdir=\"\u002Fpath\u002Fto\u002Frepo\")\n```\n\n## Parallel Issue Fixing with Worktrees\n\n```\n# Create worktrees\nterminal(command=\"git worktree add -b fix\u002Fissue-78 ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78 main\", workdir=\"~\u002Fproject\")\nterminal(command=\"git worktree add -b fix\u002Fissue-99 ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-99 main\", workdir=\"~\u002Fproject\")\n\n# Launch Grok headless in each (background)\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #78: \u003Cdescription>. Commit when done.'\", workdir=\"~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78\", background=true, notify_on_complete=true)\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #99: \u003Cdescription>. Commit when done.'\", workdir=\"~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-99\", background=true, notify_on_complete=true)\n\n# Monitor\nprocess(action=\"list\")\n\n# After completion: push and open PRs\nterminal(command=\"cd ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78 && git push -u origin fix\u002Fissue-78\")\nterminal(command=\"gh pr create --repo user\u002Frepo --head fix\u002Fissue-78 --title 'fix: ...' --body '...'\")\n\n# Cleanup\nterminal(command=\"git worktree remove ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78\", workdir=\"~\u002Fproject\")\n```\n\n## Useful Subcommands & TUI Commands\n\n| Command | Purpose |\n|---------|---------|\n| `grok` | Start the interactive TUI |\n| `grok -p \"query\"` | Headless one-shot |\n| `grok login` \u002F `grok logout` | Sign in \u002F out (SuperGrok \u002F X Premium+ OAuth) |\n| `grok inspect` | Show what Grok discovered in cwd: config sources, instructions, skills, plugins, hooks, MCP servers |\n| `grok agent stdio` | Run as an ACP agent over JSON-RPC (for IDE\u002Ftool integration) |\n| `grok update` | Update the CLI (needs the `x.ai` host; skip in automation) |\n\nTUI slash commands (interactive only): `\u002Fmodel \u003Cname>`, `\u002Falways-approve`,\n`\u002Fplan`, `\u002Fcontext`, `\u002Fcompact`, `\u002Fresume`, `\u002Fsessions`, `\u002Ffork`, `\u002Fusage`,\n`\u002Fquit`. `Shift+Tab` cycles session modes (including Plan mode, which blocks\nwrite tools except the session plan file).\n\n## Config (`~\u002F.grok\u002Fconfig.toml`)\n\n```toml\n[cli]\nauto_update = false          # skip background update checks persistently\n\n[ui]\npermission_mode = \"ask\"      # or \"always-approve\" to skip tool prompts by default\n\n[models]\ndefault = \"grok-build-0.1\"\n```\n\nPut global preferences in `~\u002F.grok\u002Fconfig.toml` (not project-scoped\n`.grok\u002Fconfig.toml`). `permission_mode` supersedes the legacy `approval_mode` \u002F\n`yolo = true` keys.\n\n## Pitfalls & Gotchas\n\n1. **Auth is subscription-gated.** `grok login` requires a SuperGrok or X\n   Premium+ subscription. If login fails or there's no `~\u002F.grok\u002Fauth.json`,\n   confirm the subscription is active before falling back to `XAI_API_KEY`.\n2. **Don't conflate Hermes' xAI auth with the `grok` CLI's auth.** Hermes'\n   `x_search` runs on its own xAI OAuth; the standalone `grok` CLI has a\n   separate token in `~\u002F.grok\u002Fauth.json`. A working `x_search` does NOT mean\n   `grok` is logged in.\n3. **Always pass `--no-auto-update` in automation** — otherwise Grok phones home\n   for update checks (and `x.ai`\u002F`storage.googleapis.com` may be unreachable).\n4. **Prefer npm install over the curl installer** — `npm install -g\n   @xai-official\u002Fgrok` avoids the Cloudflare-walled `x.ai` host.\n5. **`--always-approve` is the autonomous-build switch.** Without it, headless\n   runs may stall waiting on tool-approval prompts. Omit it deliberately for\n   read-only review\u002Faudit work so Grok can't mutate files.\n6. **Headless `-p` skips TUI dialogs**; the TUI needs `pty=true` (+ tmux for\n   monitoring), just like Claude Code.\n7. **Use `--no-alt-screen`** if you run the TUI inline and the fullscreen\n   alt-screen takeover garbles captured output.\n8. **No git repo needed**, but for PR\u002Fcommit workflows you still want one — use\n   `mktemp -d && git init` for scratch commit tasks.\n9. **Clean up tmux sessions** with `tmux kill-session -t \u003Cname>` when done.\n\n## Rules for Hermes Agents\n\n1. **Prefer headless `-p`** for single tasks — cleanest integration, structured\n   output via `--output-format json`.\n2. **Always set `workdir`** (or `--cwd`) so Grok targets the right project.\n3. **Pass `--no-auto-update`** in every automated invocation.\n4. **Use `--always-approve` only when Grok should write autonomously**; omit it\n   for read-only reviews and audits.\n5. **Background long tasks** with `background=true, notify_on_complete=true` and\n   monitor via the `process` tool.\n6. **Use tmux for multi-turn interactive work** and monitor with\n   `tmux capture-pane -t \u003Csession> -p -S -50`.\n7. **Verify auth before relying on it** — check `~\u002F.grok\u002Fauth.json` or run a\n   cheap `grok -p \"Say ok.\"` smoke test; don't assume Hermes' xAI auth carries\n   over.\n8. **Report results to the user** — summarize what Grok changed and what's left.\n","# Grok Build CLI — Hermes Orchestration Guide\n\nDelegate coding tasks to [Grok Build](https:\u002F\u002Fdocs.x.ai\u002Fbuild\u002Foverview) (xAI's\nautonomous coding agent CLI, the `grok` command) via the Hermes terminal. Grok\ncan read files, write code, run shell commands, spawn subagents, and manage git\nworkflows. It runs three ways: an interactive TUI, **headless** (`-p`), and as\nan **ACP agent** over JSON-RPC.\n\nThis is the third sibling to `codex` and `claude-code`. The orchestration\npattern is nearly identical — **prefer headless `-p` for one-shots**, use a PTY\nfor interactive sessions.\n\n## When to use\n\n- Building features\n- Refactoring\n- PR reviews\n- Batch issue fixing\n- Any task where you'd otherwise reach for Codex \u002F Claude Code but want Grok\n\n## Prerequisites\n\n- **Install (preferred):** `npm install -g @xai-official\u002Fgrok`\n  - The official installer `curl -fsSL https:\u002F\u002Fx.ai\u002Fcli\u002Finstall.sh | bash` also\n    works, but the `x.ai` host is Cloudflare-walled in some environments. The\n    npm path avoids that dependency entirely.\n- **Auth — SuperGrok \u002F X Premium+ subscription (primary path):**\n  - Run `grok login` once → opens a browser for OAuth → token cached in\n    `~\u002F.grok\u002Fauth.json`. This uses your **SuperGrok or X Premium+** subscription\n    (no per-token API billing).\n  - Check sign-in state by looking for `~\u002F.grok\u002Fauth.json`, or run a cheap\n    headless smoke test: `grok --no-auto-update -p \"Say ok.\"`\n  - In the TUI, `\u002Flogout` signs out and `\u002Flogin` (or relaunching) signs back in.\n- **No git repo required** — unlike Codex, Grok runs fine outside a git\n  directory (good for scratch\u002Fthrowaway tasks).\n- **Claude Code \u002F AGENTS.md compatible with zero config** — Grok auto-reads\n  `CLAUDE.md`, `.claude\u002F` (skills, agents, MCPs, hooks, rules), and the\n  `AGENTS.md` family. Existing project context just works.\n\n> **API-key fallback (not the default for this user):** Grok also supports\n> setting the `XAI_API_KEY` environment variable for pay-as-you-go billing\n> via `api.x.ai`. Only use\n> this if `grok login` \u002F SuperGrok auth is unavailable. The subscription path\n> (`grok login`) is the intended setup here.\n\n## Two Orchestration Modes\n\n### Mode 1: Headless (`-p`) — Non-Interactive (PREFERRED)\n\nRuns a one-shot task, prints the result, and exits. No PTY, no interactive\ndialogs to navigate. This is the cleanest integration path — the analog of\n`claude -p` and `codex exec`.\n\n```\nterminal(command=\"grok --no-auto-update -p 'Add a dark mode toggle to settings'\", workdir=\"\u002Fpath\u002Fto\u002Fproject\", timeout=180)\n```\n\nAlways pass `--no-auto-update` in automation to skip background update checks.\n\n**When to use headless:**\n- One-shot coding tasks (fix a bug, add a feature, refactor)\n- CI\u002FCD automation and scripting\n- Structured output parsing with `--output-format json`\n- Any task that doesn't need multi-turn conversation\n\n### Mode 2: Interactive PTY — Multi-Turn TUI Sessions\n\nThe TUI is a fullscreen, mouse-interactive app. Drive it with `pty=true`. For\nrobust monitoring\u002Finput use tmux (same pattern as the `claude-code` skill).\n\n```\n# Launch in a tmux session for capture-pane monitoring\nterminal(command=\"tmux new-session -d -s grok-work -x 140 -y 40\")\nterminal(command=\"tmux send-keys -t grok-work 'cd \u002Fpath\u002Fto\u002Fproject && grok' Enter\")\n\n# Wait for startup, then send a task\nterminal(command=\"sleep 5 && tmux send-keys -t grok-work 'Refactor the auth module to use JWT' Enter\")\n\n# Monitor progress\nterminal(command=\"sleep 15 && tmux capture-pane -t grok-work -p -S -50\")\n\n# Exit when done\nterminal(command=\"tmux send-keys -t grok-work '\u002Fquit' Enter && sleep 1 && tmux kill-session -t grok-work\")\n```\n\n**Tip for headless-but-inline output:** if you want TUI-style output without the\nfullscreen alt-screen takeover (e.g. for cleaner logs), add `--no-alt-screen`.\nFor pure automation, headless `-p` is still cleaner than the TUI.\n\n## Headless Deep Dive\n\n### Common Flags\n\n| Flag | Effect |\n|------|--------|\n| `-p, --single \u003CPROMPT>` | Send one prompt, run headless, exit |\n| `-m, --model \u003CMODEL>` | Choose a model |\n| `-s, --session-id \u003CUUID>` | Assign a **NEW** valid UUID to a fresh conversation (must not already exist). Does **not** resume — use `--resume`\u002F`--continue` for that. Only valid with `--resume`\u002F`--continue` when paired with `--fork-session` |\n| `-r, --resume [\u003CUUID>]` | Resume an existing session by its UUID (or the most recent if omitted) |\n| `-c, --continue` | Continue the most recent session in the current directory |\n| `--fork-session` | When resuming, create a new session ID instead of reusing the original |\n| `--max-turns \u003CN>` | Cap the maximum number of agent turns |\n| `--cwd \u003CPATH>` | Set the working directory |\n| `--output-format \u003CFMT>` | `plain` (default), `json`, or `streaming-json` |\n| `--always-approve` | Auto-approve all tool executions (the `--full-auto` \u002F `--yolo` equivalent) |\n| `--no-alt-screen` | Run inline, no fullscreen TUI takeover |\n| `--no-auto-update` | Skip background update checks (use in all automation; hidden from `--help` but still works) |\n\n### Output Formats\n\n- `plain` — human-readable text (default)\n- `json` — one JSON object at the end of the run (parse the result cleanly)\n- `streaming-json` — newline-delimited JSON events as they arrive\n\n```\n# Structured result for parsing\nterminal(command=\"grok --no-auto-update -p 'List all TODO comments in src\u002F' --output-format json\", workdir=\"\u002Fproject\", timeout=120)\n\n# Auto-approve for autonomous building\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the database layer and run the tests'\", workdir=\"\u002Fproject\", timeout=300)\n```\n\n### Background Mode (Long Tasks)\n\n```\n# Start headless in background\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the auth module'\", workdir=\"\u002Fproject\", background=true, notify_on_complete=true)\n# Returns session_id\n\n# Monitor\nprocess(action=\"poll\", session_id=\"\u003Cid>\")\nprocess(action=\"log\", session_id=\"\u003Cid>\")\n\n# Kill if needed\nprocess(action=\"kill\", session_id=\"\u003Cid>\")\n```\n\nFor an interactive (TUI) background session, use `pty=true` + tmux and monitor\nwith `tmux capture-pane`, exactly like the `claude-code` \u002F `codex` skills.\n\n### Session Continuation\n\nSessions are keyed by **UUID**, not by name. `--session-id` assigns a *new* UUID\nto a fresh run (it does **not** resume); `--resume` takes an existing session's\nUUID (or omit the value to resume the most recent).\n\n```\n# Start a session with a self-assigned UUID (must be a valid, unused UUID)\nSID=$(uuidgen)\nterminal(command=\"grok --no-auto-update -s $SID -p 'Start refactoring the database layer' --always-approve\", workdir=\"\u002Fproject\", timeout=240)\n\n# Resume that exact session later by its UUID\nterminal(command=\"grok --no-auto-update -r $SID -p 'Now add connection pooling' --always-approve\", workdir=\"\u002Fproject\", timeout=180)\n\n# Or just continue the most recent session in this directory (no UUID needed)\nterminal(command=\"grok --no-auto-update -c -p 'What did you change last time?'\", workdir=\"\u002Fproject\", timeout=60)\n```\n\n## Read-Only Audit → Markdown Note Pattern\n\nTo have Grok review local artifacts and return a clean markdown note (for\nObsidian or a repo) without mutating anything:\n\n1. Prepare stable input files first with Hermes tools (`read_file`,\n   `write_file`). Snapshot only the relevant context into a temp file rather\n   than dumping raw paths.\n2. Run Grok headless **without** `--always-approve` so it cannot auto-write, and\n   demand `markdown only, no preamble`.\n3. Save Grok's stdout straight into the destination note with `write_file()`.\n\n```\ngrok --no-auto-update -p \"Read ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fcurrent.md and ~\u002F.hermes\u002Fcache\u002Fscratch\u002Finventory.md. Produce markdown only, no preamble. Output a clean note titled 'Cleanup Review'.\" --output-format plain\n```\n\n**Pitfall (same as Claude Code):** for document rewrites, a loose \"rewrite this\"\nprompt may return a change summary instead of the full file. Instead: pipe the\nfile in, and demand `Return ONLY the full revised markdown document. No intro,\nno explanation, no code fences. Start immediately with '# Title'.` Verify the\nfirst lines with `read_file()` before overwriting the destination.\n\n## PR Review Patterns\n\n### Quick Review (Headless)\n\n```\nterminal(command=\"cd \u002Fpath\u002Fto\u002Frepo && git diff main...feature-branch | grok --no-auto-update -p 'Review this diff for bugs, security issues, and style problems. Be thorough.'\", timeout=120)\n```\n\n### Clone-to-temp Review (safe, no repo mutation)\n\n```\nterminal(command=\"REVIEW=$(mktemp -d) && git clone https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo.git $REVIEW && cd $REVIEW && gh pr checkout 42 && grok --no-auto-update -p 'Review the changes vs origin\u002Fmain. Check bugs, security, race conditions, missing tests.'\", pty=true, timeout=300)\n```\n\n### Post the review\n\n```\nterminal(command=\"gh pr comment 42 --body '\u003Creview text>'\", workdir=\"\u002Fpath\u002Fto\u002Frepo\")\n```\n\n## Parallel Issue Fixing with Worktrees\n\n```\n# Create worktrees\nterminal(command=\"git worktree add -b fix\u002Fissue-78 ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78 main\", workdir=\"~\u002Fproject\")\nterminal(command=\"git worktree add -b fix\u002Fissue-99 ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-99 main\", workdir=\"~\u002Fproject\")\n\n# Launch Grok headless in each (background)\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #78: \u003Cdescription>. Commit when done.'\", workdir=\"~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78\", background=true, notify_on_complete=true)\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #99: \u003Cdescription>. Commit when done.'\", workdir=\"~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-99\", background=true, notify_on_complete=true)\n\n# Monitor\nprocess(action=\"list\")\n\n# After completion: push and open PRs\nterminal(command=\"cd ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78 && git push -u origin fix\u002Fissue-78\")\nterminal(command=\"gh pr create --repo user\u002Frepo --head fix\u002Fissue-78 --title 'fix: ...' --body '...'\")\n\n# Cleanup\nterminal(command=\"git worktree remove ~\u002F.hermes\u002Fcache\u002Fscratch\u002Fissue-78\", workdir=\"~\u002Fproject\")\n```\n\n## Useful Subcommands & TUI Commands\n\n| Command | Purpose |\n|---------|---------|\n| `grok` | Start the interactive TUI |\n| `grok -p \"query\"` | Headless one-shot |\n| `grok login` \u002F `grok logout` | Sign in \u002F out (SuperGrok \u002F X Premium+ OAuth) |\n| `grok inspect` | Show what Grok discovered in cwd: config sources, instructions, skills, plugins, hooks, MCP servers |\n| `grok agent stdio` | Run as an ACP agent over JSON-RPC (for IDE\u002Ftool integration) |\n| `grok update` | Update the CLI (needs the `x.ai` host; skip in automation) |\n\nTUI slash commands (interactive only): `\u002Fmodel \u003Cname>`, `\u002Falways-approve`,\n`\u002Fplan`, `\u002Fcontext`, `\u002Fcompact`, `\u002Fresume`, `\u002Fsessions`, `\u002Ffork`, `\u002Fusage`,\n`\u002Fquit`. `Shift+Tab` cycles session modes (including Plan mode, which blocks\nwrite tools except the session plan file).\n\n## Config (`~\u002F.grok\u002Fconfig.toml`)\n\n```toml\n[cli]\nauto_update = false          # skip background update checks persistently\n\n[ui]\npermission_mode = \"ask\"      # or \"always-approve\" to skip tool prompts by default\n\n[models]\ndefault = \"grok-build-0.1\"\n```\n\nPut global preferences in `~\u002F.grok\u002Fconfig.toml` (not project-scoped\n`.grok\u002Fconfig.toml`). `permission_mode` supersedes the legacy `approval_mode` \u002F\n`yolo = true` keys.\n\n## Pitfalls & Gotchas\n\n1. **Auth is subscription-gated.** `grok login` requires a SuperGrok or X\n   Premium+ subscription. If login fails or there's no `~\u002F.grok\u002Fauth.json`,\n   confirm the subscription is active before falling back to `XAI_API_KEY`.\n2. **Don't conflate Hermes' xAI auth with the `grok` CLI's auth.** Hermes'\n   `x_search` runs on its own xAI OAuth; the standalone `grok` CLI has a\n   separate token in `~\u002F.grok\u002Fauth.json`. A working `x_search` does NOT mean\n   `grok` is logged in.\n3. **Always pass `--no-auto-update` in automation** — otherwise Grok phones home\n   for update checks (and `x.ai`\u002F`storage.googleapis.com` may be unreachable).\n4. **Prefer npm install over the curl installer** — `npm install -g\n   @xai-official\u002Fgrok` avoids the Cloudflare-walled `x.ai` host.\n5. **`--always-approve` is the autonomous-build switch.** Without it, headless\n   runs may stall waiting on tool-approval prompts. Omit it deliberately for\n   read-only review\u002Faudit work so Grok can't mutate files.\n6. **Headless `-p` skips TUI dialogs**; the TUI needs `pty=true` (+ tmux for\n   monitoring), just like Claude Code.\n7. **Use `--no-alt-screen`** if you run the TUI inline and the fullscreen\n   alt-screen takeover garbles captured output.\n8. **No git repo needed**, but for PR\u002Fcommit workflows you still want one — use\n   `mktemp -d && git init` for scratch commit tasks.\n9. **Clean up tmux sessions** with `tmux kill-session -t \u003Cname>` when done.\n\n## Rules for Hermes Agents\n\n1. **Prefer headless `-p`** for single tasks — cleanest integration, structured\n   output via `--output-format json`.\n2. **Always set `workdir`** (or `--cwd`) so Grok targets the right project.\n3. **Pass `--no-auto-update`** in every automated invocation.\n4. **Use `--always-approve` only when Grok should write autonomously**; omit it\n   for read-only reviews and audits.\n5. **Background long tasks** with `background=true, notify_on_complete=true` and\n   monitor via the `process` tool.\n6. **Use tmux for multi-turn interactive work** and monitor with\n   `tmux capture-pane -t \u003Csession> -p -S -50`.\n7. **Verify auth before relying on it** — check `~\u002F.grok\u002Fauth.json` or run a\n   cheap `grok -p \"Say ok.\"` smoke test; don't assume Hermes' xAI auth carries\n   over.\n8. **Report results to the user** — summarize what Grok changed and what's left.\n",{"name":5,"author":23,"license":14,"version":24,"metadata":25,"platforms":38,"description":7},"Matt Maximo (MattMaximo), Hermes Agent","0.1.1",{"hermes":26},{"tags":27,"related_skills":34},[28,29,30,31,32,33],"Coding-Agent","Grok","xAI","Code-Review","Refactoring","Automation",[35,36,37],"codex","claude-code","hermes-agent",[39,40,41],"linux","macos","windows","main","0905b0264ce5a54908bedc9637e50251543db132","optional-skills\u002Fautonomous-ai-agents\u002Fgrok",0,"https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary","https:\u002F\u002Fgithub.com\u002Fashneil12","2026-11-04 08:25:00",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add ashneil12\u002Fvanilla-hermes-agent-canary --skill grok",{"tool":55,"command":56},"bunx","bunx skills add ashneil12\u002Fvanilla-hermes-agent-canary --skill grok",{"tool":58,"command":59},"pnpm","pnpm dlx skills add ashneil12\u002Fvanilla-hermes-agent-canary --skill grok","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Foptional-skills\u002Fautonomous-ai-agents\u002Fgrok\u002FSKILL.md",true,[],[64,71,78,85,92,99],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M7380YR13A23353XT9NS6EGR","blocked-page-recovery","Use when a fetch fails: 403\u002F429, paywall, WAF, bot wall.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fblocked-page-recovery\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M7380VZ8P60Q64J3F92D4AMY","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M7380QXN6F90R0MH1M3FHRKX","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M7380N4BZYT2WRRZN1N9DZ65","spike","Throwaway experiments to validate an idea before build.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fspike\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":18},"01M7380JAEC9ZH5DVPHHK56P97","simplify-code","Parallel 4-agent cleanup of recent code changes.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fsimplify-code\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":18},"01M7380F5MBB7FKWWV3G3TZ193","requesting-code-review","Pre-commit review: security scan, quality gates, auto-fix.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Frequesting-code-review\u002FSKILL.md",[],[]]