[FEATURE]: Dynamic AGENTS.md resolution has no low-cost trigger for intentional loading #9291

Closed
opened 2026-02-16 18:12:06 -05:00 by yindo · 2 comments
Owner

Originally created by @wblazer on GitHub (Feb 13, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

The AGENTS.md autoloading (added in #10678) is only triggered by the read tool. This means the only way to trigger autoloading of a subdirectory's AGENTS.md is to read an actual file from that directory.

There's no low-cost way for an agent to load folder-level agent documentation without pulling in potentially unwanted file content. Tools like glob and grep that operate on directories don't trigger autoloading, and explicitly reading the AGENTS.md itself doesn't prevent re-injection on subsequent reads (since explicit reads don't populate metadata.loaded the same way).

The root problem for me is that I want a system where an agent can explore the codebase through its localized agent documentation before reading any code, but also have any unloaded documentation loaded passively as a side effect of the read tool (current approach).

A potential solution is to deduplicate explicit AGENTS.md reads against subsequent autoloads.

This functionality can be recreated with plugins, and I had Claude recreate it as a plugin with deduplication of explicit reads here. The main constraint of this approach is that the built-in dynamic AGENTS.md resolution can't be disabled currently, so I'm forced to use a different filename. However, I think I like my output format better for my needs because auto-loaded localized documentation feels semantically different than a "system-reminder," so I may continue using it even if my suggestion here goes through. An option to disable the built-in auto-loading would let me use AGENTS.md as the filenames still with my plugin, so that might be a nice addition as well.

Originally created by @wblazer on GitHub (Feb 13, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request The AGENTS.md autoloading (added in #10678) is only triggered by the read tool. This means the only way to trigger autoloading of a subdirectory's AGENTS.md is to read an actual file from that directory. There's no low-cost way for an agent to load folder-level agent documentation without pulling in potentially unwanted file content. Tools like glob and grep that operate on directories don't trigger autoloading, and explicitly reading the AGENTS.md itself doesn't prevent re-injection on subsequent reads (since explicit reads don't populate metadata.loaded the same way). The root problem for me is that I want a system where an agent can explore the codebase through its localized agent documentation before reading any code, but also have any unloaded documentation loaded passively as a side effect of the read tool (current approach). A potential solution is to deduplicate explicit AGENTS.md reads against subsequent autoloads. This functionality can be recreated with plugins, and I had Claude recreate it as a plugin with deduplication of explicit reads [here](https://gist.github.com/wblazer/25eea3574fe4fd9502e875e9e4cf435f). The main constraint of this approach is that the built-in dynamic AGENTS.md resolution can't be disabled currently, so I'm forced to use a different filename. However, I think I like my output format better for my needs because auto-loaded localized documentation feels semantically different than a "system-reminder," so I may continue using it even if my suggestion here goes through. An option to disable the built-in auto-loading would let me use AGENTS.md as the filenames still with my plugin, so that might be a nice addition as well.
yindo added the discussionneeds:compliance labels 2026-02-16 18:12:06 -05:00
yindo closed this issue 2026-02-16 18:12:06 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 13, 2026):

This issue doesn't fully meet our contributing guidelines.

What needs to be fixed:

  • Feature Request titles should start with [FEATURE]: prefix. Current title: "Dynamic AGENTS.md resolution has no low-cost trigger for intentional loading" should be "[FEATURE]: Dynamic AGENTS.md resolution has no low-cost trigger for intentional loading"

Please edit this issue to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions[bot] commented on GitHub (Feb 13, 2026): <!-- issue-compliance --> This issue doesn't fully meet our [contributing guidelines](../blob/dev/CONTRIBUTING.md). **What needs to be fixed:** - Feature Request titles should start with **[FEATURE]:** prefix. Current title: "Dynamic AGENTS.md resolution has no low-cost trigger for intentional loading" should be "[FEATURE]: Dynamic AGENTS.md resolution has no low-cost trigger for intentional loading" Please edit this issue to address the above within **2 hours**, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 13, 2026):

This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new issue that follows our issue templates.

@github-actions[bot] commented on GitHub (Feb 13, 2026): This issue has been automatically closed because it was not updated to meet our [contributing guidelines](../blob/dev/CONTRIBUTING.md) within the 2-hour window. Feel free to open a new issue that follows our issue templates.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9291