Skip to content
Development
Hook

Hooks

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

From plugin
tencentdb-agent-memory
118 skills1 agent2 commands5 hooks
Install
> /plugin marketplace add baodq97/tencentdb-agent-memory
> /plugin install tencentdb-agent-memory@tencentdb-agent-memory

Ships with tencentdb-agent-memory. Installing the plugin gets these hooks.

What fires, and when

PreToolUse

  • MatchesBashnode ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/on_pre_tool.js

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}/hooks/scripts/on_session_start.js

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}/hooks/scripts/on_user_prompt.js

Stop

  • node ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/on_stop.jsnode ${CLAUDE_PLUGIN_ROOT}/scripts/memory_pipeline.js

SessionEnd

  • node ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/on_session_end.js
Read hooks/hooks.json
Ships withtencentdb-agent-memory

Four-layer long-term memory (L0 Conversation → L1 Atom → L2 Scene → L3 Persona) for Claude Code, inspired by Tencent/TencentDB-Agent-Memory. Fully local — no external Gateway, no paid API, no Python.

Get the whole plugin, auto-invoked