Skip to content

The Manual Instructions in AGENTS.md seems to only work for relative referecnes in the current project #1490

Closed

Description

@nerdo

I've been experimenting with a set of rules primarily for use with Claude Code that I also want to try out with opencode.

I've relied on @file/references/like/this.md in Claude Code and it's worked pretty well, so when I saw the documentation on rules that alluded to similar functionality in opencode (https://opencode.ai/docs/rules/#manual-instructions-in-agentsmd), I was hoping I could use the same set of files as-is but that doesn't seem to be the case.

To clarify, I have my AGENTS.md and file references in ~/.config/opencode/AGENTS.md. Similar to my Claude Code setup, I have subfolders like standards/data.md referenced within AGENTS.md as @standards/data.md, but what I found is that when I ran prompts, it would try to read standards/data.md relative to the project directory I was in, not relative to the file that it was referenced from.

Perhaps this is by design, but the documentation on it is unclear. At a minimum, clarifying the documentation would be good to avoid confusion, but I would love for it to behave similar to Claude Code to make sharing system prompts with opencode trivial.

Activity

  1. JouckJack commented on Aug 1, 2025

    @JouckJack
  2. nerdo commented on Aug 1, 2025

    @nerdo
    Author

    I've also been trying to use the instructions property in ~/.config/opencode.json and it seems like that isn't working either. I've tried with both relative and absolute paths and I haven't been able to verify that it's loading.

    I've tried a cursory check of the context usage, but I've also asked the AI if a specific copy & pasted text showed up in my system prompt and it responded with no.

    So maybe neither of these methods properly work from ~/.config?

  3. changed the title [-]The Maanual Instructions in AGENTS.md seems to only work for relative referecnes in the current project[/-] [+]The Manual Instructions in AGENTS.md seems to only work for relative referecnes in the current project[/+] on Aug 1, 2025
  4. self-assigned this
    on Aug 1, 2025
  5. nerdo commented on Aug 1, 2025

    @nerdo
    Author

    More context. I found some documentation about using {file:...} in the opencode.json file (https://opencode.ai/docs/config/#files). It DID seem to expand the file contents - I verified it by looking at the logs and found where the processed config gets output. I can see my file contents there, but it did not seem to have any effect on the system prompt or size of the context window, so it seems like there's either out of date documentation on how this all works or something is broken.

  6. rekram1-node commented on Aug 1, 2025

    @rekram1-node
    Contributor

    regarding your last comment, that is a separate issue: #1240 (just for context)

  7. taqtiqa-mark commented on Oct 14, 2025

    @taqtiqa-mark

    what I found is that when I ran prompts, it would try to read standards/data.md relative to the project directory I was in, not relative to the file that it was referenced from.

    The overloading of @ and the merit of ahereing strictly to legacy apps like Claude Code is debated: #2965
    Specifically, a claude_compat option has been suggested as a way to configure OC so that it resembles Claude behavior.

    @nerdo, not sure if that issue addresses your itch enough the consider closing this and joining the discussion there?

  8. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions