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 expect /new to clear the current conversation context and start a new session within the same project.
After running /new, OpenCode does NOT automatically load AGENTS.md. I have to explicitly ask it to read the file again.
If this is expected behavior?
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Reacted by Ove Ragnar Oddløkken, Hao Ke, Danil Suetin, Tim Dittler, x8code, Thai Hoang, Luco Bellic, Alexander Schwenn, Ordinate IO, Enrico Nello and 7 more
in that case maybe it's a problem with the model (GLM 4.7 Flash on llama.cpp, but it does great in general, I use it with opencode for many days now), I observe that after /new when I talk to opencode, model skips all the instructions from AGENTS.md, I will check other models, thanks
I notice the same (similar?) issue. I am on the latest version of OpenCode, and opened it in the root directory of the repo where I have AGENTS.md files:
Started a new session on a repo that I have never used OpenCode on.
Selected a model; in my case it was kimi-k2.5-free.
Asked it to plan a change.
It reported that it read the relevant files, and AGENTS.md was not one of them.
Not sure however whether the file is expected to show on the list of read files, or how to verify that is read.
it could be useful to have a visual clue in the TUI and GUIs of what files the context is made of. Probably we should just trust that AGENTS are parsed in every time, but seeing would make us feel better, I believe. Cursor and copilot do this
Reacted by Essam, Yves Parès (Ywen), Eric Lindell, Patrick Veltrop, David, Brian Lewis, Juan Cruz Linsalata, Ordinate IO, Johan Andrébeck, Aurel Branzeanu and 5 more
This is something I've noticed as well. Mostly I see the file not read, but rarely I've seen it inspected. Can't figure out what makes OpenCode read it without me explicitly asking for it.
Okay when I say "read" i just mean it's included in context, like the global and project root ones are in the system prompt, but yeah having more transparency around the context is a good idea that we should have.
The desktop app actually has this, just haven't done it in tui yet
The same issue occurs on OpenCode Desktop version 1.4.4. My project folder is a junction directory, and I start OpenCode from that junction. How can I check whether the new session has loaded AGENTS.md from the project root directory?
same here:
opencode from VS code extension and qwen 3.5 27B (opus distilled) on llama.cpp
it completely ignores the AGENTS.md i put inside the project root folder...
Same issue here, but let's be concrete rather than speculative. My project has AGENTS.md at its root:
user@laptop:~/project$ ls
AGENTS.md [...other files...]
If I run opencode in there and run it, it does not include AGENTS.md in the context, only the default system prompt + my prompt + tools definition:
{
"model": "qwen/qwen3-coder-30b",
"max_tokens": 32000,
"temperature": 0.55,
"top_p": 1,
"messages": [
{
"role": "system",
"content": "You are opencode, (...) rather than after mistakes.\n"
},
{
"role": "user",
"content": "Analyse the project"
}
],
"tools": [
(functions def for question, bash, read, glob, grep, edit, write, task, webfetch, todowrite, skill)
],
"tool_choice": "auto",
"stream": true,
"stream_options": {
"include_usage": true
}
}
If I run opencode web and prompt from there, same thing.
For those who want to do the same, you can use mitmproxy as a proxy between opencode and the LLM. Configure opencode to send to mitmproxy and mitmproxy to send to the LLM.
This is my first time using openCode, the latest version. I used the opencode command in the repo root directory and started a dialog, but it apparently wasn't reading AGENTS.md.
For random travelers, this bug is about AGENTS.md in working trees; the global rules file in ~/.config/opencode/AGENTS.md is correctly read (as of 1.14.48 in my testing at least) by /new. However, watch out if you use https://github.com/dotCipher/opencode-claude-bridge as it currently clobbers the global rules.
Still an issue. instructions in the config dont work, global and project AGENTS.md get ignored, but opencode will read the README.md file instead and thats it?
I think there is a misunderstanding here, AGENTS.md is always included in context, there must be a misconfiguration on ur end or ur using small local models that arent abiding by ur rules.
If you can run opencode through mitm and show me that the AGENTS.md are actually being dropped instead of trying to verify by asking llm / seeing what llm does then I can reopen, but rn I cannot reproduce this at all.
Activity
github-actions commentedon Jan 31, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Jan 31, 2026
which AGENTS.md isn't "loaded", where are u running opencode and where is the file located?
jacekpoplawski commentedon Jan 31, 2026
I run opencode in folder with my project, AGENTS.md is in the folder, I use local setup
rekram1-node commentedon Jan 31, 2026
if u have:
project:
|- AGENTS.md
and you run opencode in project
then AGENTS.md should ALWAYS be included in the system prompt sent to the model
jacekpoplawski commentedon Jan 31, 2026
in that case maybe it's a problem with the model (GLM 4.7 Flash on llama.cpp, but it does great in general, I use it with opencode for many days now), I observe that after /new when I talk to opencode, model skips all the instructions from AGENTS.md, I will check other models, thanks
TheBlueSky commentedon Feb 1, 2026
I notice the same (similar?) issue. I am on the latest version of OpenCode, and opened it in the root directory of the repo where I have
AGENTS.mdfiles:kimi-k2.5-free.AGENTS.mdwas not one of them.Not sure however whether the file is expected to show on the list of read files, or how to verify that is read.
bakaburg1 commentedon Feb 2, 2026
it could be useful to have a visual clue in the TUI and GUIs of what files the context is made of. Probably we should just trust that AGENTS are parsed in every time, but seeing would make us feel better, I believe. Cursor and copilot do this
DrOptix commentedon Feb 2, 2026
This is something I've noticed as well. Mostly I see the file not read, but rarely I've seen it inspected. Can't figure out what makes OpenCode read it without me explicitly asking for it.
rekram1-node commentedon Feb 2, 2026
Okay when I say "read" i just mean it's included in context, like the global and project root ones are in the system prompt, but yeah having more transparency around the context is a good idea that we should have.
The desktop app actually has this, just haven't done it in tui yet
lindelleric commentedon Feb 5, 2026
I had this issue as well, but since updating to 1.1.49 I cannot reproduce it anymore. Now it has the AGENTS.md-file from the start.
patrickveltrop-coda commentedon Feb 11, 2026
Same issue unfortunately, switching models or even adding an instruction in opencode's config to always read the agents.md file doesnt work
x8code commentedon Feb 23, 2026
Same problem here ....
AGENTS.mdfile is in the root of my project directory.AGENTS.mdfile is not being read.I'm using LM Studio with its API exposed, and the model is
nvidia/nemotron-3-nano.Every time I try to use OpenCode, and think I'm going to make progress this time, I am disappointed by a new problem .....
celestial-rose commentedon Apr 10, 2026
Same issue, is there a way to have it being read without having to put it in.
.opencodefolder ?tdhung80 commentedon Apr 15, 2026
The same issue occurs on OpenCode Desktop version 1.4.4. My project folder is a junction directory, and I start OpenCode from that junction. How can I check whether the new session has loaded AGENTS.md from the project root directory?
superDuperCyberTechno commentedon Apr 15, 2026
It seems that changing model (and back) fixes it in the TUI, at least temporarily.
enricollen commentedon Apr 19, 2026
same here:
opencode from VS code extension and qwen 3.5 27B (opus distilled) on llama.cpp
it completely ignores the AGENTS.md i put inside the project root folder...
matthieu-vergne commentedon Apr 29, 2026
Same issue here, but let's be concrete rather than speculative. My project has AGENTS.md at its root:
user@laptop:~/project$ ls AGENTS.md [...other files...]If I run opencode in there and run it, it does not include AGENTS.md in the context, only the default system prompt + my prompt + tools definition:
{ "model": "qwen/qwen3-coder-30b", "max_tokens": 32000, "temperature": 0.55, "top_p": 1, "messages": [ { "role": "system", "content": "You are opencode, (...) rather than after mistakes.\n" }, { "role": "user", "content": "Analyse the project" } ], "tools": [ (functions def for question, bash, read, glob, grep, edit, write, task, webfetch, todowrite, skill) ], "tool_choice": "auto", "stream": true, "stream_options": { "include_usage": true } }If I run opencode web and prompt from there, same thing.
For those who want to do the same, you can use mitmproxy as a proxy between opencode and the LLM. Configure opencode to send to mitmproxy and mitmproxy to send to the LLM.
Biogasbottle commentedon May 13, 2026
Same issue.
This is my first time using openCode, the latest version. I used the opencode command in the repo root directory and started a dialog, but it apparently wasn't reading AGENTS.md.
kikoreis commentedon May 14, 2026
For random travelers, this bug is about AGENTS.md in working trees; the global rules file in
~/.config/opencode/AGENTS.mdis correctly read (as of 1.14.48 in my testing at least) by /new. However, watch out if you use https://github.com/dotCipher/opencode-claude-bridge as it currently clobbers the global rules.lemonvlt commentedon May 26, 2026
Still an issue.
instructionsin the config dont work, global and project AGENTS.md get ignored, but opencode will read the README.md file instead and thats it?Happening with any Ollama Cloud model.
mrkprdo commentedon May 31, 2026
It seems to be an issue, i have to steer and let agent parse AGENTS.md for every new session
rekram1-node commentedon May 31, 2026
I think there is a misunderstanding here, AGENTS.md is always included in context, there must be a misconfiguration on ur end or ur using small local models that arent abiding by ur rules.
If you can run opencode through mitm and show me that the AGENTS.md are actually being dropped instead of trying to verify by asking llm / seeing what llm does then I can reopen, but rn I cannot reproduce this at all.