You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Hierarchical rules triggered by file-related tool calls for progressive disclosure #9511
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Claude Code looks up nested CLAUDE.md files based on what files are being read, allowing for progressive disclosure based on what Claude is working on (docs link). This seems small, but I think this is a killer feature because context bloat is so undesirable and degrades model performance so aggressively.
Implementation:
Rules files are matched based on the regex (.+[-_\.])?AGENTS.md, allowing for files such as python.AGENTS.md, backend_AGENTS.md, typescript.AGENTS.md, and the normal AGENTS.md to match
When the tool calls that introduced a rule are pruned during compaction, the rules themselves are pruned as well
Rules support a paths parameter via YAML frontmatter, which is a list of file globs. If present, the rule will only be loaded if the globs match the file(s) being loaded. This is analogous to Claude Code's path-specific rules feature.
I'm in the process of implementing this, and have a functional prototype with the exception of:
Rules that have been loaded are missing from the web UI message interface
List of all rules loaded in a session in the context panel in the web UI
Open questions/feedback I'm requesting:
Is "hierarchical" the right word to describe this? I'm not really settled on if this is what this should be called.
Are rules different conceptually from the current instructions implementation? Should I merge the two concepts somehow?
Should the regular expression for rule loading be configurable? In either case, does the default regex (.+[-_\.])?AGENTS.md make sense?
The paths frontmatter thinge feels like it possibly should be split off into it's own feature and supported in instructions as well, but I'm not totally sure.
Activity
github-actions commentedon Jan 19, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
bailey-busc commentedon Jan 19, 2026
Github issue search sucks ass, I'll just discuss my implementation in #6316