search-routing

search-routing is a cursor rule for Cursor from davekilleen/Dex. It costs 559 tokens per session, scanned A, original, MIT.

A search-routing rule for Dex's vault, its personal information store. It directs searches to QMD semantic search, which finds related meaning rather than only matching exact words.

In plain words
What is it for?
Use it to control how Dex searches vault content when QMD semantic search is available.
Why use it?
It prevents vault searches from bypassing the designated search method. This keeps searches routed through the configured semantic search system.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Claude Code.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node .scripts/semantic-search/check-availability.cjs --quiet.

Good fit Use it to control how Dex searches vault content when QMD semantic search is available.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/davekilleen/Dex
agentmods
npx agentmods add rules/davekilleen/dex/search-routing

Made for: Cursor.

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 search-routing

README.md
[![agentmods](https://agentmods.dev/badge/rules/davekilleen/dex/search-routing/github.svg)](https://agentmods.dev/rules/davekilleen/dex/search-routing)
Your own site
<a href="https://agentmods.dev/rules/davekilleen/dex/search-routing"><img src="https://agentmods.dev/badge/rules/davekilleen/dex/search-routing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for search-routing

Your own site · 80×15
<a href="https://agentmods.dev/rules/davekilleen/dex/search-routing"><img src="https://agentmods.dev/badge/rules/davekilleen/dex/search-routing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 559 This file is loaded in full into every session.
When invoked 559 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00559 $0.00559
Opus 5.5 $0.00224 $0.00224
Sonnet 5.5 $0.00112 $0.00112
Haiku 4.5 $0.00056 $0.00056

Measured 6d ago against content hash d0bab90ac317, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

search-routing 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 6d 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.

.cursor/rules/search-routing.mdc · 56 lines

What it actually says

Smart Search Routing (All Platforms)

Before ANY vault search operation, check QMD availability:

node .scripts/semantic-search/check-availability.cjs --quiet
# Exit 0 = QMD available → use qmd query
# Exit 1 = QMD unavailable → fall back to grep

Collection Mapping

Use qmd query "your intent" -c <collection> for all vault content searches:

Content Type QMD Collection Fallback Path
Meeting notes meetings 00-Inbox/Meetings
Archived meeting notes meetings_archive 07-Archives/Meetings
People / person pages people 05-Areas/People
Projects / initiatives projects 04-Projects
Accounts / deals accounts 05-Areas/Relationships/Key_Accounts
Tasks tasks 03-Tasks
Goals goals 01-Quarter_Goals
Weekly priorities priorities 02-Week_Priorities
PRDs / feature specs prds System/PRDs
Implementation plans plans plans/
Session learnings learnings System/Session_Learnings
Reference / guides resources 06-Resources
Career / content / events areas 05-Areas
LinkedIn / newsletter / YouTube intel intel 00-Inbox/*_Intel

Rules

  • Never hardcode vault folder paths for content covered by a QMD collection
  • Never use grep -r or file globbing for natural language vault searches
  • Always check availability first — QMD unavailable = grep fallback, not skip
  • Code files (.ts, .tsx, .py, .json) are NOT in QMD — use grep/glob for those

Example

# ✅ Correct — semantic intent, QMD routes it
qmd query "renewal risk accounts not touched" -c accounts

# ❌ Wrong — bypasses routing
grep -r "renewal" 05-Areas/Relationships/Key_Accounts/

This routing applies in Cursor, Claude Code, and Pi sessions — no exceptions.

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. 6d ago Changed · +1 lines · +20 tokens per session d0bab90ac317
  2. 1mo ago First seen · 55 lines · 539 tokens per session scan A 76f402408cad

Subscribe to this mod's changes

search-routing is a cursor rule published in the GitHub repository davekilleen/Dex (508 stars, last pushed 3d ago), licensed MIT. It adds 559 tokens to every session, about $0.0022 per session on Opus 5.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-09-03.