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.
npx agentmods add commands/alvis-haoh/gkd/askgit clone --depth 1 https://github.com/alvis-HaoH/gkdWrote 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.
[](https://agentmods.dev/commands/alvis-haoh/gkd/ask)<a href="https://agentmods.dev/commands/alvis-haoh/gkd/ask"><img src="https://agentmods.dev/badge/commands/alvis-haoh/gkd/ask.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00043 | $0.01022 |
| Opus 5 | $0.00022 | $0.00511 |
| Sonnet 5 | $0.00009 | $0.00204 |
| Haiku 4.5 | $0.00004 | $0.00102 |
Grade A, and why
ask 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 4d 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.
What it actually says
把任务委派给指定模型,只读模式——子进程不能改文件、不能跑除 git:* 外的 Bash。
委派的目的是把重活的 token 留在子进程,别搬回主上下文——给方向和路径,实活交给子进程。
原始参数(可能多行,含特殊字符):
$ARGUMENTS
怎么做
-
拣 flags:识别
--<modelKey>(见${CLAUDE_PLUGIN_ROOT}/config/models.json)、--with-context、--resume、--effort <档>、--json、--quiet。忽略--write——ask 只读,用户若需要修改就提醒他改用/gkd:do。--effort(none/low/medium/high/xhigh/max)调思考强度,claude/codex 模型通用;用户说"深想一点/xhigh""快速点/别想太多"之类就补上。不传则各 harness 用自己的默认档。 -
选模型:
- 用户显式指定或自然语言提名("用 GPT 看看","让所有模型xxx")就用之;没说就自己判断挑一个合适的,拿不准就不传、让 runtime 用默认。
- 视觉约束(须自觉遵守):任务涉及图片时,只能从这些支持视觉的模型里选:!
node "${CLAUDE_PLUGIN_ROOT}/scripts/gkd-runtime.mjs" --list-vision - 本机装了 codex CLI 时
--codex可用(走 codex harness、GPT 原生工具循环,不是又一个便宜模型;要 harness 差异 / 独立第二意见 / GPT-image生成时选它)。codex 也支持--with-context,首次会把当前对话导入成 codex thread(约 1-2s)。
-
--with-context自己判断:任务若回指了主对话里才有、任务文本没写清的信息(指代某个之前讨论的方案/实体),就加--with-context把主对话 fork 给子进程;任务完全自洽就不加;拿不准就用AskUserQuestion问用户(选项:带上对话历史 / 干净委派)。 -
跑(任务文本第一个非 flag token 起,保留所有换行):
node "${CLAUDE_PLUGIN_ROOT}/scripts/gkd-runtime.mjs" \
<拣出+补的 flags> \
--allowed-tools "Read Grep Glob Bash(git:*)" \
"$(cat <<'__GKD_TASK_EOF__'
<把任务原文逐字粘进来,保留换行,不重排/总结/翻译>
__GKD_TASK_EOF__
)"
单引号 heredoc 终止符 + 外层 "$(...)" 让多行任务成为单个 argv 参数(裸用 $ARGUMENTS 会被 shell 拆成多条命令,别这么写)。
- 运行模式:默认
run_in_background: true。Bash 前台默认 2 分钟超时会杀子进程丢进度,而读长文档/全仓审常超时。只有确信 < 30 秒(简单单点问答)才前台,且必须传timeout: 600000,绝不用默认。不确定就后台。
输出处理
- 后台:Bash 立刻返回 task_id,报给用户("已在后台启动,task:
<id>,跑完会通知")并立刻还控制权,不要 TaskOutput 阻塞。收到<task-notification>后 Read 那个.output文件,把 result 汇报给用户。 - 前台:stdout 直接就绪,直接汇报。
- stderr 末尾
[gkd]行确认实际模型;❌ 失败时把 result 里的 API 错误原文如实告知用户。 - ask 只读,**由你判断结果是否采纳、如何落盘。
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.
- 4d ago First seen · 49 lines · 43 tokens per session scan A 7cb238fc5774
ask is a command published in the GitHub repository alvis-HaoH/gkd (10 stars, last pushed 1mo ago), licensed MIT. It adds 43 tokens to every session and 1,022 once invoked, about $0.0002 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.
Other commands, from other repositories
OPSX: Fast Forward
Create a change and generate all artifacts needed for implementation in one go.
OPSX: Propose
Propose a new change - create it and generate all artifacts in one step.
OPSX: Onboard
Guided onboarding - walk through a complete OpenSpec workflow cycle with narration.
OPSX: Sync
Sync delta specs from a change to main specs.
OPSX: Apply
Implement tasks from an OpenSpec change (Experimental).
OPSX: Archive
Archive a completed change in the experimental workflow.