hierarchical-rule-loading

hierarchical-rule-loading is a cursor rule for Cursor from alkoleft/platform-context-exporter. It costs 2,056 tokens per session, scanned A, a copy of hierarchical-rule-loading, MIT.

A rule system that loads only the development guidance needed for the current task, work stage, and complexity level.

In plain words
What is it for?
Use it to organize guidance for planning, implementation, creative work, review, file operations, and different task-complexity levels.
Why use it?
It reduces unnecessary instructions in the working context, making it easier to focus on the rules relevant to the current job.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/alkoleft/platform-context-exporter/hierarchical-rule-loading
Clone the repo
git clone --depth 1 https://github.com/alkoleft/platform-context-exporter

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 hierarchical-rule-loading

README.md
[![agentmods](https://agentmods.dev/badge/rules/alkoleft/platform-context-exporter/hierarchical-rule-loading.svg)](https://agentmods.dev/rules/alkoleft/platform-context-exporter/hierarchical-rule-loading)
Your own site
<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>
Per session 2,056 This file is loaded in full into every session.
When invoked 2,056 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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 $0.02056 $0.02056
Opus 5 $0.01028 $0.01028
Sonnet 5 $0.00411 $0.00411
Haiku 4.5 $0.00206 $0.00206

Measured 4d ago against content hash 70dcffa02549, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

Origin

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.

.cursor/rules/isolation_rules/Core/hierarchical-rule-loading.mdc · 271 lines

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

Read the full file on GitHub · 271 lines

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. 4d ago First seen · 271 lines · 2,056 tokens per session scan A 70dcffa02549

Subscribe to this mod's changes

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.