grok-subagent AGENTS.md

grok-subagent AGENTS.md is an instructions file for Codex, OpenCode from Walvez/grok-subagent. It costs 591 tokens per session, scanned A, original, MIT.

Developer instructions for a Codex plugin that uses the official Grok command-line tool as an external helper agent, including its separate X and web search workflow. Grok is an AI service, and the command line lets the plugin run it from development tools.

In plain words
What is it for?
Running Grok-assisted searches, delegating controlled tasks, and developing or testing the grok-subagent plugin.
Why use it?
They explain setup, search isolation, write restrictions, caching, and secret handling so the plugin can be used without exposing credentials or modifying the wrong worktree.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/walvez/grok-subagent/agents-md
Clone the repo
git clone --depth 1 https://github.com/Walvez/grok-subagent

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for grok-subagent AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/walvez/grok-subagent/agents-md.svg)](https://agentmods.dev/instructions/walvez/grok-subagent/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/walvez/grok-subagent/agents-md"><img src="https://agentmods.dev/badge/instructions/walvez/grok-subagent/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 591 This file is loaded in full into every session.
When invoked 591 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00591 $0.00591
Opus 5 $0.00296 $0.00296
Sonnet 5 $0.00118 $0.00118
Haiku 4.5 $0.00059 $0.00059

Measured 3d ago against content hash 67e356c79db6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

grok-subagent AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 46 lines

What it actually says

AGENTS.md

项目定位

Codex 插件:通过官方 Grok Build CLI,把 Grok 作为受控外部子 Agent,并支持仓库外的 Grok 原生 X/Web 搜索。Codex 负责编排与最终核验。

怎么跑起来

# 依赖:Node.js 22+、已登录的官方 Grok CLI(~/.grok/bin/grok 或 grok)
npm test
codex plugin marketplace add "$PWD"
codex plugin add grok-subagent@walvez-grok
# 安装后必须新建 Codex 任务,旧会话不会热加载 Skill/MCP

搜索 smoke(会消耗 Grok 额度):

python3 plugins/grok-subagent/scripts/run_search.py run --platform x --depth quick --since 3d "..."

技术栈

  • 无 npm 运行时依赖
  • MCP stdio bridge:plugins/grok-subagent/mcp-server/server.mjs
  • 官方 grok agent stdio(ACP)用于只读/写入/交互
  • 隔离搜索桥:plugins/grok-subagent/scripts/run_search.py(改编自 sudoHG/codex-grok-search)

目录与约定

  • 插件根:plugins/grok-subagent/
  • Skill:plugins/grok-subagent/skills/grok-subagent/SKILL.md
  • 中文 README 是默认入口;英文见 README.en.mdREADME.zh-CN.md 仅为迁移跳转
  • 用户可见行为变更时同步更新 README.mdREADME.en.mdCHANGELOG.mdARCHITECTURE.mdSECURITY.md
  • 写入模式只允许 linked Git worktree(.git 为文件),禁止主检出
  • 搜索模式禁止进入当前仓库 cwd;结果缓存在 ~/.cache/grok-subagent/search-runs
  • 不要提交 ~/.grok/auth.json、token、私有 prompt 或含真实密钥的测试仓

当前状态与下一步

  • 现役版本:0.4.0main 已含隔离搜索工具
  • 本地插件缓存:~/.codex/plugins/cache/walvez-grok/grok-subagent/0.4.0
  • 公开 GitHub Release 仍停在 v0.3.1;若要对外安装路径解析到 0.4.0,需要补 tag/Release
  • 新任务中优先:项目审查用 grok_spawn_readonly;X/Reddit/实时公开研究用 grok_search
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 46 lines · 591 tokens per session scan A 67e356c79db6

Subscribe to this mod's changes

grok-subagent AGENTS.md is an instructions file published in the GitHub repository Walvez/grok-subagent (4 stars, last pushed 1mo ago), licensed MIT. It adds 591 tokens to every session, about $0.0030 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.