cd /news/ai-tools/i-built-persistent-memory-for-ai-cod… Β· home β€Ί topics β€Ί ai-tools β€Ί article
[ARTICLE Β· art-24442] src=dev.to β†— pub= topic=ai-tools verified=true sentiment=↑ positive

I built persistent memory for AI coding tools one install, every tool, no more re-explaining context

A developer built EGC (Extended Global Context), an open-source tool that gives AI coding assistants persistent memory across sessions and tools. The tool installs two MCP servers into 13 supported AI coding tools, automatically saving and loading project context so developers no longer need to re-explain their codebase, decisions, or next steps. EGC reduces context rebuilding from roughly 1,500 tokens per session to about 200 tokens, and is available on GitHub under the MIT license.

read2 min publishedJun 11, 2026

Every AI coding session starts from zero.

Close Claude Code and open it tomorrow. The AI doesn't know your project. You spend the first 10 minutes re-explaining the stack, the architectural decisions from last week, the approach that failed after three attempts.

It gets worse when you switch tools. Move from Cursor to Codex and you start over again.

I got tired of this. So I built EGC β€” Extended Global Context.

One install. Every tool. Permanent memory.

sh install.sh

detects which AI tools you have (Claude Code, Cursor, Codex, Gemini CLI, OpenCode, Windsurf, Kiro, Trae, CodeBuddy) and registers two local MCP servers in all of them. It also writes the memory protocol into each tool's global instruction file, so the AI calls get_state({})

at session start and update_state({})

at session end β€” automatically.

The state file lives at ~/.egc/state/

on your machine. It follows the project, not the IDE.

You open Claude Code on a project you haven't touched in two weeks. Without typing anything:

State loaded from egc-memory

Context acknowledged.

Ready to pick up:

β€’ Fix the auth middleware regression

β€’ Add rate limiting before deploy

β€’ Decision: use Redis, not in-memory (discussed 2 sessions ago)

The AI already knows. You just start working.

Rebuilding context from scratch costs ~1,500 tokens per session. EGC delivers the same in ~200 tokens.

20 sessions/month = ~$0.08 saved. The money is small. The interrupted flow is not.

Requires Node.js 20+.

bash
npm install -g @egchq/egc
egc install

That's it. Run egc doctor to verify.

The two MCP servers

egc-memory β€” the one you use every session
- get_state β€” reads project memory at session start
- update_state β€” saves decisions, preferences, next steps
- store_decision β€” persists a decision to SQLite
- query_history β€” returns past decisions by timestamp

egc-guardian β€” runs in the background
- validate_command β€” blocks shell injection
- validate_write β€” blocks writes to sensitive paths
- reduce_context β€” deduplicates Markdown payloads

It's open source

GitHub: https://github.com/Fmarzochi/EGC

MIT license. Built by one developer. 13 supported tools. If it saves you time, a star helps other developers find it.

---
If you've been re-explaining context every session, try it and let me know what breaks.
![ ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7y8tf9v3gtaqdwln2wye.png)
── more in #ai-tools 4 stories Β· sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/i-built-persistent-m…] indexed:0 read:2min 2026-06-11 Β· β€”