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
[FEATURE]: add OPENCODE_DISABLE_GLOBAL_CONFIG flag to skip global config loading #21264
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
When embedding OpenCode as a subprocess via opencode serve (e.g. in an Electron app or backend service), the host application
provides all configuration through OPENCODE_CONFIG_CONTENT. However, OpenCode still loads global config files and scans global
directories from ~/.config/opencode/, which can cause unexpected behavior by merging unrelated user-level settings, agents, skills,
and plugins into the intended configuration.
Currently there is no way to skip global config and directory scanning:
OPENCODE_DISABLE_PROJECT_CONFIG only skips project-level config, not global
OPENCODE_CONFIG_CONTENT is additive — it merges on top of global config rather than replacing it
Note: This is related to but different from #20784 (settingSources). That PR provides a granular SDK-level mechanism to control
config sources. This PR takes a simpler approach with a single env var flag, consistent with existing OPENCODE_DISABLE_*
conventions, specifically targeting the embedded opencode serve use case.
Proposed Solution
Add a new environment variable OPENCODE_DISABLE_GLOBAL_CONFIG. When set to 1 or true:
loadGlobal() in config.ts returns an empty config object, skipping all files under ~/.config/opencode/ (config.json, opencode.json, opencode.jsonc)
ConfigPaths.directories() in paths.ts excludes ~/.config/opencode/ from the returned list, preventing scanning of global
agents, skills, commands, and plugins
I would really appreciate this feature as well. I have many global skills, agents, and configurations that are essential for some projects but completely irrelevant (or even counterproductive) for others. Being able to conditionally disable them would be fantastic.
Either an environment variable like OPENCODE_DISABLE_GLOBAL_CONFIG or a setting in my local opencode.jsonc would work well for my use case. I use devenv, so the env var approach feels natural.
Activity
michaelvolz commentedon Apr 26, 2026
I would really appreciate this feature as well. I have many global skills, agents, and configurations that are essential for some projects but completely irrelevant (or even counterproductive) for others. Being able to conditionally disable them would be fantastic.
Either an environment variable like OPENCODE_DISABLE_GLOBAL_CONFIG or a setting in my local opencode.jsonc would work well for my use case. I use devenv, so the env var approach feels natural.
test(ci): load plugin via OPENCODE_CONFIG_CONTENT and skip integratio…
test(ci): isolate integration tests from developer's global OpenCode …
Xynonners commentedon May 4, 2026
+1 here.
CH-Chang commentedon Jun 1, 2026
+1
mostashkin commentedon Jul 22, 2026
+1
github-actions commentedon Sep 22, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.