git hygiene
Tools don't get co-author credit.
Two git hooks, zero dependencies beyond bash/grep/awk/git.
Strips AI-attribution trailers. Catches secrets before they land in your object store.
Every repo I worked in slowly accumulated Co-Authored-By: Claude and 🤖 Generated with Claude Code trailers in the log. Sometimes the setting got reverted. Sometimes a collaborator's setup differed.
Commit history is the one artifact future employers, acquirers, and collaborators read to evaluate how you work.
For regulated industries — defense, finance, health — AI-assisted code is becoming a real disclosure question. A clean history sidesteps the question. A dirty one raises it.
Strips AI-attribution trailers
Case-insensitive pattern match on the standard trailer shapes: Co-Authored-By, Generated with, AI-assisted, noreply@anthropic.com. Legitimate human co-authors preserved. Prose mentions of Claude Code as a tool are not touched.
Three-layer secret scan
Layer 1: high-precision regex for known token shapes (AWS, GitHub, OpenAI, Slack). Layer 2: gitleaks if installed (~700 detectors). Layer 3: optional OPSEC content scan for your machine-level identifiers — hostnames, tailnet name, agent handles.
AKIA…, ghp_…, sk-or-…, xox[bp]-…, Bearer, generic key="…". No dependencies. Tight by design — a commit gate that cries wolf gets disabled.$PATH. Adds ~700 detectors — Stripe live keys, GCP service account JSON, private keys, database URLs. Missing? Hook warns and falls back to Layer 1.~/.config/opsec-patterns.local + ./.opsec-patterns.local. Scans added diff lines for your hostnames, agent handles, tailnet suffixes. Catches what credential regex can't.# Clone anywhere stable $ git clone https://github.com/JordanNewell/git-hygiene.git ~/git-hygiene # Symlink hooks into your global hooks path $ mkdir -p ~/.githooks $ ln -s ~/git-hygiene/hooks/commit-msg ~/.githooks/commit-msg $ ln -s ~/git-hygiene/hooks/pre-commit ~/.githooks/pre-commit $ chmod +x ~/.githooks/* # Tell git to use that hooks path globally $ git config --global core.hooksPath ~/.githooks
Optional: brew install gitleaks (macOS) or apt install gitleaks (Debian) to enable Layer 2. See the full install guide for per-repo setup and OPSEC scan configuration.
| Capability | git-hygiene | pre-commit fw | GitGuardian | CC setting |
|---|---|---|---|---|
| Strips AI trailers | Yes | — | — | Emits, doesn't strip |
| Secret scan (regex) | Yes | Plugin | — | — |
| Secret scan (gitleaks) | Auto-detect | Plugin | Native | — |
| OPSEC content scan | Yes | — | — | — |
| Dependencies | Bash + grep + awk | Python | Go binary / SaaS | n/a |
| Telemetry / SaaS | None | None | Optional | n/a |
includeCoAuthoredBy: false already. Do I need this?test[s]/, spec/, fixtures/, __tests__/, example[s]/, docs/, *.example, *.template, node_modules/, vendor/, *.min.js. Real secrets live in source and config files, not in fixtures.Co-Authored-By: Jane Doe <jane@example.com>) are preserved.git config opsec.scan disable in any repo. Lives in .git/config — never accidentally committed. Accepts disable, off, false, no, 0. The AI-trailer strip and secret scan are unaffected.67567DC5E7C5353F85F2AF0DAC05D3F3E0EFA32A. Run git verify-commit HEAD to confirm.