Memory for AI Coding Agents — Persistent Memory That Survives Sessions
Why AI Coding Agents Need Memory
Section titled “Why AI Coding Agents Need Memory”AI coding agents like Claude, Cursor, and OpenCode are powerful — but they have a critical limitation: no memory between sessions.
Every time you start a new session, your agent:
- Forgets the architecture decisions from yesterday
- Doesn’t remember the bug fixes you discovered
- Can’t recall the patterns your team established
- Has to re-learn your project from scratch
This wastes tokens, burns time, and leads to frustrating repetition.
The Solution: Persistent Memory for AI Agents
Section titled “The Solution: Persistent Memory for AI Agents”toon-memory gives your AI coding agent a persistent memory that:
- Survives restarts — memory persists across sessions
- Works offline — no cloud, no API calls, no LLM needed
- Saves tokens — 22% fewer tokens than JSON
- Scales — 80% fewer tool calls per session
- Works everywhere — 15+ agents supported
What Can AI Agents Remember?
Section titled “What Can AI Agents Remember?”Decisions
Section titled “Decisions”memory_remember({ category: "decision", key: "use-zod", content: "Use Zod for validation — simpler than Joi, better TS support"})Bug Fixes
Section titled “Bug Fixes”memory_remember({ category: "bug", key: "redis-pool-fix", content: "Redis pool exhaustion — fix was max_connections=20"})Patterns
Section titled “Patterns”memory_remember({ category: "pattern", key: "api-versioning", content: "Always use /api/v1/ prefix for REST endpoints"})Knowledge
Section titled “Knowledge”memory_remember({ category: "knowledge", key: "deploy-process", content: "Deploy script lives in scripts/deploy.sh, runs on CI merge to main"})How Memory Improves AI Agent Performance
Section titled “How Memory Improves AI Agent Performance”| Metric | Without Memory | With toon-memory | Improvement |
|---|---|---|---|
| Tokens per session | 2,411 | 972 | -60% |
| Tool calls per session | 25 | 5 | -80% |
| Cost per session (GPT-4) | $0.072 | $0.029 | -60% |
| Context reconstruction | Manual | Automatic | 100% |
Memory Features
Section titled “Memory Features”- 35 MCP tools — remember, recall, forget, stats, summary, archive, diff, suggest, smart_recall, encrypt, decrypt, and more
- Graph-aware recall — connects related entries with links and references
- Quality scoring — automatically rates entry quality (0-1)
- Merge-dedup — saves with the same key, merges automatically
- TTL — entries can expire after 7d, 30d, or custom dates
- Encryption — AES-256-GCM for sensitive data
Supported Agents
Section titled “Supported Agents”toon-memory works with 15+ AI coding agents:
- OpenCode — Plugin-based, SessionStart hooks
- Claude Code — Full hook support (SessionStart, PostToolUse, Stop)
- Cursor — MCP configuration
- Windsurf — MCP configuration
- VS Code / Copilot — MCP configuration
- Codex CLI — TOML config + hooks
- Gemini CLI — JSON config + hooks
- Zed — JSONC config
- And more — Cline, Continue, Antigravity, Aider, KiloCode, OpenClaw, Kiro
Get Started
Section titled “Get Started”npm install -g toon-memorynpx toon-memory # Interactive installerYour agent will have persistent memory in the next session.