query

A command-line search tool for qmd, a local document-search system, combining word matching, meaning-based matching, and result reranking.

In plain words
What is it for?
Use it to search code or documents, limit or inspect results, skip slower reranking, and return output as JSON.
Why use it?
It helps find relevant documents even when they do not contain the exact words in the search, while offering options to trade speed for ranking quality.

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/ramonclaudio/skills/query
Clone the repo
git clone --depth 1 https://github.com/ramonclaudio/skills
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 437 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.00023 $0.00437
Opus 5 $0.00012 $0.00218
Sonnet 5 $0.00005 $0.00087
Haiku 4.5 $0.00002 $0.00044

Measured 2d ago against content hash af59b1110b80, 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 2d 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.

plugins/qmd/commands/query.md · 25 lines

What it actually says

Run qmd query $ARGUMENTS. Full hybrid pipeline: BM25 + vector + RRF fusion + LLM reranking + position-aware blending. ~10s for plain queries, ~3-8s for typed query documents.

Two paths:

  • Plain string (qmd query "auth middleware"): runs the local 1.7B expansion model first, then the hybrid pipeline. Slower but lets the pipeline pick types for you.
  • Typed query document (qmd query $'lex: handleAuth\nvec: how does auth middleware verify requests'): skips expansion entirely. Faster. Same path the MCP query tool takes.

Useful flags:

  • --intent <text> — disambiguate ambiguous keywords (effectively required for vague queries; see search SKILL)
  • --no-rerank — skip LLM reranker, return RRF-fused scores only (much faster on CPU)
  • -C <n> / --candidate-limit <n> — cap candidates passed to reranker (default 40)
  • --explain — emit per-result score traces (FTS, vector, RRF, reranker, blended)
  • --chunk-strategy auto — AST-aware chunk selection (should match what you embedded with)
  • -c <name> (repeatable), -n <num>, --json, --all, --min-score <n>

Lex sub-grammar: "phrase" for exact match, -term for negation, prefix match by default.

Prefer the MCP query tool when available — same pipeline, structured output, no shell escaping headaches. This command is the CLI fallback when the MCP server is down.

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. 2d ago First seen · 25 lines · 23 tokens per session scan A af59b1110b80

Subscribe to this mod's changes

query is a command published in the GitHub repository ramonclaudio/skills (4 stars, last pushed 3mo ago), licensed MIT. It adds 23 tokens to every session and 437 once invoked, about $0.0001 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.