Skip to content

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

Closed as not planned

Description

@jordandru

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.

Activity

  1. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

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

  2. jordandru commented on Sep 9, 2026

    @jordandru
    Author

    Checked both. Neither covers this ask, though they're adjacent:

    This one is specifically: per-project, either skip AGENTS.md or let opencode.json instructions be the sole source instead of combining. Happy to fold it into whichever of the others maintainers prefer if there's a single design that covers all three, but as filed they're three different switches.

  3. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed write-up, @jordandru!

    You tested this on OpenCode 1.18.29, which is v1. v1 (versions 0.x and 1.x, the opencode-ai npm package) now only receives fixes for critical bugs, so new options like this are unlikely to be added there.

    Please consider upgrading to v2 (the @opencode/cli package, opencode command), where active development happens. As far as we can tell, v2 also has no dedicated per-project option yet to skip AGENTS.md or to make instructions replace it rather than add to it. If you need this on v2, please reply here (or open a new issue) saying so, and it can be considered as a v2 feature request. Please also reply if you think this is critical for v1.

  4. opencodejr commented on Oct 29, 2026

    @opencodejr
    Contributor

    Closing this as not planned. The request was tested on OpenCode 1.18.29 (v1), and v1 now only gets fixes for critical bugs. We haven't heard that this is needed on v2.

    If you move to v2 (@opencode/cli) and still need a way to skip project AGENTS.md, or to make instructions replace it rather than add to it, please open a new issue and mention that it's about v2. Thanks again for the clear write-up, @jordandru!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions