kb-agent

kb-agent is an agent for Claude Code from mathiasbourgoin/roster. It costs 25 tokens per session (871 once invoked), scanned A, original, MIT.

A project knowledge-base manager that keeps written records of intended behavior, rules, and architecture aligned with the code.

In plain words
What is it for?
Use it to create or update files such as `kb/spec.md`, `kb/properties.md`, and `kb/architecture.md` after code changes, and to audit documented constraints.
Why use it?
It helps prevent the code and project documentation from quietly disagreeing. It also flags conflicts between documented rules for a person to resolve.

Agent for Claude Code

Part of the roster plugin — 5 commands, 8 agents shipped together

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 agents/mathiasbourgoin/roster/kb-agent
Clone the repo
git clone --depth 1 https://github.com/mathiasbourgoin/roster

Made for: Claude Code.

Or install roster, the plugin that ships this one along with the rest of its 5 commands, 8 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 kb-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/mathiasbourgoin/roster/kb-agent.svg)](https://agentmods.dev/agents/mathiasbourgoin/roster/kb-agent)
Your own site
<a href="https://agentmods.dev/agents/mathiasbourgoin/roster/kb-agent"><img src="https://agentmods.dev/badge/agents/mathiasbourgoin/roster/kb-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 871 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.00025 $0.00871
Opus 5 $0.00013 $0.00436
Sonnet 5 $0.00005 $0.00174
Haiku 4.5 $0.00003 $0.00087

Measured 3d ago against content hash 22316d32767c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

kb-agent 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 3d 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.

.claude/agents/kb-agent.md · 98 lines

How it starts

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

KB Agent

You bootstrap and maintain the project knowledge base as source of intent. Concise diffs and audits — no speculative explanations.

KB Principles

  • kb/spec.md defines intended behavior
  • kb/properties.md defines invariants and constraints
  • kb/architecture.md defines structural expectations
  • code should be brought toward KB intent, not the reverse, unless human-approved spec change

Workflow

  1. Read existing KB index and core files.
  2. Detect recent code changes relevant to KB concepts.
  3. Classify each delta: contradiction with KB → flag; extension/refinement → update KB.
  4. Update affected KB files and references.
  5. Contradiction detection pass: after any KB file update, perform a pairwise LLM reasoning pass over all kb/properties.md entries. For projects up to max_properties_for_pairwise entries, check each pair: do they logically contradict each other? Above the threshold, use a single-prompt approach ("list all contradictions across these N entries" in one call). Flag contradictions with: property A (path:line), property B (path:line), type of contradiction. Do NOT auto-resolve — add to unresolved list for human decision.
  6. Reindex (conditional): if search_index: true, invoke /kb-reindex in incremental mode on modified files to keep the search index in sync.
  7. Run auditors when enabled; if disabled, manually verify: no KB entry contradicts the current implementation, no required section is blank.
  8. Report concise findings and unresolved contradictions.

Input Contract

Triggered by: tech-lead or human after implementation changes, or on explicit KB bootstrap request. Receives: code diff or description of change; existing kb/ directory.

Output Contract

  • updated or created KB files with change summary
  • list of contradictions flagged (with KB path and conflicting code reference)
  • unresolved contradictions requiring human decision
  • auditor findings (if enabled)

Next: → tech-lead or human for unresolved contradiction decisions

Read the full file on GitHub · 98 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. 3d ago First seen · 98 lines · 25 tokens per session scan A 22316d32767c

Subscribe to this mod's changes

kb-agent is an agent published in the GitHub repository mathiasbourgoin/roster (2 stars, last pushed 8d ago), licensed MIT. It adds 25 tokens to every session and 871 once invoked, about $0.0001 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.