@@ -428,24 +428,25 @@ const resolveClaudeConfigDirPath = Effect.fn("resolveClaudeConfigDirPath")(funct
428428 return path . join ( home , ".claude" ) ;
429429} ) ;
430430
431- const SettingsBaseUrl = fromLenientJson (
432- Schema . Struct ( {
433- env : Schema . optional ( Schema . Struct ( { ANTHROPIC_BASE_URL : Schema . optional ( Schema . String ) } ) ) ,
434- } ) ,
431+ const SettingsEnv = Schema . Struct ( {
432+ ANTHROPIC_BASE_URL : Schema . optional ( Schema . String ) ,
433+ CLAUDE_CODE_ENTRYPOINT : Schema . optional ( Schema . String ) ,
434+ } ) ;
435+ const decodeSettingsEnv = Schema . decodeUnknownEffect (
436+ fromLenientJson ( Schema . Struct ( { env : Schema . optional ( SettingsEnv ) } ) ) ,
435437) ;
436- const decodeSettingsBaseUrl = Schema . decodeUnknownEffect ( SettingsBaseUrl ) ;
437438
438- /** ANTHROPIC_BASE_URL from Claude's settings `env`, which Claude Code applies over the process env . */
439- export const readClaudeSettingsBaseUrl = Effect . fn ( "readClaudeSettingsBaseUrl " ) ( function * (
439+ /** The `env` values T3 Code reads from Claude's user and managed settings; later files win . */
440+ export const readClaudeSettingsEnv = Effect . fn ( "readClaudeSettingsEnv " ) ( function * (
440441 config : Pick < ClaudeSettings , "homePath" > ,
441442 cwd : string | undefined ,
442443 environment : NodeJS . ProcessEnv ,
443- ) : Effect . fn . Return < string | undefined , never , FileSystem . FileSystem | Path . Path > {
444+ ) : Effect . fn . Return < typeof SettingsEnv . Type , never , FileSystem . FileSystem | Path . Path > {
444445 const fileSystem = yield * FileSystem . FileSystem ;
445446 const path = yield * Path . Path ;
446447 const platform = yield * HostProcess . Platform ;
447448 const configDirPath = yield * resolveClaudeConfigDirPath ( config , environment , cwd ) ;
448- let baseUrl : string | undefined ;
449+ const settingsEnv : typeof SettingsEnv . Type = { } ;
449450 for ( const settingsPath of claudeSettingsPaths (
450451 path ,
451452 configDirPath ,
@@ -457,12 +458,10 @@ export const readClaudeSettingsBaseUrl = Effect.fn("readClaudeSettingsBaseUrl")(
457458 . readFileString ( settingsPath )
458459 . pipe ( Effect . orElseSucceed ( ( ) => undefined ) ) ;
459460 if ( contents === undefined ) continue ;
460- const parsed = yield * decodeSettingsBaseUrl ( contents ) . pipe (
461- Effect . orElseSucceed ( ( ) => undefined ) ,
462- ) ;
463- baseUrl = parsed ?. env ?. ANTHROPIC_BASE_URL ?? baseUrl ;
461+ const parsed = yield * decodeSettingsEnv ( contents ) . pipe ( Effect . orElseSucceed ( ( ) => undefined ) ) ;
462+ Object . assign ( settingsEnv , parsed ?. env ) ;
464463 }
465- return baseUrl ;
464+ return settingsEnv ;
466465} ) ;
467466
468467// Claude's --add-dir is repeatable and variadic; parseCliArgs keeps only one value.
0 commit comments