understand

understand is a skill for Claude Code, Codex from smallnest/goal-workflow. It costs 125 tokens per session (1,778 once invoked), scanned A, original, MIT.

A review tool for understanding newly generated code changes. It builds a two-column webpage with the changed files on the left and a highlighted diff, or line-by-line change view, on the right, with explanations in Chinese.

In plain words
What is it for?
Use it to review committed, staged, unstaged, or newly created files in the current repository. It helps explain what changed, why it may be needed, and how the changed code works.
Why use it?
It makes a large or unfamiliar set of changes easier to inspect. The file tree, highlighted additions and removals, and explanations connect each code change to its surrounding project context.

Skill for Claude CodeCodex

Part of the goal-workflow plugin — 19 skills 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 skills/smallnest/goal-workflow/understand
Any agent
npx skills add smallnest/goal-workflow --skill understand
Clone the repo
git clone --depth 1 https://github.com/smallnest/goal-workflow

Made for: Claude Code, Codex.

Or install goal-workflow, the plugin that ships this one along with the rest of its 19 skills.

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 understand

README.md
[![agentmods](https://agentmods.dev/badge/skills/smallnest/goal-workflow/understand.svg)](https://agentmods.dev/skills/smallnest/goal-workflow/understand)
Your own site
<a href="https://agentmods.dev/skills/smallnest/goal-workflow/understand"><img src="https://agentmods.dev/badge/skills/smallnest/goal-workflow/understand.svg" alt="Measured on agentmods" height="20"></a>
Per session 125 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,778 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.00125 $0.01778
Opus 5 $0.00063 $0.00889
Sonnet 5 $0.00025 $0.00356
Haiku 4.5 $0.00013 $0.00178

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

Security

Grade A, and why

understand 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.

The scan reads SKILL.md. This mod also ships 1 executable file (understand.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/understand/SKILL.md · 102 lines

How it starts

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

understand

把「本次(AI)新生成的代码变更」变成一个可交互的审阅网页:左侧按真实项目布局列出变更文件树,右侧显示所选文件的 diff(高亮、增删与未变更代码明显区分),并在右侧边栏逐段给出相关单位需求代码解释

始终用中文产出解释与需求。

何时用

  • 用户说 /understand、"review 这次改动"、"解释下新写的代码"、"看看这次变更做了啥"。
  • 目标是理解 + 审阅当前工作区里尚未吃透的改动(通常是 AI 刚生成的),不是重构或修 bug。

组成

skill 目录下三件套(都在 ~/.claude/skills/understand/):

  • understand.py — 纯标准库生成器,两个子命令:scan(解析 git diff → data.json + annotations.json 骨架)、render(合并注释 → report.html)。
  • template.html — Claude light 主题两栏页面(占位符 __UNDERSTAND_PAYLOAD__ 注入数据),Prism.js 走 CDN 做语法高亮。
  • 本文件 — 流程说明。

执行流程

在**用户当前工作目录(仓库内)**执行以下步骤。全程把 SKILL_DIR 当作本 skill 目录的绝对路径(即本文件所在目录)。

1. 扫描变更

python3 "$SKILL_DIR/understand.py" scan
  • 默认基线 = 当前分支与主分支(origin/main→main→master)的 merge-base;如用户指定范围可加 --base <ref>(例如只看最后一次提交用 --base HEAD~1)。
  • 默认输出目录 .understand/(相对 CWD)。可用 --out <dir> 改。
  • 它覆盖:已提交(base..HEAD) + 已暂存 + 未暂存 + 未跟踪新文件
  • 命令会打印 JSON:文件数、增删行数、data.json / annotations.json 路径、以及 paths(变更文件列表)。读这个输出了解改了哪些文件。

2. 通读改动并撰写注释

先把改动读懂,再落注释。建议:

  • Read 每个变更文件(结合 data.json 里的 hunks 看具体增删行号),必要时读周边未改代码补足上下文。
  • 判断每处改动对应的单位需求:优先从仓库线索找真实依据——commit message、docs/ 需求文档、代码注释里写的需求编号/背景、相关 issue。找到真实需求就照写;确实找不到,就基于代码逻辑写「推测意图」并在注释里把 inferred 置为 true(前端会标成灰色「推测意图」而非「需求」,避免把猜测伪装成事实)。

然后编辑 .understand/annotations.json(scan 已生成骨架,保留其 files[].path 顺序,逐个填充)。结构:

{
  "title": "本次变更的一句话主题",
  "summary": "整体在做什么、为什么(2~4 句,可用 **加粗** 与 `代码`)",
  "files": [
    {
      "path": "src/main/java/.../PwaTierInvitationService.java",
      "summary": "这个文件这次改了什么、为何改(1~3 句)",
      "annotations": [
        {
          "side": "new",
          "start": 52,
          "end": 53,
          "requirement": "expires_at 为 timestamptz,需正确编码",
          "explanation": "Vert.x PG 客户端不支持 `java.time.Instant`,改绑 `OffsetDateTime`(`atOffset(UTC)`),否则运行期报 coercion 错误。",
          "inferred": false
        }
      ]
    }
  ]
}

注释字段:

  • side"new" 锚定新版本行号(增行/上下文),"old" 锚定旧版本行号(删行)。绝大多数解释用 "new"
  • start / end — 该段代码的行号区间(data.json 里对应 side 的 newNo/oldNo;单行时 end 可省或等于 start)。行号是文件真实行号,不是 diff 里的序号。
  • requirement — 该段对应的单位需求(简短一句,作为标签展示)。可留空。
  • explanation — 代码解释:讲清这段在干嘛、为什么这么写、有何风险/前提。可用 `code`**bold**
  • inferred — 需求为推测时置 true

Read the full file on GitHub · 102 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 102 lines · 125 tokens per session scan A 878dde837fcb

Subscribe to this mod's changes

understand is a skill published in the GitHub repository smallnest/goal-workflow (268 stars, last pushed 7d ago), licensed MIT. It adds 125 tokens to every session and 1,778 once invoked, about $0.0006 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-30.

Related

Other skills, from other repositories

mass-line

触发:当你需要收集多方意见、把零散反馈整合成可执行方案,或把方案带回真实使用者/执行者验证时调用;常见信号包括 stakeholder input、user feedback、意见汇总、对齐与验证。 English: Trigger when input must be gathered from many people, synthesized into a clearer plan, and returned to the affected users or executors for validation. Use this skill for a collect-synthesize-validate loop.

HughYau/qiushi-skill · 103 tokens

workflows

触发:当你面临的任务明显需要多个思想武器协作时调用;常见信号包括:从零启动新项目、攻坚复杂疑难问题、对已有方案进行迭代优化。此 skill 提供标准化的跨 skill 工作流组合,解决"应该先用哪个 skill、怎么衔接"的问题。 English: Trigger when a task clearly requires multiple skills in sequence. Use this skill to select a standard workflow that chains skills together, defines data handoff between steps, and specifies…

HughYau/qiushi-skill · 117 tokens

concentrate-forces

触发:当多个任务同时争夺时间、注意力、算力或预算,必须确定主攻方向并停止分散用力时调用;常见信号包括优先级过多、资源紧张、推进分散、需要决定先做什么。 English: Trigger when limited resources are being split across too many tasks and one main target must be chosen. Use this skill to concentrate effort, sequence work decisively, and finish a meaningful breakthrough before expanding.

HughYau/qiushi-skill · 105 tokens

protracted-strategy

触发:当目标长期、任务复杂、资源暂时处于劣势,或短期无法速胜但又不能放弃时调用;常见信号包括 long-term effort、phased plan、endurance、战略耐心、需要分阶段推进。 English: Trigger when the work is long-horizon, difficult, and unlikely to be won quickly. Use this skill to divide the effort into stages, keep strategic confidence, and accumulate small wins into overall victory.

HughYau/qiushi-skill · 105 tokens

practice-cognition

触发:当你提出了方案、假设或判断,需要通过实践验证、试错迭代或复盘升级认知时调用;常见信号包括 experiment、prototype、validate、iterate、feedback loop。 English: Trigger when an idea, hypothesis, or plan must be tested in practice and improved through iteration. Use this skill to move from action to understanding and back to action in a spiral learning loop.

HughYau/qiushi-skill · 92 tokens

contradiction-analysis

触发:当问题复杂、存在多个冲突因素、优先级不清,或你不知道应该先解决什么时调用;常见信号包括 trade-off、瓶颈、根因不明、主次不清、多个问题互相牵制。 English: Trigger when a problem contains competing forces, unclear priorities, or no obvious entry point. Use this skill to identify contradictions, isolate the principal contradiction, classify its nature, and choose the right response.

HughYau/qiushi-skill · 105 tokens