OpenCode doesn't respect external instructions files when added to opencode.json #3004

Closed
opened 2026-02-16 17:38:13 -05:00 by yindo · 8 comments
Owner

Originally created by @Salloxy on GitHub (Nov 20, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

The docs include a way to add external files to act the same way as AGENTS.md by adding

"{
"$schema": "https://opencode.ai/config.json",
"instructions": ["docs/development-standards.md", "test/testing-guidelines.md", "packages/*/AGENTS.md"]
}"

but when adding this to my global config.json and testing it I see that only AGENTS.md is respected.

OpenCode version

V1.0.80

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Originally created by @Salloxy on GitHub (Nov 20, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description The docs include a way to add external files to act the same way as AGENTS.md by adding "{ "$schema": "https://opencode.ai/config.json", "instructions": ["docs/development-standards.md", "test/testing-guidelines.md", "packages/*/AGENTS.md"] }" but when adding this to my global config.json and testing it I see that only AGENTS.md is respected. ### OpenCode version V1.0.80 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System Windows 11 ### Terminal Windows Terminal
yindo added the bug label 2026-02-16 17:38:13 -05:00
yindo closed this issue 2026-02-16 17:38:13 -05:00
Author
Owner

@rekram1-node commented on GitHub (Nov 20, 2025):

@Salloxy where are those files that it references located? They are resolved relative to ur cwd

@rekram1-node commented on GitHub (Nov 20, 2025): @Salloxy where are those files that it references located? They are resolved relative to ur cwd
Author
Owner

@Salloxy commented on GitHub (Nov 20, 2025):

Both the opencode.json and the external files are in the same directory (both are in the global directory). Everything else in the global opencode.json (for example the MCP servers) work as expected. I will re-try this later with the newest opencode version and share my exact opencode.json file.

@Salloxy commented on GitHub (Nov 20, 2025): Both the opencode.json and the external files are in the same directory (both are in the global directory). Everything else in the global opencode.json (for example the MCP servers) work as expected. I will re-try this later with the newest opencode version and share my exact opencode.json file.
Author
Owner

@Salloxy commented on GitHub (Nov 20, 2025):

After thorough testing I see how it works! After adding "instructions": ["ultracite.md"] to my global opencode.json, it does not follow the rules in ultracite.md, but, when I add "instructions": ["ultracite.md"] to a project's opencode.json, it does follow the rules in ultracite.md. Is it on purpose that "instructions": ["ultracite.md"] doesn't work globally or a bug? @rekram1-node ?

@Salloxy commented on GitHub (Nov 20, 2025): After thorough testing I see how it works! After adding "instructions": ["ultracite.md"] to my global opencode.json, it does **not** follow the rules in ultracite.md, but, when I add "instructions": ["ultracite.md"] to a project's opencode.json, it **does** follow the rules in ultracite.md. Is it on purpose that "instructions": ["ultracite.md"] doesn't work globally or a bug? @rekram1-node ?
Author
Owner

@Salloxy commented on GitHub (Nov 20, 2025):

I see now that after adding "instructions": ["ultracite.md"] to my global directory it also includes my local directory's ultracite.md in the custom instructions. Is there any way to be able to add my ultracite.md to my global directory and add something to my global opencode.json for it to include my global ultracite.md in the custom instructions or only AGENTS.md can work globally but all external custom instructions files (even those mentioned in the global opencode.json) has to be added in every project directory?

@Salloxy commented on GitHub (Nov 20, 2025): I see now that after adding "instructions": ["ultracite.md"] to my global directory it also includes my local directory's ultracite.md in the custom instructions. Is there any way to be able to add my ultracite.md to my global directory and add something to my global opencode.json for it to include my global ultracite.md in the custom instructions or only AGENTS.md can work globally but all external custom instructions files (even those mentioned in the global opencode.json) has to be added in every project directory?
Author
Owner

@rekram1-node commented on GitHub (Nov 21, 2025):

im not sure im following

@rekram1-node commented on GitHub (Nov 21, 2025): im not sure im following
Author
Owner

@Salloxy commented on GitHub (Nov 21, 2025):

Haha sorry for the confusion, when I add

"instructions": ["ultracite.md"]

to my global opencode.json, even if I have a file named "ultracite.md" in my global directory (the same directory where the global opencode.json file lives) it will not include it into its custom instructions. In order for me to be able to have my "ultracite.md" work as custom instructions globally, I have to add it (ultracite.md) in every single project directory. Is that on purpose or a bug?

@Salloxy commented on GitHub (Nov 21, 2025): Haha sorry for the confusion, when I add "instructions": ["ultracite.md"] to my global opencode.json, even if I have a file named "ultracite.md" in my global directory (the same directory where the global opencode.json file lives) it will not include it into its custom instructions. In order for me to be able to have my "ultracite.md" work as custom instructions globally, I have to add it (ultracite.md) in every single project directory. Is that on purpose or a bug?
Author
Owner

@rekram1-node commented on GitHub (Nov 21, 2025):

that’s on purpose, it is resolved relative to where opencode runs, use an absolute path if u dont want that

@rekram1-node commented on GitHub (Nov 21, 2025): that’s on purpose, it is resolved relative to where opencode runs, use an absolute path if u dont want that
Author
Owner

@Salloxy commented on GitHub (Nov 22, 2025):

that’s on purpose, it is resolved relative to where opencode runs, use an absolute path if u dont want that

Makes sense, will close the issue.

@Salloxy commented on GitHub (Nov 22, 2025): > that’s on purpose, it is resolved relative to where opencode runs, use an absolute path if u dont want that Makes sense, will close the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3004