Claude Code
Plugin for Claude Code with lifecycle hooks. Reads your Working Memory at session start, searches when relevant, and saves insights at the right moment.
claude plugin marketplace add nowledge-co/community && claude plugin install nowledge-mem@nowledge-communityPlugin-Native
Claude Code supports plugins -- install once for built-in autonomous behavior. No system prompts or MCP configuration needed.
Your agent searches what you know, saves what matters -- without you asking.
Your first success state
Install the plugin, make sure nmem is available, start a new Claude Code session, and verify one real behavior: Working Memory loads at session start, or /search / /save works without extra wiring.
Before You Start
- Nowledge Mem running locally (installation) or a reachable remote Mem server
- Claude Code installed
Setup
Install the plugin
# Add the Nowledge community marketplace
claude plugin marketplace add nowledge-co/community
# Install the Nowledge Mem plugin
claude plugin install nowledge-mem@nowledge-communityThe plugin requires nmem CLI:
# Option 1 -- uvx (no installation needed)
curl -LsSf https://astral.sh/uv/install.sh | sh
uvx --from nmem-cli nmem --version
# Option 2 -- pip
pip install nmem-cliIf the Nowledge Mem desktop app is on this machine, the safest path is Settings → Preferences → Developer Tools → Install CLI. For remote-only machines without the desktop app, use
uvxor install manually.
Use slash commands and skills
Slash commands:
/save-- Save the current session to Nowledge Mem/sum-- Distill insights from this conversation/search <query>-- Search your knowledge base/status-- Check server connection and status
Natural language: Say "Save this session" or "Distill this conversation" and Claude runs the right nmem command automatically.
Autonomous (skills): The plugin includes three skills that run on their own:
- Read Working Memory -- loads your daily briefing at session start and after context compaction
- Search Memory -- searches when you reference past work
- Distill Memory -- suggests distillation at breakthrough moments
On request: Save Thread -- saves sessions when you ask ("save this session", "checkpoint this")
Update the plugin:
claude plugin marketplace update
claude plugin update nowledge-mem@nowledge-community
# Restart Claude Code to apply changesCustomize Safely
Use Claude Code's own memory files, not the installed plugin directory:
CLAUDE.local.mdfor your personal tweaks that should survive updatesCLAUDE.mdfor repo-shared rules
Do not edit the installed Nowledge Mem plugin files directly. For the full host-by-host map, see Customize Integration Behavior.
Lifecycle Hooks
The plugin uses Claude Code hooks for automatic lifecycle management:
| Event | Trigger | Action |
|---|---|---|
SessionStart (startup/resume/clear) | New session, resume, or clear | Loads Working Memory via nmem wm read (API), falls back to local file |
SessionStart (compact) | After context compaction | Re-loads Working Memory + prompts Claude to checkpoint progress |
UserPromptSubmit | Every user message | Injects search/save syntax as context Claude can see |
PreCompact | Before manual or automatic compaction | Saves the exact Claude Code session before context is compressed |
Stop | Model finishes responding | Captures session to knowledge graph with a bounded retry window |
Working Memory context is refreshed after compaction. The PreCompact hook saves the full local transcript before Claude Code compresses it, and the Stop hook keeps normal turn-by-turn capture running even when Nowledge Mem runs on a different machine (remote mode). If Claude Code needs a moment to flush the transcript file after a response, the hook waits and retries instead of reporting a silent no-op save.
If the desktop app's Claude Code file watcher is also enabled, you can leave it on. The watcher and plugin hooks converge on the same claude-code-<sessionId> thread, so repeated saves update the existing thread instead of creating a second one.
Local vs Remote
The plugin works transparently in both modes:
- Local (Mem on same machine): Working Memory read through Mem. The plugin keeps
~/ai-now/memory.mdonly as the Default-space compatibility fallback when the API path is unavailable. Sessions are captured by the desktop app file watcher, the Stop hook, and the PreCompact hook before context compression. - Remote (Mem on different machine): configure this machine once:
nmem config client set url https://your-server
nmem config client set api-key your-keyThat writes the shared local client config used by nmem and the plugin. You can still use environment variables (NMEM_API_URL, NMEM_API_KEY) for temporary overrides. Priority: CLI flags > env vars > config file > defaults.
When the Stop or PreCompact hook runs nmem t save --from claude-code, Claude's session files are read locally on the machine running Claude Code, then uploaded to Mem as normalized thread messages. By default that means ~/.claude, but if you've moved Claude's config, CLAUDE_CONFIG_DIR is used automatically. The remote Mem server does not need direct access to that local folder.
Go Further
AGENTS.md -- a complete memory-keeper agent example using the agents.md standard. Works with any AI coding agent.
Related
- Integrations overview -- native integrations, reusable packages, MCP, and browser capture
- Claude Desktop · Codex CLI · Alma · OpenClaw · Raycast · Other Chat AI
ChatGPT Web and Desktop
Connect ChatGPT to Nowledge Mem with the browser extension for capture, or Remote MCP over OAuth so ChatGPT Web and desktop can search your Mem directly.
Claude Desktop
One-click memory extension for Claude Desktop on macOS and Windows. Save, search, and update your knowledge base in any conversation.