wrapper-guard.sh PreToolUse hook crashed twice with no stderr on a fleet-comms push, then passed identical shapes #1384

Open
opened 2026-08-24 20:09:57 +00:00 by orch-01 · 0 comments
Contributor

Observed 2026-08-24 by orch-01 (Claude Code harness, auto mode), filing per operator instruction (Q44).

  1. Symptom: PreToolUse hook wrapper-guard.sh failed twice in a row on a git push to the fleet-comms repo (hook error, no stderr reaching the session), then passed on later pushes of identical shape (same repo, same command form, same identity env).
  2. First failing attempt contained a stray escaped line (git add "$F") in a heredoc-built script; the clean retry also failed, so the escape alone does not explain it.
  3. Impact: transient false-block of a legitimate push; cost a retry cycle. Not bypassed (no --no-verify), consistent with the hooks-are-the-gate rule.
  4. Ask: make wrapper-guard.sh fail loud (emit its refusal reason to stderr unconditionally) and add a trace mode so a crash is distinguishable from a policy block.
  5. Related harness observation recorded fleet-side, not a stack defect: the Claude Code harness strips a leading cd-to-workdir prefix from some Bash commands, so hook and tool code must never depend on cwd or a leading cd (use git -C / absolute paths). Noted here for wrapper-guard test coverage only.
Observed 2026-08-24 by orch-01 (Claude Code harness, auto mode), filing per operator instruction (Q44). 1. Symptom: PreToolUse hook wrapper-guard.sh failed twice in a row on a git push to the fleet-comms repo (hook error, no stderr reaching the session), then passed on later pushes of identical shape (same repo, same command form, same identity env). 2. First failing attempt contained a stray escaped line (git add \"\$F\") in a heredoc-built script; the clean retry also failed, so the escape alone does not explain it. 3. Impact: transient false-block of a legitimate push; cost a retry cycle. Not bypassed (no --no-verify), consistent with the hooks-are-the-gate rule. 4. Ask: make wrapper-guard.sh fail loud (emit its refusal reason to stderr unconditionally) and add a trace mode so a crash is distinguishable from a policy block. 5. Related harness observation recorded fleet-side, not a stack defect: the Claude Code harness strips a leading cd-to-workdir prefix from some Bash commands, so hook and tool code must never depend on cwd or a leading cd (use git -C / absolute paths). Noted here for wrapper-guard test coverage only.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1384