anomalyco / anomalyco/opencode
[FEATURE]: Disable or replace project AGENTS.md (instructions currently only adds)
@rekram1-node is already working on this.
Since Sep 8, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Ask: a per-project way to either (1) skip loading AGENTS.md, or (2) let opencode.json instructions replace AGENTS.md instead of combining with it.
Why: AGENTS.md is becoming a shared filename across coding harnesses. In a repo that already uses it as another product's identity file, OpenCode cannot load a different instruction file as the sole source of truth. An override line in a second file is not the same as not loading the first file.
Current documented behavior (https://opencode.ai/docs/rules/ as of 2026-09-07):
You can provide custom instructions to opencode by creating an
AGENTS.mdfile.
When opencode starts, it looks for rule files in this order:
- Local files by traversing up from the current directory (
AGENTS.md,CLAUDE.md)- Global file at
~/.config/opencode/AGENTS.md- Claude Code file at
~/.claude/CLAUDE.md(unless disabled)The first matching file wins in each category. For example, if you have both
AGENTS.mdandCLAUDE.md, onlyAGENTS.mdis used.
You can specify custom instruction files in your
opencode.jsonor the global~/.config/opencode/opencode.json. This allows you and your team to reuse existing rules rather than having to duplicate them to AGENTS.md.
All instruction files are combined with your
AGENTS.mdfiles.
There is already OPENCODE_DISABLE_CLAUDE_CODE / OPENCODE_DISABLE_CLAUDE_CODE_PROMPT to skip Claude's files. There is no equivalent to skip project AGENTS.md.
What would fix it (any one of these):
- A config flag or env, analogous to
OPENCODE_DISABLE_CLAUDE_CODE, that skips projectAGENTS.md(for example"agents_md": falseorOPENCODE_DISABLE_AGENTS_MD=1). - An
instructionsmode that replaces auto-loadedAGENTS.mdinstead of combining, e.g."instructions": { "replace": ["OPENCODE.md"] }or"instructions_mode": "replace". - Documented per-project precedence so a named instruction file wins over
AGENTS.mdrather than being concatenated with it.
Claude Code compatibility already treats AGENTS.md as taking precedence over CLAUDE.md. The missing piece is a way for a project that must keep AGENTS.md for another tool to still give OpenCode its own exclusive instructions.
Verified against OpenCode 1.18.29: "instructions": ["OPENCODE.md"] is loaded in addition to repo-root AGENTS.md.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.