git clone https://github.com/jim80net/claude-gatekeeper.git
cd claude-gatekeeper
make testRequires Go 1.22+. By submitting a pull request, you agree that your contributions are licensed under the MIT License.
cmd/claude-gatekeeper/ CLI entry point
internal/config/ TOML config loading and layering
internal/engine/ Rule evaluation engine
internal/protocol/ Claude Code hook JSON wire format
internal/migrate/ settings.json to TOML migration
hooks/ Claude Code plugin hook definition
- Add the rule to
gatekeeper.toml(repo root) - Add a test case to
TestDefaultRulesininternal/engine/engine_test.go - Run
make test
Install pre-commit then enable hooks:
pre-commit installThis runs format, vet, lint, build, and test checks before each commit.
make test # Unit tests with race detector
make lint # Static analysis (requires golangci-lint)
make fmt # Check gofmt formatting
make vet # Run go vet
make check # Run all checks (fmt + vet + lint + test)CI runs the same checks on every PR via .github/workflows/ci.yml.
make build
echo '{"tool_name":"Bash","tool_input":{"command":"git status"},"cwd":"/tmp"}' | ./bin/claude-gatekeeper --debugThis project uses Conventional Commits with release-please for automated versioning.
| Prefix | Version bump | Example |
|---|---|---|
fix: |
Patch (1.0.x) | fix: handle empty tool input |
feat: |
Minor (1.x.0) | feat: add precondition timeout config |
feat!: or BREAKING CHANGE: |
Major (x.0.0) | feat!: rename config file |
chore:, docs:, ci:, test: |
No release | docs: update README |
Releases are automated via GitHub Actions:
- Push conventional commits to
main - release-please creates/updates a Release PR with changelog and version bump
- Merge the Release PR → release-please tags and creates a GitHub Release
- goreleaser builds platform archives and attaches them to the release
- build.yml rebuilds
dist/binaries in the repo for marketplace installs
To test goreleaser locally:
goreleaser release --snapshot --clean