claude-hooks: Command for Claude Code

.claude/commands/install.md

install is a command for Claude Code from lasso-security/claude-hooks. It costs 0 tokens per session (711 once invoked), scanned A, original, MIT.

An installation command for adding prompt-injection defender hooks to a Claude Code project. Prompt injection is text that tries to make an agent ignore its intended instructions.

In plain words
What is it for?
Use it to choose a Python or TypeScript implementation, select project or user-wide installation, copy the required files, and update Claude settings.
Why use it?
It guides setup of protections that inspect prompts and tool activity for suspicious instructions, reducing the need to configure the defenses by hand.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions Claude Code.

This is lasso-security/claude-hooks's own configuration. It tells Claude Code how to work on claude-hooks itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-hooks configures →

Reuse

Borrowing it

Nothing to install: this file belongs to lasso-security/claude-hooks. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/lasso-security/claude-hooks/dev/.claude/commands/install.md
Clone the repo
git clone --depth 1 https://github.com/lasso-security/claude-hooks

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for install

README.md
[![agentmods](https://agentmods.dev/badge/commands/lasso-security/claude-hooks/install/github.svg)](https://agentmods.dev/commands/lasso-security/claude-hooks/install)
Your own site
<a href="https://agentmods.dev/commands/lasso-security/claude-hooks/install"><img src="https://agentmods.dev/badge/commands/lasso-security/claude-hooks/install/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for install

Your own site · 80×15
<a href="https://agentmods.dev/commands/lasso-security/claude-hooks/install"><img src="https://agentmods.dev/badge/commands/lasso-security/claude-hooks/install.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 711 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00711
Opus 5.5 $0.00000 $0.00284
Sonnet 5.5 $0.00000 $0.00142
Haiku 4.5 $0.00000 $0.00071

Measured 1mo ago against content hash 296bc875f948, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

install scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- For user-wide: update `~/.claude/settings.json`

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.claude/commands/install.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Install Prompt Injection Defender

Install the prompt injection defender hooks into your Claude Code project.

Instructions

Guide me through installing the prompt injection defender. Ask me:

  1. Which implementation? Python (uv) or TypeScript (bun)
  2. Installation scope? Project-only or user-wide
  3. Which tools to monitor? All recommended tools or let me select

Installation Steps

After gathering my preferences:

  1. Check prerequisites

    • For Python: Verify uv is installed (which uv)
    • For TypeScript: Verify bun is installed (which bun)
  2. Copy hook files

    • Copy the appropriate hook implementation to my project or user config
    • For project: .claude/hooks/prompt-injection-defender/
    • For user-wide: ~/.claude/hooks/prompt-injection-defender/
  3. Copy patterns.yaml

    • Place patterns.yaml alongside the hook script
    • This file contains all detection patterns
  4. Update settings configuration

    • IMPORTANT: Check if .claude/settings.local.json exists first
    • If settings.local.json exists, merge hooks into THAT file (it takes precedence over settings.json)
    • If only settings.json exists, merge hooks there
    • Use the template from python-settings.json or typescript-settings.json
    • Adjust paths based on installation scope
    • For user-wide: update ~/.claude/settings.json

    Settings precedence (highest to lowest):

    1. .claude/settings.local.json (local project - overrides all below)
    2. .claude/settings.json (project settings)
    3. ~/.claude/settings.json (user settings)
  5. Restart Claude Code

    • CRITICAL: Hooks are captured at session startup
    • Tell the user they MUST restart Claude Code for hooks to take effect
    • Exit the current session and start a new one
  6. Verify installation

    • After restart, run a quick test to ensure the hook is working
    • Read a test file with known injection patterns
    • Use /hooks command to verify hooks are loaded

Read the full file on GitHub · 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 88 lines · 0 tokens per session scan A 296bc875f948

Subscribe to this mod's changes

install is a command published in the GitHub repository lasso-security/claude-hooks (269 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 711 tokens. A static security scan graded it A with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.