A unified knowledge base for your AI conversations. Search, learn, and reflect across Claude Code, Cursor, Codex, claude.ai, ChatGPT, and more.
From the creator of claude-reflect (300+ stars) - this is the evolution: a native macOS app that aggregates all your AI conversations, extracts learnings, and helps you build persistent context.
The problem: You use Claude Code, claude.ai, ChatGPT, and other AI tools daily. Context is scattered. When you discover a preference in one tool, you lose it in another. You keep re-explaining the same things.
The solution: Retain aggregates all your AI conversations into a single searchable knowledge base. It automatically extracts corrections and preferences, then exports them to CLAUDE.md so Claude remembers what you taught it.
- Multi-source sync: Auto-sync from CLI tools (Claude Code, Codex, Cursor, Gemini CLI, OpenCode, GitHub Copilot CLI), manual sync from claude.ai and ChatGPT (cookie-based)
- Instant search: Full-text search across 10k+ conversations with FTS5
- Learning extraction: Automatic detection of corrections ("no, use X instead") and preferences
- CLAUDE.md export: Export approved learnings so Claude remembers your preferences
- Auto-updates: Automatic update notifications via Sparkle framework
- Local-first: All data stored locally. Optional cloud features (web sync, AI analysis) connect to external services when enabled.
Stable Features:
- ✅ Conversation sync (Claude Code, Codex CLI, Cursor, Gemini CLI, OpenCode, GitHub Copilot CLI, claude.ai, ChatGPT)
- ✅ Full-text search across all conversations
- ✅ Conversation browser and detail view
- ✅ Menu bar integration
- ✅ Auto-updates via Sparkle
Work in Progress:
- 🚧 Learnings extraction - functional but under active development
- 🚧 Automations - experimental, API may change significantly
- 🚧 CLAUDE.md export - works but formatting improvements planned
- macOS 14.0 (Sonoma) or later
- For web sync: Safari, Chrome, or Firefox with active sessions
Download the latest notarized DMG (recommended) or zip from Releases.
DMG (recommended):
- Open the DMG.
- Drag Retain to Applications.
- Launch Retain from Applications.
- Future updates will be automatic via Sparkle.
Zip (advanced):
- Unzip and move Retain.app to Applications.
- Launch Retain from Applications.
Retain checks for updates automatically and notifies you when a new version is available. You can also check manually via the app menu.
| Source | Type | Sync Method | Status |
|---|---|---|---|
| Claude Code | CLI | Auto (file watching) | ✅ Stable |
| Codex CLI | CLI | Auto (file watching) | ✅ Stable |
| Cursor | IDE | Auto (file watching) | ✅ Stable |
| Gemini CLI | CLI | Auto (file watching) | ✅ Stable |
| OpenCode | CLI | Auto (file watching) | ✅ Stable |
| GitHub Copilot CLI | CLI | Auto (file watching) | ✅ Stable |
| claude.ai | Web | Cookie import from Safari/Chrome/Firefox | ✅ Works, sessions expire |
| chatgpt.com | Web | Cookie import from Safari/Chrome/Firefox | ✅ Works, sessions expire |
This is important. Please read.
- All conversations are stored in a local SQLite database (
~/Library/Application Support/Retain/) - No data is sent to Retain servers (there are none)
- No telemetry, no analytics, no tracking
-
Web sync reads browser cookies: To sync from claude.ai/ChatGPT, the app reads session cookies from your browser. This requires Full Disk Access permission. The cookies are used only to authenticate API requests.
-
Gemini integration (optional): If you enable AI features with Gemini:
- Your API key is stored securely in the macOS Keychain
- Learning extraction: Sends the last 10 messages (up to 500 chars each) to Google's Gemini API
- Workflow classification: Sends conversation title, preview, and first message to categorize automation candidates
- This feature is opt-in and disabled by default
-
Claude Code CLI analysis (optional): If you enable CLI-based analysis:
- Uses your local Claude Code CLI installation
- Sends conversation data to Anthropic's API via the CLI
- Requires consent in Settings before any data is sent
- Codex CLI is disabled for security reasons (lacks hard no-tools flag)
-
Web sessions expire: claude.ai and ChatGPT sessions typically expire after ~30 days. You'll need to reconnect.
This is beta software. Core features are stable, but expect some rough edges.
- macOS only - No Windows/Linux support planned for v1
- Web sync is fragile - Cookie-based auth can break if claude.ai/ChatGPT change their APIs
- No import from exports - Can't yet import JSON exports from ChatGPT/Claude settings
- Web sessions expire - claude.ai/ChatGPT cookie-based sessions require periodic reconnection
- No conflict resolution - If you sync from multiple Macs, conversations may duplicate
Best-effort. Please open an issue with clear reproduction steps and redacted logs.
# Clone
git clone https://github.com/BayramAnnakov/retain.git
cd retain
# Build
swift build -c release
# Run
.build/release/RetainSee PHASED_VISION.md for the long-term vision:
- Phase 1 (Current): Personal Memory OS - unified ingestion, learning extraction
- Phase 2: Personal Automation - turn recurring workflows into playbooks
- Phase 3: System of Record - versioning, governance, teams
If you used claude-reflect, Retain is its spiritual successor:
- claude-reflect: CLI tool that extracts learnings from Claude Code sessions
- Retain: Native app that does the same across all your AI tools with a proper UI
The learning extraction logic is similar, but Retain adds multi-source aggregation, search, and a native interface.
This is an early beta. The best way to contribute right now:
- Try it and report bugs via Issues
- Share feedback on what sources you'd want next (Aider? Windsurf? API logs?)
- Star the repo if you find it useful
See CONTRIBUTING.md for dev setup and PR guidelines.
- Security policy: SECURITY.md
- Privacy details: PRIVACY.md
MIT License - see LICENSE for details.
Questions? Open an issue or reach out on Twitter/X.

