* Parse and load settings flags early, before init() * This ensures settings are filtered from the start of initialization
()
| 513 | * This ensures settings are filtered from the start of initialization |
| 514 | */ |
| 515 | function eagerLoadSettings(): void { |
| 516 | profileCheckpoint('eagerLoadSettings_start'); |
| 517 | // Parse --settings flag early to ensure settings are loaded before init() |
| 518 | const settingsFile = eagerParseCliFlag('--settings'); |
| 519 | if (settingsFile) { |
| 520 | loadSettingsFromFlag(settingsFile); |
| 521 | } |
| 522 | |
| 523 | // Parse --setting-sources flag early to control which sources are loaded |
| 524 | const settingSourcesArg = eagerParseCliFlag('--setting-sources'); |
| 525 | if (settingSourcesArg !== undefined) { |
| 526 | loadSettingSourcesFromFlag(settingSourcesArg); |
| 527 | } |
| 528 | profileCheckpoint('eagerLoadSettings_end'); |
| 529 | } |
| 530 | function initializeEntrypoint(isNonInteractive: boolean): void { |
| 531 | // Skip if already set (e.g., by SDK or other entrypoints) |
| 532 | if (process.env.CLAUDE_CODE_ENTRYPOINT) { |
no test coverage detected