do

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

A command for delegating coding tasks to another AI model. In write mode, the delegated process can read and change files and run commands, with options for model choice, context, effort, and continuing earlier sessions.

In plain words
What is it for?
Delegating file edits, coding, and command execution; resuming delegated sessions; selecting models or reasoning effort; and passing the current conversation as context.
Why use it?
It moves substantial implementation work into a separate agent session while preserving options for model selection, task context, and follow-up work.

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/do
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 do

README.md
[![agentmods](https://agentmods.dev/badge/commands/alvis-haoh/gkd/do.svg)](https://agentmods.dev/commands/alvis-haoh/gkd/do)
Your own site
<a href="https://agentmods.dev/commands/alvis-haoh/gkd/do"><img src="https://agentmods.dev/badge/commands/alvis-haoh/gkd/do.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 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,310 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.00042 $0.01310
Opus 5 $0.00021 $0.00655
Sonnet 5 $0.00008 $0.00262
Haiku 4.5 $0.00004 $0.00131

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

Security

Grade A, and why

do 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 5d 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/do.md · 51 lines

How it starts

The opening of the file, as written. The whole thing — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.

把任务委派给指定模型,写模式——子进程获得 Read/Grep/Glob/Edit/Write/Bash 全权,可改文件、可执行命令。 委派的目的是把重活的 token 留在子进程,别搬回主上下文——给方向和路径,读写实活交给子进程。

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

$ARGUMENTS

怎么做

  1. 拣 flags:识别 --<modelKey>(见 ${CLAUDE_PLUGIN_ROOT}/config/models.json)、--with-context--resume--effort <档>--json--quiet--write 由命令自动加,不用让用户重复传。 --effort(none/low/medium/high/xhigh/max)调思考强度,claude/codex 模型通用;用户说"深想一点/xhigh""快速点/别想太多"之类就补上。不传则各 harness 用自己的默认档。

    • 续历史会话并写:/gkd:do --resume [<sessionId>] <补充> 可续上次(或点名续某次)委派并给写权限(即使原会话是只读)。续接语义、sessionId 检索 SOP、UUID 误拣防范、--with-context 互斥等规则,统一见 commands/resume.md——此处不复述,避免两处漂移。
  2. 选模型:

  • 用户显式指定或自然语言提名("用 GPT 改")就用之;没说就自己判断挑一个合适的,拿不准就不传、让 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)。codex 写模式的两点差异务必知悉:① 写边界由 codex 自己的 sandbox(workspace-write)定义,不是 gkd 的 allowed-tools 粒度;② codex 写模式默认关闭网络——装库/联网命令(npm install、git fetch 等)会失败,这类任务别派给 codex。
  1. --with-context 自己判断:任务若回指了主对话里才有、任务文本没写清的信息,就加 --with-context 把主对话 fork 给子进程;任务完全自洽就不加;拿不准就用 AskUserQuestion 问用户(选项:带上对话历史 / 干净委派)。

  2. (任务文本第一个非 flag token 起,保留所有换行):

node "${CLAUDE_PLUGIN_ROOT}/scripts/gkd-runtime.mjs" \
  --write \
  <拣出+补的 flags> \
  "$(cat <<'__GKD_TASK_EOF__'
<把任务原文逐字粘进来,保留换行,不重排/总结/翻译>
__GKD_TASK_EOF__
)"

单引号 heredoc 终止符 + 外层 "$(...)" 让多行任务成为单个 argv 参数(裸用 $ARGUMENTS 会被 shell 拆成多条命令,别这么写)。

  1. 运行模式:默认 run_in_background: true。Bash 前台默认 2 分钟超时会杀子进程丢进度,而装库/批量改/多次 LLM 调用常超时。只有确信 < 30 秒(改单文件一两行)才前台,且必须传 timeout: 600000,绝不用默认。不确定就后台。

    runtime 内部对委派子进程有默认 30 分钟超时兜底(防子进程僵死),到点 SIGTERM→SIGKILL 并归一成失败。若这次是预计会超 30 分钟的大任务(超大批量改、逐文件长生成),在 runtime 命令前加环境变量提高上限或关闭:GKD_TIMEOUT_MS=3600000(1 小时)或 GKD_TIMEOUT_MS=0(禁用),否则任务会在 30 分钟被杀、白烧 token。常规任务不用管,用默认即可。

Read the full file on GitHub · 51 lines

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. 5d ago First seen · 51 lines · 42 tokens per session scan A f54104d8b24d

Subscribe to this mod's changes

do is a command published in the GitHub repository alvis-HaoH/gkd (10 stars, last pushed 1mo ago), licensed MIT. It adds 42 tokens to every session and 1,310 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.