grok-cli
Skill0 starsChanged 4 months agoMITView on GitHub
Operate and orchestrate the xAI Grok Build CLI as a bounded coding collaborator. Use when invoking `grok`, especially `grok -p` for headless prompts, `grok agent` for ACP integrations, exact session continuation, delegated implementation or review, agent pairing, consulting, rubber-duck dialogue, structured output, or CLI configuration and diagnostics. Do not use for the Grok web app or direct xAI API integration unless Grok Build CLI behavior is involved.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- amirkiarafiei/subagent-cli-skillstheir own version, first seen Nov 15, 2026
- rookiewu417/claude-skillstheir own version, first seen Oct 25, 2026
- SnowyLake/snowy-agent-skillstheir own version, first seen Oct 20, 2026
- SnowyLake/SnowySkillstheir own version, first seen Oct 20, 2026
- scarletkc/agentstheir own version, first seen Sep 11, 2026
- carson2222/skillstheir own version, first seen Jun 20, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- scarletkc/agents★ 227same name
- carson2222/skills★ 113same name
- amirkiarafiei/subagent-cli-skills★ 14same name
- SnowyLake/snowy-agent-skills★ 4same name
- SnowyLake/SnowySkills★ 4same name
- rookiewu417/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-tauri-native-window-effectsSkill
- agent-councilSkill
- claude-cliSkill
- deep-code-reviewSkill
- design-ui-excellenceSkill
- godot-engineering-suiteSkill
- godot-ui-design-excellenceSkill
- handoffSkill
- react-codebase-excellenceSkill
- rust-codebase-excellenceSkill
- typescript-codebase-excellenceSkill
- webdesign-excellenceSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 13 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use the installed Grok Build CLI as a deliberately scoped collaborator.
- Very specific: line 37
Run grok <command> --help for every subcommand used.
- Very specific: line 46
Do not hard-code a current model ID or copy an old example flag without this check.
- Distinctive: line 52
Do not start an interactive login, sign out, fetch managed setup, or mutate configuration merely to complete a consulting call.
- Very specific: line 71
Prefer grok -p for delegation, review, pair-agent turns, consulting, and rubber-duck work.
- Distinctive: line 83
Default to advisory, read-only access.
- Distinctive: line 87
Before a call, determine:
- Distinctive: line 104
Read Permissions, sandbox, and trust before granting edits, shell access, web access, MCP tools, plugins, or always-approve.
- Distinctive: line 125
Do not paste an entire host-agent transcript when a concise packet is enough.
- Distinctive: line 126
Do not include credentials, unrelated private files, or hidden reasoning.
- Distinctive: line 130
Use the ready-made packets and command shapes in Collaboration patterns.
- Distinctive: line 143
Treat sandbox application as a startup result, not as intent expressed by a flag.
- Distinctive: line 152
Use a fresh session for independent review.
- Distinctive: line 155
Check the process exit code, terminal event or result object, stop reason, incomplete-usage markers, and requested deliverable.
- Distinctive: line 157
Verify factual claims, diffs, and test results in the host environment.
- Distinctive: line 158
Treat Grok's answer as advisory until that verification passes.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Grok CLI
Use the installed Grok Build CLI as a deliberately scoped collaborator. Choose the smallest mode that fits the interaction, give Grok a complete task packet, and independently verify its result before accepting it.
Resolve version drift first
This skill supports the current stable CLI, not older releases. Establish that contract before relying on a flag or output field:
command -v grok
grok version --json
grok update --check --json
grok --help
grok inspect --jsonProceed only when the installed version, the updater's latest stable version,
and metadata.tested-cli-version agree. If the installation is older, report
that an update is required; do not add compatibility branches. If stable has
moved ahead of this skill, refresh the skill before using version-sensitive
guidance. Never update the CLI without separate user authorization.
Run grok <command> --help for every subcommand used. If present, the bundled
guide under ~/.grok/docs/user-guide/ is normally closer to the installed
binary than the website. Apply sources in this order:
- The installed binary's version and command help.
- The guide bundled with that installation.
- Current official documentation, changelog, and source.
- This skill's tested patterns.
Do not hard-code a current model ID or copy an old example flag without this
check. In particular, do not pass speculative prompt flags such as
--best-of-n, --check, or --self-verify to grok -p unless its current
help advertises them. A similarly named flag can have a separate valid meaning;
for example, the tested grok update --check only checks for an update.
Do not start an interactive login, sign out, fetch managed setup, or mutate
configuration merely to complete a consulting call. Those are separate
user-authorized operations. An ACP client still has to send
the protocol's authenticate request when Grok advertises an existing cached
or environment-backed method; that selects already available credentials and
is distinct from initiating grok login.
Choose the operating mode
| Need | Mode | Why |
| Human-led interactive work | grok [PROMPT] | Full TUI, approvals, slash commands, and direct supervision |
| One bounded task or a scripted follow-up | grok -p ... | Starts, returns an answer, and exits; easiest delegation primitive |
| A persistent local client integration | grok agent stdio | Long-lived bidirectional ACP over JSON-RPC stdio |
| A local WebSocket service | grok agent serve | Persistent ACP server for one or more trusted clients |
| A remote relay connection | grok agent headless | Connects the agent through a Grok WebSocket relay |
| Shared backend process | grok agent leader | Coordinates compatible clients through a leader process |
| Grok itself needs child workers | Grok subagents | Child sessions inside one Grok session, distinct from grok agent |
Prefer grok -p for delegation, review, pair-agent turns, consulting, and
rubber-duck work. Choose grok agent only when a client needs a long-lived,
bidirectional protocol, streamed tool lifecycle, permission callbacks, or
mid-turn control. For status, steering, cancellation, and permissions from a
host agent, use the bundled stdlib-only JSONL bridge instead of hand-writing
JSON-RPC. Read
Headless mode or
Agent mode and ACP before invoking the selected mode;
read ACP bridge client before using the helper.
Establish the authority envelope
Default to advisory, read-only access. A request to ask Grok for an opinion is not authority for Grok to edit files, run write-capable commands, contact external systems through MCP, or fan out into its own subagents.
Before a call, determine:
- The exact working directory and project root.
- Which repository and user instructions Grok will discover there.
- Whether Grok may only read, may edit named paths, or may run named validation commands.
- Whether web, MCP, plugins, hooks, memory, or nested subagents are needed.
- Which existing worktree changes belong to the user or another agent.
- The expected output, evidence, turn limit, and stop conditions.
For write delegation, give Grok exclusive ownership of explicit files or a
dedicated host-created worktree. Never assume grok -p --worktree provides
isolation: in Grok Build 1.0.13, current grok --help explicitly says headless
mode does not create a worktree from that flag. Create and inspect the
worktree outside Grok, then pass its absolute path with --cwd. Do not delete
or clean it automatically afterward.
Read Permissions, sandbox, and trust before granting edits, shell access, web access, MCP tools, plugins, or always-approve.
Build a complete task packet
Give Grok only the context required for the assignment, organized as:
Role: <consultant, reviewer, navigator, driver, implementer, rubber duck>
Objective: <one concrete outcome>
Working directory: <absolute path and relevant project root>
Scope: <owned files, symbols, diff, or questions>
Known facts: <evidence already established>
Constraints: <repo rules, compatibility, safety, no-go actions>
Allowed actions: <read, edit paths, exact commands, web/MCP if needed>
Deliverable: <format, detail, schema, or patch expectations>
Validation: <evidence and commands required>
Stop conditions: <ambiguity, destructive action, scope expansion, turn cap>Do not paste an entire host-agent transcript when a concise packet is enough. Do not include credentials, unrelated private files, or hidden reasoning. For an independent second opinion, ask Grok before revealing the host agent's conclusion; compare evidence afterward instead of deciding by vote.
Use the ready-made packets and command shapes in Collaboration patterns.
Run and evaluate the call
- Inspect the current worktree and effective Grok configuration without changing either.
- Select the least-capable tool set, permission mode, sandbox, and extension
set that can complete the task. Headless
grok -pexposes the strongest per-invocation controls. The testedgrok agentsurface does not expose the same--tools,--no-subagents, or permission-mode flags, so use an audited effective configuration or agent profile there; choosegrok -pwhen a strict per-call read-only boundary is required. - Treat sandbox application as a startup result, not as intent expressed by a
flag. If a requested sandbox warns, fails, or exits before the model turn,
never retry automatically without it. A fresh, explicit
--sandbox offtool-free consultation is allowed only when the complete bounded input is supplied in the prompt and effective hooks, plugins, MCP, web, memory, permissions, configuration, and subagents have been disabled or independently reviewed. If Grok needs any local tool capability, or an executable extension cannot be proven inactive or non-mutating, stop until the intended sandbox can be enforced. - Use a fresh session for independent review. Resume the exact returned session ID for pairing or rubber-duck continuity.
- Capture stderr separately from structured stdout when automating.
- Check the process exit code, terminal event or result object, stop reason, incomplete-usage markers, and requested deliverable.
- Verify factual claims, diffs, and test results in the host environment.
- Treat Grok's answer as advisory until that verification passes.
An exit code of zero means the prompt completed, not that the proposed change is correct. An interrupted run does not roll back file changes.
Load the relevant reference
| Task | Reference |
-p, prompt inputs, output formats, JSON/NDJSON, sessions, automation | headless.md |
| ACP lifecycle, stdio, WebSocket server, relay, leader, client design | agent-acp.md |
| Bundled ACP bridge, JSONL commands/events, status, steering, cancellation, permissions | acp-client.md |
| Delegation, pairing, consulting, rubber duck, review, parallel work | collaboration-patterns.md |
| Permissions, tools, sandbox, secrets, hooks, MCP, plugins, trust | permissions-sandbox-trust.md |
| TUI, sessions, agents, rules, memory, configuration, operational commands | cli-areas.md |
| Exact behavior specific to the supported stable CLI | Grok Build 1.0.13 |
| Source hierarchy, official links, version notes, maintenance | sources.md |
Report the outcome
State the mode, working directory, authority granted, session ID when useful,
Grok's conclusion or changes, host-side verification performed, and any
unresolved uncertainty. Do not claim that Grok used a tool, passed a check, or
made no edits unless the captured events, diff, or local verification support
that claim. If a tool-free call follows a failed sandbox start, report the two
attempts separately: the requested sandbox and its startup failure; whether the
later call explicitly used --sandbox off; that it was tool-free rather than
filesystem-read-only; which extension surfaces were inspected or disabled;
and whether a model turn occurred and which session ID belongs to it. Attribute
conclusions and usage or cost only to the output that actually contains them;
do not assign a conclusion, session ID, tool audit, usage, or cost to the
failed start unless its captured output contains that field.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

