LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

create-hooks

Guide for creating Claude Code hooks with proper configuration, shell commands, event handling, and security practices. Use when the user wants to create hooks, automate workflows, add event handlers, format code automatically, protect files, log actions, or mentions creating/configuring/building hooks.

16starsUpdated 3/19/2026
Productivity & Workflow#shell-commands#create-hooks#event-handling#coding#security-practices#automation

Security Assessment

Critical Risk(0/100)

Detected risks:

Destructive Operations([SKILL.md] rm -rf)
Secret Exposure([SKILL.md] API_KEY=)
Sensitive File Access([SKILL.md] .env)
Command Injection([SKILL.md] subprocess.run)
Security Score0/100

About create-hooks

The 'create-hooks' skill provides a comprehensive guide for users looking to create Claude Code hooks, which are user-defined shell commands that allow for precise control over specific points in the Claude Code lifecycle. This skill addresses the need for automation and customization by enabling users to define actions that execute in response to various events, ensuring that workflows can be tailored to meet specific requirements without relying on the unpredictability of large language model (LLM) decisions. By following a structured approach, users can effectively implement hooks that enhance both the functionality and security of their coding environment.

Main features of this skill include the ability to define actions for nine distinct lifecycle events, such as PreToolUse, PostToolUse, UserPromptSubmit, and more. Each event serves a unique purpose, allowing for file protection, code formatting, session logging, and other essential tasks. Additionally, users can easily configure hooks through a JSON format in their settings, enabling seamless integration into their workflow. This skill is particularly beneficial for developers, system administrators, and anyone involved in automating tasks within Claude Code, as it empowers them to create a highly customized and efficient coding experience.

Use cases for the 'create-hooks' skill include automating code formatting and linting after edits, validating user input before execution, and logging actions for auditing purposes. Target users range from individual developers seeking to streamline their coding practices to teams looking for a way to enforce code quality standards and maintain security protocols. By utilizing the capabilities provided by this skill, users can enhance their productivity and ensure that their coding environment operates smoothly and securely.

FAQ

How do I create a new hook?

Follow the workflow outlined in the Quick Start section, which includes identifying the event, defining the action, configuring the matcher, and testing the command.

What events can I use for hooks?

Claude Code supports nine hook events: PreToolUse, PostToolUse, UserPromptSubmit, Notification, Stop, SubagentStop, PreCompact, SessionStart, and SessionEnd.

Are there any limitations on the shell commands I can use?

Shell commands must be compatible with the operating system you are using, and they should be tested independently before being registered as hooks.

Can hooks block events from executing?

Yes, some hooks like PreToolUse and UserPromptSubmit can block events by returning an exit code.

Where do I configure my hooks?

Hooks are configured in the settings.json file located at ~/.claude/settings.json.

Install create-hooks

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

ronnycoding/.claude

Related Skills

threat-modeling-with-aws-security-agent

2,903

amazon-workspaces-agent-access

2,903

build-loop-codex

230

developing-ios-apps

1,477