Bug Report
Description
When both a global ~/.config/opencode/AGENTS.md and a project-level AGENTS.md exist, only the project-level file is loaded. The global rules are silently ignored.
Documentation Says
From https://opencode.ai/docs/rules/:
Global: You can also have global rules in a ~/.config/opencode/AGENTS.md file. This gets applied across all opencode sessions.
Precedence: The first matching file wins in each category.
The phrase "in each category" implies that local and global are separate categories that should both load. But in practice, only the project AGENTS.md is loaded.
Steps to Reproduce
- Create
~/.config/opencode/AGENTS.md with unique rules (e.g., "Always use rg instead of grep")
- Create a project-level
AGENTS.md in a git repo with different rules
- Start opencode in that project
- Ask the agent to recite its instructions — only the project AGENTS.md content is present
Expected Behavior
Both files should be loaded:
- Global rules apply to ALL sessions (personal preferences, tool preferences, communication style)
- Project rules apply to the specific project (architecture, conventions, build commands)
They serve different purposes and should compose, not override.
Current Workaround
Adding @~/.config/opencode/AGENTS.md to the project AGENTS.md forces loading both, but this:
- Requires manual setup in every project
- Is not documented as necessary
- Defeats the purpose of "global" rules
Environment
- OpenCode: latest
- OS: Windows 11
- Global AGENTS.md at:
C:\Users\<user>\.config\opencode\AGENTS.md
Bug Report
Description
When both a global
~/.config/opencode/AGENTS.mdand a project-levelAGENTS.mdexist, only the project-level file is loaded. The global rules are silently ignored.Documentation Says
From https://opencode.ai/docs/rules/:
The phrase "in each category" implies that local and global are separate categories that should both load. But in practice, only the project AGENTS.md is loaded.
Steps to Reproduce
~/.config/opencode/AGENTS.mdwith unique rules (e.g., "Always use rg instead of grep")AGENTS.mdin a git repo with different rulesExpected Behavior
Both files should be loaded:
They serve different purposes and should compose, not override.
Current Workaround
Adding
@~/.config/opencode/AGENTS.mdto the project AGENTS.md forces loading both, but this:Environment
C:\Users\<user>\.config\opencode\AGENTS.md