feat(opencode): load .opencode/AGENTS.md instructions#12096
Open
skabillium wants to merge 6 commits intoanomalyco:devfrom
Open
feat(opencode): load .opencode/AGENTS.md instructions#12096skabillium wants to merge 6 commits intoanomalyco:devfrom
skabillium wants to merge 6 commits intoanomalyco:devfrom
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
rekram1-node
reviewed
Feb 4, 2026
| 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`) | ||
| 1. **Local files** by traversing up from the current directory (`AGENTS.md`, `CLAUDE.md`, `CONTEXT.md`) plus `.opencode/AGENTS.md` |
Collaborator
There was a problem hiding this comment.
prefer not documenting CONTEXT.md it is deprecated and will be removed
Author
There was a problem hiding this comment.
@rekram1-node sure, should I remove other mentions of it in the file?
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Closes #11454
Adds support for loading project rules from
.opencode/AGENTS.mdin addition to the existing local rule-file resolution.AGENTS.md,CLAUDE.md, and (deprecated)CONTEXT.md..opencode/AGENTS.mdfiles found via upward traversal are loaded in addition to the local rule file above..opencode/AGENTS.mdand the local precedence behavior.Why?
Allows projects to keep OpenCode-specific instructions in a dedicated
.opencode/folder without replacing existingAGENTS.md/CLAUDE.mdusage.How did you verify your code works?
AGENTS.md+.opencode/AGENTS.md, and for loading only.opencode/AGENTS.mdwhenAGENTS.mdis absent.bun test test/session/instruction.test.ts(frompackages/opencode)Notes