create-hook

Define and manage Cursor hooks for agent events via hooks.json.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/OM-bit-hub/daily_tracker --skill create-hook-om-bit-hub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-hook
Source: https://github.com/OM-bit-hub/daily_tracker/tree/main/.agents/skills-cursor/create-hook
Command: npx skills add https://github.com/OM-bit-hub/daily_tracker --skill create-hook-om-bit-hub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cursor hooks provide a way to inject custom logic around agent events, enabling pre- and post-processing, auditing, and automated responses without modifying core code.

Core Features & Use Cases

  • Define project or user hooks and decide when they run (preToolUse, postToolUse, beforeShellExecution, etc).
  • Write deterministic script or prompt-based hooks that communicate over stdin/stdout with JSON.
  • Use cases include auditing, gating commands, injecting context, or continuing/altering workflows based on tool output.

Quick Start

Configure a project hook by creating a script under .cursor/hooks and adding its entry to .cursor/hooks.json.

Frequently Asked Questions about create-hook

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

FAQPage Schema
How do I create Cursor hooks to automate agent events?

To create Cursor hooks, you define and manage custom logic around agent events by adding script entries to the .cursor/hooks.json file. This enables deterministic pre- and post-processing for agent workflows.

What trigger events can I use for Cursor hooks?

Cursor hooks support trigger events including preToolUse, postToolUse, and beforeShellExecution. These triggers allow you to inject custom logic, audit actions, or gate commands at specific points in the agent workflow.

How do Cursor hooks communicate with scripts and prompts?

Cursor hooks communicate with scripts and prompts over stdin/stdout using JSON. This deterministic communication method allows hooks to inject context, gate commands, or alter workflows based on tool output.

Can I use prompts instead of scripts for Cursor hooks?

Yes, you can write either deterministic script-based or prompt-based hooks. Both types communicate over stdin/stdout with JSON to integrate custom behavior into the agent event workflow.

What is the best way to set up a project hook in Cursor?

The best way to set up a project hook is to create a script under the .cursor/hooks directory and add its entry to .cursor/hooks.json. This configuration injects custom logic around agent events without modifying core code.

Does the create-hook Skill validate hook safety requirements?

Yes, the Skill validates hook configurations including scope, trigger, behavior, implementation type, and safety requirements. This validation ensures deterministic behavior and safe integration of scripts or prompts with hooks.json.