Loading image...Kiro

Product

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

For

  • Enterprise
  • Startups
  • Students

Community

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

Resources

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

Social

Site TermsLicenseResponsible AI PolicyLegalPrivacy PolicyCookie Preferences
Kiro
  • Agents
  • Enterprise
  • Pricing
  • Docs
SIGN INDOWNLOADS
Kiro

Get Started

InstallationAuthenticationYour first project

Models

OverviewAvailable modelsReasoning effortAWS GovCloud (US) models

Features

How Kiro worksLocal command sandboxACP integrations
Specs
Steering
Hooks
MCP
Permissions
Custom agents
Workflows
Agent Skills
Powers
Cloud sessionsMemoryCompactionKiroignoreCheckpoints 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 V3
Migration guide
Upgrading agent configs
Permissions migration
Hooks migration
Migrate an ACP client to CLI V3
Agent config changes
New features in V3
Tangent
Setup & First Run
Terminal UI
Chat
Fullscreen modeVoice modeHeadless modeACPAuto complete
Experimental
2.x reference

Crew

Quick startInstallationRunning 24/7
Chat
Agent Capabilities
Features
Interfaces
Apps
System & storageConfigurationSecurityTroubleshooting

Web

Setup & First RunIdentity Center
Connect your repositories
Working with the agent
Autonomous modeScheduleConfiguration Sync
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
Deployment optionsSubscribe your teamManage subscriptions
Governance
Monitor and track
SettingsManaged updatesTLS inspection compatibilityBillingIAMSupported regions
AWS GovCloud (US)

Privacy and Security

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

Guides

OverviewRunning Kiro in the cloud
Language support
Learn by playing

Migration

Migrating from Q DeveloperMigrating from VSCodeUpgrading from Q CLI
  1. Docs
  2. CLI
  3. What's new in V3
  4. Hooks migration
View as Markdown

Hooks migration

View as Markdown

New to Kiro CLI V3? This page covers migration from CLI 2.x Hooks. For the current standalone format reference, see Hooks →.

Tip: Run /upgrade-agent first. It converts object-form Hooks to a profile-scoped inline array and reports any triggers or matchers it could not convert safely.

CLI V3 supports two current placements. Agent profiles can keep profile-scoped Hooks in a flat hooks array. For automation that should work independently of a particular profile or across IDE and CLI, place the same Hook definitions in standalone .kiro/hooks/*.json files. The legacy object form remains accepted as compatibility input, but use the current array form when you revise migrated definitions.

Legacy object format

CLI 2.x Hooks used an object keyed by camelCase trigger names:

json
{ "hooks": { "agentSpawn": [{ "command": "echo 'starting'" }], "preToolUse": [{ "command": "npm run lint", "matcher": "fs_read" }] } }

Current profile-scoped format

/upgrade-agent flattens the legacy object into an array in the agent profile. It gives each Hook a name and keeps the compatible camelCase trigger alias:

json
{ "hooks": [ { "name": "agentSpawn-0", "trigger": "agentSpawn", "action": { "type": "command", "command": "echo 'starting'" }, "timeout": 10 }, { "name": "preToolUse-0", "trigger": "preToolUse", "matcher": "read", "action": { "type": "command", "command": "npm run lint" }, "timeout": 10 } ] }

The converter preserves array-form Hooks. It drops a Hook that V3 cannot represent and reports a warning instead of writing an invalid profile.

Current standalone file format

A standalone .kiro/hooks/*.json file wraps the same Hook definitions in a versioned document. Use PascalCase trigger names when you create or revise a standalone Hook:

json
{ "version": "v1", "hooks": [ { "name": "lint-before-read", "trigger": "PreToolUse", "matcher": "read", "action": { "type": "command", "command": "npm run lint" }, "timeout": 30, "enabled": true } ] }

Migrate tool matchers

In the V2 terminal UI, both the V2 and V3 engines can match an exact tool name or a shared tool group. The table uses the V2 names for each tool:

MatcherTools in the V2 group
readfs_read, grep, glob, code, introspect, tool_search
writefs_write, code
shellexecute_bash
webweb_fetch, web_search
subagentuse_subagent

The Classic engine treats read, write, shell, and subagent as aliases for one tool. It does not support the @mcp matcher or tag globs.

/upgrade-agent rewrites known CLI 2.x names to shared groups. For example, fs_read becomes read, and execute_cmd becomes shell. It warns when a group covers more tools than the old name. The fs_read rewrite also matches grep, glob, code, introspect, and tool_search.

Array-form matchers that are valid V3 tool IDs stay as authored. Kiro reports matchers that only one engine can evaluate.

Tool Hook input in the V2 engine

Tool Hooks running through the V2 engine receive tool_tags with tool_name and tool_input. Use the tags when a script should treat every tool in a group the same way:

json
{ "tool_name": "fs_read", "tool_tags": ["read", "@builtin"], "tool_input": {} }

The Classic and V3 engines do not send tool_tags.

Trigger reference

CLI V3 supports these Hook triggers in inline profiles and standalone files:

TriggerFires whenMatcher matchesCan block?
SessionStartA session beginsNot evaluatedNo
UserPromptSubmitThe user submits a promptNot evaluatedNo
PreToolUseBefore a tool executesTool name or groupYes
PostToolUseAfter a tool executesTool name or groupNo
PostFileCreateAfter Kiro creates a fileFile pathNo
PostFileSaveAfter Kiro saves or edits a fileFile pathNo
PostFileDeleteAfter Kiro deletes a fileFile pathNo
PreTaskExecBefore a spec task executesNot evaluatedYes
PostTaskExecAfter a spec task completesNot evaluatedNo
StopKiro finishes respondingNot evaluatedNo

For Stop, No means the Hook cannot reject an event with exit code 2. A CLI V3 Stop command Hook can exit with code 1 or return {"decision":"block","reason":"..."} to ask Kiro to continue for another turn. For UserPromptSubmit, No means CLI V3 sends the prompt regardless of the exit code; a non-zero exit forwards the Hook output and exit code to the agent as context instead of rejecting the prompt.

File triggers respond to changes made by Kiro, and task triggers wrap spec task execution. Existing Manual Hooks are an IDE 0.x feature; you cannot create a new Manual-trigger Hook. See Hook types for the cross-surface table.

Trigger name changes

CLI 2.x triggerV3 trigger
agentSpawnSessionStart
userPromptSubmitUserPromptSubmit
preToolUsePreToolUse
postToolUsePostToolUse
stopStop

Store workspace Hooks in .kiro/hooks/. To run the same V3 Hook in every workspace, place it in ~/.kiro/hooks/. Global and workspace Hooks run alongside each other. See the full Hooks reference → for schema details, locations, and action types.

Page updated: October 10, 2026
Permissions migration
Migrate an ACP client to CLI V3