Hooks and commands cheat sheet

Hook file

{ "version": "v1",
  "hooks": [{
    "name": "x", "trigger": "PreToolUse", "matcher": "shell",
    "action": { "type": "command", "command": "./guard.sh" },
    "timeout": 60, "enabled": true }] }
PlaceScope
Agent hooks arrayOne agent
.kiro/hooks/*.jsonWorkspace
~/.kiro/hooks/*.jsonGlobal

Triggers: SessionStart, UserPromptSubmit (CLI cannot block), PreToolUse (can block), PostToolUse, Stop, SessionEnd, PreCompact, PostCompact, PostFileCreate, PostFileSave, PostFileDelete, PreTaskExec, PostTaskExec. v2 camelCase names are accepted aliases. Matchers: read write shell web spec, @builtin @mcp @server @server/tool, wildcard, or regex. Source: Hook types.

Slash commands and flags seen so far

CommandPurpose
/upgrade-agent, /upgrade-agent diagnosticsConvert v2 agents; list warnings
/permissions, /tools trust-allPolicies; session-wide trust
/hooks, /configVerify loaded hooks and config
/tangent [name|ls|root|merge]Side conversations
/rewindFork conversation from an earlier turn
/sessionsBrowse, bookmark, rename sessions
/spec new <name>Start a spec
/workflow run <recipe> --input valueRun a workflow (needs chat.enableWorkflows)
/memories, /voiceCross-session memory; voice input
kiro-cli --cloudCloud session
kiro-cli --v2One run on the v2 harness