Reference
Hook events
Hook events
ist _hook <event> receives JSON on stdin from the engine and answers on stdout. The --engine flag says which engine fired it (claude-code, codex, ollama or cursor).
| Event | When it fires | What Istari does |
|---|---|---|
session-start | A new engine session starts, resumes, or is compacted | Create or reuse the Istari session, detect the ticket, inject knowledge, related work, graph hint and handover notes |
user-prompt-submit | You send a prompt | Budget and context-pressure gate, trust and mirror words, feed verbs and alerts, memory recall, Discord messages, cost hints |
pre-tool | Before any tool call | Write boundary, exfiltration block, rulebook outward gate, danger gate, pause gate, surface gate, placement nudge |
post-tool | After a tool call | Registry, budget, loop detector, confidence gate, checkpoints, snapshots, stats, graph dirtiness, activity streaming |
post-tool-failure | A tool call failed | Feed the loop detector |
permission-request | The engine shows a permission prompt | Auto-answer from the trust level (interactive, supervised, autonomous, silent) |
notification | The engine needs attention | Route the notice to Discord or Slack |
stop | The engine finished responding | Quality gate for the turn |
subagent-start / subagent-stop | A subagent starts or ends | Track subagents so orphan guards stay accurate |
task-created / task-completed | An engine task is created or done | Task lifecycle tracking |
pre-compact / session-end | Context is about to be lost | Preserve capture opportunities (ledger nudge, memory save) |
session-stop / session-stop-bg | Session ends | Mark complete, then run learning capture, memory save and ingest in a detached background process |
Feed actions handled inside the hook: open-url, spawn-pick, spawn-watch-pr, dismiss, snooze, mark-delivered, set-dnd, inject-inbox, inject-brief, inject-sources, audit-log, pause-pr, unpause-pr.