Skip to main content

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.

Claude Secret Scan demo

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_secret_scan-0.1.14.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_secret_scan-0.1.14-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

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

Hashes for claude_secret_scan-0.1.14.tar.gz
Algorithm Hash digest
SHA256 3f4c8d32a709db82354d61a4af49da7254578cb328d7b932f70dcdb2e0191d6b
MD5 d40743fb04fa97c74d6b78607032ec9c
BLAKE2b-256 34723cbcfce71c9b95371a11efe23352063b564f5922231ecdc9199a8130f631

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_secret_scan-0.1.14.tar.gz:

Publisher: ci.yml on mintmcp/agent-security

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_secret_scan-0.1.14-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_secret_scan-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 d6f4b4da2d1b30f5cd42e56d19123c29898dbcd193107910bbd057221896d0c9
MD5 a28cc14ae9a08eab8ac90335cb2b6619
BLAKE2b-256 a6f6340446c563352af85bd18c979cda52d1a7b95d03a053c6883759c2217803

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page