Skip to content

Conversation

@bailey-busc
Copy link

@bailey-busc bailey-busc commented Jan 20, 2026

What does this PR do?

First pass draft implementation at loading of rules from subdirectories.

Closes #6316

Working

  • Loading of subdirectory rules in response to tool calls that introduce files which should result in a rule load
  • Path filtering via YAML frontmatter, meaning that rule application can be restricted further to only apply when files matching the globs are in context.
  • Configuration under subdirectoryRules option
    • Disabled by default
    • Glob patterns can be set via patterns, default is **/AGENTS.md
    • Searches up by default, can be configured to just load rule files that are in the same directory as the loaded file by setting the exact option to true
  • When tool calls that introduced rules into the session are pruned, the rules are also pruned. Tool calls that would match a rule are all tracked, so any live tool calls that reference a rule will keep the rule loaded into the session
  • TUI shows rule loads in the message interface, all currently loaded rules are listed in the sidebar

Not working

  • Web UI + Desktop UI (Rule loading triggers, just having trouble getting the UI aspect working)

How did you verify your code works?

  • Running the TUI, adding additional AGENTS.md files, sending chat messages that should trigger loading of rules
  • Simple unit tests

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

I found a potentially related PR:

Related PR:

This PR appears to address similar functionality around loading rules from subdirectories. While it's an older PR, it may contain relevant implementation details or context for the current PR #9657. You may want to review if it was previously merged, closed, or if there's overlap in the approach being taken.

@bailey-busc bailey-busc force-pushed the bailey/push-osnszlnqwyxm branch from 905a456 to 1f0af09 Compare January 20, 2026 18:10
@bailey-busc bailey-busc force-pushed the bailey/push-osnszlnqwyxm branch from 1f0af09 to 9a0c9bd Compare January 20, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Context Auto-Discovery: Load AGENTS.md from Directories When Accessing Files

1 participant