kb-query

kb-query is a skill for Claude Code, Codex from ernestolee13/para-knowledge-base. It costs 57 tokens per session (2,075 once invoked), scanned A, original, MIT.

A search and answering workflow for information stored in an Obsidian PARA knowledge base. It finds relevant notes, combines their contents into an answer, and cites the source notes with Obsidian links.

In plain words
What is it for?
Use it to answer questions about projects, references, logs, links, recent activity, or information spread across several notes.
Why use it?
It prevents answers about the vault from being based on memory alone and avoids reading every document when a smaller search is enough.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the para-knowledge-base plugin — 5 skills, 3 hooks 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 skills/ernestolee13/para-knowledge-base/kb-query
Any agent
npx skills add ernestolee13/para-knowledge-base --skill kb-query
Clone the repo
git clone --depth 1 https://github.com/ernestolee13/para-knowledge-base

Made for: Claude Code, Codex.

Or install para-knowledge-base, the plugin that ships this one along with the rest of its 5 skills, 3 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 kb-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/ernestolee13/para-knowledge-base/kb-query.svg)](https://agentmods.dev/skills/ernestolee13/para-knowledge-base/kb-query)
Your own site
<a href="https://agentmods.dev/skills/ernestolee13/para-knowledge-base/kb-query"><img src="https://agentmods.dev/badge/skills/ernestolee13/para-knowledge-base/kb-query.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,075 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.00057 $0.02075
Opus 5 $0.00028 $0.01038
Sonnet 5 $0.00011 $0.00415
Haiku 4.5 $0.00006 $0.00208

Measured 4d ago against content hash 3a2f789f0a09, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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 · 129 lines

How it starts

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

KB Query

Answer vault-based questions by narrowing the search path before reading full documents. Cite sources with [[wikilinks]]. Do not answer from memory alone when the user asks about vault content.

Core Contract

  1. Parse the question: subject, scope, time range, desired output.
  2. If query telemetry is configured, start one explicit kb-query operation before the first vault lookup and retain the returned operation_id.
  3. Pick the cheapest route or route combination.
  4. Start from indexes, project hubs, tags, backlinks, or short search snippets.
  5. Read full documents only when needed for the answer.
  6. Synthesize with source [[wikilinks]].
  7. Immediately before the final answer, complete that same operation with one semantic QuerySummary; the runtime Stop hook then finalizes elapsed time and token deltas including answer generation.

Keep source reading under a small budget by default. Expand only when evidence is insufficient.

Routes

Route Use when First move
A. Direct folder Target project/category is clear Read the category index or project hub if present, then selected files
B. Tag/topic collection Topic spans folders Use tag inventory/search, then inspect matched candidates
C. Backlink/reference User asks what cites or depends on something Use Obsidian backlinks or targeted wikilink search
D. Index/log browse User asks overview, recent activity, trend, or change history Read relevant index and only the needed log window
E. Full-text search User gives a term, phrase, error, or concept Use short search/context results before opening files

Complex questions can combine routes. Example: project status may use Route A for the project hub, Route D for recent _log.md, and Route E for a specific term.

Search Rules

  • Do not always start from 0. Common/index.md; choose the route that best matches the question.
  • For project-like names, first try the project hub if the vault uses project hubs (1. Projects/<slug>/_index.md) or inspect 1. Projects/_index.md to resolve the slug. Do not run broad full-text search on the project name before checking indexes.
  • For topic-wide questions, prefer tags, backlinks, and short context snippets over reading every match.
  • Use search:context for specific terms, errors, phrases, or concepts. Avoid high-frequency broad queries such as category names, project names, or large OR patterns unless the output is capped.
  • If a first hit-list command returns many files, narrow to candidate paths before requesting context lines. Do not run vault-wide context grep over all matches.
  • For recent activity, project _log.md files are usually newest-first when the vault uses them. Read from the top.
  • For 0. Common/log.md, parse by [YYYY-MM-DD] records and inspect only the requested date range.
  • Avoid logs unless the question needs time, change history, trends, or root-cause evidence.
  • If the answer is already supported by index/search snippets, do not open more documents just to be exhaustive.
  • If a candidate document has no frontmatter summary field, read its first paragraph as a lightweight substitute before deciding whether the full document is needed.
  • Skip full-body reads for documents with frontmatter type: data (large data-style listings — raw exports, link dumps, telemetry-adjacent tables). Read only their frontmatter and summary (or first-paragraph fallback) to judge relevance; open the full body only if the user explicitly asks for its contents.

Read the full file on GitHub · 129 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. 4d ago First seen · 129 lines · 57 tokens per session scan A 3a2f789f0a09

Subscribe to this mod's changes

kb-query is a skill published in the GitHub repository ernestolee13/para-knowledge-base (21 stars, last pushed 27d ago), licensed MIT. It adds 57 tokens to every session and 2,075 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

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

compile-wiki

Merge source summaries into durable concept pages with backlinks, index entries, and explicit open questions.

arnaudgelas/K-Ops · 22 tokens

refresh-context

Re-snapshot Core Context.md from the 9 mothership system files and key essays when the mothership changes or the snapshot is older than 30 days; also responds to /refresh-context and 코어 컨텍스트 갱신.

johnfkoo951/cmds-llm-wiki · 51 tokens

qa-agent

Answer questions from the vault, then file durable insights back into the knowledge base.

arnaudgelas/K-Ops · 19 tokens

llm-wiki

The foundational knowledge distillation pattern for building and maintaining an AI-powered Obsidian wiki. Based on Andrej Karpathy's LLM Wiki architecture. Use this skill whenever the user wants to understand the wiki pattern, set up a new knowledge base, or needs guidance on the three-layer architecture (raw sources…

Ar9av/obsidian-wiki · 113 tokens

wiki-lint

Audit and maintain the health of the Obsidian wiki. Use this skill when the user wants to check their wiki for issues, find orphaned pages, detect contradictions, identify stale content, fix broken wikilinks, or perform general maintenance on their knowledge base. Also triggers on "clean up the wiki", "what needs…

Ar9av/obsidian-wiki · 152 tokens