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.
npx agentmods add rules/hmj1026/dhpk/tool-routinggit clone --depth 1 https://github.com/hmj1026/dhpkWrote 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.
[](https://agentmods.dev/rules/hmj1026/dhpk/tool-routing)<a href="https://agentmods.dev/rules/hmj1026/dhpk/tool-routing"><img src="https://agentmods.dev/badge/rules/hmj1026/dhpk/tool-routing.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00018 | $0.01265 |
| Opus 5 | $0.00009 | $0.00633 |
| Sonnet 5 | $0.00004 | $0.00253 |
| Haiku 4.5 | $0.00002 | $0.00127 |
Grade A, and why
tool-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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Tool Routing — gitnexus / cx / claude-mem / Read / Grep
SSOT for code exploration in dhpk-using projects. Cross-references the existing dhpk:tool-routing skill (richer prose, examples, sub-agent prompt boilerplate); this file is the compact reference card consumable directly from a project's CLAUDE.md.
Tools mentioned (
cx,gitnexus,claude-mem) are external — each project decides whether to install them. dhpk does not bundle them. The decision tree below degrades gracefully (fall back toGrep/Readif the primary tool is not installed).
Decision tree
| Intent | Primary | Fallback |
|---|---|---|
| What breaks if I edit X? | gitnexus_impact({target, direction:"upstream"}) |
cx references |
| Where is X defined? | cx definition --name X |
gitnexus_query |
| File overview (>200 lines) | cx overview <file> |
cx definition for selected functions |
| File <100 lines, full read needed | Read (after cx overview confirms) |
— |
| Find callers | cx references --name X |
gitnexus_impact upstream |
| Global rename / refactor | gitnexus_rename |
cx references → scoped Edit (never blind find-and-replace) |
| Pre-commit scope check | gitnexus_detect_changes() |
git diff --stat |
| Explore unfamiliar module | cx overview <dir> |
gitnexus_query |
| Past decisions (cross-session) | claude-mem smart_search / search |
get_observations([IDs]) |
| Plain text / comments / docs | Grep |
— |
Tie-breakers
- cx > gitnexus when both apply (cheaper, local, no MCP round-trip)
gitnexusis the hard rule forimpact/detect_changes/rename(when installed)claude-memskips current session (already in scrollback); only for past-session decisionsReadis the floor — only when nothing else fits- Multi-repo GitNexus index: always pass the
repoparameter togitnexus_impact/gitnexus_querycalls — omitting it errors with "Multiple repositories indexed" and costs a retry cycle
Investigation order & perspective depth
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.
- today First seen · 79 lines · 18 tokens per session scan A 30f6c01a0c19
tool-routing is a cursor rule published in the GitHub repository hmj1026/dhpk (2 stars, last pushed today), licensed MIT. It adds 18 tokens to every session and 1,265 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-09-05.
Other cursor rules, from other repositories
token-compression-enforcement
Global RTK + Context Mode enforcement — hard requirements for all Cursor workspaces.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.