Skip to content

Conversation

@khduy
Copy link

@khduy khduy commented Jan 30, 2026

Summary

When the current working directory equals the home directory, ~/.claude/settings.json was being loaded twice:

  1. Once as the home config (~/.claude/settings.json)
  2. Once as the cwd config (process.cwd()/.claude/settings.json)

This caused hooks like Stop to execute twice, resulting in sounds playing twice, notifications appearing twice, etc.

Fix

Added deduplication using Set in getClaudeSettingsPaths() to ensure each config file path is only included once.

Testing

Verified locally that Stop hooks now execute only once when cwd is the home directory.


Summary by cubic

Prevents double execution of Claude Code hooks by deduplicating settings file paths. Fixes the case where ~/.claude/settings.json was loaded twice when the cwd is the home directory.

  • Bug Fixes
    • Deduplicate paths in getClaudeSettingsPaths using Set so each config loads once.
    • Hooks (e.g., Stop) now fire once when cwd equals home.

Written for commit 4c40c3a. Summary will update on new commits.

…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.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@khduy
Copy link
Author

khduy commented Jan 30, 2026

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant