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/bia-technologies/yaxunit/hierarchical-rule-loadinggit clone --depth 1 https://github.com/bia-technologies/yaxunitWrote 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/bia-technologies/yaxunit/hierarchical-rule-loading)<a href="https://agentmods.dev/rules/bia-technologies/yaxunit/hierarchical-rule-loading"><img src="https://agentmods.dev/badge/rules/bia-technologies/yaxunit/hierarchical-rule-loading.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.02056 | $0.02056 |
| Opus 5 | $0.01028 | $0.01028 |
| Sonnet 5 | $0.00411 | $0.00411 |
| Haiku 4.5 | $0.00206 | $0.00206 |
Grade A, and why
hierarchical-rule-loading 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 4d 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.
Copies of this mod
3 near-identical copies found in the catalogue:
- hierarchical-rule-loading — 100% identical, 0 lines differ
- hierarchical-rule-loading — 100% identical, 0 lines differ
- hierarchical-rule-loading — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 271 lines — stays where its author put it; the contents beside it link to each section on GitHub.
HIERARCHICAL RULE LOADING SYSTEM
TL;DR: This rule implements an optimized loading system that only loads necessary rules based on context, complexity level, and current phase to maximize token efficiency.
🧠 HIERARCHICAL RULE STRUCTURE
graph TD
Root["Root Rules"] --> Core["Core Rules<br>(Always Loaded)"]
Root --> Common["Common Rules<br>(Mode Independent)"]
Root --> Mode["Mode-Specific<br>Rules"]
Root --> Level["Complexity Level<br>Rules"]
Core --> Platform["Platform<br>Detection"]
Core --> File["File<br>Operations"]
Core --> Transition["Mode<br>Transitions"]
Mode --> VAN["VAN Mode<br>Rules"]
Mode --> PLAN["PLAN Mode<br>Rules"]
Mode --> CREATIVE["CREATIVE Mode<br>Rules"]
Mode --> IMPLEMENT["IMPLEMENT Mode<br>Rules"]
Mode --> REFLECT["REFLECT Mode<br>Rules"]
Level --> Level1["Level 1<br>Rules"]
Level --> Level2["Level 2<br>Rules"]
Level --> Level3["Level 3<br>Rules"]
Level --> Level4["Level 4<br>Rules"]
style Root fill:#4da6ff,stroke:#0066cc,color:white
style Core fill:#ffa64d,stroke:#cc7a30,color:white
style Common fill:#4dbb5f,stroke:#36873f,color:white
style Mode fill:#d94dbb,stroke:#a3378a,color:white
style Level fill:#4dbbbb,stroke:#368787,color:white
📊 RULE LOADING PROTOCOL
sequenceDiagram
participant User
participant LoadManager
participant RuleCache
participant FileSystem
User->>LoadManager: Request mode activation
LoadManager->>RuleCache: Check cached core rules
RuleCache-->>LoadManager: Return cached rules if available
LoadManager->>FileSystem: Load essential mode rules
FileSystem-->>LoadManager: Return essential rules
LoadManager->>LoadManager: Register lazy loaders for specialized rules
LoadManager->>User: Return initialized mode
User->>LoadManager: Request specialized functionality
LoadManager->>RuleCache: Check specialized rule cache
RuleCache-->>LoadManager: Return cached rule if available
alt Rule not in cache
LoadManager->>FileSystem: Load specialized rule
FileSystem-->>LoadManager: Return specialized rule
LoadManager->>RuleCache: Cache specialized rule
end
LoadManager->>User: Execute specialized functionality
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.
- 4d ago First seen · 271 lines · 2,056 tokens per session scan A 70dcffa02549
hierarchical-rule-loading is a cursor rule published in the GitHub repository bia-technologies/yaxunit (323 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 2,056 tokens to every session, about $0.0103 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-01.
Other cursor rules, from other repositories
file-edit-efficiency
Выбор инструмента чтения и правки файлов по стоимости токенов.
git-workflow
Rules for git operations, commit strategy, and GitHub CLI usage.
go
Cursor rule "go" from supertokens/create-supertokens-app, covering go and examples.
feedback-enhanced
Enhanced feedback mechanism with 1-hour timeout - 增强反馈机制,1小时超时.
testing
Testing conventions for Ion Design System using Jest and Angular Testing Library.
122-swift-development
122: Swift development workflow including TDD, refactoring, and performance optimization.