knowledge-builder

knowledge-builder is an agent for Claude Code from shenchangmin/cairnkit. It costs 42 tokens per session (456 once invoked), scanned A, original, MIT.

An import agent that turns collected sources and a user profile into a small set of draft knowledge entries. It also creates an archive summary and checks for secrets such as passwords, tokens, private keys, and credential files.

In plain words
What is it for?
Use it during the third step of a knowledge-import process to create standardized draft entries from source and profile files.
Why use it?
It reduces a large source collection into reusable guidance while preventing sensitive values from being copied into the knowledge base.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cairnkit plugin — 2 skills, 7 commands, 11 agents shipped together

Good fit Use it during the third step of a knowledge-import process to create standardized draft entries from source and profile files.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/shenchangmin/cairnkit/knowledge-builder
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/shenchangmin/cairnkit

Made for: Claude Code.

Or install cairnkit, the plugin that ships this one along with the rest of its 2 skills, 7 commands, 11 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 knowledge-builder

README.md
[![agentmods](https://agentmods.dev/badge/agents/shenchangmin/cairnkit/knowledge-builder/github.svg)](https://agentmods.dev/agents/shenchangmin/cairnkit/knowledge-builder)
Your own site
<a href="https://agentmods.dev/agents/shenchangmin/cairnkit/knowledge-builder"><img src="https://agentmods.dev/badge/agents/shenchangmin/cairnkit/knowledge-builder/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 knowledge-builder

Your own site · 80×15
<a href="https://agentmods.dev/agents/shenchangmin/cairnkit/knowledge-builder"><img src="https://agentmods.dev/badge/agents/shenchangmin/cairnkit/knowledge-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 456 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.00042 $0.00456
Opus 5.5 $0.00017 $0.00182
Sonnet 5.5 $0.00008 $0.00091
Haiku 4.5 $0.00004 $0.00046

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

Security

Grade A, and why

knowledge-builder 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.

agents/knowledge-builder.md · 32 lines

What it actually says

knowledge-builder

From 01-sources.md + 02-profile.md, produce at most 13 durable draft entries — quality over quantity (the strict extraction gate will reject shallow ones anyway).

Secret boundary

Never read or record known secret files such as .env, .env.*, private keys (*.pem, *.key, *.p12, *.pfx), credential stores, token/cookie dumps, or files explicitly marked secret. If a source artifact contains credential-like material, never print or copy the secret value; retain only its path and a redacted warning.

Before materializing any candidate, review candidate bodies for private-key headers and assigned password/token/secret/cookie/API-key values using filename-only output. On any hit, stop the extraction and surface only the candidate/file name for human remediation; do not call kb extract, write a knowledge entry, or push knowledge.

Write docs/knowledge-import/knowledge-candidates.json as a JSON list. Each candidate uses a unique TK-... or BK-... ID and the fields id, title, category, domain, type, guideline_polarity, knowledge_class, layer, tags, applicable_phases, contributors, and body. Set layer to L3; only explicit review through kbrepo promote can make an entry cross-project-visible. If nothing passes the quality boundary, write []. Then run: cairn --root . kb extract --from docs/knowledge-import to gate + materialize drafts, and kb build-index. Initial maturity is draft. A nonzero result from either command is a hard failure: stop and surface it instead of writing a success summary. Write docs/knowledge-import/03-summary.md. Return a one-line summary.

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 · 32 lines · 42 tokens per session scan A 6b3d8514b142

Subscribe to this mod's changes

knowledge-builder is an agent published in the GitHub repository shenchangmin/cairnkit (1 stars, last pushed 3mo ago), licensed MIT. It adds 42 tokens to every session and 456 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-08-31.

Related

Other agents, from other repositories