create-hook

Automate hook creation and execution for Cursor agent events.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/min-zou/obsidian-doc --skill create-hook-min-zou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-hook
Source: https://github.com/min-zou/obsidian-doc/tree/main/format/areas/system/agent-skills/cursor-builtin/create-hook
Command: npx skills add https://github.com/min-zou/obsidian-doc --skill create-hook-min-zou

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the creation and modification of hooks within the Cursor system, streamlining the customization of agent behavior before or after events.

Core Features & Use Cases

  • Hook Creation: Build hooks to control behavior around agent events.
  • Hook Execution: Run hooks for specific agent events or tool use.
  • Hook Scripting: Execute scripts or prompts based on event triggers.
  • Use Case: Automatically create a hook that restricts access to certain commands during terminal sessions.

Quick Start

Create a hook to block 'rm -rf' commands during terminal sessions with Cursor.

Frequently Asked Questions about create-hook

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

FAQPage Schema
How do I automate agent behavior modification for Cursor events?

Agent behavior modification in Cursor is automated by creating hooks that execute scripts or prompt checks before or after specific agent events like session start or tool use.

Can I restrict terminal commands in Cursor using agent event hooks?

You can restrict terminal commands in Cursor by creating a hook that triggers on tool use events, checking prompt inputs to block specific commands such as 'rm -rf' during sessions.

How do I filter agent events when setting up Cursor hooks?

Cursor hook event filtering supports regular expression matching to precisely target specific agent events, ensuring scripts or prompts only execute when defined event patterns occur.

Does hook script execution in Cursor require specific input formats?

Hook script execution in Cursor requires JSON format for defining script execution parameters, enabling proper configuration of automated triggers for subagent operations and tool use.

What is the best way to trigger scripts on session start and end in Cursor?

Triggering scripts on session start and end in Cursor is best handled by configuring hooks that listen for these specific agent events, executing your custom scripts automatically.

Why use hooks for customizing Cursor agent behavior instead of standard settings?

Hooks provide advanced administrative customization for Cursor agent behavior, allowing dynamic script execution and prompt checks that standard settings cannot achieve for complex event-driven workflows.