chore(hooks): add Claude Code session hooks + drift-guard (P3)#13
Merged
Conversation
Vendor attune-ai's canonical Claude Code session hooks into attune-help, matching the attune-rag pilot (P1) and attune-author (P2). Vendors the current 8-file closure (includes _sdk_gate.py / the SDK-subprocess fix), so no re-sync is needed. - .claude/hooks/: 8 hooks byte-identical from attune-ai/plugin/hooks (security_guard, format_on_save, compact_warning, spec_orient + helpers _state, _resume_prompt, _transcript_size, _sdk_gate) - .claude/hooks/.canonical-sha256 manifest (8 entries) + Makefile `sync-hooks` target (ATTUNE_AI_ROOT default ../attune-ai) - .claude/settings.json hooks block (SessionStart/Stop/PreToolUse/PostToolUse) - .gitattributes pins LF on the hook tree (stable hashes across OSes) - .gitignore: track .claude/hooks/ + settings.json, ignore the rest - tests: drift-guard (checksum match) + behavior smoke (security_guard block/allow, spec_orient emit/no-op, format_on_save best-effort) Zero-dep budget unaffected: these are dev-time .claude/ files, not runtime dependencies — attune-help's install footprint is unchanged. Refs specs/sibling-claude-hooks (P3). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Vendor attune-ai's canonical Claude Code session hooks into attune-help — P3 of
specs/sibling-claude-hooks, matching the attune-rag pilot (#151) and attune-author (#59 + re-sync #68).Vendors the current 8-file canonical (includes
_sdk_gate.py, the SDK-subprocess-isolation fix), so attune-help starts on the latest — no re-sync debt.Changes
.claude/hooks/— 8 hooks byte-identical fromattune-ai/plugin/hooks/(verified 8/8).canonical-sha256(8 entries) + newMakefilesync-hookstarget.claude/settings.jsonhooks block;.gitattributesLF pin;.gitignoretracks.claude/hooks/+settings.jsontests/test_claude_hooks_drift.py+tests/test_claude_hooks_behavior.pyVerification
ruff check .claude/hooks/ tests/: clean (hooks unmodified → byte-identity preserved)Zero-dep budget
Unaffected — these are dev-time
.claude/files, not runtime deps. attune-help's install footprint is unchanged.Follow-up (out of scope)
help-runtime hooks (
help_freshness_checketc.) — help is the runtime, so it's the strongest candidate, but that's its own spec.🤖 Generated with Claude Code