Skip to content

Memory for Claude Code, Cursor & OpenCode — Persistent AI Agent Memory

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.

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.

Add MCP configuration to Cursor:

{
"servers": {
"toon-memory": {
"command": "npx",
"args": ["-y", "toon-memory", "mcp"]
}
}
}

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.

{
"servers": {
"toon-memory": {
"command": "npx",
"args": ["-y", "toon-memory", "mcp"]
}
}
}

Add to .vscode/mcp.json:

{
"servers": {
"toon-memory": {
"command": "npx",
"args": ["-y", "toon-memory", "mcp"]
}
}
}

Add to .codex/config.toml:

[mcpServers.toon-memory]
command = "npx"
args = ["-y", "toon-memory", "mcp"]

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"]
}
}
}
Terminal window
npx toon-memory

The installer will:

  1. Detect which agents you have installed
  2. Ask which ones to configure
  3. Add MCP config automatically

All agents get the same 35 MCP tools and 4 MCP resources:

  • memory_remember — Save decisions, patterns, bugs
  • memory_recall — Search memory (flat or graph mode)
  • memory_smart_recall — Unified recall with BM25 + graph + quality
  • context_generate — Full project briefing in one call
  • context_diff — What changed since last session
  • And 20 more tools…

You can configure toon-memory for multiple agents simultaneously:

Terminal window
npx toon-memory
# Select: claude, cursor, opencode

All agents share the same memory file at .toon-memory/memory/data.toon.

When running multiple agents in parallel:

Terminal window
memory_sessions()
// 🧭 Active sessions (2):
// claude @ feature/auth (you)
// opencode @ feature/db

See which files other sessions are touching to avoid conflicts.

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
Terminal window
npm install -g toon-memory
npx toon-memory # Interactive installer

See the Supported Agents page for detailed configuration.