ITADN

feat: Hooks (Claude Code-style lifecycle hooks)

#5300Closedf-mofujiwara 创建于 2026-06-20
F
f-mofujiwaracommented
## What Calidern doesn't have lifecycle hooks yet. Claude Code's pattern works well: - `UserPromptSubmit` — fires when user hits Enter, before the message goes to the LLM. Can mutate or block. - `PreToolUse` / `PostToolUse` — fires around each tool call. Useful for audit logs, permission gating, redaction. - `Stop` — fires when the model finishes its turn. Can chain further actions. ## Suggested shape - Hooks live as executable scripts under `~/.calider/hooks/<event>/*.sh` (or `.calider/hooks/...` for project-scoped). - Calidern invokes them in alphabetical order, passing the relevant payload via stdin (JSON) and env vars. - Non-zero exit blocks the event (for UserPromptSubmit + PreToolUse). - Output on stdout is shown to the user; stderr is logged. ## Why later (not tonight) Orthogonal to all the existing machinery — no rush, and the surface is large enough to deserve its own design pass.
关闭于 2026-06-20 1 条评论