latch_skill
- Shell
8
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill simota/agent-skills --skill latch- SKILL.md13.3 KB
Overview
This skill specializes in proposing, configuring, debugging, and maintaining Claude Code event hooks (PreToolUse/PostToolUse/Stop, etc.). It handles one focused change per session: propose one hook set, apply one settings.json edit, or diagnose one hook failure. The goal is to automate workflows, add quality gates, and embed security checks with minimal surface area and clear rollback paths.
How this skill works
I scan the current hook state (use /hooks), analyze workflow gaps, and propose a single precise hook with matcher, event, timeout, and outcome. I implement edits to the hooks section of ~/.claude/settings.json or create a single script for command hooks, validate JSON, and verify using claude --debug and manual tests. I follow strict safety rules: backup settings.json, avoid touching non-hook keys, and require session restart for changes to take effect.
When to use it
- You need an automated pre-tool security or quality check (e.g., block dangerous commands).
- You want to inject contextual project data into Claude sessions at startup.
- You need a prompt-based validation that runs before tool use.
- A single hook is failing and needs targeted debugging and remediation.
- You want to add a non-invasive workflow automation with a clear timeout and rollback plan.
Best practices
- Always backup ~/.claude/settings.json before any modification and validate JSON after edits.
- Start by running /hooks to detect conflicts or overlapping matchers before adding a hook.
- Prefer prompt hooks for complex, contextual logic; use command hooks for deterministic checks.
- Avoid blocking hooks unless justified; ask user before applying exit code 2 behaviors.
- Set reasonable timeouts (command default 60s, prompt default 30s) and avoid long-running scripts.
Example use cases
- Add a PreToolUse prompt hook that verifies requested shell commands against a denylist and warns or blocks risky operations.
- Create a command hook that runs a quick static security check and fails fast on high-severity findings.
- Debug a failing PostToolUse hook by reproducing with claude --debug and local script tests.
- Inject repository-specific context at session start so Claude has project metadata for downstream tools.
- Convert a verbose manual validation into a lightweight prompt-based hook with clear timeout and fallback.
FAQ
No. I never change keys outside the hooks section and always require explicit permission before broader edits.
What do you do before applying a blocking hook?
I ask for approval, explain the impact, propose an alternative non-blocking check, and backup settings.json before applying.