V4 · Integration

Claude Code Integration.

Connect SuperLocalMemory to Claude Code via MCP and optional lifecycle hooks. Memories persist across sessions in a local SQLite store; hook behavior and recalled scope must be verified in the installed release.

V4 AGPL v3 MCP stdio Lifecycle hooks
Quick Start

Install, connect, verify.

Package installation is separate from configuration. Review and approve hook and MCP changes during setup, then run the integration contract.

1

Install SuperLocalMemory

Use pipx or uv with Python 3.11–3.14. Mode A does not require a model-provider key for its core path; optional modes and features have separate requirements.

terminal
pipx install superlocalmemory
slm setup
2

Connect to Claude Code

Run the connect command to review and apply the Claude Code MCP configuration and optional hook setup. Review each proposed change before confirming.

terminal
slm connect claude-code

Or configure manually — add the server to your Claude Code MCP settings:

MCP configuration
{
  "mcpServers": {
    "superlocalmemory": {
      "command": "slm",
      "args": ["mcp"]
    }
  }
}
3

Verify the connection

Restart Claude Code. Ask it to call get_status — you should see the active mode, profile, provider boundary, and store counts. Then run a remember → recall round trip.

terminal
slm status
# Expected: mode: A · provider: none · fact_count: 0
Lifecycle Hooks

Three hook points.

After explicit setup via slm connect claude-code, Claude Code can fire optional hooks at session lifecycle events. Inspect hook configuration, latency, and recalled evidence before relying on them.

SessionStart

Context at Session Open

SessionStart can inject bounded recalled context before the first message. Inspect scope, provenance, truncation, and failure behavior — recalled context is not a complete restore of all prior facts.

PostToolUse

Observe During Work

PostToolUse can observe supported tool events when configured. Verify event coverage, rate limits, redaction, and whether the captured event becomes durable memory. An observation is not automatically a confirmed fact.

Stop

Checkpoint at Session End

The Stop hook can generate a session summary with available git context. Verify the stored result and the failure path. The next session receives bounded recalled context — critical state should still be re-verified.

Hook failures are designed to be absorbed without blocking the Claude Code session. Verify timeout, error, and parallel-session behavior in the installed release. Run slm hooks remove to opt out and verify the resulting configuration.

Memory Scope

What persists and where.

Core memory state is SQLite-backed in the configured data root. Claude Code, optional providers, connectors, backups, proxies, and model downloads retain their own network behavior and require separate assessment.

Architecture Decisions

Project Structure

Folder conventions, module boundaries, dependency choices, and the reasoning behind them — stored explicitly and available for selective recall.

Conventions

Code Patterns

Naming patterns, formatting preferences, TypeScript strictness, import ordering, and testing conventions you store explicitly during sessions.

Session Context

Debugging History

Known issues, workarounds, edge cases investigated, and bugs fixed — available for selective recall across sessions, subject to retrieval quality.

Common Questions

Questions about Claude Code memory.

Mode A keeps the core memory-content path in the configured local data root. Claude Code, model downloads, backups, connectors, proxies, and optional providers can still use the network; assess the complete deployment.
After explicit setup, the SessionStart hook can inject bounded recalled context before the first message. Inspect omissions, provenance, truncation, and failure behavior. Retrieval is selective — not a promise that every prior fact will be loaded.
Run slm hooks remove to opt out and verify the resulting client configuration. You can still use the MCP tools directly in Claude Code without lifecycle hooks.
Documented clients can target the same configured SLM profile. Each client still needs install, identity, scope, remember, recall, update, forget, restart, upgrade, and uninstall verification.
Only when the client actually exposes the configured SLM tools to that subagent. Verify tool visibility and agent identity for each subagent type; a parent client configuration is not by itself proof of inheritance or shared scope.
Get started

Claude Code sessions,
with persistent context.

Install, connect, then verify the memory round trip in Claude Code before treating it as active.

Install V4.0 Architecture