[FEATURE] Support on-demand / non-auto-loaded rules in ~/.claude/rules/

Resolved 💬 3 comments Opened Feb 11, 2026 by mark-hubers Closed Feb 11, 2026

Problem

All .md files in ~/.claude/rules/ are auto-loaded into context at session start, including files in subdirectories. There is no way to have "on-demand" rules that exist in the rules directory but only load when relevant.

Current Behavior

  • Every .md file in ~/.claude/rules/ loads automatically (recursively through subdirectories)
  • The paths: frontmatter scoping doesn't prevent loading — it only affects which files the rules apply to
  • Moving files to a subdirectory like rules/on-demand/ does NOT prevent auto-loading

Workaround

I moved on-demand rule files to ~/.claude/on-demand/ (completely outside the rules/ tree). This reduced my session startup context from 49K to 37K tokens — a 24% reduction.

Proposed Solution

One of:

  • Support a .rulesignore file (like .gitignore) to exclude patterns
  • Support a frontmatter flag like autoload: false
  • Support a convention where a specific subdirectory name (e.g., rules/on-demand/) is excluded from auto-loading

Why This Matters

Power users with many context-specific rules (coding style, project-specific, task-specific) waste significant context tokens loading rules that aren't relevant to the current task. On-demand loading would let users organize rules by topic and only load what's needed.

~Mark

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗