{{ message }}
Repository navigation
fix(core): honor OPENCODE_DISABLE_CLAUDE_CODE - #55774
Merged
Merged
Conversation
V2 documented the flag but never wired it into config discovery, so ~/.claude and project .claude skill roots always loaded. Add a `claude` config option that drops those roots, and map OPENCODE_DISABLE_CLAUDE_CODE (and OPENCODE_DISABLE_CLAUDE_CODE_SKILLS, since .claude is only read for skills) to it in the CLI alongside the other env-driven options. Supersedes #51888. Co-authored-by: malarahfelipe <29868402+malarahfelipe@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
Looks good. I ran opencode serve from source on the base and with this PR, against a project and home directory that each have .claude/skills, plus a project .agents/skills, and listed skills with GET /api/skill. On the base, OPENCODE_DISABLE_CLAUDE_CODE=1 and OPENCODE_DISABLE_CLAUDE_CODE_SKILLS=1 had no effect. With the PR, either flag removes the global and project .claude skills, while the .agents skill and the built-in skills stay. Setting the flag to 0 loads everything again. The core config tests (47/47) and type checks in core, server and cli pass.
Public API (all additions, backwards compatible):
claude?: booleanis a new optional field in coreConfig.Options. Leaving it unset keeps the current behaviour.config.claude?: booleanis a new optional field in the server'sServerOptions. The SDK'sCreateOptionsextendsServerOptions, so SDK callers get it too.- The documented env vars
OPENCODE_DISABLE_CLAUDE_CODEandOPENCODE_DISABLE_CLAUDE_CODE_SKILLSnow take effect in v2. Before, they did nothing.
No blocking concerns.
This was referenced Oct 15, 2026
Closed
2 tasks done
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?
OPENCODE_DISABLE_CLAUDE_CODEis documented but v2 never wired it up, so~/.claudeand project.claudeskill roots always load.claudeconfig option (default on).claude: falsedrops every.clauderoot from discovery, which also removes its skill loading and watches..agentsroots are unaffected.OPENCODE_DISABLE_CLAUDE_CODEandOPENCODE_DISABLE_CLAUDE_CODE_SKILLStoclaude: false, next to the other env-driven options inserver-process.ts. Core doesn't read the environment directly. v2 only reads.claudefor skills, so the two flags gate the same roots.OPENCODE_DISABLE_CLAUDE_CODE_PROMPTstays a no-op because v2 doesn't loadCLAUDE.md.config.claudethrough toConfig.configured.Supersedes #51888 from @malarahfelipe (credited as co-author). Same goal, but the env var is mapped at the CLI boundary instead of being read inside core discovery.
How did you verify your code works?
packages/core:bun test test/config/config.test.ts, 47/47. The new test checks thatclaude: falsedrops the global and project.clauderoots and keeps both.agentsroots, with a control run showing the roots are found by default. It fails when the discovery change is reverted.bun typecheckpasses inpackages/core,packages/serverandpackages/cli.Requested by: @thdxr (dax via Slack)
Added by the opencode bot (AI-generated).
Fixes #55750
Related: #36990
Public API: adds optional
claudeto core Config options and server/SDKconfigoptions; OPENCODE_DISABLE_CLAUDE_CODE(_SKILLS) now take effect (backwards compatible)