init/update: tag hook entries with _managedBy: "openwolf" (fixes #31)#32
Open
mann1x wants to merge 1 commit into
Open
init/update: tag hook entries with _managedBy: "openwolf" (fixes #31)#32mann1x wants to merge 1 commit into
_managedBy: "openwolf" (fixes #31)#32mann1x wants to merge 1 commit into
Conversation
Adds `_managedBy: "openwolf"` to every hook object in `HOOK_SETTINGS` so Claude Code's settings round-tripper recognizes them as third-party managed entries and preserves them through `/effort`, `/config`, and similar rewrites. Without the tag, entries get silently dropped: a working OpenWolf install can be de-wired by typing `/effort medium` once, since Claude Code's merge logic only preserves entries it recognizes as owned (claude-hooks uses the same field, for example). Also tightens `replaceOpenWolfHooks` to recognize the new tag in addition to the legacy `.wolf/hooks/` substring — defensive against future path schema changes, and keeps the dedupe correct for installs upgrading from a pre-tag version. The two changes are minimal and backward-compatible: untagged entries from older installs still match the substring fallback, so upgrades clean up cleanly. New installs get tagged from the start. Fixes cytostack#31.
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 #31.
Why
The 6 hook entries OpenWolf installs into
settings.jsoncarry noprovenance tag. When Claude Code rewrites
settings.jsonas part ofan unrelated command —
/effort,/config, plugin toggling, etc. —entries that don't carry a
_managedByfield appear to be droppedsilently. The
.wolf/hooks/*.jsfiles stay on disk, but Claude Codestops invoking them.
Reproduced on Linux (Claude Code 2.1.121.cc5) and Windows (2.1.126.a4b)
by running
/effort mediumonce afteropenwolf init. Confirmed viafile backup that this is a write of
~/.claude/settings.jsonfromClaude Code itself (sibling internal-state files mtimed at the same
instant), and that claude-hooks-tagged entries survive the same write.
What
HOOK_SETTINGS(bothinit.tsandupdate.ts)with
_managedBy: "openwolf". Same field that claude-hooks uses forthe same purpose.
replaceOpenWolfHooksin both files to match by tag OR by.wolf/hooks/substring. The substring fallback ensures upgradesfrom pre-tag installs clean up correctly.
The TypeScript change is small (32 insertions, 12 deletions across
two files).
tsc --noEmitis clean.Backward compatibility
for dedupe, so
openwolf updatecleanly removes the old entriesand installs the tagged versions.
Test plan
openwolf initin a fresh project — verify the 6 entries landin
.claude/settings.jsonwith_managedBy: "openwolf"./effort high; confirm the openwolfentries are still present afterwards (they were dropped before
this fix).
openwolf updateon a project with the OLD untagged entries —verify they get cleanly replaced with the tagged version (no
duplicates).