metaception

metaception is a skill for Claude Code from magic3007/dotfiles. It costs 332 tokens per session (6,711 once invoked), scanned A, original, MIT.

A method for turning corrections and debugging discoveries into checks that an agent or repository can run. It prefers types, tests, lint rules, hooks, CI, and verification commands, using structured written knowledge only when automation is not possible.

In plain words
What is it for?
It helps convert repeated mistakes into tests, static rules, pre-commit or CI gates, runtime assertions, review commands, and dated knowledge with conditions for reconsidering it.
Why use it?
A written reminder can be missed or forgotten, allowing the same mistake to return. An executable check can fail consistently at a defined point and make the correction part of the development process.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; names the AskUserQuestion tool.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is | X2 | 配置里 timeout 漏填导致默认 0 | type | `src/config.ts` 的 zod schema | `npx tsc --noEmit && node scripts/validate_config.mjs` | exit=0 | 删掉 `timeout` 字段后 exit=1,报 .

Good fit It helps convert repeated mistakes into tests, static rules, pre-commit or CI gates, runtime assertions, review commands, and dated knowledge with conditions for reconsidering it.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/magic3007/dotfiles
agentmods
npx agentmods add skills/magic3007/dotfiles/metaception

Made for: Claude Code.

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 metaception

README.md
[![agentmods](https://agentmods.dev/badge/skills/magic3007/dotfiles/metaception/github.svg)](https://agentmods.dev/skills/magic3007/dotfiles/metaception)
Your own site
<a href="https://agentmods.dev/skills/magic3007/dotfiles/metaception"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/metaception/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 metaception

Your own site · 80×15
<a href="https://agentmods.dev/skills/magic3007/dotfiles/metaception"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/metaception.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 332 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,711 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.00332 $0.06711
Opus 5.5 $0.00133 $0.02684
Sonnet 5.5 $0.00066 $0.01342
Haiku 4.5 $0.00033 $0.00671

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

Security

Grade A, and why

metaception 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 4 executable files (scripts/validate_skill.py, tests/ab/score.py, tests/grade_runs.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/metaception/SKILL.md · 392 lines

How it starts

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

Metaception:先把纠正变成检查,剩下的才写成知识

你是 Metaception。输入是一次工作会话,输出是对未来真正起作用的约束。

顺序不可颠倒:

  1. 先问「这次纠正能不能变成一条确定性检查?」——能,就产出检查。
  2. 不能,再问「能不能变成受校验的结构化知识?」——能,就按四类知识落位。
  3. 两者都不能,如实报告「本次不抽取」,并写明理由。

0. 第一原则:纠正优先变成检查,而不是多写一行规则

往规则文件里加一行散文,是成本最低、效果最差的纠正方式。它依赖未来的 agent 恰好读到、恰好记住、 恰好在正确的时刻联想起来。三个"恰好"相乘,命中率很低;而且规则文件越长,每一行被注意到的概率越低—— 加规则这个动作本身会稀释已有规则。

确定性检查没有这个问题:它在固定时刻无条件执行,输出 0 或 1,不依赖注意力。

所以每条纠正都先走这张形态阶梯,从 L1 往下找,取第一个可行级别:

级别 形态 机器词 做法 例子
L1 消除可能性 eliminate 让错误无法被表达:删掉错误入口、合并重复写入路径、把非法状态变成不可构造 两条写配置的路径合成一条;可选参数改必填
L2 类型/构建期 type 编译或 schema 校验阶段失败 zod/pydantic schema、tsc --noEmit、mypy、JSON Schema
L3 测试 test 把这次的错误固化成失败用例,修好后变回归测试 针对该 bug 的最小单测
L4 静态规则 lint 一条扫全仓的规则,命中即失败 eslint 自定义规则、ast-grep 模式、ruff 规则、rg 守卫脚本
L5 门禁 hook / ci 在提交/流水线上无条件执行 pre-commit hook、CI job
L6 运行期断言 runtime-assert 早失败,并在报错文案里直接写修法 assert path.is_absolute(), "传相对路径会在 worker 里解析错,改传 abspath"
L7 复核命令 command 一条可粘贴执行、判据确定的命令(人工触发) python3 scripts/validate_skill.py <dir>
L8 散文规则 prose 最后手段,必须写明为何 L1–L7 都不可行 "命名要符合领域习惯"(审美无法判定)

选了 L6 及以下,必须在 ## Checks 的"无法自动化"表里写明为什么上面几级不可行。 写不出理由,说明还没想清楚,回去重想。

0.1 纠正性质 → 形态的常见映射

纠正的说法 通常落在
"不要用 X,用 Y" L4:一条禁止 X 的静态规则
"这个字段不能为空 / 这个值只能是这几种" L2:schema 或枚举类型
"这个 bug 别再回来了" L3:回归测试
"提交前必须先跑 Z" L5:pre-commit / CI
"参数传错单位 / 传错路径形态" L6:带修法文案的运行期断言
"每次都要记得检查 W" L4 或 L5——出现"每次都要记得"这种措辞,几乎总能自动化
"这里要理解业务背景才知道怎么权衡" L8:散文,且只写判断依据,不写流水步骤

0.2 负控:没有负控的检查等于没有检查

写完一条检查,必须把错误故意写回去,确认检查真的失败,并记录那次失败的输出。

理由来自实测失败模式:检查写错路径、错 glob、错正则,于是永远 PASS;人以为被保护,实际裸奔。 一条永远 PASS 的检查比没有检查更糟,因为它消耗注意力并提供虚假安全感。

负控记录格式:把 <文件> 的 <改动> 还原后,<命令> exit=1,输出 <关键片段>。

1. 四类知识的落位(无法自动化的部分写这里)

认知心理学把知识分为事实性、概念性、程序性、元认知四类。凡是没能变成检查的知识,按下表落位:

知识类型 回答的问题 落位 缺失后果(实测失败模式)
事实性 (Factual) "是什么":常量、报错串、版本、路径、默认值 ## Facts 表格,每行带证据 + 复核命令 + 生效条件 + 记录日期 半年后无法判断结论是否仍成立;报错串被记错,检索命中不了
概念性 (Conceptual) "为什么":机制、类别、关系、判别标准、边界 ## Model:机制链 + 分类树 + 判别标准 + 适用边界 只有"这么改能好",症状相同、根因不同的近似案例会误用
程序性 (Procedural) "怎么做":有序步骤、条件分支、回滚、停止条件 ## Procedure:决策表 + 分支步骤 + 每步期望输出 + 回滚 + 停止条件 步骤只在原始环境成立;换环境第一步就卡住,且不知何时放弃
元认知 (Metacognitive) "我(不)知道什么":置信度、证伪条件、未知项、复审 ## Calibration:逐条置信度 + 证伪条件 + 未知清单 + 复审日期 + 使用台账 推测与实测混在一起被当事实传播;技能永不失效,成为污染源

Read the full file on GitHub · 392 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. 4d ago Changed · +1 lines · +8 tokens per session fba7d07f5f93
  2. 16d ago First seen · 391 lines · 324 tokens per session scan A 83047c0c1753

Subscribe to this mod's changes

metaception is a skill published in the GitHub repository magic3007/dotfiles (11 stars, last pushed 5d ago), licensed MIT. It adds 332 tokens to every session and 6,711 once invoked, about $0.0013 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-11-14.

Related

metaception compared with skills from other repositories

metaception next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
metaceptionmagic3007/dotfilesSkill115d agoMITA332Claude Code
assess-qualityurmzd/dotfilesSkill64d agoApache-2.0A120Claude Code
create-oss-skillurmzd/dotfilesSkill64d agoApache-2.0A63Claude Code
extend-oss-skills-to-claudeurmzd/dotfilesSkill64d agoApache-2.0A74Claude Code
scaffold-nodeurmzd/dotfilesSkill64d agoApache-2.0A119Claude Code
test-codeurmzd/dotfilesSkill64d agoApache-2.0A101Claude Code
scaffold-docsurmzd/dotfilesSkill64d agoApache-2.0A196Claude Code