fix(core): honor OPENCODE_DISABLE_CLAUDE_CODE by opencode-agent[bot] · Pull Request #55774 · anomalyco/opencode · GitHub
Skip to content

fix(core): honor OPENCODE_DISABLE_CLAUDE_CODE - #55774

Merged
rekram1-node merged 1 commit into
devfrom
disable-claude-code
Oct 15, 2026
Merged

rekram1-node merged 1 commit into
devfrom
disable-claude-code

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

OPENCODE_DISABLE_CLAUDE_CODE is documented but v2 never wired it up, so ~/.claude and project .claude skill roots always load.

  • Core: new claude config option (default on). claude: false drops every .claude root from discovery, which also removes its skill loading and watches. .agents roots are unaffected.
  • CLI: maps OPENCODE_DISABLE_CLAUDE_CODE and OPENCODE_DISABLE_CLAUDE_CODE_SKILLS to claude: false, next to the other env-driven options in server-process.ts. Core doesn't read the environment directly. v2 only reads .claude for skills, so the two flags gate the same roots. OPENCODE_DISABLE_CLAUDE_CODE_PROMPT stays a no-op because v2 doesn't load CLAUDE.md.
  • Server: passes config.claude through to Config.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 that claude: false drops the global and project .claude roots and keeps both .agents roots, with a control run showing the roots are found by default. It fails when the discovery change is reverted.
  • bun typecheck passes in packages/core, packages/server and packages/cli.

Requested by: @thdxr (dax via Slack)


Added by the opencode bot (AI-generated).

Fixes #55750

Related: #36990

Public API: adds optional claude to core Config options and server/SDK config options; OPENCODE_DISABLE_CLAUDE_CODE(_SKILLS) now take effect (backwards compatible)

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>

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?: boolean is a new optional field in core Config.Options. Leaving it unset keeps the current behaviour.
  • config.claude?: boolean is a new optional field in the server's ServerOptions. The SDK's CreateOptions extends ServerOptions, so SDK callers get it too.
  • The documented env vars OPENCODE_DISABLE_CLAUDE_CODE and OPENCODE_DISABLE_CLAUDE_CODE_SKILLS now take effect in v2. Before, they did nothing.

No blocking concerns.

Fixes #55750
Related: #36990

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OPENCODE_DISABLE_CLAUDE_CODE_SKILLS=1 no longer disables .claude/skills discovery in v2

2 participants