search
QMD Search
STOP — Read Config First
- Use the Read tool to read
.claude/qmd.json. If missing, tell the user: "qmd is not configured for this project. Run/qmd:configureto set it up." Then STOP. - Extract
projectname andcollections(each has: name, path, pattern, description). - Pick the best collection for the query (match against descriptions). If only one, use it.
Every qmd command MUST include --json and -c <collection_name>. No exceptions.
Do NOT
- Run qmd without
--jsonflag - Run qmd without
-c <collection> - Use
npxto run qmd — it is already installed - Use
qmd getto read files — use the Read tool// - Use the
--fullflag — it floods the context window - Skip reading
.claude/qmd.jsonbefore searching
Query Types
qmd provides three search commands. Pick the right one for the situation:
qmd search — BM25 keyword search
Best when you know the exact terms or vocabulary used in the documents.
qmd search "<query>" -c <collection> --json -n 5
Query writing tips:
- Use 2-5 specific terms, no filler words
- Use exact phrases with quotes:
qmd search "error handling" -c col --json -n 5 - Exclude terms with minus:
qmd search "auth -oauth" -c col --json -n 5 - Think about what words actually appear in the documents
qmd vsearch — Vector/semantic search
Best when you don't know the exact vocabulary or want conceptual matching.
qmd vsearch "<query>" -c <collection> --json -n 5
Query writing tips:
- Write a full natural language question
- Be specific about what you're looking for
- Good:
"How does the authentication system handle session expiry?" - Bad:
"auth sessions"
qmd query — Auto-expand + rerank (most powerful)
Best for complex topics. Automatically generates query variations and reranks results.
qmd query "<query>" -c <collection> --json -n 5
Query writing tips:
- Use for complex or multi-faceted topics
- Write naturally — the system auto-generates search variations
- Good for exploratory searches where you're not sure what you'll find
Strategy
| Situation | Use |
|---|---|
| Know exact terms | qmd search |
| Don't know vocabulary | qmd vsearch or qmd query |
| Best recall needed | Try search first, vsearch if poor results |
| Complex or broad topic | qmd query |
Reading Results
JSON output contains an array:
[
{
"docid": "#abc123",
"score": 0.74,
"file": "qmd://<collection>/path/to/file.md",
"title": "Document Title",
"context": "Collection description...",
"snippet": "..."
}
]
Score interpretation:
- 0.7+: Highly relevant — read this document
- 0.5-0.7: Worth reading if topic matches
- < 0.5 on all results: Try a different query type or refine your query
To read a result file:
- Extract the file path from the
filefield - Strip the
qmd://<collection>/prefix - Prepend the collection's
pathfrom config to get the repo-relative path - Use the Read tool to read the file
Fallback
After poor results from 2 query types or 2 retries with refined queries, fall back to Glob/Grep on the directory. Default -n 5 (use 3 for narrow queries, 10 for broad).
More from aviflombaum/claude-code-in-avinyc
ux-ui
UX/UI design principles for clean, intuitive interfaces. Use when designing layouts, improving usability, planning information architecture, or ensuring accessibility. Triggers on "user experience", "usability", "information architecture", "accessibility", "interaction design".
12interview
Interview about a plan file to refine it through in-depth questioning. Use when you have a plan that needs validation, refinement, or deeper exploration before implementation. Triggers on "interview me about", "refine this plan", "question this spec".
9tailwind
Tailwind CSS patterns, utilities, and component styling for Rails. Use when styling with Tailwind, creating responsive layouts, or building UI components. Triggers on "tailwind", "style with", "css classes", "responsive layout".
9write
Write technical blog posts, tutorials, and documentation in Flatiron School's engaging style. Use for explaining code patterns, debugging stories, or turning complex topics into clear narratives. Triggers on "write a blog post", "tutorial about", "explain how", "technical writing".
8hotwire
Hotwire, Turbo, and Stimulus patterns for Rails. Use when implementing JavaScript interactions, Turbo Frames/Streams, or Stimulus controllers. Triggers on "stimulus controller", "turbo frame", "turbo stream", "hotwire", "rails javascript".
8write-test
Writes comprehensive RSpec tests for Rails applications. Use when writing model specs, request specs, system specs, job specs, mailer specs, channel specs, or storage specs. Triggers on "write tests for", "add specs to", "test the User model", "create request specs", "write RSpec", "add test coverage".
8