Dev.to
8/1/2026

MemoFS: Adding persistent memory to AI coding agents via hooks, MCP, and SDK
Original: Supercharging AI Coding Agents & Custom Agent Runtimes with Persistent Memory: A Detailed Cookbook
Short summary
MemoFS is an open-source, file-first memory runtime for AI coding agents that injects project context at session start, propagates memory to subagents, and re-injects after context compaction. It supports three integration patterns: lifecycle hooks for Claude Code/Codex/OpenCode, MCP server for Cursor/Copilot/Windsurf, and a TypeScript SDK for custom agent runtimes. Setup takes under two minutes via npm.
- •MemoFS provides persistent memory for AI coding agents across sessions, subagents, and context compaction
- •Three integration modes: hooks (Claude Code/Codex), MCP server (Cursor/Copilot), and SDK (custom runtimes)
- •Open-source, file-first, setup in under two minutes — but content is partly promotional for the tool
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



