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/alkoleft/platform-context-exporter/hierarchical-rule-loadinggit clone --depth 1 https://github.com/alkoleft/platform-context-exporterWrote 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/alkoleft/platform-context-exporter/hierarchical-rule-loading)<a href="https://agentmods.dev/rules/alkoleft/platform-context-exporter/hierarchical-rule-loading"><img src="https://agentmods.dev/badge/rules/alkoleft/platform-context-exporter/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 | $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.
This is a copy
100% identical to hierarchical-rule-loading — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
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 alkoleft/platform-context-exporter (48 stars, last pushed 1y ago), licensed MIT. 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. It is 100% identical to hierarchical-rule-loading, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
bsl-ssl
Переиспользование БСП, разметка правок типовых модулей, устаревшие объекты.
edt-form-xml-requirements
Требования EDT к XML-формам (Form.form): extInfo, дефолты полей.
1c-report-direct-query
Прямой запрос в отчётах 1С (СКД) без схемы компоновки.
1c-transactions-and-locks
Транзакции и управляемые блокировки: шаблон, порядок захвата.
async-methods-1c
Асинхронные методы 1С: Асинх/Ждать/Обещание (8.3.18+).
query-optimization-tips
Оптимизация запросов 1С: ВЫРАЗИТЬ, ВТ, индексы.