Skip to content

[FEATURE]: Option to skip ~/.claude loading when OPENCODE_CONFIG_DIR is set #18693

@MinhoJJang

Description

@MinhoJJang
  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Environment: opencode v1.3.0, macOS

Setup: OPENCODE_CONFIG_DIR set to a custom path. My mcp.json there has only one server registered.

Expected: Only MCP servers defined in OPENCODE_CONFIG_DIR are loaded.

Actual: Notion MCP (installed as a Claude Code plugin) also gets loaded on startup.


Root cause I traced:

skill/index.ts scans ~/.claude unconditionally regardless of OPENCODE_CONFIG_DIR:

const EXTERNAL_DIRS = [".claude", ".agents"]

for (const dir of EXTERNAL_DIRS) {
  const root = path.join(Global.Path.home, dir)
  await scan(state, root, EXTERNAL_SKILL_PATTERN, ...)
}

When scanning skills, loadSkillFromPath also calls loadMcpJsonFromDir, which reads mcp.json from each skill directory. Since Claude Code plugins live under ~/.claude/plugins/cache/, and each plugin can ship a .mcp.json (e.g. ~/.claude/plugins/cache/claude-plugins-official/Notion/0.1.0/.mcp.json), their MCP servers get picked up automatically.

Verified: temporarily renamed that .mcp.json → Notion MCP no longer appeared on startup.


Request:

When OPENCODE_CONFIG_DIR is explicitly set, skip ~/.claude scanning entirely — similar to how OPENCODE_DISABLE_EXTERNAL_SKILLS works, but scoped to the Claude Code compat layer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions