Created
September 22, 2025 17:02
-
-
Save PovilasKorop/4d29db55e9e23c5e30d8b777a009eedd to your computer and use it in GitHub Desktop.
Claude Code Hook for Checking Git Status on Session Start
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "hooks": { | |
| "SessionStart": [ | |
| { | |
| "hooks": [ | |
| { | |
| "type": "command", | |
| "command": "git rev-parse --git-dir > /dev/null 2>&1 && (! git diff-index --quiet HEAD -- && echo '⚠️ You have uncommitted changes in your git repository.' && echo '' && echo 'Changes:' && git status --porcelain || echo '✅ Git repository is clean')" | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment