query

A command for asking questions about the pages in a knowledge wiki. It can retrieve existing information, challenge a position, or combine information across sources.

In plain words
What is it for?
Use it for research questions, critical reviews of wiki claims, or syntheses of multiple sources.
Why use it?
It provides a defined way to search the wiki while limiting answers to its recorded content unless outside information is explicitly allowed.

Command

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/evb87-tech/corpus/query
Clone the repo
git clone --depth 1 https://github.com/evb87-tech/corpus
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 609 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.00049 $0.00609
Opus 5 $0.00024 $0.00304
Sonnet 5 $0.00010 $0.00122
Haiku 4.5 $0.00005 $0.00061

Measured yesterday against content hash 672f9703f885, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 yesterday.

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.

corpus-core/commands/query.md · 45 lines

What it actually says

Pre-flight:

CORPUS_VAULT="${CORPUS_VAULT:-$CLAUDE_PLUGIN_OPTION_VAULT_PATH}"
if [ -z "$CORPUS_VAULT" ]; then
  echo "No vault configured. Set CORPUS_VAULT (local dev) or configure the vaultPath userConfig option in the installed plugin (exposed as CLAUDE_PLUGIN_OPTION_VAULT_PATH). Neither is set. Run /init-vault <path> to scaffold a fresh vault, then export the path." >&2
  exit 1
fi

Verify $CORPUS_VAULT/.corpus-vault exists. If not, refuse and tell the owner to run /init-vault <path>. See corpus-core/rules/08-vault-structure.md.

Answer the owner's question against $CORPUS_VAULT/wiki/: $ARGUMENTS

Detect the posture (research | contradictor | synthesis) from the wording, OR honor an explicit posture token at the start of $ARGUMENTS:

  • research <question> — retrieve what the wiki already says.
  • contradictor <target> — attack the wiki, surface weaknesses.
  • synthesis <question> — produce a statistical average across sources.

Follow corpus-core/rules/05-query-postures.md:

  1. Read wiki/index.md first.
  2. Read identified pages and adjacent ones.
  3. Answer using only wiki content unless the owner explicitly invites outside knowledge.
  4. Cite at the end: Sources: [[page-1]], [[page-2]].
  5. File-back rules:
    • Research producing a reusable lookup → file as wiki page with type: reference.
    • Contradictor → file as wiki page with type: stress-test. Delegate to the contradictor subagent.
    • Synthesis → write to output/, never to wiki/. Flag the output as a statistical average.
  6. Append to wiki/log.md:
    ## [YYYY-MM-DD] query | <question summary>
    Posture: <research|contradictor|synthesis>
    Pages consulted: [[a]], [[b]]
    Filed as: [[result-page]]   (research/contradictor only)
    

Hard rules: never invent sources, never harmonize contradictions, never silently complete with training-data knowledge. See corpus-core/rules/07-anti-lissage.md.

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. yesterday First seen · 45 lines · 0 tokens per session scan A 672f9703f885

Subscribe to this mod's changes

query is a command published in the GitHub repository evb87-tech/corpus (1 stars, last pushed 4mo ago), licensed MIT. It adds 49 tokens to every session and 609 once invoked, about $0.0002 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.