Error
The commit message title is too long or has formatting problems.
Why this matters
Git log, GitHub, and most tools truncate titles longer than 50-72 characters. Short titles are easier to scan in git history.
How to fix
Keep your title under 50 characters (default):
# Too long:
git commit -sS -m "feat(api): add comprehensive user authentication and authorization system"
# Better:
git commit -sS -m "feat(api): add user authentication system"
For longer explanations, use the commit body:
git commit -sS -m "feat(api): add user authentication
This implements OAuth2 and JWT-based authentication
with support for multiple identity providers."
Configuration
Adjust the maximum title length in config.toml:
[validators.git.commit.message]
title_max_length = 72 # Default: 50
Allow unlimited length for revert commits:
[validators.git.commit.message]
allow_unlimited_revert_title = true # Default: true
Hook output
When this error is triggered, klaudiush writes JSON to stdout:
permissionDecisionReason (shown to Claude):
[GIT004] Commit message title exceeds 50 characters. Use format: type(scope): description (max 50 chars)
systemMessage (shown to user): Formatted error with fix hint and reference URL.
additionalContext (behavioral guidance):
Automated klaudiush validation check. Fix the reported errors and retry the same command.