* Parse and load settings flags early, before init() * This ensures settings are filtered from the start of initialization
()
| 500 | * This ensures settings are filtered from the start of initialization |
| 501 | */ |
| 502 | function eagerLoadSettings(): void { |
| 503 | profileCheckpoint('eagerLoadSettings_start'); |
| 504 | // Parse --settings flag early to ensure settings are loaded before init() |
| 505 | const settingsFile = eagerParseCliFlag('--settings'); |
| 506 | if (settingsFile) { |
| 507 | loadSettingsFromFlag(settingsFile); |
| 508 | } |
| 509 | |
| 510 | // Parse --setting-sources flag early to control which sources are loaded |
| 511 | const settingSourcesArg = eagerParseCliFlag('--setting-sources'); |
| 512 | if (settingSourcesArg !== undefined) { |
| 513 | loadSettingSourcesFromFlag(settingSourcesArg); |
| 514 | } |
| 515 | profileCheckpoint('eagerLoadSettings_end'); |
| 516 | } |
| 517 | function initializeEntrypoint(isNonInteractive: boolean): void { |
| 518 | // Skip if already set (e.g., by SDK or other entrypoints) |
| 519 | if (process.env.CLAUDE_CODE_ENTRYPOINT) { |
no test coverage detected