Commit Graph
2 Commits
Author SHA1 Message Date
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
carraes 7b0f7f878a refactor: extract modular components from main.go
- Add internal/cli/validation.go for CLI flag validation
- Add internal/commands/hooks.go for hook management commands
- Add internal/commands/config.go for configuration commands
- Add internal/guide/guide.go for LLM usage guide
- Follows Go project layout standards for better maintainability
2025-07-06 12:00:56 -03:00