Skip to content

chore(hooks): add Claude Code session hooks + drift-guard (P3)#13

Merged
silversurfer562 merged 1 commit into
mainfrom
chore/claude-session-hooks
Jun 17, 2026
Merged

chore(hooks): add Claude Code session hooks + drift-guard (P3)#13
silversurfer562 merged 1 commit into
mainfrom
chore/claude-session-hooks

Conversation

@silversurfer562

Copy link
Copy Markdown
Member

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 from attune-ai/plugin/hooks/ (verified 8/8)
  • .canonical-sha256 (8 entries) + new Makefile sync-hooks target
  • .claude/settings.json hooks block; .gitattributes LF pin; .gitignore tracks .claude/hooks/ + settings.json
  • tests/test_claude_hooks_drift.py + tests/test_claude_hooks_behavior.py

Verification

  • pytest: 17 passed
  • 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_check etc.) — help is the runtime, so it's the strongest candidate, but that's its own spec.

🤖 Generated with Claude Code

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

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@silversurfer562 silversurfer562 merged commit 9d29a47 into main Jun 17, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant