Claude Code hook
Lasso Claude Hooks
Security hooks from Lasso that scan tool output for prompt-injection attempts.
Install
git clone https://github.com/lasso-security/claude-hooks.gitFrom the README
Claude Hooks A collection of security and utility hooks for Claude Code. Hooks allow you to extend Claude Code's behavior by running custom scripts at key points during execution. Research Paper: For detailed analysis of indirect prompt injection vulnerabilities in Claude Code, see: The Hidden Backdoor in Claude Coding Assistant Available Hooks š”ļø Prompt Injection Defender Defense against indirect prompt injection attacks. Scans tool outputs (files, web pages, command results) for injection attempts and warns Claude about suspicious content via PostToolUse hooks. Quick Start Option 1: Interactive Installation (Recommended) If you have this repo added as a Claude Code skill, simply tell Claude: Claude will handle the entire installation process for you. Option 2: Install Script What gets installed The installer copies hook files to your project and configures Claude Code: š For manual installation and more options, see INSTALLATION.md Understanding Prompt Injection The Problem: Indirect Prompt Injection When Claude Code reads files, fetches web pages, or runs commands, malicious instructions can be hidden in that content: Without protection, Claude might follow these hidden instructions. The defender scans all tool outputs and warns Claude when suspicious patterns are detected. Direct vs Indirect Injection - Direct: Malicious instructions from the user directly (not our focus) - Indirect: Malicious instructions hidden in content Claude reads (our focus) Attack Categories 1. System Prompt Forgery - Attempts to override system instructions 2. User Prompt Camouflage - Hidden malicious content in user data 3. Model Behavior Manipulation - Exploiting AI alignment tendencies Why Pattern-Based Detection? - Fast: No API calls, instant scanning -ā¦
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.
Details
- Repository
- lasso-security/claude-hooks
- Type
- Hooks
- Website
- lasso.security
- Language
- TypeScript
- License
- MIT
- Last updated
- 8 January 2026
- Topics
- agentaiclaude-codeclaude-desktopcoding-agenthooksprompt-injectionprompt-injection-llm-security
- Listed in
- awesome-claude-code-hooks
FAQ
What is Lasso Claude Hooks?
Security hooks from Lasso that scan tool output for prompt-injection attempts. It is a hook for Claude Code, from lasso-security/claude-hooks on GitHub.
How do I install Lasso Claude Hooks?
Clone lasso-security/claude-hooks from GitHub and follow the setup steps in its README.
Is Lasso Claude Hooks popular?
lasso-security/claude-hooks has 271 GitHub stars and 30 forks, and is included in 1 curated Claude Code list. It was last updated on 8 January 2026.
More hooks
Instagram Skills
728sergebulaev/instagram-skills
Instagram marketing skills for Claude Code and Codex: captions, carousels, hooks, hashtag strategy, and a weekly plan. Draft, humanize, and publish via Publora. MIT. Content engineering by Creative Content Crafts.
nWave
631nWave-ai/nWave
AI agents that guide you from idea to working code, with you in control at every step.
claude-hooks
397johnlindquist/claude-hooks
TypeScript framework for writing typed Claude Code hooks with a generated starter setup.
Abide
621coldteadotai/abide
Make your coding agent abide by all your project rules
Claude Code Config
1.1kjarrodwatts/claude-code-config
My personal Claude Code configuration - rules, hooks, agents, skills, and commands
LSP Enforcement Kit
328nesaminua/claude-code-lsp-enforcement-kit
Hooks that steer Claude Code toward LSP-based navigation instead of grep to save tokens.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.