Repository navigation
Conversation
There was a problem hiding this comment.
The change works as described. With the simulated model, the base branch sends only AGENTS.md to the model, even with the new config set. This branch also sends CLAUDE.md when the flag is on and the file is listed. The core tests closest to the change pass, and tsc passes for core and schema.
Public API (all additions, backwards compatible): a top-level config key instruction_files (an array of unique plain file names), a flag experimental.instruction_files (boolean), and a schema Config.InstructionFileName in the OpenAPI spec and generated client types. Without the flag, behaviour is unchanged: only AGENTS.md is looked up.
Letting a project config choose file names doesn't add new exposure, since a project's instructions array can already load ~/ and absolute paths. Global file names come only from config outside the project, as the docs say.
I found no blocking concerns.
Related: #53402
a6c2375 to
a458f0f
Compare
There was a problem hiding this comment.
The new head is a rebase onto newer dev. The read tool now reads config through its existing config observer instead of calling config.entries() on every read, and the generated OpenAPI spec and client types were rebased around the new upstream flags.
I checked again with the simulated model. The base sends only AGENTS.md to the model; this branch also sends CLAUDE.md when the flag is on and the file is listed. The core tests closest to the change pass, and tsc passes for core and schema.
The public API impact is the same as before, all additions and backwards compatible: the instruction_files config key, the experimental.instruction_files flag, and the Config.InstructionFileName schema in the OpenAPI spec and client types.
No new concerns.
|
Closing this. CLAUDE.md now loads as a fallback since #64474, and the instructions setting already loads exact files, so most of this is not needed anymore. |



Issue for this PR
Closes #54489
Related: #53402
Related: #32069
Type of change
What does this PR do?
I use Claude Code and OpenCode on the same repos and did not want to keep
AGENTS.mdandCLAUDE.mdin sync by hand. Saw #54489 and #53402 ask for this too, so I made the file names configurable. Running it in my fork for some weeks now.{ "experimental": { "instruction_files": true }, "instruction_files": ["AGENTS.md", "CLAUDE.md"] }Without the experimental flag only
AGENTS.mdis read, as before. The names apply in the three places whereAGENTS.mdwas hard coded: the global config folder, the walk up from the workspace, and the files found near a path the read tool opens. Each entry must be a plain file name. A list with no valid entry falls back toAGENTS.md.How did you verify your code works?
I put a
CLAUDE.mdwith the lineThe secret test word is PINEAPPLE-42.in a project and asked the model, without tools, for the secret word from its instructions. It answered PINEAPPLE-42. After I removedCLAUDE.mdfrom the list, a new session answered NONE.New tests in
packages/corecover the config check, the discovery and the read tool.bun run checkpasses.Screenshots / recordings
The model reads the word from
CLAUDE.md:Checklist
Added by the opencode bot (AI-generated).
Related: #53402
Public API: adds the
instruction_filesconfig key and theexperimental.instruction_filesflag (backwards compatible)