Skip to content

/ask-grok

Get Grok (xAI) second opinion on a question or current work. Single-shot, advisory, no contamination.

From plugin
deliberation
18015 skills15 commands1 MCP
> /plugin marketplace add antonbabenko/deliberation
> /plugin install deliberation@antonbabenko-deliberation

Command definition

ask-grok.md
name: ask-grok
description: Get Grok (xAI) second opinion on a question or current work. Single-shot, advisory, no contamination.
allowed-tools: mcp__deliberation-grok__grok, Read, Bash
timeout: 660000

Ask Grok

Single-shot delegation to Grok (xAI) via MCP for an independent second opinion. Fresh thread, no shared context with prior calls. Advisory only - the Grok bridge talks to the xAI HTTP API and has no filesystem access, so it cannot implement changes (unlike `/ask-gemini`, which can - `/ask-gpt` is advisory-only too). Model defaults to `GROK_DEFAULT_MODEL` (or `grok-4.6`). The bridge tells the model it has no tools and no further turns, and a reply that only announces intent ("I'll verify the cited files...") or is shorter than `GROK_MIN_ANSWER_CHARS` (default 1, so only an empty body) comes back as `errorKind: "empty"` (retryable) instead of a stub answer.

Input

User question or topic: $ARGUMENTS

Workflow

1. **Identify expert** - match `$ARGUMENTS` against trigger patterns in `~/.claude/rules/deliberation/triggers.md`:

  • Architecture / design / tradeoffs → Architect
  • Plan validation → Plan Reviewer
  • Requirements / scope → Scope Analyst
  • Code review / find bugs → Code Reviewer
  • Security / vulnerabilities → Security Analyst
  • Default if unclear → Architect

2. **Read expert prompt** via this resolution sequence: 1. Glob `~/.claude/plugins/cache/*/deliberation/*/prompts/[expert].md`. Pick the match with the highest semver version segment (the segment immediately after `deliberation/`, parsed as semver - not lexical string compare). 2. If no match, look up the inlined fallback under the heading `## Inlined fallback - [Expert]` in this command file (see end of this file). 3. If neither found, abort with: `Error: deliberation plugin cache missing for expert "[Expert]". Run /plugin install deliberation or /reload-plugins.`

3. **Build 7-section delegation prompt** per `~/.claude/rules/deliberation/delegation-format.md`. Include:

  • Verbatim user question from `$ARGUMENTS`
  • Relevant code snippets / file paths from current conversation context (attach local files Grok should read via `files` in step 4; inline small snippets directly)
  • Any specific constraints user has mentioned this session
  • Time-sensitive facts: when the question turns on latest or current versions, pricing, a roadmap, or whether a model or tool exists, verify it with your own tools first and add the facts with as-of date and source (the delegate gets today's date from the server but cannot look anything up)

4. **Call Grok** - single-shot, advisory:

   mcp__deliberation-grok__grok({
     prompt: "[7-section delegation prompt]",
     "developer-instructions": "[contents of expert prompt file]",
     sandbox: "read-only",
     cwd: "[repo root]",
     roots: ["[absolute repo root]"],            // optional; falls back to [cwd]
     files: [{ path: "path/relative/to/root" }]  // attach referenced local files by default
   })

**Files:** attach the local files Grok should read by default in `files`. Each entry is EXACTLY ONE of `{ path }` (local file; delivery controlled by `mode` — default uploads to the xAI Files API), `{ file_id }` (already uploaded), `{ file_url }` (public URL), or `{ dir, include?, exclude?, excludeReset?, maxFiles?, maxBytes? }` (recursive directory expansion via the bundled glob walker; caller `exclude` is APPENDED to safe defaults that skip VCS, `node_modules`, `dist`/`build`/`out`, modern Node build dirs, Yarn Berry caches, lockfiles, Python venv/cache dirs, coverage, `target`/`vendor`, `.terraform`/`.terragrunt-cache`, plus security patterns (`*.tfstate*`, `.env*`, `.ssh/**`, SSH keypairs, `*.pem`/`*.key`). Set `excludeReset: true` to replace defaults entirely. Hard caps `maxFiles=50` / `maxBytes=128MB`). Path/dir entries also accept `mode: "auto" | "inline" | "upload"` (default `"upload"`): **`"inline"` embeds the file as `input_text` so Grok reads it line-by-line** (use this for source code review — `input_file` references are searchable, not always fully read); `"auto"` inlines text ≤ `GROK_INLINE_MAX_BYTES` (default 256 KB) and uploads the rest; `"upload"` always goes through the Files API. Resolution: `path` and `dir` resolve under `roots[]` (first-root-wins) or `cwd` if `roots` is omitted. Uploads are SHA-256 dedup-cached locally, so a second `/ask-grok` with the same files uploads nothing (inline files skip the cache entirely — they cost prompt tokens each call but are always fully read). Uploads auto-expire (default 7 days, `GROK_FILE_TTL_SECONDS`); prune with `/grok-files`. Full reference: `TECHNICAL.md` § "Grok files and cleanup".

**Grok context parity (CRITICAL):** Grok cannot list, glob, or walk the repo - it only sees what is in the `files` array. For any open-ended, repo-wide question ("improve this repo", "audit this code", "what are tradeoffs in our architecture"), Grok will otherwise answer from the prompt text alone and produce abstract, unciteable analysis. Whenever the prompt asks Grok to reason about the repo at all, ALWAYS attach an orientation bundle:

1. Pick 2-6 high-signal files: project `CLAUDE.md` / `AGENTS.md` / `README.md` (if present), top-level entrypoints (`main.tf`, `package.json`, `app.py`, `Cargo.toml`, `pyproject.toml`, etc.), and any module the question is clearly about. For a whole directory, prefer a `{ dir }` entry over enumerating files. 2. Pass them as `files: [{ path: "CLAUDE.md", mode: "auto" }, { path: "main.tf", mode: "auto" }, { dir: "src", include: ["**/*.ts"], mode: "auto" }, ...]` with `cwd` = repo root. `mode: "auto"` is strongly recommended for source-code review — it inlines text files so Grok reads them line-by-line instead of treating them as searchable attachments (the default `"upload"` matches the v2.0 behavior; explicitly say `"inline

Read more
@antonbabenko
Ships withdeliberation

Get a second opinion from GPT, Gemini, and Grok in Claude Code, Codex, Cursor, Kiro, Antigravity, OpenCode, or any other MCP host - plus local models (Ollama, LM Studio) and 400+ more models through OpenRouter, including Qwen, Kimi, and DeepSeek.

Stars on GitHub

Momentum

stars in total
180
Star history of antonbabenko/deliberation on GitHub, a chart by star-history.com

Other commands on deliberation.

analyze
Auto-invoked

analyze

Command

Analyze recent runs - per-model latency, tokens, and verdict agreement - and suggest model/reasoning/fanout tuning. Advisory,…

ask-all
Auto-invoked

ask-all

Command

Ask GPT, Gemini, Grok, and any configured OpenRouter models in parallel for independent second opinions, then synthesize and…

ask-gemini
Auto-invoked

ask-gemini

Command

Get Gemini second opinion on a question or current work. Single-shot, advisory, no contamination. Model pinned per call.

ask-gpt
Auto-invoked

ask-gpt

Command

Get GPT (Codex) second opinion on a question or current work. Single-shot, advisory, no contamination.

codex-login
Auto-invoked

codex-login

Command

Log GPT (Codex) in on this machine with a ChatGPT device login - shows a link and a one-time code. For remote or headless…

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command