Claude-Mem Records Every Agent Tool Call Into a Local SQLite File and Feeds It Back Next Session
Software / news
Claude-Mem Records Every Agent Tool Call Into a Local SQLite File and Feeds It Back Next Session
The Apache-2.0 plugin has 95,940 stars. A July 2026 arXiv paper on poisoned memory files did not test it, but it describes the risk of any store an agent re-reads.
Claude-mem, a plugin that records what a coding agent does and feeds a compressed version back into later sessions, gained 627 stars on October 4, 2026 on GitHub trending and now has 95,940. It stores everything in a local SQLite database, uses an AI provider you choose to summarise it, and we found no published security analysis of it.
The repository, thedotmack/claude-mem, is credited to Alex Newman under the handle @thedotmack. GitHub's API shows an Apache License 2.0, a creation date of August 31, 2025 and 110 open issues.
What it captures and where it keeps it
The README describes it as a system that "captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions." Installation is one command, npx claude-mem install, and it supports Claude Code, OpenClaw, Codex and other agents.
Capture runs through five lifecycle hooks: SessionStart, UserPromptSubmit, PostToolUse, Stop and SessionEnd.
The database lives in ~/.claude-mem/ and uses SQLite 3 with FTS5 full-text search. A local HTTP worker, managed by Bun, serves a web viewer and search endpoints on a port set in settings.json. Observations are tagged by type, including decision, bugfix, security_alert and sensitive.
Who sees the data
Compression is not local by default. The README lists the default as the claude-mem observer, with a free 14-day trial, and alternatives of OpenRouter, the Gemini API or your own Anthropic plan. Whichever you pick receives the observations it is asked to summarise.
Optional cloud backup goes to cmem.ai, which the README says syncs "on write" and needs an email magic-link sign-in. A <private> tag excludes marked text from storage and compression entirely, so keeping a secret out depends on the user tagging it.
| Setting | What the README says |
|---|---|
| Storage | SQLite with FTS5, in ~/.claude-mem/ |
| Compression | claude-mem observer (14-day trial), OpenRouter, Gemini API or Anthropic plan |
| Cloud sync | Optional, cmem.ai, magic-link sign-in |
| Exclusion | <private> tags |
The README claims "~10x token savings." It describes the method as progressive disclosure: compact search results of roughly 50 to 100 tokens, then a timeline, then full details at roughly 500 to 1,000 tokens each for filtered IDs. That is the project's claim, and we found no independent measurement.
The risk the stored text creates
A store that an agent re-reads is a store an attacker can aim at. A paper posted to arXiv on July 16, 2026, Bad Memory: Evaluating Prompt Injection Risks from Memory in Agentic Systems, by Soham Gadgil, David Alexander, Sai Sunku and Franziska Roesner, tested Claude Code and OpenAI's Codex across four models: Claude Haiku 4.5, Claude Opus 4.7, GPT-5.2 and GPT-5.5.
Its finding is narrow. The agents resisted overwriting their own memory with untrusted external content, but "payloads already planted in those files can successfully attack current and future sessions." Success varied by system, model and objective.
The paper studied memory files, not claude-mem, and we have not seen anyone test claude-mem against it. The shared lesson is about direction of trust. Anything an agent reads from a web page or a dependency during a session becomes an observation, and an observation that is summarised and re-injected next week is text the agent treats as its own history.
What a user can check today
Open ~/.claude-mem/ and read what has been stored after a week of use. Check which compression provider is set in settings.json, and whether cloud sync is on. Mark anything sensitive with <private>.
For more on agent security, see our earlier piece on leaky agent sandboxes, and for another fast-rising agent repository, Agent-Reach.
Sources
More in Software
- 01Levien's Next-100 Rust GUIs Post Counts About 20 New Toolkits and Bets Against egui's Immediate ModeThe Linebender author credits AI rewrites for the surge; egui's own README concedes the trade-off he is pressing on.
- 02C++26 Is Reopened: The 13–9–12 Ballot, the Enforced Label That Answers It, and What Is Still OpenSutter's Búzios report says the committee kept contracts, added one paper, and will send C++26 to a second ballot with no published date.
- 03OpenAI Says Codex Cannot Run in Docker for iOS Builds, and Docker Launches It With Codex's Sandbox OffBolin's November 18 post lists Seatbelt, Bubblewrap and MXC as Codex's three sandboxes; Docker's page defaults to --dangerously-bypass-approvals-and-sandbox.
- 04CLI-Anything Has 62,119 Stars and a README With Three Different Test TotalsThe HKUDS project turns desktop software into agent-callable CLIs; its own per-harness lines sum to 158 more tests than it reports.