Answer: You use the Shell Command action, which lets you define a shell command that is executed each time the hook is triggered. If the command returns an exit code of "0", its stdout output is added to the agent's context; otherwise the stderr output is sent to the agent and the agent is notified that the hook returned an error. Status: Confirmed Entry: tool/kiro/agents-and-automation/shell-command-action Revision: 1 Digest: sha256:146d388450f38fe3 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:41:59Z Last changed: 2026-11-13T03:41:59Z Last verified: 2026-11-20T13:28:25Z Next check: 2026-11-21T13:28:25Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Unit | Source | As of action | Shell Command | | [1] | 2026-11-20 success exit code | 0 | | [1] | 2026-11-20 default timeout | 60 seconds | seconds | [1] | 2026-11-20 timeout disable value | 0 | | [1] | 2026-11-20 Sources: [1] Amazon Web Services. "Hook actions - Hooks - Features - Docs - Kiro". https://kiro.dev/docs/hooks/actions/ Role: primary. Accessed: 2026-11-20T13:28:25Z Quote: "Shell Command action With this action, you can define a shell command that is executed each time the hook is triggered." (Supports: action) Quote: "If the command returns an exit code of "0" indicating success, the stdout output of the command is added to the agent's context." (Supports: success exit code) Quote: "The default timeout is 60 seconds." (Supports: default timeout) Quote: "Set to 0 to disable the timeout." (Supports: timeout disable value) Published: 2026-11-20T07:39:25Z Snapshot SHA-256: 8b8fa662f63b0a2518d07f9b32e18d0f88fd6607db9359d451cb9a3bdf370aa8 (captured 2026-11-20T13:28:24Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T13:28:25Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:28:25Z Last attempt: 2026-11-20T13:28:25Z Notes and limitations: Extracted automatically from a single official source (section "Shell Command action"). Related: https://latestn.com/tool/kiro/agents-and-automation/start-a-session How do I start a session in Kiro? https://latestn.com/tool/kiro/agents-and-automation/start-agent-session How do I start a session with the Kiro web agent? https://latestn.com/tool/kiro/agents-and-automation/start-subagent-dashboard-cli How do I start a subagent in Kiro Crew from the dashboard or the CLI? https://latestn.com/tool/kiro/agents-and-automation/set-up-hooks How do I set up hooks in Kiro? https://latestn.com/tool/kiro/agents-and-automation/set-up-scheduled-activity How do I set up scheduled activity for a Kiro bot? https://latestn.com/tool/kiro/agents-and-automation/share-hook-configurations How do I share Kiro hook configurations with my team? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:41:59Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/kiro/agents-and-automation/shell-command-action/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/kiro/agents-and-automation/shell-command-action POST: https://latestn.com/dispute/tool/kiro/agents-and-automation/shell-command-action with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/kiro/agents-and-automation/shell-command-action?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I run a shell command from a Kiro hook? Revision 1, last verified 2026-11-20T13:28:25Z. https://latestn.com/tool/kiro/agents-and-automation/shell-command-action (accessed 2026-11-21T09:57:37Z). @misc{LatestN_tool_kiro_agents_and_automation_shell_command_action_r1, title = {How do I run a shell command from a Kiro hook?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/kiro/agents-and-automation/shell-command-action}}, note = {Revision 1; digest sha256:146d388450f38fe3; last verified 2026-11-20T13:28:25Z; accessed 2026-11-21T09:57:37Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/kiro/agents-and-automation/shell-command-action