ask

ask is a command for coding agents from alvis-HaoH/gkd. It costs 43 tokens per session (1,022 once invoked), scanned A, original, MIT.

A read-only command for asking another AI model to answer, analyze, review, or advise on a task. It can include relevant conversation context and lets the user choose thinking effort or a model.

In plain words
What is it for?
Use it for code reviews, investigations, planning, brainstorming, and other questions where the delegated model only needs to read information.
Why use it?
It moves demanding analysis into a separate process, keeping the main conversation shorter. Because it cannot edit files or run most commands, it is suited to getting a second opinion safely.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the gkd plugin — 7 commands shipped together

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 commands/alvis-haoh/gkd/ask
Clone the repo
git clone --depth 1 https://github.com/alvis-HaoH/gkd

Or install gkd, the plugin that ships this one along with the rest of its 7 commands.

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 ask

README.md
[![agentmods](https://agentmods.dev/badge/commands/alvis-haoh/gkd/ask.svg)](https://agentmods.dev/commands/alvis-haoh/gkd/ask)
Your own site
<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>
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,022 The whole file, excluding the scripts and references it only reads on demand.
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.00043 $0.01022
Opus 5 $0.00022 $0.00511
Sonnet 5 $0.00009 $0.00204
Haiku 4.5 $0.00004 $0.00102

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

Security

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.

commands/ask.md · 49 lines

What it actually says

把任务委派给指定模型,只读模式——子进程不能改文件、不能跑除 git:* 外的 Bash。 委派的目的是把重活的 token 留在子进程,别搬回主上下文——给方向和路径,实活交给子进程。

原始参数(可能多行,含特殊字符):

$ARGUMENTS

怎么做

  1. 拣 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 用自己的默认档。

  2. 选模型:

  • 用户显式指定或自然语言提名("用 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)。
  1. --with-context 自己判断:任务若回指了主对话里才有、任务文本没写清的信息(指代某个之前讨论的方案/实体),就加 --with-context 把主对话 fork 给子进程;任务完全自洽就不加;拿不准就用 AskUserQuestion 问用户(选项:带上对话历史 / 干净委派)。

  2. (任务文本第一个非 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 拆成多条命令,别这么写)。

  1. 运行模式:默认 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 只读,**由你判断结果是否采纳、如何落盘。
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. 4d ago First seen · 49 lines · 43 tokens per session scan A 7cb238fc5774

Subscribe to this mod's changes

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.