Skip to content

[FEATURE]: Ability to ignore AGENTS.md #4035

Closed

Description

@NaikSoftware

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

Now it is able to add custom files that will be attached to the context, but there is no way to disable AGENTS.md.
In the repository some users use Codex and some Opencode. We need to have different files for them because OpenCode supports subagents and other differences from Codex. For example, ClaudeCode uses CLAUDE.md and we can add specific instructions only related to the Claude.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Nov 7, 2025
  2. rekram1-node commented on Nov 7, 2025

    @rekram1-node
    Contributor

    @NaikSoftware do u think "instructions": [...] should allow for exclusions? Just trying to think in terms of settings we already have in opencode.json

  3. NaikSoftware commented on Nov 7, 2025

    @NaikSoftware
    Author

    Yes, I think instructions can override default behaviour. By default read agents.md, claude.md. Settings can override this list by my own

  4. rekram1-node commented on Nov 7, 2025

    @rekram1-node
    Contributor

    Right now they are append so we'd need to distinguish them, (some people use them to add their cursor rules for example)

  5. NaikSoftware commented on Nov 7, 2025

    @NaikSoftware
    Author

    Users could specify any list of files they want. cursor and agents.md or any list. It is much flexible than hardcoded some files inside core and ability only to expand list of files.

  6. taqtiqa-mark commented on Nov 11, 2025

    @taqtiqa-mark

    Right now they are append so we'd need to distinguish them, (some people use them to add their cursor rules for example)

    @rekram1-node not sure if you want to track this as a separate docs issue....

    Documentation:

  7. rekram1-node commented on Nov 12, 2025

    @rekram1-node
    Contributor

    yeah having consistent terminology makes sense idek why it is different that's a good point

  8. self-assigned this
    on Nov 12, 2025
  9. WAY29 commented on Dec 8, 2025

    @WAY29
    Contributor

    This is certainly a very good idea, many AIs read AGENTS.md(codex, opencode, cursor...) , yet we have no way to differentiate between it, which is certainly frustrating

  10. jordanjones-sq commented on Jan 17, 2026

    @jordanjones-sq

    @rekram1-node I think I have a working solution for this based on the discussion here. It adds support for excluding default rule files by prefixing them with ! in the instructions array:

    {
      instructions: ["!AGENTS.md", "AGENTS.local.md"]
    }
    

    For context, this was built with AI using OpenCode. I'm a professional senior software engineer but not familiar with this codebase or TypeScript, so feedback is welcome.

    The code changes follow the contribution guidelines to the best of my knowledge. Let me know if you'd like me to push it up for review.

  11. jordanjones-sq commented on Jan 23, 2026

    @jordanjones-sq

    @rekram1-node have you had a chance to review my comment regarding a fix for this?

  12. DavidBK commented on Mar 10, 2026

    @DavidBK

    Yes, please! Sometimes the AGENT.md files committed in the repo takes up too much context. Instead of manually deleting them (which creates a Git changes), ignoring it at the OpenCode level would be very convenient and more “pro-user” friendly.

  13. NaikSoftware commented on Mar 10, 2026

    @NaikSoftware
    Author

    @DavidBK i think rewrite Opencode from scratch to the new TUI is much simple for the maintainers then adding two lines of code for devs who can't use OpenCode without this feature 😔

  14. vuon9 commented on Mar 10, 2026

    @vuon9

    Would it be possible to re-open the issue? @NaikSoftware
    It's currently very important to me, and I need to handle it by removing files locally and using Git to disregard the changes, which is rather inconvenient.

  15. NaikSoftware commented on Mar 10, 2026

    @NaikSoftware
    Author

    @vuon9 I created many issues like this (critical for many peoples) and none of them was done. Only "it's good idea we will think about it". Instead of it I see major updates not so critical (TUI, web interface) was implemented. Because of it I think team has it's own roadmap/plan for the project. Such a simple and usable things like this not so interesting. We can discuss this issue infinitely but it not reasonable. Just use Claude Code if you want good UX and all needed features.

  16. vuon9 commented on Mar 10, 2026

    @vuon9

    The OC team's prioritization is unclear to me, but the concern is totally valid.
    Latecomers will read and form their opinions on the ongoing discussion, then they will probably decide to work on it.

  17. taqtiqa-mark commented on Mar 12, 2026

    @taqtiqa-mark

    @vuon9 I created many issues like this (critical for many peoples) and none of them was done. Only "it's good idea we will think about it". Instead of it I see major updates not so critical (TUI, web interface) was implemented. Because of it I think team has it's own roadmap/plan for the project. Such a simple and usable things like this not so interesting. We can discuss this issue infinitely but it not reasonable. Just use Claude Code if you want good UX and all needed features.

    I had the same experience, and drew the same conclusion. As I disentangle from OC, I've offered this encouragement, to consider rewarding implementation excellence:

    In the spirit of calling out excellent engineering and design....

    I've found that the Pi Coding Agent is more robust and, for me has none of the issues that I've encountered in OC, or has an elegant way to resolve them.... I'm dropping out of OC issues:

    [Pi Coding Agent](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent)
    [Overview](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/)
    [Example development session](https://www.youtube.com/watch?v=ANQ1IYsFM2s)
    
  18. EatMyLunch commented on Jul 18, 2026

    @EatMyLunch

    Temporary workaround for anyone blocked by this:

    Our repo has a committed AGENTS.md, but I want to use my own local version. Keep your preferred file anywhere outside the repo, then run:

    cp /path/to/your/AGENTS.md ./AGENTS.md
    git update-index --skip-worktree AGENTS.md

    I also added Git hooks to rerun this after checkout, pull, merge, or rebase. Not ideal, but it works for now.

  19. NaikSoftware commented on Aug 9, 2026

    @NaikSoftware
    Author

    Temporary workaround for anyone blocked by this:

    Our repo has a committed AGENTS.md, but I want to use my own local version. Keep your preferred file anywhere outside the repo, then run:

    cp /path/to/your/AGENTS.md ./AGENTS.md
    git update-index --skip-worktree AGENTS.md
    I also added Git hooks to rerun this after checkout, pull, merge, or rebase. Not ideal, but it works for now.

    and dont forget to copy in every git worktree)

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

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions