This repository was archived by the owner on Apr 1, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ export namespace Flag {
1313 export const OPENCODE_ENABLE_EXPERIMENTAL_MODELS = truthy ( "OPENCODE_ENABLE_EXPERIMENTAL_MODELS" )
1414 export const OPENCODE_DISABLE_AUTOCOMPACT = truthy ( "OPENCODE_DISABLE_AUTOCOMPACT" )
1515 export const OPENCODE_DISABLE_MODELS_FETCH = truthy ( "OPENCODE_DISABLE_MODELS_FETCH" )
16+ export const OPENCODE_DISABLE_CLAUDE_CODE = truthy ( "OPENCODE_DISABLE_CLAUDE_CODE" )
17+ export const OPENCODE_DISABLE_CLAUDE_CODE_PROMPT =
18+ OPENCODE_DISABLE_CLAUDE_CODE || truthy ( "OPENCODE_DISABLE_CLAUDE_CODE_PROMPT" )
19+ export const OPENCODE_DISABLE_CLAUDE_CODE_SKILLS =
20+ OPENCODE_DISABLE_CLAUDE_CODE || truthy ( "OPENCODE_DISABLE_CLAUDE_CODE_SKILLS" )
1621 export const OPENCODE_FAKE_VCS = process . env [ "OPENCODE_FAKE_VCS" ]
1722 export const OPENCODE_CLIENT = process . env [ "OPENCODE_CLIENT" ] ?? "cli"
1823
Original file line number Diff line number Diff line change @@ -62,10 +62,10 @@ export namespace SystemPrompt {
6262 "CLAUDE.md" ,
6363 "CONTEXT.md" , // deprecated
6464 ]
65- const GLOBAL_RULE_FILES = [
66- path . join ( Global . Path . config , "AGENTS.md" ) ,
67- path . join ( os . homedir ( ) , ".claude" , "CLAUDE.md" ) ,
68- ]
65+ const GLOBAL_RULE_FILES = [ path . join ( Global . Path . config , "AGENTS.md" ) ]
66+ if ( ! Flag . OPENCODE_DISABLE_CLAUDE_CODE_PROMPT ) {
67+ GLOBAL_RULE_FILES . push ( path . join ( os . homedir ( ) , ".claude" , "CLAUDE.md" ) )
68+ }
6969
7070 if ( Flag . OPENCODE_CONFIG_DIR ) {
7171 GLOBAL_RULE_FILES . push ( path . join ( Flag . OPENCODE_CONFIG_DIR , "AGENTS.md" ) )
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { Log } from "../util/log"
77import { Global } from "@/global"
88import { Filesystem } from "@/util/filesystem"
99import { exists } from "fs/promises"
10+ import { Flag } from "@/flag/flag"
1011
1112export namespace Skill {
1213 const log = Log . create ( { service : "skill" } )
@@ -80,22 +81,24 @@ export namespace Skill {
8081 claudeDirs . push ( globalClaude )
8182 }
8283
83- for ( const dir of claudeDirs ) {
84- const matches = await Array . fromAsync (
85- CLAUDE_SKILL_GLOB . scan ( {
86- cwd : dir ,
87- absolute : true ,
88- onlyFiles : true ,
89- followSymlinks : true ,
90- dot : true ,
91- } ) ,
92- ) . catch ( ( error ) => {
93- log . error ( "failed .claude directory scan for skills" , { dir, error } )
94- return [ ]
95- } )
96-
97- for ( const match of matches ) {
98- await addSkill ( match )
84+ if ( ! Flag . OPENCODE_DISABLE_CLAUDE_CODE_SKILLS ) {
85+ for ( const dir of claudeDirs ) {
86+ const matches = await Array . fromAsync (
87+ CLAUDE_SKILL_GLOB . scan ( {
88+ cwd : dir ,
89+ absolute : true ,
90+ onlyFiles : true ,
91+ followSymlinks : true ,
92+ dot : true ,
93+ } ) ,
94+ ) . catch ( ( error ) => {
95+ log . error ( "failed .claude directory scan for skills" , { dir, error } )
96+ return [ ]
97+ } )
98+
99+ for ( const match of matches ) {
100+ await addSkill ( match )
101+ }
99102 }
100103 }
101104
Original file line number Diff line number Diff line change @@ -566,6 +566,9 @@ OpenCode can be configured using environment variables.
566566| ` OPENCODE_DISABLE_LSP_DOWNLOAD ` | boolean | Disable automatic LSP server downloads |
567567| ` OPENCODE_ENABLE_EXPERIMENTAL_MODELS ` | boolean | Enable experimental models |
568568| ` OPENCODE_DISABLE_AUTOCOMPACT ` | boolean | Disable automatic context compaction |
569+ | ` OPENCODE_DISABLE_CLAUDE_CODE ` | boolean | Disable reading from ` .claude ` (prompt + skills) |
570+ | ` OPENCODE_DISABLE_CLAUDE_CODE_PROMPT ` | boolean | Disable reading ` ~/.claude/CLAUDE.md ` |
571+ | ` OPENCODE_DISABLE_CLAUDE_CODE_SKILLS ` | boolean | Disable loading ` .claude/skills ` |
569572| ` OPENCODE_CLIENT ` | string | Client identifier (defaults to ` cli ` ) |
570573| ` OPENCODE_ENABLE_EXA ` | boolean | Enable Exa web search tools |
571574
You can’t perform that action at this time.
0 commit comments