Loading image...Kiro

Product

  • About Kiro
  • IDE
  • CLI
  • Web
  • Mobile
  • Crew
  • Pricing
  • Downloads

For

  • Enterprise
  • Startups
  • Students

Community

  • Overview
  • Ambassadors
  • Discord
  • Events
  • Powers
  • Shop
  • Showcase

Resources

  • Docs
  • Blog
  • Changelog
  • FAQs
  • Report a bug
  • Suggest an idea
  • Billing support

Social

Site TermsLicenseResponsible AI PolicyLegalPrivacy PolicyCookie Preferences
Loading image...Kiro
  • CLI
  • Web
  • Enterprise
  • Pricing
  • Docs
SIGN INDOWNLOADS
Loading image...Kiro

Get Started

InstallationAuthenticationYour first project

Models

OverviewAvailable modelsReasoning effort

Features

How Kiro works
Specs
Steering
Hooks
Hook triggers
Hook actions
Examples
Management
Best practices
Troubleshooting
MCP
Permissions
Custom agents
Agent Skills
Powers
Cloud sessionsCompactionKiroignoreCheckpoints and rewind
Built-in tools
Configuration scopes

IDE 1.x

What's new in 1.0
Setup & First Run
Editor
Chat
Experimental
Troubleshooting0.x reference

CLI

What's new in 3.0
Setup & First Run
Terminal UI
Chat
Voice modeHeadless modeACPAuto complete
Experimental
2.x reference

Crew

Quick startInstallationRunning 24/7
Chat
Agent Capabilities
Features
Interfaces
Apps
ConfigurationSecurityTroubleshooting

Web - Preview

Setup & First RunIdentity Center
Connect your repositories
Working with the agent
Autonomous modeAutomationsMemory
Sandbox

Mobile - Preview

Overview

Commands and Reference

CLI commandsSlash commandsBuilt-in toolsExit codesSettings

Billing

OverviewManaging your subscriptionUpgrading your planDowngrading your planCancelling your planPurchasing add-on creditsManaging your paymentsManaging usage notificationsManaging your taxesContacting billing supportDeleting your accountRelated questions

Enterprise

ConceptsOnboarding quickstart
Connecting your identity provider
Subscribe your teamManage subscriptions
Governance
Monitor and track
SettingsManaged updatesBillingIAMSupported regions

Privacy and Security

OverviewData protectionCode referencesCompliance validationInfrastructure securityIAM permissionsFirewalls, proxies, and data perimetersVPC endpoints (AWS PrivateLink)

Guides

Overview
Language support
Learn by playing

Migration

Migrating from Q DeveloperMigrating from VSCodeUpgrading from Q CLI
  1. Docs
  2. Features
  3. Hooks
  4. Hook triggers
View as Markdown

Hook types

View as Markdown

Agent hooks support various trigger types, each designed for specific automation scenarios. Understanding these types helps you choose the right approach for your workflow needs.

Availability by surface

Not all hook triggers are available on every surface. Some triggers are specific to the IDE (task execution) or CLI (agent spawn). The table below shows what's supported where.

TriggerIDECLIWeb
Prompt Submit✓✓—
Agent Stop✓✓—
Agent Spawn—✓—
Pre Tool Use✓✓—
Post Tool Use✓✓—
File Create✓✓—
File Save✓✓—
File Delete✓✓—
Pre Task Execution✓——
Post Task Execution✓——
Legacy Manual HookLegacy only——

Prompt Submit

Triggers when the user submits a prompt.

When using the shell command action, the user prompt can be accessed via the USER_PROMPT environment variable.

Use Cases:

  • Provide additional context to the agent relevant to the prompt
  • Block certain prompts based on their content
  • Log all user prompts to a central location

Agent Stop

Triggers when the agent has completed its turn and finished responding to the user.

This is useful for running post-processing tasks like code compilation, testing, formatting, or cleanup after the agent's response.

Use Cases:

  • Compile code and report any failures to the agent
  • Format or review any agent-generated code
  • Review changes made by agent and provide additional instructions

Agent Spawn (CLI only)

Runs when the agent is first activated. No tool context is provided.

json
{ "hook_event_name": "agentSpawn", "cwd": "/current/working/directory", "session_id": "abc123-def456-789" }

Exit Code Behavior:

  • 0: Hook succeeded, STDOUT is added to agent's context
  • Other: Show STDERR warning to user

Use Cases:

  • Set up environment context when a session starts
  • Load project-specific configuration
  • Initialize logging or auditing systems

Pre Tool Use

Triggers when the agent is about to invoke a tool. Can validate and block tool usage.

In the Tool name field, provide the names of the specific tools for which this hook should execute. You can specify multiple entries. The following built-in categories are supported:

  • read - all built-in file read tools
  • write - all built-in file write tools
  • shell - all built-in shell command-related tools
  • web - all built-in web tools
  • spec - all built-in spec tools
  • * - all tools (built-in and MCP)

You can also use prefix filters to target tools by source:

  • @mcp - all MCP tools
  • @powers - all Powers tools
  • @builtin - all built-in tools

Prefixes starting with @ are matched by regex, so you can use patterns like @mcp.*sql.* to match specific MCP tools by name.

You can ask Kiro for the names of the available tools.

Use Cases:

  • Block certain tool invocations
  • Validate tool inputs before execution
  • Provide additional instructions to the agent before it invokes a tool

Post Tool Use

Triggers after the agent has invoked a tool, with access to tool results.

For details on the Tool name field, refer to the Pre Tool Use section above.

Use Cases:

  • Log tool invocations for auditing purposes
  • Format or review any updated files after a "write" tool call
  • Provide additional instructions to the agent on top of the tool response

File Create

Triggers when the agent creates new files matching specific patterns in your workspace.

Info

File triggers respond only to changes made by the agent. Manual editor changes do not trigger File Create, File Save, or File Delete hooks.

Use Cases:

  • Generate boilerplate code for new components
  • Add license headers to new files
  • Set up test files when creating implementation files

File Save

Triggers when the agent saves or modifies files matching specific patterns.

Use Cases:

  • Run linting and formatting
  • Update related files
  • Generate documentation
  • Run tests for changed files

File Delete

Triggers when the agent deletes files matching specific patterns.

Use Cases:

  • Clean up related files
  • Update import references in other files
  • Maintain project integrity

Pre Task Execution (IDE only)

Triggers before a spec task begins execution, when its status changes to in_progress.

Use Cases:

  • Run setup scripts or environment preparation before task execution
  • Validate prerequisites are met before a task starts
  • Log task start events for tracking

Post Task Execution (IDE only)

Triggers after a spec task completes execution, when its status changes to completed.

Use Cases:

  • Run tests after a task completes to verify correctness
  • Run linting or formatting on changed files
  • Generate documentation for completed work
  • Notify external systems of task completion

Legacy manual Hooks (IDE only)

Manual Hooks created in IDE 0.x continue to appear in the Agent Hooks panel with a legacy label. Enabled legacy manual Hooks remain runnable using the play button next to the Hook name or Start Hook in the Hook view.

Legacy manual Hooks don't have a v1 trigger equivalent, and you can't create a new Manual-trigger Hook. For a new on-demand workflow, create a manually included Steering file; it runs as a /<filename> slash command.

MCP tool hooks

For MCP tools, the tool name includes the full namespaced format including the MCP server name:

json
{ "hook_event_name": "preToolUse", "cwd": "/current/working/directory", "session_id": "abc123-def456-789", "tool_name": "@postgres/query", "tool_input": { "sql": "SELECT * FROM orders LIMIT 10;" } }

This applies to both Pre Tool Use and Post Tool Use hooks when targeting MCP server tools.

Page updated: August 21, 2026
Hooks
Hook actions