* Resolve all settings file paths in precedence order (lowest to highest). * Later files' hooks are appended but all run.
(cwd: string, homeDir?: string)
| 71 | * Later files' hooks are appended but all run. |
| 72 | */ |
| 73 | function getSettingsFilePaths(cwd: string, homeDir?: string): string[] { |
| 74 | const home = homeDir ?? os.homedir(); |
| 75 | const continueHome = |
| 76 | process.env.CONTINUE_GLOBAL_DIR || path.join(home, ".continue"); |
| 77 | |
| 78 | return [ |
| 79 | // User-global (lowest precedence) |
| 80 | path.join(home, ".claude", "settings.json"), |
| 81 | path.join(continueHome, "settings.json"), |
| 82 | |
| 83 | // Project-level |
| 84 | path.join(cwd, ".claude", "settings.json"), |
| 85 | path.join(cwd, ".continue", "settings.json"), |
| 86 | |
| 87 | // Project-local (highest precedence) |
| 88 | path.join(cwd, ".claude", "settings.local.json"), |
| 89 | path.join(cwd, ".continue", "settings.local.json"), |
| 90 | ]; |
| 91 | } |
| 92 | |
| 93 | export interface LoadedHooksConfig { |
| 94 | hooks: HooksConfig; |