Claude Code hook

Medusa

AI-first security scanner. NEW in v2026.7: Claude Code compromise detection — vet .claude/ hooks, permissions & skills before you clone — plus an always-on AI attack-signature scanner and native Rust & PHP rules. Also: medusa scan --git to vet any repo, medusa secrets scan for leaked API keys. 40,000+ patterns, zero setup.

1,013 stars 153 forksHooks Source

Install

Install
pip install medusa-security

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/Pantheon-Security/medusa.git

From the README

🐍 MEDUSA - AI Security Scanner

AI-first security scanner with 40,000+ detection patterns for AI/ML, agents, and LLM applications.
🤖 Works out of the box - no tool installation required.
🚨 200 CVEs: Log4Shell, Spring4Shell, XZ Utils, LangChain RCE, MCP-Remote RCE, React2Shell
🔥 medusa scan --git  — Scan any repo for AI supply chain attacks (repo poisoning, prompt injection, MCP tool poisoning)
🔐 medusa secrets scan — Find leaked API keys in your Claude / Cursor / Copilot / shell history. 21 issuer types. Interactive in-place redaction.
🚀 v2026.7.0: Claude Code compromise detection, an always-on AI attack-signature scanner, native Rust & PHP security rules, and rule-level diagnostics — on top of 40,000+ detection patterns.

🎯 What is MEDUSA?

MEDUSA is an AI-first security scanner with 40,000+ detection patterns that works out of the box. Simply install and scan - no external tool installation required. MEDUSA's built-in rules detect vulnerabilities in AI/ML applications, LLM agents, MCP servers, RAG pipelines, and traditional code.

✨ Key Features

- 🔥 medusa scan --git  - Scan any GitHub repo for AI supply chain attacks in seconds
- 🔐 medusa secrets scan + purge - Find API keys / tokens / private keys leaked into Claude Code / Cursor / Copilot / Zed / Gemini chat histories *and* your bash / zsh / psql / mysql / python REPL history. 21 issuer types (Anthropic, OpenAI, PyPI, GitHub PATs, AWS, GCP, Stripe, Slack…). Interactive [y/n/s/a/q] purge with mandatory byte-identical backup and JSONL-safe redaction. Local-only, no telemetry.
- 🤖 40,000+ AI Security Patterns - Industry-leading coverage for AI/ML, agents, and LLM applications
- 🛡️ Repo Poisoning Detection - Detects weaponized AI editor configs across 28+ file types (Cursor, Cline, Copilot, Claude Code,…
Read the full README on GitHub

How hooks work

  • Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
  • They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
  • A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Claude Code docs

Details

Type
Hooks
Language
Python
License
AGPL-3.0
Last updated
10 August 2026
Topics
agent-securityai-securitycode-analysiscve-detectiondevsecopsllm-securitymcpnextjsopen-sourcepythonreactsast

FAQ

What is Medusa?

AI-first security scanner. NEW in v2026.7: Claude Code compromise detection — vet .claude/ hooks, permissions & skills before you clone — plus an always-on AI attack-signature scanner and native Rust & PHP rules. Also: medusa scan --git to vet any repo, medusa secrets scan for leaked API keys. 40,000+ patterns, zero setup. It is a hook for Claude Code, from Pantheon-Security/medusa on GitHub.

How do I install Medusa?

Run pip install medusa-security, then follow the setup in the README.

Is Medusa popular?

Pantheon-Security/medusa has 1,013 GitHub stars and 153 forks, and is included in 1 curated Claude Code list. It was last updated on 10 August 2026.

More hooks

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.