diffusion-map

diffusion-map is a skill for Claude Code, Codex from jtsang4/efficient-coding. It costs 101 tokens per session (1,638 once invoked), scanned A, original, MIT.

A conversation mode that grows a visual map of a topic over time. The map stores ideas and their relationships locally, can continue across sessions, and lets users revisit the conversations behind its nodes.

In plain words
What is it for?
Use it to explore a subject, learn a field, or develop a project step by step. It can create topic pillars, add and merge nodes, and serve the map in a local web page.
Why use it?
It prevents a broad discussion from becoming a flat list of notes that is hard to resume or reorganize. It keeps the evolving structure available between conversations.

Skill for Claude CodeCodex

Written for Claude Code and Codex: disable-model-invocation in frontmatter, but also agents/openai.yaml present. Also seen: mentions Claude Code; mentions Codex.

Good fit Use it to explore a subject, learn a field, or develop a project step by step. It can create topic pillars, add and merge nodes, and serve the map in a local web page.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jtsang4/efficient-coding/diffusion-map
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.

Any agent
npx skills add jtsang4/efficient-coding --skill diffusion-map
Clone the repo
git clone --depth 1 https://github.com/jtsang4/efficient-coding

Made for: Claude Code, Codex.

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 diffusion-map

README.md
[![agentmods](https://agentmods.dev/badge/skills/jtsang4/efficient-coding/diffusion-map/github.svg)](https://agentmods.dev/skills/jtsang4/efficient-coding/diffusion-map)
Your own site
<a href="https://agentmods.dev/skills/jtsang4/efficient-coding/diffusion-map"><img src="https://agentmods.dev/badge/skills/jtsang4/efficient-coding/diffusion-map/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for diffusion-map

Your own site · 80×15
<a href="https://agentmods.dev/skills/jtsang4/efficient-coding/diffusion-map"><img src="https://agentmods.dev/badge/skills/jtsang4/efficient-coding/diffusion-map.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,638 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.00101 $0.01638
Opus 5.5 $0.00040 $0.00655
Sonnet 5.5 $0.00020 $0.00328
Haiku 4.5 $0.00010 $0.00164

Measured 7d ago against content hash 8831c545c2c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

diffusion-map 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 7d ago.

The scan reads SKILL.md. This mod also ships 30 executable files (evals/visual/capture.ts, evals/visual/fixture-kit.ts, evals/visual/fixtures-en.ts, …), 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/diffusion-map/SKILL.md · 83 lines

How it starts

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

扩散图谱

进入这个模式后,你同时做两件事:

  1. 和用户正常对话:讲解、讨论、追问。这仍然是主要工作,质量不能因为维护图谱而打折。
  2. 维护一张扩散图谱:从几个支柱出发,随着对话把信息结构向外生长、重组。图谱是对话的副产品,由你主动判断何时增长、怎么调整,不需要等用户下指令。

图谱存放在 ~/.efficient-coding/diffusion/maps/<slug>/,跨会话、跨 Agent 都能继续。用户在本地网页上看它实时生长,点开节点可以回看当时的对话。

准备

  • 这个 skill 目录记为 SKILL_DIR。只需要 Bun:不用 bun install,也没有任何构建步骤。网页的界面库和字体由浏览器从 CDN 加载。
  • 下文的 dm 都指 bun "$SKILL_DIR/scripts/dm.ts"。不要 cd 到 skill 目录再执行,保持在当前工作目录直接调用,这样会话的 cwd 才会记录正确。
  • 当前会话(Claude Code 或 Codex)由 CLI 从环境变量中自动识别。所有改动图谱的命令都会自动把当前会话关联到受影响的节点,不需要你手动处理 session id。

开场

  1. 执行 dm maps,看有没有与本次主题相符的图谱。
  2. 继续已有图谱:执行 dm show -m <slug> 读取大纲。用两三句话说明目前的进展(支柱有哪些、哪些已经稳定、frontier 还有哪些),给出 2–3 个可以继续的方向,然后顺着用户的选择往下聊。
  3. 新建图谱:
    • 弄清用户的意图。意图清楚就不要追问;不清楚最多问一个问题。
    • 设计这张图的 lens:支柱代表什么、有哪些节点类型、状态用哪些词、节点之间有哪几种关系。lens 没有固定模板,按这次的意图来定。设计方法和示例见 references/protocol.md。
    • 提议 3–7 个支柱,每个用一句话说明为什么它是支柱。和 lens 一起交给用户确认,按用户的调整修改。
    • 确认后执行 dm new,再用一次 dm apply 写入支柱。
  4. 执行 dm serve -m <slug>,把网址告诉用户(本机地址,以及同一网络下其他设备可用的地址)。服务已经在运行时,这条命令只打印网址;服务连续 30 分钟没有被访问会自动退出,下次调用再启动即可。用户只想本机访问时,加 --host 127.0.0.1。

每一轮对话

先把这一轮的对话做好,然后问自己:这一轮之后,信息结构应该变成什么样?

  • 生长:某个点被实质性地讲清楚了,就作为节点挂到最合适的父节点下。只是提到、还没有展开的点,用 lens 里 open 语气的状态加进来,作为后续可以扩散的方向。
  • 调整:发现两个节点其实是同一件事,就合并;层级放错了,就移动;之前的理解有误,就修改摘要或状态;不同分支之间存在关系,就连一条边。
  • 状态推进:用户表现出已经理解、已经拍板,或者已经否决,就更新状态。
  • 登记讨论:这一轮讨论到了已有节点,但结构没有变化,就用 touch 记录,这样网页上能从这些节点找到这次对话。

一轮里的所有变化,用一次 dm apply 提交,格式见 references/cli.md。不需要每轮都改:纯闲聊,或者只是在复述已有内容时,什么都不做。

在对话里,图谱的更新最多用一句话带过,比如"图谱:新增『借用检查』,并入『生命周期』"。不要把记账过程展开给用户看。

什么时候先和用户确认

大多数调整直接做。下面这些影响大的改动,先说明再动手:

  • 增加、删除或更换支柱;
  • 删除一棵子树,或者删除已经关联了会话的节点(remove --cascade);
  • 修改 lens(dm lens),比如新增或删除节点类型、修改状态体系。

拿不准结构该怎么组织时,也可以直接问用户,比如"这个更像 A 的一部分,还是一个独立的支柱?"

用户主动要求时

用户说"展开这个""把 X 拆开""这两个合并""删掉这块"时,照做。展开节点就是围绕它讲解,然后把讲到的内容按上面的规则长进图谱。

删除图谱

用户可以自己在网页的图谱列表页删除(卡片上的删除按钮,带确认)。在对话里,只有用户明确要求时才删除整张图谱(例如快照占用空间太大,或者主题已经不需要了):

  1. 先执行 dm delete -m <slug> 预览,它会列出节点数、关联对话数和占用空间,但不会删除任何东西;
  2. 把预览结果告诉用户,确认后再执行 dm delete -m <slug> --yes。

Read the full file on GitHub · 83 lines

Files

What ships with it

42 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. 7d ago Changed 8831c545c2c2
  2. 9d ago First seen · 83 lines · 101 tokens per session scan A f7a5cc7b9dd1

Subscribe to this mod's changes

diffusion-map is a skill published in the GitHub repository jtsang4/efficient-coding (2 stars, last pushed 8d ago), licensed MIT. It adds 101 tokens to every session and 1,638 once invoked, about $0.0004 per session on Opus 5.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-10-11.

Related

Other skills, from other repositories

plugin-creator

Create and scaffold plugin directories for Codex with a required .codex-plugin/plugin.json, optional plugin folders/files, valid manifest defaults, and personal-marketplace entries by default. Use when Codex needs to create a new personal plugin, add optional plugin structure, generate or update marketplace entries…

openinterpreter/openinterpreter · 86 tokens

cw-gates

Use before claiming any Codewhale change is done, green, or ready to land: the focused-to-broad verification ladder, the budget checks CI enforces, and the rules for what counts as a passing test.

Hmbown/Codewhale · 48 tokens

eval-dataset-design

A guide to creating reliable test sets for AI agents. Each evaluation task includes the request, the simulated user's behaviour, a reset starting state, and a success check that can be independently verified.

bojieli/ai-agent-book · 138 tokens

memory-system

A guide to giving an AI agent persistent, user-specific memory across conversations. It covers what to remember, how to store it, how to update or compress it, and when to use memory instead of a shared knowledge base.

bojieli/ai-agent-book · 95 tokens

feishu

Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.

Hmbown/CodeWhale · 33 tokens

interview

Ask one useful structured question at a time only when material product/implementation choices are genuinely missing; remember answers and produce a brief/spec. Discoverable facts should be investigated instead of asked.

Hmbown/CodeWhale · 40 tokens