AGENTS.md not loaded after /new #8183

Open
opened 2026-02-16 18:09:22 -05:00 by yindo · 11 comments
Owner

Originally created by @jacekpoplawski on GitHub (Jan 31, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

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

Originally created by @jacekpoplawski on GitHub (Jan 31, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description 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_
yindo added the bug label 2026-02-16 18:09:22 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 31, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #3031: Model in BUILD mode does not have enough context to continue after compaction (related context loss after session events)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 31, 2026): This issue might be a duplicate of existing issues. Please check: - #3031: Model in BUILD mode does not have enough context to continue after compaction (related context loss after session events) Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Jan 31, 2026):

which AGENTS.md isn't "loaded", where are u running opencode and where is the file located?

@rekram1-node commented on GitHub (Jan 31, 2026): which AGENTS.md isn't "loaded", where are u running opencode and where is the file located?
Author
Owner

@jacekpoplawski commented on GitHub (Jan 31, 2026):

I run opencode in folder with my project, AGENTS.md is in the folder, I use local setup

@jacekpoplawski commented on GitHub (Jan 31, 2026): I run opencode in folder with my project, AGENTS.md is in the folder, I use local setup
Author
Owner

@rekram1-node commented on GitHub (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

@rekram1-node commented on GitHub (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
Author
Owner

@jacekpoplawski commented on GitHub (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

@jacekpoplawski commented on GitHub (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
Author
Owner

@TheBlueSky commented on GitHub (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.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.

@TheBlueSky commented on GitHub (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.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.
Author
Owner

@bakaburg1 commented on GitHub (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

@bakaburg1 commented on GitHub (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
Author
Owner

@DrOptix commented on GitHub (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.

@DrOptix commented on GitHub (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.
Author
Owner

@rekram1-node commented on GitHub (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

@rekram1-node commented on GitHub (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
Author
Owner

@lindelleric commented on GitHub (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.

@lindelleric commented on GitHub (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.
Author
Owner

@PatrickVeltrop commented on GitHub (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

@PatrickVeltrop commented on GitHub (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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8183