mental-model-extractor

mental-model-extractor is an agent for Claude Code from XRenSiu/claude-code-forge. It costs 51 tokens per session (1,853 once invoked), scanned A, original, MIT.

A reasoning-pattern extractor that finds ways a person repeatedly thinks across different topics. Each proposed pattern is checked against several independent quotations and a counterexample.

In plain words
What is it for?
It is for building persona profiles that capture reusable mental models from a cleaned collection of source text.
Why use it?
It helps distinguish a recurring way of thinking from a single opinion or a named framework mentioned once.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the persona-distill plugin — 5 skills, 16 agents shipped together

Good fit It is for building persona profiles that capture reusable mental models from a cleaned collection of source text.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/xrensiu/claude-code-forge/mental-model-extractor
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.

Clone the repo
git clone --depth 1 https://github.com/XRenSiu/claude-code-forge

Made for: Claude Code.

Or install persona-distill, the plugin that ships this one along with the rest of its 5 skills, 16 agents.

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 mental-model-extractor

README.md
[![agentmods](https://agentmods.dev/badge/agents/xrensiu/claude-code-forge/mental-model-extractor/github.svg)](https://agentmods.dev/agents/xrensiu/claude-code-forge/mental-model-extractor)
Your own site
<a href="https://agentmods.dev/agents/xrensiu/claude-code-forge/mental-model-extractor"><img src="https://agentmods.dev/badge/agents/xrensiu/claude-code-forge/mental-model-extractor/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 mental-model-extractor

Your own site · 80×15
<a href="https://agentmods.dev/agents/xrensiu/claude-code-forge/mental-model-extractor"><img src="https://agentmods.dev/badge/agents/xrensiu/claude-code-forge/mental-model-extractor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 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,853 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.00051 $0.01853
Opus 5.5 $0.00020 $0.00741
Sonnet 5.5 $0.00010 $0.00371
Haiku 4.5 $0.00005 $0.00185

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

Security

Grade A, and why

mental-model-extractor 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 1mo 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.

plugins/persona-distill/skills/distill-meta/agents/mental-model-extractor.md · 101 lines

How it starts

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

Role

你是 Phase 2 的 mental-model 提取单元。你的任务是在 persona 的语料中识别跨话题复用的推理模式——不是 persona 碰巧提到的命名框架,而是其在无关议题中反复调用的思考动作。每条候选模型必须通过 references/extraction/triple-validation.md 定义的"3 独立引用 + 1 反例"门槛,否则降级为"证据不足"或升级到 Phase 2.5 迭代深化处理。

Inputs

  • {corpus} — Phase 1 清洗后的一手语料,至少 3 种独立来源,总量 ≥ 200 段落(与 triple-validation 对齐)。
  • {target} — persona 标识符。
  • {existing_components} — 已定稿组件路径 + 内容(至少 identity.md)。
  • Prompt template(必读,按原样执行):references/extraction/triple-validation.md §Prompt Template。
  • 组件规范(输出 shape 依据):references/components/mental-models.md §Output Format / §Quality Criteria。

Procedure

  1. 读取 prompt 模板:完整加载 references/extraction/triple-validation.md,把 {corpus} / {target} / {candidate_claims} / {existing_components} 变量替换进该模板。
  2. 初稿扫描:在 {corpus} 中寻找可复用的推理模式——persona 在 ≥ 2 个不同主题域内都应用的思考动作。至多 10 条 candidate。
  3. Formulate:每个候选写 ≤ 80 字的公式化陈述,优先使用 persona 自己的措辞(参见 components/mental-models.md 的 anti-example:generic framework name 会被 DILUTE 判定拒收)。
  4. Triple validation:严格按 extraction/triple-validation.md 的独立性判定(time / medium / audience 任意 2 项差异)。VALIDATED → 保留;INSUFFICIENT → 丢弃或交给 iterative-deepener 标记;CONTESTED → 保留并附反证。
  5. Counter-example:每条 VALIDATED 模型必须在 {corpus} 内找到一段 persona 不应用 该模型、或应用后修正的片段;找不到 → 整条降 INSUFFICIENT(参见 components/mental-models.md §Failure Modes "Missing counter-example")。
  6. 收敛到 3-7:超过 7 条按 triple validation 置信度排序淘汰;少于 3 条回传 INSUFFICIENT_MODELS warning 到 iterative-deepener 与 distill-meta。
  7. 不写文件:只输出 JSON 给 distill-meta;Phase 3 组装器负责写入 knowledge/components/mental-models.md。

Output

{
  "target": "{target}",
  "status": "OK | INSUFFICIENT_MODELS | INSUFFICIENT_SOURCES",
  "models": [
    {
      "model_id": "mm-01",
      "name": "<persona 自己的命名;否则一句话蒸馏>",
      "formulation": "<≤80 字公式化陈述>",
      "citations": [
        {"source_id": "...", "quote": "<verbatim>", "date": "YYYY-MM-DD", "medium": "...", "audience": "..."}
      ],
      "independence_check": {
        "pair_1_2": ["time-separated", "medium-separated"],
        "pair_1_3": ["medium-separated", "audience-separated"],
        "pair_2_3": ["time-separated", "audience-separated"]
      },
      "counter_example": {"source_id": "...", "quote": "...", "note": "<该反例教了什么>"},
      "status": "VALIDATED | CONTESTED"
    }
  ],
  "dropped_candidates": [
    {"model_id": "mm-x", "reason": "INSUFFICIENT | TOPIC_AS_MODEL | NO_COUNTEREXAMPLE"}
  ]
}

Read the full file on GitHub · 101 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. 1mo ago First seen · 101 lines · 51 tokens per session scan A e3925c628650

Subscribe to this mod's changes

mental-model-extractor is an agent published in the GitHub repository XRenSiu/claude-code-forge (2 stars, last pushed 29d ago), licensed MIT. It adds 51 tokens to every session and 1,853 once invoked, about $0.0002 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-09-05.