query-kb

query-kb is a skill for Claude Code, Codex from hraness/wrench. It costs 83 tokens per session (2,472 once invoked), scanned A, original, MIT.

A workflow for finding and reading relevant context in a Markdown knowledge base before answering a repository question.

In plain words
What is it for?
Use it to load repository guidance, find notes by title or metadata, follow relationships, and inspect related records.
Why use it?
It helps an agent use the right instructions, notes, links, and history without searching the entire repository blindly.

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/hraness/wrench/query-kb
Any agent
npx skills add hraness/wrench --skill query-kb
Clone the repo
git clone --depth 1 https://github.com/hraness/wrench

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/hraness/wrench/query-kb.svg)](https://agentmods.dev/skills/hraness/wrench/query-kb)
Your own site
<a href="https://agentmods.dev/skills/hraness/wrench/query-kb"><img src="https://agentmods.dev/badge/skills/hraness/wrench/query-kb.svg" alt="Measured on agentmods" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,472 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.00083 $0.02472
Opus 5 $0.00042 $0.01236
Sonnet 5 $0.00017 $0.00494
Haiku 4.5 $0.00008 $0.00247

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

Security

Grade A, and why

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

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

  • query-kb — 100% identical, 0 lines differ
  • query-kb — 100% identical, 0 lines differ
.agents/skills/query-kb/SKILL.md · 206 lines

How it starts

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

Query the knowledge base

Use the cheapest precise view first, then broaden. Markdown files remain the authority; search scores, metadata rows, and graph results are derived views.

Locate the vault

  • Resolve <vault> to the directory containing its managed or authored index.md, then set the shell-local KB_ROOT to that path (KB_ROOT=kb from a typical repository root, or KB_ROOT=. from inside the vault).
  • Resolve <repository> to the repository root when the question concerns a repository path (KB_REPO=. from that root).
  • Read the vault's applicable agent instructions and note conventions.
  • Pass the resolved path to every --root; do not scan a repository root merely because that is where the agent session started.

Choose the retrieval lane

  • Repository file or directory: run kb context first. Read its inherited guides root to nearest, then inspect its maintained knowledge, active plans, dated research, reports, and separate historical-plan group. Open only useful context hubs or records.
  • Known frontmatter field or tag such as type, status, or area: use kb list.
  • Known note title, path, or alias: use kb links or kb backlinks, which resolve note identities before returning authored relationships.
  • A whole-vault structural question or relationship audit: use kb graph --json, then inspect the smallest relevant portion of its canonical output.
  • A phrase, identity, or concept expressed with different vocabulary: use kb search, whose default hybrid result preserves exact and QMD evidence separately.
  • Direct provenance for one note or repository path: use kb history or kb history search without changing authored metadata or links.
  • Recent captures awaiting maintained disposition: use the advisory kb inbox view.
  • Broad orientation: read index.md, then follow the smallest useful link trail. Use kb catalog when an exhaustive disposable inventory is actually needed.
kb context src/parser.ts --root "$KB_ROOT" --repo "$KB_REPO"
kb list --root "$KB_ROOT" --scope src/parser --where type=plan --json
kb list --root "$KB_ROOT" --where type=plan --where status=in-progress --sort area --json
kb list --root "$KB_ROOT" --tag retrieval --sort title --json
kb backlinks "Plan title or path" --root "$KB_ROOT" --json
kb links "Plan title or path" --root "$KB_ROOT" --direction both --depth 1 --limit 25 --json
kb relation list "Plan title or path" --root "$KB_ROOT" --json
kb graph --root "$KB_ROOT" --json
kb search "why browser capture uses the current tab" --root "$KB_ROOT" --json
kb search "accepted ingestion plans" --root "$KB_ROOT" --where type=plan --where status=accepted --tag ingestion --json
kb search "notes/write-path" --root "$KB_ROOT" --mode exact --no-history --json
kb history "notes/write-path" --root "$KB_ROOT" --repo "$KB_REPO" --json
kb history search src/parser.ts --root "$KB_ROOT" --repo "$KB_REPO" --json
kb inbox --root "$KB_ROOT" --limit 25 --json

Read the full file on GitHub · 206 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 206 lines · 83 tokens per session scan A 982eea60ef02

Subscribe to this mod's changes

query-kb is a skill published in the GitHub repository hraness/wrench (4 stars, last pushed 3d ago), licensed MIT. It adds 83 tokens to every session and 2,472 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

knowledge-base

Build and maintain a company knowledge base as a wiki of interlinked markdown notes in the workspace — a private, compounding Wikipedia. Use when the user wants to start or organize a knowledge base / wiki, ingest sources (URLs, documents, pasted notes) into it, ask questions answered from it, or audit (lint) it.…

Open-Curiosity/gini-agent · 119 tokens

gno

Search local documents, files, notes, and knowledge bases. Index directories, search with BM25/vector/hybrid, get AI answers with citations. Use when user wants to search files, find documents, query notes, look up information in local folders, index a directory, set up document search, build a knowledge base, needs…

gmickel/gno · 86 tokens

kb

Operate a hraness/kb local-first Markdown knowledge base for coding-agent memory. Use when a user asks to search or query a KB or Obsidian vault; load repository context, plans, decisions, concepts, backlinks, semantic search, or Git provenance; save, clip, scrape, or archive a URL, article, social thread, signed-in…

hraness/kb · 133 tokens

context-canvas-memory

Use for compaction, coordination, or two complexity cues.

phenomenoner/hermes-agent-harness-plus · 17 tokens

stats

Show Captain Memo's corpus statistics (chunks per channel, observation counts, indexing progress, embedder info). Use when the user types /captain-memo:stats.

kalinbogatzevski/captain-memo · 36 tokens

search

Hybrid search across Captain Memo's local memory + skills + observations. Use when the user types /captain-memo:search to retrieve top hits without the model having to decide whether to call searchall on its own.

kalinbogatzevski/captain-memo · 49 tokens