DEV Community

Alfredo Izquierdo
Alfredo Izquierdo

Posted on • Originally published at contextforge.dev

Give Your AI Coding Agent a Memory That Survives Every Session

Open a new session with Claude Code, Cursor, or Copilot and it has no idea what you were doing yesterday. Your stack, your decisions, the bug you spent an hour explaining — gone. So you re-explain. Again.

The root cause is simple: your AI's memory only lasts one conversation. Close the terminal and it's wiped.

ContextForge fixes that. It's an MCP server that gives any AI agent a permanent, searchable memory that carries across every session and every project. Below is the full setup — it takes three commands.

The walkthrough uses Claude Code as the example, but the same setup works for Cursor, ChatGPT, Claude Desktop, Windsurf, and GitHub Copilot.

📺 Watch the full walkthrough

▶️ Watch the setup on YouTube →

The setup, in three commands

1. Install the MCP server

npm install -g contextforge-mcp
Enter fullscreen mode Exit fullscreen mode

2. Connect it to your editor — the wizard asks for your API key (grab a free one at contextforge.dev):

npx contextforge-setup
Enter fullscreen mode Exit fullscreen mode

3. Initialize your project — this is the step people skip:

npx contextforge-mcp init
Enter fullscreen mode Exit fullscreen mode

That last command writes a small rules file (CLAUDE.md for Claude Code, .cursorrules for Cursor) that tells your AI to use ContextForge for memory. Without it, your agent silently falls back to its built-in memory and ignores ContextForge — even though the server is connected.

The payoff

Once it's connected, you just talk to your agent like normal:

"Remember this is a todo app with Next.js and Supabase, deployed on Vercel. Save it to memory."

It stores that as a real, searchable memory — not in the chat, in a permanent store. Plant a couple of tasks the same way, then close the terminal and open a brand-new session:

"Let's start working on this project. What do I have pending?"

And it knows. New session, clean slate, and your agent already has your stack, your context, and your open tasks — no re-explaining. You can browse everything in the dashboard, organized by project.

Try it

ContextForge has a free tier — no credit card. Give your AI a memory that actually sticks:

👉 Get started at contextforge.dev

Works with Claude Code, Cursor, ChatGPT, Claude Desktop, Windsurf, and GitHub Copilot.

Top comments (3)

Collapse
 
kcarriedo profile image
Kyle Carriedo

The "session ends, context gone" problem is real. One wrinkle I've hit that's adjacent to this: when you're running more than one Claude Code session at a time (worktrees, agent teams, or just two separate tasks), the shared memory problem gets worse -- each session is also unaware of what the other sessions are doing right now. The ContextForge approach works for single-session history, but the multi-session coordination case needs a shared state layer that's live, not just historical. Something that knows "session A is currently working on the auth module" so session B doesn't step on it.

The memory-survives-session piece is necessary but not sufficient for anyone running parallel sessions. Worth considering that as a follow-on.

Collapse
 
alfredoizjr profile image
Alfredo Izquierdo

Thanks Kyle, you nailed it. Funny enough, this is exactly what I've been working on: a live presence layer so parallel sessions can see what each other is doing right now, not just what happened before. It's coming in one of the next releases, I'll ping you right here when it ships. Comments like this one are gold, I appreciate you taking the time 🙌

Collapse
 
alfredoizjr profile image
Alfredo Izquierdo

Update: it shipped! 🎉

Session Presence is now live in ContextForge. Every Claude Code session registers a live heartbeat with what it's currently working on, so parallel sessions (worktrees, agent teams, or just two terminals) can see each other in real time — session B now knows "session A is working on the auth module" before stepping on it. Exactly the shared live-state layer you described, on top of the historical memory.

I wrote up the full story (including how this comment kicked it off): contextforge.dev/blog/one-develope...

Docs, if you want to try it: contextforge.dev/docs/session-pres...