Repository navigation
fix(core): let either Claude Code flag disable every CLAUDE.md - #64533
Conversation
There was a problem hiding this comment.
Looks good. I ran OpenCode from source with the simulated model on a project that has only a CLAUDE.md. On the base, OPENCODE_DISABLE_CLAUDE_CODE_PROMPT=1 still loaded the project CLAUDE.md. With this PR it is skipped, the same as with OPENCODE_DISABLE_CLAUDE_CODE=1. With no flag set, it still loads. The instruction-discovery and session-instructions tests pass. I couldn't run the type checks here because bun check isn't available, but no claudeGlobal option is left in packages/.
Public API: removes the server option instructions.claudeGlobal and the matching InstructionDiscovery option, which leaves instructions.claude as the only switch. OPENCODE_DISABLE_CLAUDE_CODE_PROMPT changes from skipping only ~/.claude/CLAUDE.md to skipping every CLAUDE.md. Both options came from #64474, which merged today, so the break is small as long as that hasn't shipped yet. The docs cover the env var change.
No concerns.
Related: #36990
Issue for this PR
Follow-up to #64474
Type of change
What does this PR do?
#64474 added two server options for the CLAUDE.md fallback,
instructions.claudeandinstructions.claudeGlobal, so thatOPENCODE_DISABLE_CLAUDE_CODE_PROMPTcould keep its V1 meaning of skipping only~/.claude/CLAUDE.md. This merges them into a singleinstructions.claudeboolean. When it isfalse, OpenCode skips everyCLAUDE.md, both the per-directory ones and~/.claude/CLAUDE.md.Both
OPENCODE_DISABLE_CLAUDE_CODEandOPENCODE_DISABLE_CLAUDE_CODE_PROMPTnow set it tofalse. If you're disabling Claude Code files, you most likely want all of them gone, and one flag is simpler than keeping V1's half-way option.OPENCODE_DISABLE_CLAUDE_CODEstill also disables.claudeskills.instructions.mdxandmigrate-v1.mdxare updated, and the migration page notes that_PROMPTused to skip only the global file.No feature flag: this narrows a fallback that just landed.
How did you verify your code works?
bun typecheckinpackages/core,packages/serverandpackages/clibun test test/instruction-discovery.test.ts test/session-instructions.test.ts test/tool-read.test.tsinpackages/core(61 pass, 1 skip)Screenshots / recordings
N/A
Checklist
Added by the opencode bot (AI-generated).
Related: #36990
Public API: removes server option instructions.claudeGlobal; OPENCODE_DISABLE_CLAUDE_CODE_PROMPT now skips every CLAUDE.md instead of only ~/.claude/CLAUDE.md (breaking only for the option added in #64474)