Skip to main content

Hooks

chat-recall init and chat-recall install-hooks install these hooks. The MCP server installs missing hooks when it starts. A tool whose folder is not on the machine gets nothing.

Claude Code​

Registered in settings.json of each Claude profile (~/.claude and each ~/.claude-* with a projects folder).

EventHookWhat it doesOpt out
SessionStart (startup, clear)wake-upAdds the wake-up bundle of the project--no-wakeup
UserPromptSubmitresume hintSearches for similar past sessions and adds a note when one exists--no-resume-hint
StopsaveSaves topics, decisions and tools to ~/.chat-recall/memory/—
PreCompactsaveSaves before Claude Code compacts the context—
SessionEndescalateAdds the session's decisions and outcome to the knowledge graph, in the background--no-escalate
PreToolUse (shell, edit, write)decision guardChecks the call against the decision register--no-guard
UserPromptSubmit, SessionEndtask boardClaims a board card when a prompt names its id, and closes it at the end of the session--no-task-board
SessionStart, UserPromptSubmit, Stop, SessionEndmessagesReports the session, delivers waiting messages--no-messages
SessionStart, UserPromptSubmit, Stop (background)message waiterWaits for a message and wakes the session, also when it is idle--no-messages

On Windows, the five shell hooks (save, resume hint, escalate, wake-up and guard) are not installed, because Claude Code runs hooks through cmd.exe. The task board and message hooks install on every platform.

Other AI tools​

ToolFileMessage hookDecision guard
Codex~/.codex/hooks.jsonSessionStart, UserPromptSubmit, Stop, SessionEndPreToolUse
Antigravity~/.gemini/config/hooks.jsonSessionStart, PreInvocation (first call of a turn), StopPreToolUse
Cursor~/.cursor/hooks.jsonsessionStart, beforeSubmitPrompt, stop, sessionEndbeforeShellExecution, afterFileEdit
OpenCode~/.config/opencode/plugins/plugin chat-recall-messages.js, with a waiter that wakes an idle session; the package chat-recall-tui/ next to it registers an OpenCode window before it has a session, so a message to its folder becomes its first promptplugin chat-recall-guard.js
pi~/.pi/agent/extensions/extension chat-recall-messages.js, with a waiter that wakes an idle session—

The other tools run the hooks through scripts in ~/.chat-recall/hooks/. On Windows, these scripts are not installed.

Codex runs a new hook only after you approve it with /hooks in Codex.

When each tool delivers a message is in Run sessions that work together.

Commands​

CommandEffect
chat-recall install-hooksInstall or repair all hooks
chat-recall install-hooks --no-<hook>Install all hooks except the named ones
chat-recall install-hooks --uninstallRemove every chat-recall hook; the MCP server then leaves them out
chat-recall doctorShow the hooks of each tool and profile

Each install replaces only chat-recall's own entries. Hooks of other programs in the same files stay.

Environment variables​

VariableEffect
CHAT_RECALL_MESSAGE_HOOK=0Turns the message hook off
CHAT_RECALL_MESSAGE_HOOK_DEBUG=1Writes the reason for each silent exit of the message hook to stderr
CHAT_RECALL_GUARD=0Turns the decision guard off
CHAT_RECALL_GUARD_ENFORCE=1Makes the decision guard block instead of warn
CHAT_RECALL_WAKEUP_TIMEOUTSeconds before the wake-up hook gives up (default 10)