Back to all errors

GIT002

GIT

Missing GPG signing flag

Error

Git commit is missing the -S or --gpg-sign flag.

Why this matters

GPG signing proves you authored the commit. Without it, anyone can claim to be you in the git history.

How to fix

Add the -S flag to your git commit command:

# Instead of:
git commit -m "message"

# Use:
git commit -sS -m "message"

Prerequisites

  1. Generate a GPG key if you don't have one:

    gpg --full-generate-key
  2. Configure Git to use your key:

    gpg --list-secret-keys --keyid-format=long
    git config --global user.signingkey YOUR_KEY_ID
  3. Add your GPG key to GitHub/GitLab.

Configuration

Disable this check in config.toml:

[validators.git.commit]
required_flags = ["-s"]  # Only require signoff, not GPG signing

Hook output

When this error is triggered, klaudiush writes JSON to stdout:

permissionDecisionReason (shown to Claude): [GIT002] Git commit is missing the -S (GPG sign) flag. Add -S flag: git commit -sS -m "message"

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.

  • GIT001 - Missing signoff flag
  • GIT010 - Missing required flags

© 2026 Smykla Skalski Labs