Files
shush/internal/commands
carraes 9109964235 fix: critical hooks bug - preserve all Claude Code settings
BREAKING BUG FIX: Hook installation was destroying existing Claude Code settings

- Fix critical data loss in --install-hook and --uninstall-hook commands
- Change ClaudeSettings to preserve ALL existing JSON settings via Data map
- Add automatic timestamped backup creation before any settings modification
- Implement surgical hook installation that adds to existing config structure
- Implement surgical hook removal that only removes shush hooks
- Prevent loss of user settings like includeCoAuthoredBy, themes, etc.
- Add comprehensive error handling for malformed settings files

This was a critical data loss bug that could destroy users' Claude Code configurations.
All existing settings are now preserved during hook operations.

Fixes: Users losing their Claude Code settings during hook installation
Added: Automatic backups with timestamp (settings.json.backup.TIMESTAMP)
Improved: Hook management now respects existing PostToolUse configurations
2025-07-07 14:18:59 -03:00
..