install: installing or uninstalling the Claude Code guard destroys unrelated existing hooks
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 67/100
Research direction
Start with core/install/clients.go around line 96 and trace the Claude Code install and uninstall paths. Check how the hooks configuration is read and written, then reproduce the issue with an unrelated hook entry. Done means install and uninstall preserve unrelated entries while changing only hooks owned by this tool.
Written by the indexing model from the issue text.
Description
Problem
In packages/core/install/clients.go:96, the install/uninstall logic for the Claude Code integration overwrites the hooks configuration file wholesale rather than merging its own hook entries into whatever hooks configuration already exists, so any hooks the user had configured independently of this tool are destroyed.
Impact
A user who has their own Claude Code hooks configured (for unrelated tooling) loses them the moment they install or uninstall the guard integration, since the write path replaces the file's content rather than merging/patching only the entries this tool owns.
Repro
- Configure a custom, unrelated hook entry in the Claude Code hooks configuration file.
- Run the guard's install (or uninstall) command for the Claude Code integration.
- Inspect the hooks configuration file afterward and observe the custom entry is gone.
Suggested fix
Parse the existing hooks configuration, add or remove only the specific entries this tool owns (e.g. tagged by a recognizable command/name), and write back the merged result, leaving any unrelated existing entries untouched. Uninstall should symmetrically remove only its own entries, not the whole file or unrelated hooks.
- Dominant language
- Go
- Stars
- 157
- Forks
- 19
- Avg merge
- 4h 4m
- Merged PRs (30d)
- 81
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from solongate/agent-security
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
solongate/agent-security#154 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
solongate/agent-security#147 ·
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
solongate/agent-security#143 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
solongate/agent-security#142 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
solongate/agent-security#140 ·
Maintainers usually reply within 1 day
All issues in solongate/agent-security
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ovh/ovhcloud-cli#309 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area/docs
Difficulty 1/5 Under an hour Newbie friendliness 92/100
layer5io/getnighthawk#380 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day