Loading image...Kiro
  • CLI
  • Powers
  • Autonomous agent
  • Enterprise
  • Pricing
  • Docs
SIGN INDOWNLOADS
Loading image...Kiro
Loading image...Kiro
Product
  • About Kiro
  • CLI
  • Powers
  • Autonomous agent
  • Pricing
  • Downloads
For
  • Enterprise
  • Startups
Resources
  • Documentation
  • Blog
  • Changelog
  • FAQs
  • Report a bug
  • Suggest an idea
  • Billing support
Social
Site TermsLicenseResponsible AI PolicyLegalPrivacy PolicyCookie Preferences
  1. Docs
  2. IDE
  3. Hooks

Hooks

On this page
  • What are agent hooks?
  • How agent hooks work
  • Setting up agent hooks
  • Creating a hook
  • Ask Kiro to create a hook
  • Manually create a hook
  • Next steps

Agent hooks are powerful automation tools that streamline your development workflow by automatically executing predefined agent actions when specific events occur in your IDE. With hooks, you eliminate the need to manually request routine tasks and ensure consistency across your codebase.

What are agent hooks?

Agent hooks are automated triggers that execute predefined agent prompts or shell commands when specific events occur in your IDE. Rather than manually asking for routine tasks to be performed, hooks set up automated responses to events such as:

  • Saving, creating, or deleting files
  • User prompt submission and agent turn completion
  • Before or after tool invocations
  • Before or after spec task execution
  • Manual triggers on demand

Agent hooks transform your development workflow through intelligent automation. By setting up hooks for common tasks, you can:

  • Maintain consistent code quality
  • Prevent security vulnerabilities
  • Reduce manual overhead
  • Standardize team processes
  • Create faster development cycles

Whether you're working on a small project or managing a large codebase, agent hooks help ensure that routine tasks are handled automatically and consistently, allowing you to focus on building great software.

How agent hooks work

The agent hook system follows a simple two-step process:

  1. Event Detection: The system monitors for specific events in your IDE
  2. Automated Action: When an event occurs, an action — either a predefined agent prompt or a shell command — is executed

This automation flow eliminates repetitive tasks and ensures consistency across your codebase.

Setting up agent hooks

You can create hooks in two ways — describe what you want in natural language and let Kiro generate the configuration, or manually fill out a form yourself.

Creating a hook

  1. Navigate to the Agent Hooks section in the Kiro panel
  2. Click the + button to create a new hook
  3. Choose how you want to create the hook:
    • Manually create a hook — configure a hook by hand in a form
    • Ask Kiro to create a hook — describe a hook using natural language and have Kiro create one

Ask Kiro to create a hook

  1. Select Ask Kiro to create a hook
  2. Describe the hook workflow using natural language
  3. Press Enter or click Submit to proceed
  4. Review the generated configuration, adjust if needed, and click Save Hook

Manually create a hook

  1. Select Manually create a hook to open the hook form
  2. Fill in the form fields:
    • Title — a short name for the hook
    • Description — what the hook does
    • Event — the trigger type (e.g., File Save, Post Tool Use, Pre Task Execution)
    • Tool name — for Pre/Post Tool Use hooks, specify which tools to match
    • File pattern — for file event hooks, specify which files to match
    • Action — choose Ask Kiro (agent prompt) or Run Command (shell command)
    • Instructions or Command — the prompt or shell command to execute
  3. Click Create Hook when done, or Clear to reset the form

You can also open the Hook UI from the Command Palette with Cmd + Shift + P (Mac) or Ctrl + Shift + P (Windows/Linux) and typing Kiro: Open Kiro Hook UI.

Next steps

Now that you have created a hook file, you can further learn about hooks here:

  • Hook Types - Learn about different trigger types and their use cases
  • Hook Actions - Learn about different hook actions and their use cases
  • Management - Learn how to organize, edit, and maintain your hooks
  • Best Practices - Follow patterns for effective hook design
  • Examples - See examples and templates you can use
Page updated: February 18, 2026
Create powers
Hook triggers