Latch

Configure and debug Claude Code hooks in settings.json.

68|14|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/simota/agent-skills --skill latch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Latch
Source: https://github.com/simota/agent-skills/tree/main/latch
Command: npx skills add https://github.com/simota/agent-skills --skill latch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of managing Claude Code's hook system, enabling users to automate workflows, enforce quality gates, and implement security checks through custom event-driven logic.

Core Features & Use Cases

  • Hook Design & Proposal: Suggests appropriate hook configurations based on workflow needs.
  • Configuration & Debugging: Assists in setting up or modifying settings.json hook entries and diagnosing hook failures.
  • Use Case: You need to ensure that no sensitive API keys are accidentally written to configuration files. Latch can help you configure a PreToolUse hook that scans file write operations for patterns resembling API keys and blocks the operation if found.

Quick Start

Use the Latch skill to propose a hook that blocks any Bash command containing rm -rf.

Frequently Asked Questions about Latch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate workflow and security checks using Claude Code hooks?

Claude Code hooks automate workflows by triggering custom event-driven logic for lifecycle events like PreToolUse and Stop. You can configure these hooks to enforce quality gates, implement security scans, and block unsafe operations automatically.

What is the best way to prevent sensitive data from being written in Claude Code?

To prevent sensitive data writes, configure a PreToolUse hook to scan file write operations for patterns resembling API keys. This security enforcement mechanism blocks the operation automatically if a sensitive pattern is detected.

How do I configure Claude Code hooks in settings.json?

Configuring Claude Code hooks in settings.json involves proposing appropriate hook entries for your workflow needs and safely adding them to the file. This setup ensures your automated quality gates and security checks are triggered correctly.

Why is my Claude Code hook not triggering or failing during execution?

Hook failures in Claude Code often stem from misconfigured settings.json entries or invalid event logic. You can diagnose these issues by analyzing the specific PreToolUse, PostToolUse, or Stop lifecycle event configurations to ensure they are safely set up.

Can I block specific Bash commands like rm -rf from running in Claude Code?

Yes, you can block specific Bash commands by configuring a PreToolUse hook. This hook intercepts the command execution lifecycle event and blocks the operation if it detects restricted patterns like rm -rf.

When should I use blocking hooks versus passive hooks in my workflow?

Use blocking hooks when you need strict quality gates or security enforcement, such as preventing dangerous commands or data leaks. Passive hooks are suitable for non-destructive automation like logging or formatting after a PostToolUse event.