Skip to content
Data
Hook

Hooks

What memx runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

From plugin
memx
4651 skill12 hooks1 MCP
Install
$ npx -y skills add NeoLi00/memX --agent claude-code

Ships with memx. Installing the plugin gets these hooks.

What fires, and when

SessionStart

Fires once when a session begins, and again after a context compaction. It is where a plugin sets up its environment, or restores state the compaction dropped.

  • node "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code SessionStart

UserPromptSubmit

Fires before Claude sees each prompt you send. A plugin can use it to inject context, so the same instruction reaches the model every turn instead of only at session start.

  • node "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code UserPromptSubmit

PreToolUse

  • MatchesEdit|Write|Read|Glob|Grepnode "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code PreToolUse

PostToolUse

  • node "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code PostToolUse

PostToolUseFailure

  • node "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code PostToolUseFailure

PreCompact

  • node "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code PreCompact

SubagentStart

  • node "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code SubagentStart

SubagentStop

  • node "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code SubagentStop

Notification

  • node "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code Notification

TaskCompleted

  • node "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code TaskCompleted

Stop

  • node "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code Stop

SessionEnd

  • node "${CLAUDE_PLUGIN_ROOT}/dist/.runtime/src/bin/memx-hook.mjs" claude-code SessionEnd
Read hooks/hooks.json
Ships withmemx

memX: self-learning, self-maintaining memory plugin for AI agents; native support for claude code, codex, and openclaw

Get the whole plugin
Stats
465
Stars
2
Forks
Maintained
Maintenance
TypeScript
Language
MIT
License
2mo ago
Last commit
3mo ago
Created

Repo: NeoLi00/memX