resume

resume is a command for Claude Code, Codex from alvis-HaoH/gkd. It costs 53 tokens per session (1,883 once invoked), scanned A, original, MIT.

A command for continuing a previously delegated task, either from the current folder or from a named past session. A session is the saved context of an earlier delegated task.

In plain words
What is it for?
Use it when you want an agent to continue the last delegated task, resume a particular session, or adjust its thinking effort or model.
Why use it?
It removes the need to restart a delegated task or manually provide its earlier context. It can also preserve whether the earlier task was read-only or allowed to make changes.

Command for Claude CodeCodex

Written for Claude Code and Codex: allowed-tools in frontmatter, but also runs codex exec. Also seen: mentions Codex.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the gkd plugin — 7 commands shipped together

Good fit Use it when you want an agent to continue the last delegated task, resume a particular session, or adjust its thinking effort or model.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add alvis-HaoH/gkd
Claude Code
/plugin install gkd

Made for: Claude Code, Codex.

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 resume

README.md
[![agentmods](https://agentmods.dev/badge/commands/alvis-haoh/gkd/resume.svg)](https://agentmods.dev/commands/alvis-haoh/gkd/resume)
Your own site
<a href="https://agentmods.dev/commands/alvis-haoh/gkd/resume"><img src="https://agentmods.dev/badge/commands/alvis-haoh/gkd/resume.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 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,883 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00053 $0.01883
Opus 5 $0.00026 $0.00941
Sonnet 5 $0.00011 $0.00377
Haiku 4.5 $0.00005 $0.00188

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

Security

Grade A, and why

resume 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 8d 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/resume.md · 68 lines

How it starts

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

续委派线程(B 档),让委派模型接着上次的上下文继续干。用户几乎不会给 sessionId——他只会说"接着刚才"或模糊描述"上次那个改配置的"。把这句话对应到哪个 session 是你(主 Claude)的活,三种情况:

  • 续本目录上次(最常见):用户只说"接着刚才/上次继续" → 不带 id,--resume 让 runtime 取本目录最近一次续上。
  • 模糊描述某次历史委派("上次那个改配置的"/"让 kimi review 的那次"/"别的项目里写文档那个") → 走检索 SOP(下方)把描述翻成 sessionId,再 --resume <id> 续(可跨目录,runtime 自动定位归属目录并在那里运行)。
  • 用户直接粘了 UUID → 直接 --resume <id>

mode 自动继承:上次 do(写)就继续写,上次 ask(读)就继续读(从委派记录恢复)。想把读会话升级到写,用 /gkd:do --resume [<sessionId>] <补充>(显式 --write 永远胜过继承)。

原始参数:

$ARGUMENTS

怎么做

  1. 拣 flags:--<modelKey>--effort <档>--json--quiet不要手动加 --write(由继承决定)。--effort(none/low/medium/high/xhigh/max)调思考强度,claude/codex 通用;用户说"这次深想一点/快速点"之类就补上。

  2. 定位要续哪个 session(三种情况见开头):续本目录上次 → 不带 id;模糊描述 → 走检索 SOP(下一节)拿 id;用户直接粘 UUID → 直接用。注意:别因补充指令里恰好有类 UUID 串(trace id/GUID)就误拣成 --resume <id>,拿不准就当普通续——runtime 侧有 UUID 正则闸门兜底。

  3. (补充指令第一个非 id/flag token 起,保留换行):

node "${CLAUDE_PLUGIN_ROOT}/scripts/gkd-runtime.mjs" --resume <可选 sessionId> <拣出的 flags> "$(cat <<'__GKD_TASK_EOF__'
<补充指令原文,保留换行>
__GKD_TASK_EOF__
)"

点名续时 --resume 紧跟 sessionId(如 --resume 550e8400-e29b-41d4-a716-446655440000);续上次则只写 --resume。单引号 heredoc 终止符 + 外层 "$(...)" 包成单个 argv 参数(同 ask/do)。

  1. 运行模式:默认 run_in_background: true(续上次线程,规模通常不小)。只有确信本次补充 < 30 秒才前台,且必须 timeout: 600000

检索 SOP:模糊描述 → sessionId

用户模糊描述某次历史委派("续上次那个改配置的")时,别自己 Read/grep delegations.jsonl(每行含大量 token 噪音,直接读会污染上下文)。用内部检索脚本 gkd-find-session.mjs——它已内建投影(剥噪音)、关键词/目录/时间过滤、追 fork 链到最新节点、限量:

node "${CLAUDE_PLUGIN_ROOT}/scripts/gkd-find-session.mjs" <关键词...> [--all-cwd] [--days N] [--limit N] [--model <key>] [--last]
  • 关键词:对任务摘要做子串匹配(多个 = 任一命中)。用户说"改配置"就传 配置 config models
  • 默认只看当前目录、时间倒序(最新在前);跨目录/别的项目找加 --all-cwd;要更早的加 --days N;按模型筛加 --model glm(用户说"上次 kimi 看的那个");用户就说"接着刚才/上次"没别的线索时,--last 直接拿当前目录最新一条。
  • 输出每条已是该 fork 链的最新节点(累积了全部续接上下文),id: 那行可直接拿去 --resume <id>[续接] 标记表示它是 fork 出来的节点,任务摘要取自该链发起行。

Read the full file on GitHub · 68 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. 8d ago First seen · 68 lines · 53 tokens per session scan A ae421ded5845

Subscribe to this mod's changes

resume is a command published in the GitHub repository alvis-HaoH/gkd (10 stars, last pushed 1mo ago), licensed MIT. It adds 53 tokens to every session and 1,883 once invoked, about $0.0003 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.