[FEATURE]: Config dir AGENTS.md conflates global and repo-specific rules #8238

Open
opened 2026-02-16 18:09:30 -05:00 by yindo · 1 comment
Owner

Originally created by @MichaelYochpaz on GitHub (Feb 1, 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

I version my ~/.config/opencode/ as a git repo (skills, commands, etc) for version-control and easy syncing across computers.

When I want to add an AGENTS.md there, it ends up serving two purposes that don't mix well:

  1. Global preferences - rules I want applied to all my OpenCode sessions everywhere
  2. Repo development context - instructions for working on this config repo specifically (like "check OpenCode docs when writing skills")

(docs for reference)

The problem is everything in ~/.config/opencode/AGENTS.md gets loaded globally, so any instructions I give agents that work on my OpenCode configuration repo (for creating skills, updating OpenCode configuration, etc.) also supposedly shows up for any project I'm working on with OpenCode.

Suggestion

A convention to use a different file for "repo-specific" stuff when the config dir is itself a repo.
For example, for the actual OpenCode config repo, the regular AGENTS.md will be used, while the global preferences file will have a different name, like USER-AGENTS.md / AGENTS.user.md GLOBAL-AGENTS.md / AGENTS.global.md, or something along these lines.

Originally created by @MichaelYochpaz on GitHub (Feb 1, 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 I version my `~/.config/opencode/` as a git repo (skills, commands, etc) for version-control and easy syncing across computers. When I want to add an `AGENTS.md` there, it ends up serving two purposes that don't mix well: 1. **Global preferences** - rules I want applied to all my OpenCode sessions everywhere 2. **Repo development context** - instructions for working on this config repo specifically (like "check OpenCode docs when writing skills") ([docs for reference](https://opencode.ai/docs/rules/#global)) The problem is everything in `~/.config/opencode/AGENTS.md` gets loaded globally, so any instructions I give agents that work on my OpenCode configuration repo (for creating skills, updating OpenCode configuration, etc.) also supposedly shows up for any project I'm working on with OpenCode. ## Suggestion A convention to use a different file for "repo-specific" stuff when the config dir is itself a repo. For example, for the actual OpenCode config repo, the regular `AGENTS.md` will be used, while the global preferences file will have a different name, like `USER-AGENTS.md` / `AGENTS.user.md` `GLOBAL-AGENTS.md` / `AGENTS.global.md`, or something along these lines.
yindo added the discussiondocs labels 2026-02-16 18:09:30 -05:00
Author
Owner

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

This issue might be a duplicate of existing issues. Please check:

  • #11534: BUG: AGENTS.md in OPENCODE_CONFIG_DIR is ignored when global AGENTS.md exists (describes the underlying technical bug that leads to this feature request)
  • #9282: docs: clarify that project and global AGENTS.md files are combined, not overridden (related to the confusion about how global vs project rules are handled)
  • #7101: [FEATURE]: Allow custom system prompts in global, project or custom directories (similar request for separating scopes of configuration)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 1, 2026): This issue might be a duplicate of existing issues. Please check: - #11534: BUG: AGENTS.md in OPENCODE_CONFIG_DIR is ignored when global AGENTS.md exists (describes the underlying technical bug that leads to this feature request) - #9282: docs: clarify that project and global AGENTS.md files are combined, not overridden (related to the confusion about how global vs project rules are handled) - #7101: [FEATURE]: Allow custom system prompts in global, project or custom directories (similar request for separating scopes of configuration) Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8238