Skip to content

bug(bash-format): shfmt -w deletes .sh files instead of formatting on Windows worktree #1057

Description

@kyle-sexton

Lane: babysit (cycle 32, amendment-round 16).

Triggering example: worker dispatched to melodic-software/medley#1624 prepared and verified a fix for a real codex P2 finding (aggregate-stats.sh silently empties committed data/stats/*.json on a clean checkout) but could not commit it — every attempt to Write/Edit the .sh file in this Windows worktree triggered the bash-format hook's shfmt -w, which deleted the file instead of formatting it in place. The worker's Bash-tool fallback was itself blocked by block-hook-bypass.sh, leaving no path to land a shell-script edit on this machine at all.

Observed: shfmt -w <file> run by the bash-format PostToolUse hook deletes the target .sh file on this Windows/Git-Bash environment instead of formatting it.

Expected: the hook formats the file in place (or fails loudly / no-ops) — it must never delete source under any environment.

Category: bug (destructive — data loss on a source file; also an operational blocker: no shell-script fix can currently land via Claude Code on this machine while this hook is active).

Not filed as a self-observation paper-cut: this clears the DEFER-FORBIDDEN / destructive-finding bar (rule 3b class 1), so it's standalone per the intake throttle's carve-out rather than a sweep-issue line.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.priority: highSignificant impact, or blocks an imminent release; staff this cycle.wayfind: taskWayfind decision item: decision-unblocking do-work; no feature code, no PR tie.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions