fix(uninstall): revoke memorable_recall independently of the hook manager and name a failed revocation

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-09-09 03:57:16 +00:00
co-authored by Claude Fable 5.1
parent e60cd924a9
commit 51713f6c70
+12 -7
View File
@@ -164,13 +164,6 @@ if [ -x "$SETTINGS_HOOK" ]; then
if "$SETTINGS_HOOK" remove-source --source gstack-memorable | grep -q "removed [1-9]"; then
REMOVED+=("Memorable UserPromptSubmit hook (Memorable's own consent is unchanged: memorable disable | memorable forget)")
fi
# The consent key must never outlive the hook, kept state or not: gstack-config
# resolves its root through GSTACK_STATE_ROOT/GSTACK_HOME, which can be a
# different directory from the STATE_DIR removed below. Only flipped when it
# is actually on, so no config file is created just to say off.
if [ -x "$GSTACK_CONFIG" ] && [ "$("$GSTACK_CONFIG" get memorable_recall 2>/dev/null)" = "on" ]; then
"$GSTACK_CONFIG" set memorable_recall off >/dev/null 2>&1 || true
fi
# Identity sweep for untagged strays (Claude Code strips _gstack_source
# tags; pre-v1.67 setups baked worktree paths). Removes every gstack-owned
# hook item, live or dead — the binaries they point at are being deleted.
@@ -178,6 +171,18 @@ if [ -x "$SETTINGS_HOOK" ]; then
REMOVED+=("stray gstack hook entries")
fi
fi
# The Memorable consent key must never outlive the hook, kept state or not, and
# not only when the hook manager is present: gstack-config resolves its root
# through GSTACK_STATE_ROOT/GSTACK_HOME, which can be a different directory
# from the STATE_DIR removed below. Only flipped when it is actually on, so no
# config file is created just to say off; a failed flip is named, not hidden.
if [ -x "$GSTACK_CONFIG" ] && [ "$("$GSTACK_CONFIG" get memorable_recall 2>/dev/null)" = "on" ]; then
if "$GSTACK_CONFIG" set memorable_recall off >/dev/null 2>&1; then
REMOVED+=("memorable_recall consent (set off)")
else
echo "WARNING: could not set memorable_recall off; run: $GSTACK_CONFIG set memorable_recall off" >&2
fi
fi
# ─── Remove global Claude skills ────────────────────────────
CLAUDE_SKILLS="$HOME/.claude/skills"