Skip to main content

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

Metadata

Release files for claude-secret-scan 0.1.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-secret-scan 0.1.14
File Size Uploaded
claude_secret_scan-0.1.14.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claude-secret-scan 0.1.14
File Interpreter ABI Platform
claude_secret_scan-0.1.14-py3-none-any.whl Python 3 none any Details

Total release size: 18.0 kB

Release files / claude_secret_scan-0.1.14.tar.gz

Download URL claude_secret_scan-0.1.14.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3f4c8d32a709db82354d61a4af49da7254578cb328d7b932f70dcdb2e0191d6b
BLAKE2b-256 checksum
How to use checksums
34723cbcfce71c9b95371a11efe23352063b564f5922231ecdc9199a8130f631
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2025.

Transparency log

Release files / claude_secret_scan-0.1.14-py3-none-any.whl

Download URL claude_secret_scan-0.1.14-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6f4b4da2d1b30f5cd42e56d19123c29898dbcd193107910bbd057221896d0c9
BLAKE2b-256 checksum
How to use checksums
a6f6340446c563352af85bd18c979cda52d1a7b95d03a053c6883759c2217803
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.14 This release

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page