Agent Hooks

What are Agent Hooks?

Agent hooks are triggers that automatically execute predefined agent prompts or shell commands when specific events occur in the IDE. Instead of having to manually request routine tasks, hooks set up automatic responses to events such as:

  • Saving a file
  • Creating a new file
  • Deleting a file
  • Sending a user prompt
  • Completing an agent turn

Agent hooks transform the development process 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 working on a small project or managing a large codebase, agent hooks ensure routine tasks are handled automatically and consistently, allowing you to focus on building great software.

How Agent Hooks Work

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

  • Event Detection: The system monitors specific events in the IDE

  • Automated Action: When an event occurs, an action — a predefined agent prompt or shell command — is executed

This automation process eliminates repetitive tasks and ensures consistency across the codebase.

How to Set Up Agent Hooks

Creating and managing hooks is very simple:

  • Use the Explorer View
  • Navigate to the Agent Hooks section in the Kiro panel
  • Click the + button to create a new hook
  • Define the hook workflow using natural language in the input box
  • Press Enter or click Submit to continue
  • Configure hook settings and save

hooks