Agent Memory
Hook
Hooks
What mega-brain runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.
Install
> /plugin marketplace add guhcostan/claude-mega-brain > /plugin install mega-brain@mega-brain
Ships with mega-brain. 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.
- Matches
startup|clear|compact"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd" session-start
PostToolUse
- Matches
Read"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd" run-python "${CLAUDE_PLUGIN_ROOT}/scripts/inject-links.py"
Ships withmega-brain
Loads the knowledge. Skips the search. 100% accuracy · 0 tool calls · −66% tokens vs Obsidian+MCP Real agentic sessions. Benchmark →
Get the whole plugin

