Claude Code integration

Claude Code that remembers your repo.

@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.

What you get

Session-start recall

The SessionStart hook queries Remnic with your project context and injects the result before Claude sees the first message.

Per-prompt recall

Every user message fires UserPromptSubmit. Remnic runs a minimal-mode recall with the prompt as the query and injects the top matches inline.

Edit-time observe

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.

MCP tools and skills

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.

Install

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.

Manual wiring: the exact hook list, the .mcp.json block, and the plugin-load steps live in the package README.

Memory skills

The plugin ships skills you can invoke directly in a Claude Code chat.

CommandDescription
/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-entitiesList tracked entities: people, projects, tools.
/remnic-statusShow Remnic connection status and memory stats.

Cross-project memory in action

The killer benefit is that memories from one project surface in another without you doing anything:

  1. You fix a tricky Zod optional().nullable() bug in Project A.
  2. Remnic extracts: "Zod optional fields must use .optional().nullable(), not just .optional()".
  3. Later, in Project B, you start writing a Zod schema.
  4. The UserPromptSubmit hook recalls the memory. Claude sees it in additionalContext before you ask.
  5. The bug never happens again.

Project-scoped and procedural memory

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.

Troubleshooting

No memories appearing in additionalContext

Check ~/.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.

Per-turn recall feels slow

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.

Token not found

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".