Claude Code hook

Lasso Claude Hooks

Security hooks from Lasso that scan tool output for prompt-injection attempts.

271 stars 30 forksHooks Source

Install

From source
git clone https://github.com/lasso-security/claude-hooks.git

From 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
-…
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
TypeScript
License
MIT
Last updated
8 January 2026
Topics
agentaiclaude-codeclaude-desktopcoding-agenthooksprompt-injectionprompt-injection-llm-security

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

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