kb-query

kb-query is a skill for Claude Code from stjbrown/agent-knowledge. It costs 77 tokens per session (1,243 once invoked), scanned A, original, MIT.

A tool for answering questions from a project knowledge bundle, which is a structured collection of linked Markdown notes. It finds the relevant notes and assembles an answer from them instead of searching the entire bundle each time.

In plain words
What is it for?
Use it to look up project facts, compare documented concepts, explore connections, or consult existing knowledge before making a decision. It follows links between the bundle's index and its relevant notes.
Why use it?
It keeps answers grounded in information the project has already collected. It can also add relevant bundle context to another task when the repository contains useful knowledge.

Skill for Claude Code

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

Part of the agent-knowledge plugin — 7 skills shipped together

Good fit Use it to look up project facts, compare documented concepts, explore connections, or consult existing knowledge before making a decision. It follows links between the bundle's index and its relevant notes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/stjbrown/agent-knowledge/kb-query
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.

Any agent
npx skills add stjbrown/agent-knowledge --skill kb-query
Clone the repo
git clone --depth 1 https://github.com/stjbrown/agent-knowledge

Made for: Claude Code.

Or install agent-knowledge, the plugin that ships this one along with the rest of its 7 skills.

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-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/stjbrown/agent-knowledge/kb-query/github.svg)](https://agentmods.dev/skills/stjbrown/agent-knowledge/kb-query)
Your own site
<a href="https://agentmods.dev/skills/stjbrown/agent-knowledge/kb-query"><img src="https://agentmods.dev/badge/skills/stjbrown/agent-knowledge/kb-query/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 kb-query

Your own site · 80×15
<a href="https://agentmods.dev/skills/stjbrown/agent-knowledge/kb-query"><img src="https://agentmods.dev/badge/skills/stjbrown/agent-knowledge/kb-query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,243 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.00077 $0.01243
Opus 5.5 $0.00031 $0.00497
Sonnet 5.5 $0.00015 $0.00249
Haiku 4.5 $0.00008 $0.00124

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

Security

Grade A, and why

kb-query 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.

skills/kb-query/SKILL.md · 96 lines

How it starts

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

kb-query — answer from the bundle

Answer a question from a knowledge bundle, or surface relevant bundle context for another task. Because synthesis was front-loaded during ingest or repository documentation, this is mostly navigation and assembly, not rediscovery. Read ../kb/references/glossary.md for terms.

Two modes, same procedure:

  • Explicit — the user asks a knowledge question ("what do we know about X?", "compare A and B").
  • Ambient — you're doing another task and a bundle in the repo has relevant context; consult it before answering from scratch, then return to the task.

1. Locate the bundle(s)

Find the bundle root (a knowledge/ dir, or an index.md with okf_version). If knowledge/ holds several bundles, read knowledge/index.md and pick the relevant one(s); a query may span more than one. If no bundle exists, say so and stop (offer kb-init).

Completion criterion: the relevant bundle root(s) are identified.

2. Navigate by progressive disclosure

Do not read the whole bundle. Read the root index.md first, then the relevant section index.md, to find candidate concepts; follow cross-links from there. Read only concepts relevant to the question. (At large scale a search tool may exist — use it to find candidates, but the retrieved unit is still a synthesized concept, not a raw chunk.)

Completion criterion: you have the specific concepts that bear on the question, reached by following the index and links rather than scanning.

3. Read with currency and conflict awareness

Apply the reading side of the trust model and the version profile:

  • If a concept is retired (status: deprecated in OKF v0.2 or legacy status: superseded), follow superseded_by to the current version and answer from that (use the old one only if the user asks how something evolved).
  • If concepts are linked by conflicts_with, read the anchor and all linked signals and answer with nuance — separate what authoritative sources confirm from what softer signals suggest, with dates and sources. Do not flatten a contested question into a single yes/no.
  • If today >= stale_after, label the concept stale and corroborate it before relying on it. Use generated.at for v0.2 recency and fall back to legacy timestamp only when generated is absent.
  • Derive the advisory trust tier from verified: no verifier is unverified, non-human verifiers are machine-confirmed, and any human: verifier is human-reviewed. Never treat a tier as access control.
  • Resolve claim footnotes through matching sources[].id; when sources is absent, a v0.2 consumer may fall back to a legacy # Citations section.
  • For type: Attested Computation, distinguish recorded definition verification from per-run attestation. Do not execute or alter its computation unless the user separately authorizes the declared executor path; never present an unattested runtime value as attested.

Read the full file on GitHub · 96 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 · 96 lines · 77 tokens per session scan A 8811d6d108e8

Subscribe to this mod's changes

kb-query is a skill published in the GitHub repository stjbrown/agent-knowledge (41 stars, last pushed 2mo ago), licensed MIT. It adds 77 tokens to every session and 1,243 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

openlore

Query and publish to an OpenLore knowledge repository over SSH using ordinary shell commands. Use when a task needs project documentation, runbooks, shared team knowledge, or a place to publish findings.

aakarim/OpenLore · 42 tokens

openlore-housekeeping

Audit and maintain a shared OpenLore knowledge repository. Use on a schedule or on request to find stale docs, broken links, unreviewed inbox items, and missing skill coverage, then publish an audit report.

aakarim/OpenLore · 48 tokens

wegent-knowledge

Knowledge base management and search tools for Wegent. Provides capabilities to list, create, update, and search knowledge bases and documents using RAG retrieval. Use this skill when the user wants to manage knowledge bases, documents, or search for information programmatically.

wecode-ai/Wegent · 51 tokens

llm-wiki

Build and maintain a persistent, interlinked Obsidian-compatible markdown wiki using Karpathy's LLM Wiki pattern. Extension-backed with auto-generated metadata, guardrails, and 14 custom tools (+3 opt-in agent-trajectory tools).

zosmaai/pi-llm-wiki · 52 tokens

mindbase

Maintain a persistent AI-tended research wiki. Activates when the user wants to ingest a source (PDF, URL, article, paste), capture a thought, build the wiki context, query what's already known, lint for orphans/contradictions, or maintain page conventions. Phrases include "add this to my wiki", "today I decided…"…

frankchu91/mindbase-llm-wiki · 105 tokens

okf-pro

Operating rules for the .okf/ knowledge bundle — filing new concepts, the board, the journal, the daily snapshot, closing work, source attribution, and the generated/verified attestation policy. Use before reading from or writing anything into .okf/.

serradura/okf · 56 tokens