One git hook blocked a fake GitHub token, so no secret hit history #Shorts
Watch on YouTube · Demo repo (notes-api)
One gitleaks pre-commit hook blocked a fake GitHub token commit, so no secrets reached git history. Demo repo (agentshipped/notes-api): https://github.com/agentshipped/notes-api Claude Code writes a hook that scans only staged changes and lives in a tracked .githooks folder, so every clone gets the same protection. I stage a fake token generated with openssl, try to commit it, and gitleaks aborts the commit with a non-zero exit code. You can copy the hook and run the same test on your own repo with a fake key. Not just JavaScript: the same technique works with the pre-commit framework instead of .githooks, or Husky in other JavaScript repos, running gitleaks in either. Tools: Claude Code, gitleaks, git hooks, openssl