Session-start recall
The SessionStart hook queries Remnic with your
project context and injects the result before Claude sees the first
message.
@remnic/plugin-claude-code plugs Remnic into Claude Code
through its session hooks. Sessions start with your project context,
each prompt recalls relevant memories, and every edit is observed for
later extraction. Recall is wired into the hooks, so the agent does not
have to ask for it.
The SessionStart hook queries Remnic with your
project context and injects the result before Claude sees the first
message.
Every user message fires UserPromptSubmit. Remnic runs
a minimal-mode recall with the prompt as the query and injects the top
matches inline.
The PostToolUse hook runs after Write, Edit, and
MultiEdit tools. It sends the change to Remnic in the background for
extraction. It never blocks Claude.
The plugin registers the Remnic MCP tool surface plus memory skills and a memory-review agent, so recall, store, and entity lookup are also available on demand.
Three steps, each writing to a different place. Start the Remnic daemon first, then wire Claude Code to it.
# 1. Install Remnic and start the daemon
npm install -g @remnic/cli && remnic daemon install
# 2. Mint a Claude Code token and record the connector
remnic connectors install claude-code
# 3. Install the plugin, then load it through Claude Code
npm install -g @remnic/plugin-claude-code
Step 2 writes Remnic-side connector state and a bearer token. It does
not edit Claude Code's config. Between steps 2 and 3, paste the
.mcp.json block from the package README into Claude Code's
MCP config, pointing it at http://localhost:4318/mcp with
that token. Load the plugin through Claude Code's plugin loader, then
restart Claude Code so the hooks fire.
.mcp.json block, and the plugin-load steps live in the
package README.
The plugin ships skills you can invoke directly in a Claude Code chat.
| Command | Description |
|---|---|
/remnic-remember <text> | Store a memory explicitly ("I prefer tabs over spaces"). |
/remnic-recall <query> | Recall memories ("what do I know about auth?"). |
/remnic-search <query> | Full-text search across all memories. |
/remnic-entities | List tracked entities: people, projects, tools. |
/remnic-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.The session-start hook detects your git repository and scopes memory to that project, so what Claude learns in one repo does not surface in another. Global facts, such as a library's behavior or your own preferences, still carry across projects. Remnic also captures procedural memory: multi-step runbooks distilled from your work, on by default outside the conservative preset. More detail is on the coding agents page.
additionalContextCheck ~/.remnic/logs/remnic-session-recall.log and
~/.remnic/logs/remnic-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_REMNIC_ACCESS_TOKEN "your-token".