You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v2: no CLAUDE.md fallback (compatibility issue, as migrate-v1 asks) #53402
V1 used CLAUDE.md when a project had no AGENTS.md, and ~/.claude/CLAUDE.md when there was no ~/.config/opencode/AGENTS.md. V2 only looks for AGENTS.md (packages/core/src/config/plugin/instruction.ts). The migration guide says to file a compatibility issue for this, so here it is.
Our setup: we use Claude Code and OpenCode on the same repos, and the instructions are written for Claude Code: a global ~/.claude/CLAUDE.md and project CLAUDE.md files. Today a local plugin injects them into V2.
Ask: bring back the V1 fallback, with the V1 off switches (OPENCODE_DISABLE_CLAUDE_CODE, OPENCODE_DISABLE_CLAUDE_CODE_PROMPT, see #36990), or add it as an opt-in setting.
Plugins
none
OpenCode version
2.0.22. instruction.ts behaves the same in 2.0.23 and on v2 @ ef07075.
Steps to reproduce
mkdir p && cd p && git init && echo 'The project codeword is TEAL-42.' > CLAUDE.md
opencode run --standalone "What is the project codeword? Answer from your context only, no tools."
V1 answers TEAL-42. V2 doesn't know it.
The same happens with the codeword in ~/.claude/CLAUDE.md and no ~/.config/opencode/AGENTS.md.
Thanks for the clear report. I could reproduce this on 2.0.22, and it still happens on the latest dev (f7d0ce1).
What I did, with a simulated model:
A git project with only CLAUDE.md (The project codeword is TEAL-42.), no AGENTS.md.
A ~/.claude/CLAUDE.md with a second codeword, and no ~/.config/opencode/AGENTS.md.
One prompt from the TUI, then a check of the request sent to the model.
Neither file's content was in that request. When I put the same text in a project AGENTS.md, it does show up, so only the CLAUDE.md fallback is missing. In the code, packages/core/src/config/plugin/instruction.ts only looks for AGENTS.md (the global file and the walk up the directory tree); nothing reads CLAUDE.md.
The script below reproduces it. It logs whether each codeword reached the model; set CONTROL=1 to run the AGENTS.md comparison.
Related: #36990 tracks V1 environment variable compatibility, including OPENCODE_DISABLE_CLAUDE_CODE and OPENCODE_DISABLE_CLAUDE_CODE_PROMPT. Bringing back the fallback would also give _PROMPT something to turn off again.
Reproduction script (drive.ts)
// Repro for #53402: V2 ignores CLAUDE.md (project) and ~/.claude/CLAUDE.md (global) fallbacks.// Neither AGENTS.md exists, so V1 would load both files into the system prompt.// Set CONTROL=1 to write the same text to AGENTS.md instead: V2 then does include it.import{Effect,Stream}from"effect"import{mkdirSync,writeFileSync}from"node:fs"import{join}from"node:path"import{Llm,OpenCodeDriver}from"opencode-drive"exportdefaultOpenCodeDriver.use({
...(process.env.OC_DEV ? {opencode: {dev: process.env.OC_DEV}} : {}),project: {git: true,files: {[process.env.CONTROL ? "AGENTS.md" : "CLAUDE.md"]: "The project codeword is TEAL-42.\n"}},tui: {recording: true},},({ artifacts, ui, llm })=>Effect.gen(function*(){// OPENCODE_TEST_HOME is the artifacts dir: this is ~/.claude/CLAUDE.md for the run.mkdirSync(join(artifacts,".claude"),{recursive: true})writeFileSync(join(artifacts,".claude","CLAUDE.md"),"The global codeword is NAVY-7.\n")constrequests: string[]=[]// Give the file watcher a moment to pick up the new global file.yield*Effect.sleep("2 seconds")yield*llm.serve((request: unknown)=>{requests.push(JSON.stringify(request))returnStream.make(Llm.text("done"))})yield*ui.submit("What is the project codeword?")yield*ui.waitFor("done",{timeout: 60000})constbody=requests.join("\n")consthasProject=body.includes("TEAL-42")consthasGlobal=body.includes("NAVY-7")consthasAgentsMention=/AGENTS\.md|Instructionsfrom/.test(body)yield*Effect.log(`requests=${requests.length} project codeword (TEAL-42) in model request=${hasProject} global codeword (NAVY-7, ~/.claude/CLAUDE.md) in model request=${hasGlobal}`)yield*Effect.log(`home=${artifacts} AGENTS/instructions mentioned=${hasAgentsMention}`)if(!hasProject||!hasGlobal)yield*Effect.log("REPRODUCED: CLAUDE.md fallback not applied")}),)
Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.
#63830 brings this back in a configurable way: with instruction_files set to ["AGENTS.md", "CLAUDE.md"], v2 reads CLAUDE.md again in the global config folder and in the upward walk. It is behind an experimental flag for now.
Feedback or a thumbs up on the PR would help :)
Activity
github-actions commentedon Oct 5, 2026
This issue might overlap with existing issues. Please check:
~/.claude/CLAUDE.mdas global instructions.CLAUDE.mdcompatibility.OPENCODE_DISABLE_CLAUDE_CODE*behavior.opencodejr commentedon Oct 27, 2026
Thanks for the clear report. I could reproduce this on 2.0.22, and it still happens on the latest
dev(f7d0ce1).What I did, with a simulated model:
CLAUDE.md(The project codeword is TEAL-42.), noAGENTS.md.~/.claude/CLAUDE.mdwith a second codeword, and no~/.config/opencode/AGENTS.md.Neither file's content was in that request. When I put the same text in a project
AGENTS.md, it does show up, so only theCLAUDE.mdfallback is missing. In the code,packages/core/src/config/plugin/instruction.tsonly looks forAGENTS.md(the global file and the walk up the directory tree); nothing readsCLAUDE.md.The script below reproduces it. It logs whether each codeword reached the model; set
CONTROL=1to run theAGENTS.mdcomparison.Related: #36990 tracks V1 environment variable compatibility, including
OPENCODE_DISABLE_CLAUDE_CODEandOPENCODE_DISABLE_CLAUDE_CODE_PROMPT. Bringing back the fallback would also give_PROMPTsomething to turn off again.Reproduction script (drive.ts)
Run it with opencode-drive:
opencode-drive run ./drive.ts. It drivesopencodefrom yourPATH; setOC_DEVto the path of an OpenCode checkout to run that from source instead.Lukk17 commentedon Nov 17, 2026
#63830 brings this back in a configurable way: with instruction_files set to
["AGENTS.md", "CLAUDE.md"], v2 reads CLAUDE.md again in the global config folder and in the upward walk. It is behind an experimental flag for now.Feedback or a thumbs up on the PR would help :)