anomalyco / anomalyco/opencode

[FEATURE]: Disable or replace project AGENTS.md (instructions currently only adds)

Open
#47,879 2 comments 1 reaction 1 assignee View on GitHub

@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.md file.

When opencode starts, it looks for rule files in this order:

  1. Local files by traversing up from the current directory (AGENTS.md, CLAUDE.md)
  2. Global file at ~/.config/opencode/AGENTS.md
  3. Claude Code file at ~/.claude/CLAUDE.md (unless disabled)

The first matching file wins in each category. For example, if you have both AGENTS.md and CLAUDE.md, only AGENTS.md is used.

You can specify custom instruction files in your opencode.json or 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.md files.

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 project AGENTS.md (for example "agents_md": false or OPENCODE_DISABLE_AGENTS_MD=1).
  • An instructions mode that replaces auto-loaded AGENTS.md instead of combining, e.g. "instructions": { "replace": ["OPENCODE.md"] } or "instructions_mode": "replace".
  • Documented per-project precedence so a named instruction file wins over AGENTS.md rather 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.