fix(claude-code-hooks): deduplicate settings paths to prevent double hook execution
When cwd equals home directory, ~/.claude/settings.json was being loaded twice (once as home config and once as cwd config), causing hooks like Stop to execute twice. This adds deduplication using Set to ensure each config file is only loaded once.
This commit is contained in:
@@ -55,7 +55,9 @@ export function getClaudeSettingsPaths(customPath?: string): string[] {
|
||||
paths.unshift(customPath)
|
||||
}
|
||||
|
||||
return paths
|
||||
// Deduplicate paths to prevent loading the same file multiple times
|
||||
// (e.g., when cwd is the home directory)
|
||||
return [...new Set(paths)]
|
||||
}
|
||||
|
||||
function mergeHooksConfig(
|
||||
|
||||
Reference in New Issue
Block a user