fix(claude-code): preserve permissions when removing hooks - #1948
Open
MuskanPaliwal wants to merge 5 commits into
Open
fix(claude-code): preserve permissions when removing hooks#1948MuskanPaliwal wants to merge 5 commits into
MuskanPaliwal wants to merge 5 commits into
Conversation
3 tasks
MuskanPaliwal
marked this pull request as ready for review
August 11, 2026 12:11
Contributor
Author
|
I took another look, and I think I interpreted the issue too broadly. Entire installs I鈥檓 going to pause this PR until we know whether the reporter already had that rule before enabling Entire, or whether they want to remove Claude hooks while keeping Entire active for another agent. Depending on the answer, I鈥檒l either narrow the fix or close the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1924
entire agent remove claude-codeis documented as uninstalling Claude Code hooks, but it also removedRead(./.entire/metadata/**)frompermissions.deny. When that was the only permission and the file contained only Entire hooks, both top-level objects were deleted and.claude/settings.jsonbecame{}.This PR removes the permissions cleanup from
UninstallHooks. Agent removal now filters Entire-managed entries underhooksand leaves the rest of the shared Claude settings file alone. Permissions, user-defined hooks, unknown hook types, and unrelated top-level settings are preserved. A file containing only Entire hooks and no other settings still correctly becomes{}.Windows amd64in the issue records the reporter's environment; the issue does not identify this as an OS-specific bug. The affected code path is platform-independent JSON parsing and rewriting.Testing
mise run lintmise run testmise run test:ciagent add claude-codefollowed byagent remove claude-coderemoves all seven hooks while preserving the complete permissions object