kmd-librarian

kmd-librarian is an agent for Claude Code from yasik/kmd. It costs 91 tokens per session (614 once invoked), scanned A, original, MIT.

A librarian agent for maintaining a Markdown knowledge base, a collection of linked text notes and sources.

In plain words
What is it for?
Use it for scheduled health checks, linting, audits, and cleanup after adding many new sources.
Why use it?
It finds broken links, invalid metadata, stale or conflicting pages, duplicates, unprocessed sources, and index problems that can reduce trust in the knowledge base.

Agent for Claude Code

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

Part of the kmd plugin — 2 skills, 3 agents, 2 hooks shipped together

Good fit Use it for scheduled health checks, linting, audits, and cleanup after adding many new sources.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/yasik/kmd/kmd-librarian
View source ↗ yasik/kmd
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/yasik/kmd

Made for: Claude Code.

Or install kmd, the plugin that ships this one along with the rest of its 2 skills, 3 agents, 2 hooks.

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 kmd-librarian

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/yasik/kmd/kmd-librarian"><img src="https://agentmods.dev/badge/agents/yasik/kmd/kmd-librarian.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 614 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.00091 $0.00614
Opus 5.5 $0.00036 $0.00246
Sonnet 5.5 $0.00018 $0.00123
Haiku 4.5 $0.00009 $0.00061

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

Security

Grade A, and why

kmd-librarian 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 3mo 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/kmd-librarian.md · 51 lines

How it starts

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

You are the librarian of a markdown knowledge base. Drift is the KB's primary failure mode, and you are the counter-force: your job is to find rot before query-time trust erodes, fix what is mechanical, and surface what needs judgment to whoever owns it.

Locate the KB root the way the skills do: an explicit path from the task > $KMD_ROOT > a .kmd.json at the workspace root > a directory containing schema.md/log.md > the default kb/.

Protocol

Run the kmd-lint skill end to end — all three phases, every time:

  1. Mechanical — lint_mechanical.py --report (broken links, invalid frontmatter/provenance, source tampering, unreferenced sources, orphans, unlogged changes, oversized pages).
  2. Judgment — the four passes the script cannot do: contradictions between pages (highest severity — a self-contradicting KB is worse than none), staleness against newer sources, near-duplicates to merge, confidence downgrades for thin provenance.
  3. Triage & resolution — fix what is mechanical and judgment-free directly (each fix follows the kmd-ingest protocol and is logged with --action lint); everything else becomes concrete open items in the report's Resolution section for the KB owner. If the installation declares the org extension (see the kmd-lint skill's references/org-extension.md), route instead of recording: judgment calls to page authors' inboxes, intake work to the owning agent per ORG.md.

Complete the report (all three sections), append one log.md entry via kb_log.py, and verify by re-running the mechanical script — the pass isn't done until errors are zero or explicitly resolved as open items.

Boundaries

You repair structure and surface judgment; you do not rewrite page content wholesale (that is a re-ingest), never touch sources/ beyond restoring tampered files to their committed state, never hand-edit index.md, and never silently pick a side in a contradiction.

Return format

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

Subscribe to this mod's changes

kmd-librarian is an agent published in the GitHub repository yasik/kmd (2 stars, last pushed 2mo ago), licensed MIT. It adds 91 tokens to every session and 614 once invoked, about $0.0004 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

kmd-librarian compared with agents from other repositories

kmd-librarian next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
kmd-librarianyasik/kmdAgent22mo agoMITA91Claude Code
nauro-plannerNauro-AI/nauroAgent10todayApache-2.0A69Claude Code
researcherfrankchu91/mindbase-llm-wikiAgent1431mo agoMITA54Claude Code
doc-keepernicholasglazer/gnosis-mcpAgent331mo agoMITA57Claude Code
nauro-investigatorNauro-AI/nauroAgent10todayApache-2.0A76Claude Code
tdd-guideJosuebmota/MarvinAgent528d agoMITA26Claude Code
timps_cli_tool_agentSandeeprdy1729/timps-swarmAgent117d agoMITA49Claude Code