Skip to content

Add Claude Code hooks infrastructure#211

Open
drn wants to merge 1 commit intomasterfrom
drn/claude-code-hooks
Open

Add Claude Code hooks infrastructure#211
drn wants to merge 1 commit intomasterfrom
drn/claude-code-hooks

Conversation

@drn
Copy link
Owner

@drn drn commented Mar 8, 2026

Summary

  • Add hooks infrastructure to dots install agents: protect-files (blocks .env, certs, SSH keys), auto-format (gofmt, prettier, rubocop, ruff), and compact-context (re-injects context after compaction)
  • Installer resolves $DOTS to absolute paths at install time so hooks work regardless of shell environment
  • Hooks are merged into ~/.claude/settings.json preserving existing settings, with a warning when replacing existing hooks

Test plan

  • go install ./... builds cleanly
  • revive -set_exit_status ./... passes
  • go test ./... passes (6 new test cases for merge logic, path resolution, error handling)
  • bash .github/lint-skills.sh passes
  • bash .github/skill-tests/run_all.sh passes

🤖 Generated with Claude Code

Add hooks infrastructure to dots: protect-files (blocks .env, certs,
SSH keys), auto-format (gofmt, prettier, rubocop, ruff), and
compact-context (re-injects context after compaction).

The installer resolves $DOTS to absolute paths at install time so hooks
work regardless of shell environment. Hooks are merged into
~/.claude/settings.json with a warning when replacing existing hooks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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