Skip to content

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

Closed

Description

@Salloxy

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 20, 2025
  2. rekram1-node commented on Nov 20, 2025

    @rekram1-node
    Collaborator

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

  3. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 20, 2025
  4. self-assigned this
    on Nov 20, 2025
  5. Salloxy commented on Nov 21, 2025

    @Salloxy
    Author

    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.

  6. Salloxy commented on Nov 21, 2025

    @Salloxy
    Author

    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 ?

  7. Salloxy commented on Nov 21, 2025

    @Salloxy
    Author

    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?

  8. rekram1-node commented on Nov 21, 2025

    @rekram1-node
    Collaborator

    im not sure im following

  9. Salloxy commented on Nov 21, 2025

    @Salloxy
    Author

    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?

  10. rekram1-node commented on Nov 22, 2025

    @rekram1-node
    Collaborator

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

  11. Salloxy commented on Nov 22, 2025

    @Salloxy
    Author

    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions