cavemem
Cavemem is a TypeScript library that gives coding assistants persistent memory across sessions by storing compressed observations in local SQLite. It hooks into multiple IDEs (Claude Code, Cursor, GitHub Copilot, etc.) to capture what happened during coding sessions, compresses the data using a deterministic grammar to save tokens, and makes it queryable via MCP tools without requiring cloud infrastructure.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | JuliusBrussee/cavemem |
| Owner | JuliusBrussee |
| Primary language | TypeScript |
| License | MIT — OSI-approved |
| Stars | 608 |
| Forks | 56 |
| Open issues | 5 |
| Latest release | v0.2.1 (2026-05-06) |
| Last updated | 2026-07-03 |
| Source | https://github.com/JuliusBrussee/cavemem |
What cavemem is
Cavemem captures IDE session events (SessionStart, UserPromptSubmit, PostToolUse, SessionEnd) via hook handlers, redacts private content, compresses observations with a deterministic grammar that preserves code/paths byte-for-byte, writes to SQLite with FTS5 full-text indexing, and optionally builds local vector embeddings for hybrid BM25+semantic search. MCP tools (search, timeline, get_observations) enable agents to retrieve and filter their own history progressively.
Get the cavemem source
Clone the repository and explore it locally.
git clone https://github.com/JuliusBrussee/cavemem.gitcd cavemem# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Windows users must ensure Git Bash (`sh`) is in PATH; without it, Claude Code hooks fail silently. Run `cavemem doctor` to verify installation.
- The library auto-spawns a background worker for embeddings and the web viewer; configure `embedding.idleShutdownMs` to control shutdown behavior and avoid resource creep.
- Redaction of `<private>...</private>` tags and path glob exclusions happen at write time. Plan your naming conventions for sensitive data.
- Hook handlers complete in <150ms, but compression and indexing are synchronous writes. Monitor for latency impact in high-frequency IDE environments.
- Optional remote embedding providers (e.g., cloud APIs) can be configured, but default is local vector index. Choose based on privacy and latency requirements.
When to avoid it — and what to weigh
- Query-Only IDEs and Limited Capture Coverage — Cursor, Gemini CLI, Antigravity, and IBM Bob are query-only (no hooks system). If your primary IDE has no capture hooks, the database never populates, and only agents on other IDEs can benefit from searching stored memory.
- Agents That Don't Support MCP — Cavemem exposes memory via Model Context Protocol. If your agent framework or IDE doesn't support MCP servers, retrieval won't work. The library cannot integrate with agents that lack MCP client support.
- Dependency on Specific IDE Hook Events — Some IDEs have incomplete hook coverage (e.g., Copilot and Codex lack SessionEnd; Augment lacks UserPromptSubmit). Gaps in the event stream mean incomplete observations. Verify the IDE capability matrix matches your workflow.
- Complex Multi-Workspace Setups — Cavemem uses a single local SQLite database. Cross-device or multi-workspace synchronization requires manual export/import. Real-time sync across machines is not supported.
License & commercial use
Cavemem is licensed under the MIT License, a permissive open-source license that allows commercial use, modification, and distribution with minimal restrictions. Attribution is required, but no copyleft obligations apply.
MIT License permits commercial use without additional licensing fees or restrictions. No proprietary license or commercial tier is mentioned. Organizations can deploy cavemem in production systems and offer it as part of a product. Verify the license for any dependencies cavemem itself requires.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
Cavemem runs locally by default with no network calls unless remote embedding is configured. Redaction of `<private>...</private>` tags and path glob exclusions mitigate accidental leakage at write time. The web viewer uses a token-protected API (bearer token auto-generated locally). Threat model: Requires review. No audit history, fuzzing results, or formal security review disclosed. SQLite injection risk is standard; assess use of untrusted queries in `search` and `timeline` calls.
Alternatives to consider
LangChain Memory / LlamaIndex Memory
General-purpose agent memory systems with broader framework support, but less IDE-specific and less compression-focused. Heavier overhead, cloud-ready defaults.
Sourcegraph Cody or GitHub Copilot Chat History
Some IDEs have built-in session history, but lack cross-IDE interoperability, semantic search, or token compression. Vendor-locked and not customizable.
Custom SQLite + Vector DB (e.g., Postgres+pgvector)
Full control, but requires manual integration, event capture, compression logic, and MCP server implementation. Significantly higher development and ops overhead.
Build on cavemem with DEV.co software developers
Start with `npm install -g cavemem` and pick your IDE. Capture observations automatically, search your session history, and watch your agents avoid repeating themselves.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
cavemem FAQ
Does cavemem work with agents outside the listed IDEs?
How much disk space will the SQLite database consume?
Can I share memory across multiple machines?
What happens if I disable the background worker?
Software development & web development with DEV.co
Need help beyond evaluating cavemem? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and rag frameworks integrations — and maintain them long-term.
Ready to Give Your Agents Memory?
Start with `npm install -g cavemem` and pick your IDE. Capture observations automatically, search your session history, and watch your agents avoid repeating themselves.