Decision Kernel — Development skill for Claude Code
Distil how you make decisions from your Claude Code history into an always-loaded CLAUDE.md kernel.
How to install Decision Kernel
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open Tespera/decision-kernel and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Decision Kernel does
Distil how you make decisions from your Claude Code history into an always-loaded CLAUDE.md kernel. Local, verifiable, you approve every entry.
Alternatives in Development
- 09 Bygdebok Extraction — Local History Extraction 1.1k ★
- Claude Usage — A local dashboard for tracking your Claude Code token usage, costs, and session history 864 ★
- Coding Agent Session Search — Unified TUI and CLI to index and search your local coding agent session history across 11+ providers (Codex, C 708 ★
README
decision-kernel
**让 Claude Code 学会你的判断方式——从你自己的对话记录里。**
不用写规则,不用填问卷。它读你和 AI 的历史对话,找出你做过的每一次取舍、说过的每一句「因为」,
提炼成一份常驻的**决策内核**:下次遇到同类问题,AI 按你的思路自己拿主意,不再一遍遍来问你。
[](https://www.python.org/) [](pyproject.toml) [](https://claude.com/claude-code) [](LICENSE)
**简体中文** | [English](README.en.md)
你是不是也这样?
**Claude:** 这个旧接口要删掉,还是先保留?
**你:** 保留,先停用。
*(三天后,另一个项目)*
**Claude:** 这张旧表要不要直接删?
**你:** ……我上次不是说过了吗。
AI 每次都在认真征求你的意见,可同一类问题你已经回答过几十遍了。 写进 `CLAUDE.md` 也不管用:你写的是「旧接口先停用」,它遇到的是「旧表」「旧配置」「旧分支」——**规则只覆盖你写过的场景。**
AI 缺的不是规则,是你**为什么**这么选。上面两次回答背后其实是同一个判断:
**按可逆性分配谨慎,不按事情大小。** 停用代替删除、并存代替覆盖、副本代替原地改造。不确定还有没有用 → 保留。删除是不对称的赌注:赌赢省一点事,赌输不可挽回。
—— 摘自作者本人蒸馏出的内核,[完整 11 条看这里](examples/decision-kernel.md)
有了这一条,AI 遇到你没写过的「旧表」「旧分支」,也能推出你会怎么选。
它产出什么
一份几百行的 Markdown,常驻在每个 Claude Code 会话里。每条内核三段:
| 写的是 | 作用 | |
|---|---|---|
| 为什么 | 你在乎什么、在保护什么 | 让 AI 理解动机,而不是死记行为 |
| 遇到取舍时问自己 | 几个提问 | 让 AI 推出没写过的场景该怎么做 |
| 边界 | 什么时候不适用 | 防止一条原则被用过头 |
最后还有一段「冲突裁决」:几条同时命中时,听哪一条的。
**可选的第二层:场景细则。** 某条内核在具体场景下怎么用(比如「按可逆性分配谨慎」落到删数据、推送远端上各怎么做),太具体、放进内核会撑大常驻内容。启用细则层后,这些写进按内核分篇的细则,不常驻,AI 遇到具体场景时才去读。用 `dk init --details` 开启。
真实跑出来的数字
作者用它蒸馏了自己约 10 个月的 Claude Code 记录:
340 万字符的对话 → 1377 个决策片段 → 784 条裁决记录 → 125 条动机 → 11 条内核
- 内核会被新对话检验,也会被修正。 第一轮增量复盘(2026-09)的 152 条裁决里,150 条能由已有内核推出,另外 2 条是“内核推得出、AI 却还在问”的提问信号,没有新模式,也没有相悖。不过这批裁决有一部分早于内核定稿,不算严格的样本外检验。第二轮(2026-10)的 330 条里冒出了 2 个新模式和 1 处相悖,作者据此修订了两条内核,其余候选进了观察清单。逐条判定由 Claude 按“内核里的提问能否直接推出这条裁决”完成,作者看报告拍板。
- 原话校验抓到过一个 subagent 替用户续写了一句原话。这种「AI 替你发明原则」的错误,会被挡在内核之外。
dk evidence 的统计,截至 2026-10,含两轮增量复盘)
|
Related Skills
Axonflow List Recent Decisions
List recent AxonFlow governance decisions for the current user/tenant — surface "what just got blocked", trace
Decide Nt
Record a load-bearing decision into plan/history.md Decisions section — one-line surgical capture mid-session
Init Rules
Scaffold opt-in path-scoped nested CLAUDE.md rule files into the project to lazy-load per-area conventions whi
Always Loaded Diet
Discipline for the files your agent loads every session (CLAUDE.md, MEMORY.md): one nightly writer, measured b
Trim Context
Find and fix sources of Claude Code "token bloat" in a repo — oversized CLAUDE.md (vs the 40k-char limit), blo
Mem Goal
Record or update a [goal] entry — the user's objective with a Status and verifiable Done-when
Related Agents
Review Workflow Context Budget
Reviews workflow machinery for context-window budget on three axes: always-loaded surface, load-on-demand disc
Sdlc Coder
Drives strict TDD (Red→Green→Refactor) implementation of one story file, in the target repository. Always load
Standup Poster
Writes clear team updates and posts them to Slack — always after you approve the wording.