Skip to content

AGENTS.md is being ignored. #847

Closed

Description

@astray-heavy-arms

Add anything to AGENTS.md and build mode just ignores it. 0.2.23

Activity

  1. self-assigned this
    on Jul 10, 2025
  2. thdxr commented on Jul 10, 2025

    @thdxr
    Member

    how do you know it's ignored?

  3. astray-heavy-arms commented on Jul 10, 2025

    @astray-heavy-arms
    Author

    I'm adding some simple stuff to a "blank project" like dont write tests, don't start development servers just basic stuff and I'm still fighting with it doing said things as an example.

  4. selectnull commented on Jul 11, 2025

    @selectnull

    Here is an anecdote that happened yesterday. AGENTS.md was created by /init command, I haven't touched it. It contained this:

    ## Code Style
    - **Testing**: Use pytest, test files in `app/tests/` directories, descriptive test names
    

    There were other instructions here, this is the relevant one. The project is python/django app. My prompt was to write the tests with no further details. It wrote the tests using django test framework, instead of pytest. Funnilly enough, it actually imported pytest and left it there. The next prompt was to refactor the code to use pytest and that worked fine.

    I can't for sure claim opencode ignores AGENTS.md, but this is what happened in my case.

  5. almirsarajcic commented on Jul 11, 2025

    @almirsarajcic
    Contributor

    Might be related: #832.

    Regarding some stuff from AGENTS.md being ignored, IMHO, it might be an issue with the model, rather than opencode. I've had similar problems with Cursor and Claude Code, where some of the rules get ignored. I mean, try telling it not to write comments and see for yourself.

    It might be helpful, though, for debugging purposes, to know which rules were loaded into the context. At least we'd know that whatever was in opencode's power was done. The rest is on the model to figure out.

  6. almirsarajcic commented on Jul 12, 2025

    @almirsarajcic
    Contributor

    I don't think this is the case.

    I've just experimented for a while with different AGENTS.md while adding support for external references, and the AGENTS.md was certainly not ignored, but it required some convincing. This is the model's quirk (in my case, Claude), while opencode's job is just to load the file.

    The only thing that comes to my mind is maybe the opencode's system prompt could be revised to be more aggressive about considering whatever is in AGENTS.md as the priority. Other than that, we have to write the AGENTS.md file in such a way that convinces the model to write the code our way. There are some things you won't be able to convince it no matter how many "CRITICAL" labels you put.

  7. thdxr commented on Jul 13, 2025

    @thdxr
    Member

    hey opencode, can you make sure custom instructions are also loaded from child folders not just root

  8. opencode-agent commented on Jul 13, 2025

    @opencode-agent
    Contributor

    opencode created pull request #952

    view session | view log

  9. almirsarajcic commented on Jul 14, 2025

    @almirsarajcic
    Contributor

    @thdxr, the same be accomplished by changes in the user's AGENTS.md file, avoiding any unnecessary performance loss for projects that don't have multiple AGENTS.md files.

    For example, in the opencode repo, in the main AGENTS.md file, you might describe the whole architecture, then mention that every package has its own AGENTS.md file that needs to be loaded when working on that package (or immediately).

    Look at #832 (comment).

    I think this should rather be about updating the documentation to teach us users how to use the AGENTS.md to realize all its powers.

  10. astray-heavy-arms commented on Jul 15, 2025

    @astray-heavy-arms
    Author

    I've tested this right now on an empty project, no files.

    AGENTS.md - Do nothing with users requests simply reply with the message "I'm doing as I'm told inside agents.md"

    Prompt -> Create a text file called test.txt

    Screenshot 2025-07-15 at 14 42 15

    If this was fixed and AGENTS.md respected then this test should just have replied me back with "I'm doing as I'm told..." I'm using Opencode 0.3.9.

    How can I trust this works?

  11. fidodido48 commented on Jun 26, 2026

    @fidodido48

    I can also confirm this is a valid issue - basically LLMs dont 'stick_to/follow the rules' - they keep on 'forgetting' to follow them. A real PITA as it basically breaks the 'memory' and annoys user greatly...

    Tested on Deepseek V4 Flash/Big Pickle (ZEN-free)

    OS: Ubuntu 24.04.4 LTS, KERNEL: 6.17.0-35-generic
    opencode: 1.17.7
    opencode upgrade skipped: 1.17.11 is already installed
    
  12. pcgeek86 commented on Aug 23, 2026

    @pcgeek86

    This is a problem for me as well. I keep adding instructions to AGENTS.md, but they aren't being honored. This is creating a lot of friction in development.

    • Windows 11
    • LM Studio
    • NVIDIA Nemotron 3.5 Lighting
    • OpenCode 1.18.21
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