Session-start recall
The SessionStart hook queries Remnic with the project
name and injects the result as additionalContext before
Claude sees the first message.
@remnic/plugin-claude-code plugs Remnic directly into Claude Code
via four lifecycle hooks. Every session starts with your project context.
Every prompt recalls relevant memories. Every edit teaches Remnic something
new. The agent never has to choose to remember — memory is structural.
The SessionStart hook queries Remnic with the project
name and injects the result as additionalContext before
Claude sees the first message.
Every user message fires UserPromptSubmit. Remnic runs a
minimal-mode recall (20s timeout) with the prompt as the query and
injects the top matches inline.
The Stop hook runs after each assistant turn. It sends
only the new messages to /engram/v1/observe in the
background. Never blocks Claude.
When the session exits, SessionEnd flushes anything the
Stop cursor didn't capture and cleans up. Nothing is lost.
# 1. Install Remnic if you haven't already
npm install -g @remnic/cli && remnic daemon install
# 2. Install the Claude Code connector
remnic connectors install claude-code
The connector installs the plugin to Claude Code's plugin directory,
wires up the four hooks, generates a dedicated auth token, configures
MCP at http://localhost:4318/mcp, and runs a health check.
Restart Claude Code to pick up the new hooks.
~/.claude/settings.json block live in the
integration guide.
| Command | Description |
|---|---|
/engram:remember <text> | Store a memory explicitly ("I prefer tabs over spaces"). |
/engram:recall <query> | Search memories ("what do I know about auth?"). |
/engram:search <query> | Full-text search across all memories. |
/engram:entities | List tracked entities — people, projects, tools. |
/engram:status | Show Remnic connection status and memory stats. |
The killer benefit is that memories from one project surface in another without you doing anything:
optional().nullable() bug in Project A..optional().nullable(), not just .optional()".UserPromptSubmit hook recalls the memory. Claude sees it in additionalContext before you ask.additionalContextCheck ~/.claude/logs/engram-session-recall.log and
~/.claude/logs/engram-user-prompt-recall.log. Prompts
shorter than 4 words are skipped. Confirm the daemon is up with
remnic daemon status.
UserPromptSubmit uses minimal mode with a 20s timeout.
If it's still too slow, raise the PROMPT_WORD_COUNT
threshold in the hook script or reduce topK from 8 to 4.
If Claude Code is launched from the Dock or Spotlight rather than a
terminal, it doesn't inherit shell variables. Either add the export to
~/.zprofile or run
launchctl setenv OPENCLAW_ENGRAM_ACCESS_TOKEN "your-token".