Bug
.claude/hooks/guard-git.sh (line ~78) blocks every git clean invocation unconditionally:
if echo "$NCOMMAND" | grep -qE '(^|[[:space:]]|&&[[:space:]]*)git[[:space:]]+clean'; then
deny "BLOCKED: 'git clean' deletes untracked files that may belong to other sessions."
fi
This also blocks the dry-run form, which is a pure listing operation that never deletes anything. The /housekeep skill's Phase 2 explicitly recommends the dry-run form of git clean -fdX as the discovery mechanism for gitignored dirt files, so the hook currently makes that step of the skill impossible to run as documented.
Worse: the grep matches on the raw command text, not just actual invocations. Any Bash command whose argument text merely contains the substring "git clean" gets blocked too — e.g. gh issue create --body "...git clean -fdX --dry-run..." was blocked while filing this very issue, because the deny message and quoted body text contained that substring.
Fix
The check should:
- Special-case
--dry-run/-n flags and allow those through, only blocking invocations that would actually delete (lack -n/--dry-run and include -f/--force).
- Scope the grep to the actual command being executed (e.g. first word of a pipeline segment / structured parse), not a blind substring match over the entire raw command string — so quoted text in unrelated commands (like
gh issue create --body "...") doesn't trigger it.
Found via
/housekeep run on 2026-07-12, discovered while running Phase 2 (dirt file discovery), then again while trying to file this issue.
Bug
.claude/hooks/guard-git.sh(line ~78) blocks everygit cleaninvocation unconditionally:This also blocks the dry-run form, which is a pure listing operation that never deletes anything. The
/housekeepskill's Phase 2 explicitly recommends the dry-run form ofgit clean -fdXas the discovery mechanism for gitignored dirt files, so the hook currently makes that step of the skill impossible to run as documented.Worse: the grep matches on the raw command text, not just actual invocations. Any Bash command whose argument text merely contains the substring "git clean" gets blocked too — e.g.
gh issue create --body "...git clean -fdX --dry-run..."was blocked while filing this very issue, because the deny message and quoted body text contained that substring.Fix
The check should:
--dry-run/-nflags and allow those through, only blocking invocations that would actually delete (lack-n/--dry-runand include-f/--force).gh issue create --body "...") doesn't trigger it.Found via
/housekeep run on 2026-07-12, discovered while running Phase 2 (dirt file discovery), then again while trying to file this issue.