knowledge-capture

A tool for saving lasting, domain-specific lessons from an AI coding session into a knowledge graph, which stores connected concepts and relationships.

In plain words
What is it for?
Use it at the end of a session or on demand to capture relevant concepts, definitions, decisions, people, and repositories after the feature has been enabled for a domain.
Why use it?
It prevents useful decisions and discoveries from being lost between sessions while avoiding temporary or unrelated conversation details.

Skill for Claude CodeCodex

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/grburgess/mindgap/knowledge-capture
Any agent
npx skills add grburgess/mindgap --skill knowledge-capture
Clone the repo
git clone --depth 1 https://github.com/grburgess/mindgap

Made for: Claude Code, Codex.

Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 602 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.00089 $0.00602
Opus 5 $0.00044 $0.00301
Sonnet 5 $0.00018 $0.00120
Haiku 4.5 $0.00009 $0.00060

Measured yesterday against content hash 0a6ec0a8dffd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

knowledge-capture 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 yesterday.

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.

mindgap-plugin/skills/knowledge-capture/SKILL.md · 45 lines

What it actually says

knowledge-capture

Turn what a session just taught you into graph nodes + edges, autonomously and reversibly. The full ingest protocol is AGENTS.md (binding); essentials below.

Capture is disabled by default. It only fires once you enable it and set a domain — see ~/.mindgap/capture.json (enabled + domain).

When this fires

  • Automatically: the SessionEnd hook (mindgap-capture-hook) spawns a headless subagent over the session transcript. It runs with MINDGAP_CAPTURE=1.
  • Manually: invoke to capture the current session's learnings on demand.

Step 1 — relevance gate (do this FIRST)

Read the transcript / recall the session. Ask: does it contain durable, on-domain learnings (domain = capture.json domain.description)? Ephemeral chatter, config edits, and off-domain work → write nothing and stop. Papers read for learning → defer to paper-to-mindmap (it owns paper nodes); don't double-ingest.

Step 2 — dedup

For each candidate learning, run mindgap_context "<topic>" / mindgap_find first. Upsert existing ids; never mint a near-duplicate (AGENTS.md near-duplicate rule).

Step 3 — ingest (provenance is mandatory)

Ingest via mindgap_ingest with, on every node:

  • created_by = "capture:<repo-basename>" (the session's cwd basename)
  • confidence = 0.6 (machine-captured; below hand-curated nodes)
  • a urls entry pointing at the transcript: {label, url:"file://<transcript>", kind:"web"}
  • [[wiki-links]] in bodies to anchor into existing nodes — never create islands.

Cap at capture.max_nodes_per_session nodes. Raise confidence only when re-deriving an existing node from an independent source (AGENTS.md confidence rule).

Step 4 — finish

Delete the lock file at ~/.mindgap/capture.lock so the next session can capture.

Health

mindgap lint reports orphans, dangling stubs, near-duplicate candidates, and stale capture nodes. Run it periodically; it is deterministic and never rewrites the graph.

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. yesterday First seen · 45 lines · 89 tokens per session scan A 0a6ec0a8dffd

Subscribe to this mod's changes

knowledge-capture is a skill published in the GitHub repository grburgess/mindgap (0 stars, last pushed 1mo ago), licensed MIT. It adds 89 tokens to every session and 602 once invoked, about $0.0004 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-31.

Related

Other skills, from other repositories

book-mirror

Take any book (EPUB/PDF), produce a personalized chapter-by-chapter analysis. Each chapter is preserved in detail (The Chapter) and mirrored back to the reader's actual life (The Mirror) using brain context. The mirror observes and resonates — a friend pointing out parallels, NOT a consultant rearranging the reader's…

garrytan/gbrain · 138 tokens

a-evolve

Apply A-Evolve's agentic evolution methodology to improve AI agent performance across runs. Use when the user wants to diagnose agent failures, generate targeted skills from error patterns, evolve system prompts, or accumulate episodic knowledge. Works standalone or inside AutoResearchClaw pipelines. Triggers on…

aiming-lab/AutoResearchClaw · 100 tokens

hive.chart-creation-foundations

Required reading whenever any chart tool is available. Teaches the one-tool embedding contract (call chartrender → live chart appears in chat AND a downloadable PNG lands in the queen session dir), the ECharts (data viz) vs Mermaid (structural diagrams) decision, the BI/financial-grade aesthetic baseline (no…

aden-hive/hive · 133 tokens

code-documenter

Use when adding docstrings, creating API documentation, or building documentation sites. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, tutorials, user guides.

zebbern/claude-code-guide · 39 tokens

deck-course-module

暖纸背景 + Playfair, 左侧学习目标常驻, 含 MCQ 自测页.

nexu-io/html-anything · 25 tokens

creating-skills

Guide for creating Claude Code skills following Anthropic's official best practices. Use when user wants to create a new skill, build a skill, write SKILL.md, update an existing skill, or needs skill creation guidelines. Provides structure, frontmatter fields, naming conventions, and new features like dynamic context…

redai-infra/Relax · 70 tokens