Skip to content

(CAT-2609) Add safety hooks for Claude Code#632

Merged
gavindidrichsen merged 4 commits into
mainfrom
CAT-2609
Apr 17, 2026
Merged

(CAT-2609) Add safety hooks for Claude Code#632
gavindidrichsen merged 4 commits into
mainfrom
CAT-2609

Conversation

@david22swan

@david22swan david22swan commented Apr 16, 2026

Copy link
Copy Markdown
Member

Summary

Implement pre-tool-use hooks to enforce project-specific guardrails, such as preventing commits to protected branches, merging pull requests, pushing code, or deleting files.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updates the project rules to ensure the AI reads the entire repository and relevant files before suggesting or making any changes.

New rules suggested by Brónagh
Updates the shell hooks to more robustly detect git and rm commands by handling environment variables, absolute paths, and common wrappers like sudo or xargs. Also refactors input parsing to pipe directly into JSON parsers and adds ShellCheck directives for script maintenance.
Add SC2034 disable directives on the cmd= assignments; the variable is
set for use by the sourcing hook scripts so shellcheck cannot see its
consumers without following the source.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gavindidrichsen gavindidrichsen merged commit 6a9a73d into main Apr 17, 2026
2 checks passed
@gavindidrichsen gavindidrichsen deleted the CAT-2609 branch April 17, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants