Reverse Engineering Cursor and Claude Code Local Storage for Context Sync
Powerful_Language_83 · reddit · 2026-08-10
To solve context loss when switching between Cursor and Claude Code, a Reddit developer reverse-engineered their local state files and built a CLI tool called memmy.
Local Storage Differences:
- Cursor: Stores data in a SQLite database (state.vscdb), with chat history buried as stringified JSON in ItemTable. The main challenge is runtime file locking, bypassed via forced read-only mode.
- Claude Code: Appends all events as raw JSONL files under /.claude/projects/.
Engineering Details:
- Handles index bloat from massive bash stdout in Claude Code.
- Addresses shifting internal KV pairs in Cursor updates.
- Implements secret redaction (e.g., sk-, ghp) and incremental parsing based on mtime and byte offsets.
The extraction logic is open-sourced on GitHub to help developers build a unified local memory database.
More from coding & agent
- Open Source PaaS Coolify Hits 40k Stars, Offers Free Self-Hosted Vercel Alternative — thisdudelikesAI · 2026-08-10
- Opus 5 Better Than 4.8, But Cutting 80% Instructions Failed: 3 CLAUDE.md Rules Fixed It — PawelHuryn · 2026-08-10
- Open-source T3 Code wins over devs: a unified control plane for Claude Code, Codex, and more — intellectronica · 2026-08-10
- Fluent: Open-Source Kit Turns Claude Code into an Adaptive AI Language Tutor — tom_doerr · 2026-08-10
- Dev Hooks Up Vercel Eve Agent for Automated Troubleshooting and Self-Recovery — chongdashu · 2026-08-10
- RAG-art: Open-Source Local Tool Turns Art History into Structured Prompts — lololerigolo60 · 2026-08-10