Claude Code Secret Gate — AI skill for Claude Code
The pre-commit secret gate for AI coding agents — content-scans staged changes and blocks any commit containing keys or tokens.
How to install Claude Code Secret Gate
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open roozbeh-bahrami/claude-code-secret-gate and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Code Secret Gate does
The pre-commit secret gate for AI coding agents — content-scans staged changes and blocks any commit containing keys or tokens.
Alternatives in AI
- Krusch Context MCP — Persistent working memory and invariant steering MCP server for AI coding agents (Claude Code, Cursor, Windsur 82 ★
- Isbetter.Ai — ⚔️ Compare AI models side by side — same prompt, streamed answers, live code previews, speed, tokens and cost 59 ★
- Harness Gate — Gate the agent setup on corpus-validated rules (gating tier) 32 ★
README
claude-code-secret-gate 🔒
**Your AI coding agent commits fast and often. This is the mechanical gate that stops it from committing secrets — before they become permanent history.**
Built for Claude Code and any AI-agent workflow; works in any plain git repo too. One shell script, zero dependencies. It scans what's *staged* (the exact content about to enter git) and blocks the commit if it finds:
- 🔑 Secret-shaped strings inside file content: JWTs, private key blocks, AWS keys, GitHub/Slack/OpenAI/Stripe-style tokens, GoHighLevel PITs
- 📄 Credential-looking filenames:
.env,.pem,id_rsa,credentials*.json…
Why content scanning matters
`.gitignore` only blocks files you *expected* to be secret. The leaks that actually happen are tokens pasted into a config export, an API response saved as JSON, a workflow backup with an embedded key. Filename rules never catch those — **content scanning does**. This gate caught three real leaks in its first day of use (workflow exports with embedded live tokens that every filename rule missed).
Install (once per repo)
cp gate.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
Done. Every `git commit` now runs the gate automatically:
✅ secret-gate: staged content clean. ← commit proceeds
🚨 SECRET-GATE: secret-shaped strings... ← commit BLOCKED, nothing recorded
Or run it manually
git add -A
./gate.sh # ✅ or 🚨
git commit -m "..."
Working with AI coding agents?
Paste this into your agent's instructions:
Between `git add` and `git commit`, ALWAYS run `./gate.sh`. If it fails, ABORT the commit, unstage the flagged files, fix `.gitignore`, and rescan. Never use `--no-verify`.
An AI agent commits fast and often — exactly why it needs a mechanical gate, not a promise to be careful.
Extend it
Patterns live in one variable (`PATTERNS`) — add your platform's token shapes. Keep the rule: **when the gate and your convenience disagree,
Related Skills
Power Coding
Mindful-coding OS for any LLM coding agent (Claude Code, Codex, Gemini CLI) — the Five Forces: session handoff
Claude Code Secret Guard
Claude Code mod that keeps API keys, tokens and passwords out of the model's context: gitleaks scans every too
Motus
Keep API keys and tokens out of your AI coding agent. Redacts exact secret values from tool output and session
Diffscribe
A VS Code extension that uses Claude AI to automatically generate meaningful Git commit messages based on stag
Git AI
Stop writing commit messages by hand. AI-powered conventional commits from your staged changes — powered by Cl
Skillgate
Deterministic finish-line gates for AI coding agents. A model-independent evaluator that blocks commit/publish
Related Agents
Secret Guard
MUST be used whenever the user asks to scan for secrets, API keys, credentials, or tokens before a commit or i
Sp Reviewer
Use as a pre-push guardrail before committing or pushing. Runs lint, build, tests and a secret scan, reviews t
Forge Speccer Validator
Pre-planning path-validation gate. Scans a spec file for path tokens inside code fences or backticks, checks e