kb-query

kb-query is a command for Claude Code from thomascasali/claude-kb-workflow. It costs 0 tokens per session (317 once invoked), scanned A, original, MIT.

A command for answering questions from an LLM Wiki, a project knowledge base written for language models, using that wiki as the main source.

In plain words
What is it for?
Use it to find relevant wiki pages, answer project questions, cite the pages used, and identify when new information should be added to the wiki.
Why use it?
It keeps answers grounded in documented project knowledge and makes missing information explicit instead of guessing.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

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 commands/thomascasali/claude-kb-workflow/kb-query
Clone the repo
git clone --depth 1 https://github.com/thomascasali/claude-kb-workflow

Made for: Claude Code.

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/commands/thomascasali/claude-kb-workflow/kb-query.svg)](https://agentmods.dev/commands/thomascasali/claude-kb-workflow/kb-query)
Your own site
<a href="https://agentmods.dev/commands/thomascasali/claude-kb-workflow/kb-query"><img src="https://agentmods.dev/badge/commands/thomascasali/claude-kb-workflow/kb-query.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 317 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.1 $0.00000 $0.00317
Opus 5 $0.00000 $0.00159
Sonnet 5 $0.00000 $0.00063
Haiku 4.5 $0.00000 $0.00032

Measured 5d ago against content hash 412a52d845cd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 5d 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.

commands/kb-query.md · 26 lines

What it actually says

/kb-query — Interroga la LLM Wiki

Rispondi alla domanda usando la LLM Wiki come fonte primaria: $ARGUMENTS

Path della Wiki: imposta $LLM_WIKI_PATH nel tuo workspace (es. ~/llm-wiki/).

Steps

  1. Leggi $LLM_WIKI_PATH/wiki/index.md per orientarti
  2. Identifica le pagine rilevanti per la domanda
  3. Leggi le pagine pertinenti (progetti, concetti, decisioni, lezioni)
  4. Se la risposta non è nella wiki → segnalalo esplicitamente e suggerisci /kb-ingest
  5. Rispondi citando le pagine usate: [fonte: wiki/projects/X.md]

Comportamento

  • Prima la wiki — non andare a leggere i progetti direttamente se la wiki ha già la risposta
  • Cita le fonti — ogni affermazione ha il link alla pagina wiki
  • Segnala gap — se manca info, di' quale /kb-ingest eseguire
  • Non inventare — se non è nella wiki, dì "non so, esegui /kb-ingest [progetto]"

Esempio

Utente: /kb-query quali progetti usano PostgreSQL? → Leggi index.md → trova progetti rilevanti → leggi loro pagine → rispondi con citazioni.

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. 5d ago First seen · 26 lines · 0 tokens per session scan A 412a52d845cd

Subscribe to this mod's changes

kb-query is a command published in the GitHub repository thomascasali/claude-kb-workflow (2 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 317 tokens. 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 commands, from other repositories

get-to-work

Autonomous ops work. Args: [mode] [repeat]. Modes: tasks | opps | full | escalating (default). Repeat: cycle (keep going, default) | once (single pass). Run this before stepping away from an ops repo.

OdinMB/ops-workflow · 66 tokens

tidy

Consistency check for non-code repos with INDEX.md hierarchy. Verifies INDEX.md accuracy, MEMORY.md references, orphaned files, stale dates, and WAITING markers.

OdinMB/ops-workflow · 33 tokens

recap

Summarize what happened in the project since a given date. Produces a short lead on what's different now, backed by tables and lists covering completed work, state changes, backlog movement, and key decisions. Use when the user wants to catch up on project activity, review recent progress, or generate a status update…

OdinMB/ops-workflow · 105 tokens

whats-next

Generate an executive overview of the project. Synthesizes state, backlogs, and recent plans into a ranked action plan answering "What should we do next?".

OdinMB/ops-workflow · 32 tokens

batch-execute

Execute a batch of ops plans continuously without user input, storing any issues and user questions in a .md file to be processed with the user afterwards. Do NOT invoke this yourself! Should only be invoked by the user.

OdinMB/ops-workflow · 44 tokens

batch-plan

Create a batch of ops plans continuously without user input, storing any user questions in a .md file to be processed with the user afterwards. Do NOT invoke this yourself! Should only be invoked by the user.

OdinMB/ops-workflow · 42 tokens