Secret scanning CLI for Claude Code
Project description
Claude Secret Scan
Secret scanning CLI for Claude Code. Blocks or warns on common credentials (cloud, source control, payment, collaboration) using zero dependencies and local regex matching.
Why
- Prevent accidental leakage in everyday editor/agent workflows.
- Zero dependencies, single-file core, runs locally only.
- Simple to set up; easy for teams to adopt.
Install
- pipx (recommended):
pipx install claude-secret-scan
- pip (user):
python3 -m pip install --user claude-secret-scan
Hook Setup (Claude Code)
Add to ~/.claude/settings.json for manual hooks:
{
"hooks": {
"UserPromptSubmit": [
{"hooks": [{"type": "command", "command": "claude-secret-scan --mode=pre"}]}
],
"PreToolUse": [
{"matcher": "Read|read", "hooks": [{"type": "command", "command": "claude-secret-scan --mode=pre"}]}
],
"PostToolUse": [
{"matcher": "Read|read", "hooks": [{"type": "command", "command": "claude-secret-scan --mode=post"}]},
{"matcher": "Bash|bash", "hooks": [{"type": "command", "command": "claude-secret-scan --mode=post"}]}
]
}
}
CLI Usage
- Pre mode (blocks on detection):
echo '{"hook_event_name":"UserPromptSubmit","prompt":"hello"}' | claude-secret-scan --mode=pre
- Post mode (warns on detection):
echo '{"tool_input":{"tool_name":"bash"},"tool_response":{"stdout":"OPENAI_API_KEY=...T3BlbkFJ..."}}' | claude-secret-scan --mode=post
How It Works
- Regex-based detection for common credentials: AWS, GitHub, GitLab, Stripe, Slack, Discord, Telegram, Google, OpenAI/Anthropic, JWT/keys, and more.
- Reads only from hook JSON input or file paths provided by the hook.
- Binary-aware scanning with size limits; local-only execution.
Notes
- Pre hooks block; post hooks print warnings.
- For plugin marketplace usage and more docs, see the repository.
Links
- Source, docs, and examples: https://github.com/mintmcp/agent-security
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_secret_scan-0.1.14.tar.gz.
File metadata
- Download URL: claude_secret_scan-0.1.14.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f4c8d32a709db82354d61a4af49da7254578cb328d7b932f70dcdb2e0191d6b
|
|
| MD5 |
d40743fb04fa97c74d6b78607032ec9c
|
|
| BLAKE2b-256 |
34723cbcfce71c9b95371a11efe23352063b564f5922231ecdc9199a8130f631
|
Provenance
The following attestation bundles were made for claude_secret_scan-0.1.14.tar.gz:
Publisher:
ci.yml on mintmcp/agent-security
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_secret_scan-0.1.14.tar.gz -
Subject digest:
3f4c8d32a709db82354d61a4af49da7254578cb328d7b932f70dcdb2e0191d6b - Sigstore transparency entry: 620899893
- Sigstore integration time:
-
Permalink:
mintmcp/agent-security@457f80af1de8a2e4796f6a7d3792a3defe37bab0 -
Branch / Tag:
refs/tags/v0.1.14 - Owner: https://github.com/mintmcp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@457f80af1de8a2e4796f6a7d3792a3defe37bab0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file claude_secret_scan-0.1.14-py3-none-any.whl.
File metadata
- Download URL: claude_secret_scan-0.1.14-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6f4b4da2d1b30f5cd42e56d19123c29898dbcd193107910bbd057221896d0c9
|
|
| MD5 |
a28cc14ae9a08eab8ac90335cb2b6619
|
|
| BLAKE2b-256 |
a6f6340446c563352af85bd18c979cda52d1a7b95d03a053c6883759c2217803
|
Provenance
The following attestation bundles were made for claude_secret_scan-0.1.14-py3-none-any.whl:
Publisher:
ci.yml on mintmcp/agent-security
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_secret_scan-0.1.14-py3-none-any.whl -
Subject digest:
d6f4b4da2d1b30f5cd42e56d19123c29898dbcd193107910bbd057221896d0c9 - Sigstore transparency entry: 620899894
- Sigstore integration time:
-
Permalink:
mintmcp/agent-security@457f80af1de8a2e4796f6a7d3792a3defe37bab0 -
Branch / Tag:
refs/tags/v0.1.14 - Owner: https://github.com/mintmcp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@457f80af1de8a2e4796f6a7d3792a3defe37bab0 -
Trigger Event:
push
-
Statement type: