Memory for Claude Code, Cursor & OpenCode — Persistent AI Agent Memory
Memory for Your Favorite AI Agent
Section titled “Memory for Your Favorite AI Agent”toon-memory gives persistent memory to the AI coding agents you already use. Whether you prefer Claude Code, Cursor, or OpenCode, your agent will remember everything between sessions.
Agent-Specific Setup
Section titled “Agent-Specific Setup”Claude Code
Section titled “Claude Code”Claude Code has full hook support with toon-memory:
{ "mcpServers": { "toon-memory": { "command": "npx", "args": ["-y", "toon-memory", "mcp"] } }}Hooks: SessionStart, PostToolUse, Stop — auto-reminders and context loading.
Cursor
Section titled “Cursor”Add MCP configuration to Cursor:
{ "servers": { "toon-memory": { "command": "npx", "args": ["-y", "toon-memory", "mcp"] } }}OpenCode
Section titled “OpenCode”Add to .opencode/opencode.json:
{ "mcp": { "toon-memory": { "type": "local", "command": ["npx", "-y", "toon-memory", "mcp"], "enabled": true } }}Plugin: .opencode/plugins/toon-memory.ts — SessionStart hooks via plugin.
Windsurf
Section titled “Windsurf”{ "servers": { "toon-memory": { "command": "npx", "args": ["-y", "toon-memory", "mcp"] } }}VS Code / Copilot
Section titled “VS Code / Copilot”Add to .vscode/mcp.json:
{ "servers": { "toon-memory": { "command": "npx", "args": ["-y", "toon-memory", "mcp"] } }}Codex CLI
Section titled “Codex CLI”Add to .codex/config.toml:
[mcpServers.toon-memory]command = "npx"args = ["-y", "toon-memory", "mcp"]Gemini CLI
Section titled “Gemini CLI”Add to .gemini/settings.json:
{ "mcpServers": { "toon-memory": { "command": "npx", "args": ["-y", "toon-memory", "mcp"] } }}Add to ~/.config/zed/settings.json:
{ "mcp_servers": { "toon-memory": { "command": "npx", "args": ["-y", "toon-memory", "mcp"] } }}Interactive Installer (Easiest)
Section titled “Interactive Installer (Easiest)”npx toon-memoryThe installer will:
- Detect which agents you have installed
- Ask which ones to configure
- Add MCP config automatically
What Each Agent Gets
Section titled “What Each Agent Gets”All agents get the same 35 MCP tools and 4 MCP resources:
memory_remember— Save decisions, patterns, bugsmemory_recall— Search memory (flat or graph mode)memory_smart_recall— Unified recall with BM25 + graph + qualitycontext_generate— Full project briefing in one callcontext_diff— What changed since last session- And 20 more tools…
Multi-Agent Support
Section titled “Multi-Agent Support”You can configure toon-memory for multiple agents simultaneously:
npx toon-memory# Select: claude, cursor, opencodeAll agents share the same memory file at .toon-memory/memory/data.toon.
Session Coordination
Section titled “Session Coordination”When running multiple agents in parallel:
memory_sessions()// 🧭 Active sessions (2):// • claude @ feature/auth (you)// • opencode @ feature/dbSee which files other sessions are touching to avoid conflicts.
Supported Agents (15+)
Section titled “Supported Agents (15+)”| Agent | Config Location | Hooks |
|---|---|---|
| OpenCode | .opencode/opencode.json |
Plugin-based |
| Claude Code | .claude/settings.json |
SessionStart + PostToolUse + Stop |
| Cursor | .cursor/mcp.json |
— |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
— |
| VS Code | .vscode/mcp.json |
— |
| Codex CLI | .codex/config.toml |
SessionStart + PostToolUse + Stop |
| Gemini CLI | .gemini/settings.json |
SessionStart + PostToolUse + Stop |
| Zed | ~/.config/zed/settings.json |
— |
| Cline | .cline/mcp.json |
— |
| Continue | .continue/config.json |
— |
| Antigravity | .gemini/config/mcp_config.json |
PreInvocation + PostToolUse + Stop |
| Aider | — | Instructions file |
| KiloCode | ~/.kilocode/mcp_settings.json |
— |
| OpenClaw | .openclaw.json |
— |
| Kiro | .kiro/settings/mcp.json |
— |
Get Started
Section titled “Get Started”npm install -g toon-memorynpx toon-memory # Interactive installerSee the Supported Agents page for detailed configuration.