You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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.
@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).
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...
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.
Activity
thdxr commentedon Jul 10, 2025
how do you know it's ignored?
astray-heavy-arms commentedon Jul 10, 2025
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.
selectnull commentedon Jul 11, 2025
Here is an anecdote that happened yesterday. AGENTS.md was created by
/initcommand, I haven't touched it. It contained this: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
pytestand 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.
almirsarajcic commentedon Jul 11, 2025
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.
almirsarajcic commentedon Jul 12, 2025
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.
thdxr commentedon Jul 13, 2025
hey opencode, can you make sure custom instructions are also loaded from child folders not just root
opencode-agent commentedon Jul 13, 2025
opencode created pull request #952
view session | view log
almirsarajcic commentedon Jul 14, 2025
@thdxr, the same be accomplished by changes in the user's
AGENTS.mdfile, 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.mdfile, you might describe the whole architecture, then mention that every package has its ownAGENTS.mdfile 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.mdto realize all its powers.astray-heavy-arms commentedon Jul 15, 2025
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
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?
Add Google auth to Den signup (anomalyco#847)
feat(web): add local Den dev stack (anomalyco#855)
fidodido48 commentedon Jun 26, 2026
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)
pcgeek86 commentedon Aug 23, 2026
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.