Repository navigation
Tracked Claude hooks infrastructure + line-ending normalization - #47
Merged
Merged
Conversation
Converts the Claude Code hooks from unrecoverable local-only state to version-controlled project infrastructure, per operator decision (docs/scaffold_hooks_reconstruction_note.md, Resolution 2026-07-24): a laptop crash should not be able to erase process controls. - tools/claude-hooks/hooks/ — canonical sources for the three hooks (pre-Bash destructive-command guard, post-Write/Edit targeted pytest, Stop-time full suite + Discord notify) plus settings.template.json. - tools/claude-hooks/schemas/ — the stdin JSON contract each hook consumes, with exit-code semantics. - install-hooks.ps1 / verify-hooks.ps1 — Windows PowerShell 5.1 compatible; .claude/ stays local and generated (gitignored), the installer refuses to clobber a customized settings.json without -Force, and the verifier proves byte-identical installation plus functional smoke tests (guard blocks force-push, passes benign; post-edit hook no-ops out of scope; -Full runs the real suite). - BOM hardening found by the verifier's first run: PowerShell 5.1 pipes prepend a UTF-8 BOM to native stdin, which json.load rejects, so the guard failed OPEN. All hooks now decode stdin as utf-8-sig; the catching smoke test is part of verify-hooks.ps1. - .gitattributes (* text=auto) + renormalization of the three CRLF blobs (CLAUDE.md, README.md, TODO.md — stored CRLF since PR #44), making git diff --check a clean gate; *.md exempts blank-at-eol since trailing double-space is meaningful Markdown (hard break). - Scaffold-hooks reconstruction note closed with the resolution; TODO.md entry updated to point at the tracked sources. Suite green at commit: 589 passed + 7 xfail. git diff --check: clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The follow-up infrastructure PR scoped out of #46: Claude Code hooks move from unrecoverable local-only state to version-controlled project infrastructure (operator decision recorded in
docs/scaffold_hooks_reconstruction_note.md, Resolution 2026-07-24 — "a laptop crash should not be able to erase process controls that matter to how Continuum is developed").Structure (per the operator's specified pattern)
.claude/stays local and generated — the.gitignoreboundary PR #30 drew is preserved; only the hook design is tracked.Real bug found and fixed during verification
verify-hooks.ps1's first run caught that PowerShell 5.1 pipes prepend a UTF-8 BOM to native-command stdin, whichjson.loadrejects — sopre_bash_guard.pyfailed open (a guard silently not guarding). All three hooks now decode stdin asutf-8-sig, and the smoke test that caught it is a permanent part of the verifier. Verified: all checks PASS on this workstation (BOM-emitting host) and the guard still blocks under BOM-less bash pipes.Line-ending normalization
.gitattributes(* text=auto) + renormalization of the only three CRLF blobs in HEAD (CLAUDE.md, README.md, TODO.md — stored CRLF since PR #44). This is what madegit diff --checknoisy on #46; it is now a permanently clean gate.*.mdgetswhitespace=-blank-at-eolbecause trailing double-space is meaningful Markdown (hard line break — README.md uses it), not accidental whitespace. The renormalization is line-ending-only; review the two doc files' content hunks and thetools/additions.Gates
pytest: 589 passed + 7 xfail at this commitgit diff --check --cached: clean (exit 0)verify-hooks.ps1: all checks PASSgit status --short: exactly the intended files🤖 Generated with Claude Code