Skip to content

feat(hooks): Claude Code hook to intercept git commands and verify branch #680

@rjmurillo-bot

Description

@rjmurillo-bot

Summary

Create a Claude Code hook that intercepts git commands (commit, push, reset) and verifies the current branch before allowing the operation.

Context

From retrospective analysis in PR #669, commits were made to wrong branches. A Claude Code hook could intercept git commands and validate branch state automatically.

Acceptance Criteria

  • Hook defined in .claude/settings.json or equivalent
  • Hook triggers on: git commit, git push, git reset
  • Hook runs git branch --show-current and logs to context
  • Hook provides warning if branch doesn't match expected pattern
  • Documentation for hook configuration

Technical Notes

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-retrospectiveLearning extraction agentarea-infrastructureBuild, CI/CD, configurationarea-workflowsGitHub Actions workflowsautomationAutomated workflows and processesdocumentationImprovements or additions to documentationenhancementNew feature or requestpriority:P1Important: Affects user experience significantly, high business value

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions