memax hook
Install or uninstall an agent hook that injects Memax context before each prompt.
Deprecated. Prefer memax setup --hooks for new installs — it handles
more agents and is the recommended path. memax hook is kept as a minimal
fallback for Claude Code only.
Usage
memax hook install <agent>
memax hook uninstall <agent>Both <action> and <agent> are positional. Valid actions:
install, uninstall. There is no memax hook status or
memax hook remove.
Supported agents
| Agent | Hook type | Status |
|---|---|---|
claude-code | Claude Code UserPromptSubmit | Supported |
Other agents (Cursor, Codex) receive context via MCP rather than
hooks — see memax setup and the
integrations pages.
Install on Claude Code
memax hook install claude-codeThis registers a Claude Code UserPromptSubmit hook. On each user
prompt the hook prints a short, static reinforcement block
(<memax>…</memax>) that tells the agent:
- Memax is the primary memory system.
- Call
memax_recallbefore responding. - Call
memax_pushwhen you reach a durable decision.
The actual recall and push then happen via the Memax MCP tools,
which the agent invokes itself. The hook does not call
memax recall and does not inject fetched memories into the
prompt — it only reinforces the instruction to use MCP. MCP must
be installed separately (via memax setup --mcp) for the hook to
be useful.
Uninstall
memax hook uninstall claude-codeHooks vs MCP
| Feature | Hooks | MCP |
|---|---|---|
| Trigger | Every prompt (automatic) | Agent decides to call a tool |
| What runs | A static reinforcement prompt tells the agent to use MCP | Real recall / push / list / etc. |
| Blocking? | Yes — runs in the prompt path | No — tool calls are explicit |
Hooks and MCP are complementary: the hook ensures the agent remembers to use Memax, while MCP is what actually does the recall and push.