* Parse and load settings flags early, before init() * This ensures settings are filtered from the start of initialization
()
| 562 | * This ensures settings are filtered from the start of initialization |
| 563 | */ |
| 564 | function eagerLoadSettings(): void { |
| 565 | profileCheckpoint('eagerLoadSettings_start'); |
| 566 | // Parse --settings flag early to ensure settings are loaded before init() |
| 567 | const settingsFile = eagerParseCliFlag('--settings'); |
| 568 | if (settingsFile) { |
| 569 | loadSettingsFromFlag(settingsFile); |
| 570 | } |
| 571 | |
| 572 | // Parse --setting-sources flag early to control which sources are loaded |
| 573 | const settingSourcesArg = eagerParseCliFlag('--setting-sources'); |
| 574 | if (settingSourcesArg !== undefined) { |
| 575 | loadSettingSourcesFromFlag(settingSourcesArg); |
| 576 | } |
| 577 | profileCheckpoint('eagerLoadSettings_end'); |
| 578 | } |
| 579 | function initializeEntrypoint(isNonInteractive: boolean): void { |
| 580 | // Skip if already set (e.g., by SDK or other entrypoints) |
| 581 | if (process.env.CLAUDE_CODE_ENTRYPOINT) { |
no test coverage detected