Directory · Hooks
Lasso Claude Hooks (Prompt Injection Defender)
PostToolUse hook for Claude Code that scans tool outputs for indirect prompt injection patterns and warns Claude when found.
★ 273 stars · last updated 2026-01-08 · Free, open source · View on GitHub
Best for
- Teams letting Claude Code read untrusted files, web pages, or MCP outputs
- Adding a lightweight, no-API-cost injection check to existing projects
- Security folks who want auditable, editable regex detection patterns
Install
git clone https://github.com/lasso-security/claude-hooks.git
cd claude-hooks
./install.sh /path/to/your-project
Our take
Detection is regex-based via an editable patterns.yaml, so it is fast and transparent but can miss novel attacks or flag legitimate content. It warns rather than blocks, adding a notice to Claude's context while still passing the content through. Ships Python and TypeScript implementations plus a skill for interactive installation, from security vendor Lasso.
Similar hooks
- Claude Code Ultimate Guide: Large open guide to Claude Code covering agent workflows, hooks, skills, MCP, security, and team adoption, with reusable templates.
- dcg (Destructive Command Guard): Rust pre-execution hook that blocks destructive shell, git, filesystem, database, and cloud commands run by AI coding agents.
- Claude Code Showcase: Example Claude Code project config with hooks, skills, agents, slash commands, MCP setup, and GitHub Actions workflows to copy from.
- Claude Code Hooks Mastery: Reference project implementing all 13 Claude Code hook events as UV Python scripts, plus sub-agents, status lines, and output styles.
- Continuous Claude v3: Hooks, skills, and agents that keep Claude Code context across sessions via YAML handoffs, ledgers, and a PostgreSQL memory store.
- Build with Claude: Plugin marketplace and discovery hub of agents, commands, hooks, and skills for Claude Code users extending their workflows.