creating-hooks

Execute shell commands at lifecycle points in Claude Code via JSON settings.

3|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/scute-sh/scute --skill creating-hooks-scute-sh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-hooks
Source: https://github.com/scute-sh/scute/tree/main/.claude/skills/creating-hooks
Command: npx skills add https://github.com/scute-sh/scute --skill creating-hooks-scute-sh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates workflows by allowing you to run shell commands at specific points in Claude Code's lifecycle, ensuring deterministic control over its behavior.

Core Features & Use Cases

  • Automated Actions: Execute shell commands automatically when Claude Code edits files, finishes tasks, or needs input.
  • Enforce Rules & Integrate Tools: Use hooks to enforce project rules, automate repetitive tasks, and integrate Claude Code with your existing tools.
  • Use Case: Automatically format code after edits using Prettier, block dangerous commands before they execute, or send desktop notifications when Claude needs your input.

Quick Start

Configure a hook to automatically format code after edits by adding the provided JSON to your settings file.

Frequently Asked Questions about creating-hooks

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

FAQPage Schema
How do I automate shell commands to run before or after tool use in my development workflow?

You can automate shell commands at specific lifecycle points by configuring JSON settings files to execute deterministic event-driven scripts, ensuring automated actions occur before or after tool use, session start, or notifications.

What are hooks in an agentic coding environment and when do I need them?

Hooks are event-driven scripts that execute shell commands at specific lifecycle points within Claude Code. You need them to enforce project rules, automate repetitive tasks, and integrate existing tools into your workflow deterministically.

How do I configure a hook to automatically format code after edits?

To configure a hook for automated formatting after edits, add the provided JSON configuration to your settings file. This enables deterministic execution of formatting shell commands immediately following file modifications.

Can I use shell commands to block dangerous operations before they execute?

Yes, you can use hooks to block dangerous commands before they execute. By configuring event-driven scripts in your JSON settings, you gain robust control over agentic behavior to prevent unsafe operations.

Do I need to install any dependencies to run lifecycle hooks?

You need the requests dependency installed in your environment to support the execution of shell commands and integration workflows triggered by lifecycle hooks.

What's the best way to send desktop notifications when an automated workflow needs input?

The best way to send desktop notifications when a session needs input is to configure a hook at the notification lifecycle point using JSON settings, executing shell commands to trigger alerts deterministically.