mirror of
https://github.com/garrytan/gstack.git
synced 2026-06-17 07:10:12 +02:00
fix(skills): anchor guard/freeze/careful hook paths so they survive CC 2.1.162 (#1871)
The PreToolUse frontmatter hooks for guard, freeze, and careful invoked
`bash ${CLAUDE_SKILL_DIR}/.../check-*.sh`. Claude Code 2.1.162 no longer populates
${CLAUDE_SKILL_DIR} in the skill-hook execution env, so it expanded to empty and
every Edit/Write/Bash ran `bash /...` and errored — breaking the safety skills
entirely.
Frontmatter hooks run before any skill-body bash, so no runtime-resolved variable
can fix this; the command must be a path that's valid at hook time. Anchor to the
installed checkout: $HOME/.claude/skills/gstack/{careful,freeze}/bin/check-*.sh,
where the scripts actually live. ($HOME is expanded by the hook shell.)
Reported by @omariani-howdy. Regenerated the three SKILL.md from templates.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ hooks:
|
||||
- matcher: "Bash"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/bin/check-careful.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/careful/bin/check-careful.sh"
|
||||
statusMessage: "Checking for destructive commands..."
|
||||
---
|
||||
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
|
||||
|
||||
@@ -19,7 +19,7 @@ hooks:
|
||||
- matcher: "Bash"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/bin/check-careful.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/careful/bin/check-careful.sh"
|
||||
statusMessage: "Checking for destructive commands..."
|
||||
sensitive: true
|
||||
---
|
||||
|
||||
+2
-2
@@ -15,12 +15,12 @@ hooks:
|
||||
- matcher: "Edit"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/bin/check-freeze.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/freeze/bin/check-freeze.sh"
|
||||
statusMessage: "Checking freeze boundary..."
|
||||
- matcher: "Write"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/bin/check-freeze.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/freeze/bin/check-freeze.sh"
|
||||
statusMessage: "Checking freeze boundary..."
|
||||
---
|
||||
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
|
||||
|
||||
@@ -20,12 +20,12 @@ hooks:
|
||||
- matcher: "Edit"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/bin/check-freeze.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/freeze/bin/check-freeze.sh"
|
||||
statusMessage: "Checking freeze boundary..."
|
||||
- matcher: "Write"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/bin/check-freeze.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/freeze/bin/check-freeze.sh"
|
||||
statusMessage: "Checking freeze boundary..."
|
||||
sensitive: true
|
||||
---
|
||||
|
||||
+3
-3
@@ -15,17 +15,17 @@ hooks:
|
||||
- matcher: "Bash"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/../careful/bin/check-careful.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/careful/bin/check-careful.sh"
|
||||
statusMessage: "Checking for destructive commands..."
|
||||
- matcher: "Edit"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/freeze/bin/check-freeze.sh"
|
||||
statusMessage: "Checking freeze boundary..."
|
||||
- matcher: "Write"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/freeze/bin/check-freeze.sh"
|
||||
statusMessage: "Checking freeze boundary..."
|
||||
---
|
||||
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
|
||||
|
||||
+3
-3
@@ -20,17 +20,17 @@ hooks:
|
||||
- matcher: "Bash"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/../careful/bin/check-careful.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/careful/bin/check-careful.sh"
|
||||
statusMessage: "Checking for destructive commands..."
|
||||
- matcher: "Edit"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/freeze/bin/check-freeze.sh"
|
||||
statusMessage: "Checking freeze boundary..."
|
||||
- matcher: "Write"
|
||||
hooks:
|
||||
- type: command
|
||||
command: "bash ${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh"
|
||||
command: "bash $HOME/.claude/skills/gstack/freeze/bin/check-freeze.sh"
|
||||
statusMessage: "Checking freeze boundary..."
|
||||
sensitive: true
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user