Claude mem persistent memory

From CarlosCaPe/octorato · View interactive version

Claude mem persistent memory is an AI agent skill from the GitHub repository CarlosCaPe/octorato. Persistent cross-session memory for coding agents: captures the session, compresses it and re-injects what is relevant later, with ~75% fewer tokens. Apache-2.0 upstream, permissive.

How to use this skill

Skill file

claude-mem — Persistent Memory for Claude Code

Brain-multiplier skill. Compresses past sessions into structured context and re-injects only the relevant chunks into future sessions. The reported token savings: ~75% per session. Effect on the Octopus: every arm's runtime budget multiplies, every long engagement gets cross-session memory automatically.

When to use

When NOT to use

Source of truth

What it does technically

  1. Hooks into the agent's session lifecycle (start, end, key tool calls)
  2. Captures: what was investigated, learned, completed, what's next
  3. Embeds + compresses into ChromaDB
  4. On next session start, retrieves the top-K most relevant compressed memories for current context
  5. Injects them as system context so the agent resumes with continuity

Quick start (rough — verify against current README)

# Install (npm/npx route)
npx claude-mem init
# This typically: configures hooks in ~/.claude/settings.json, starts ChromaDB, opens viewer

After install, the next Claude Code session writes session digests automatically, and subsequent sessions read them. Check localhost:37777 to see what's been captured.

License caveat (READ before embedding in client work)

This section used to say AGPL 3.0 and warn about network copyleft. That was WRONG at the time it was written: upstream relicensed to Apache-2.0 on 2026-05-08 (36b0929f), ten days before this skill entered the repo on 2026-05-18. Apache-2.0 is permissive and carries no network-copyleft trigger, so the warning was advice nobody needed against a license nobody had.

What survives is the method, not the verdict. A license is a fact about a DATE: read the LICENSE file at the exact commit you vendor, because this repo alone has been AGPL-3.0 and then Apache-2.0, and a skill that quotes yesterday's answer is a false claim about somebody else's terms.

Safe usage patterns:

When in doubt, treat it like running it inside your laptop is fine, redistributing it as part of a client product is not.

Relationship to the brain's existing memory

The Octopus brain already has lightweight auto-memory under ~/.claude/projects/<sanitized-cwd>/memory/ (per CLAUDE.md). That system uses plain markdown files and is good for stable facts (user role, feedback, project context).

claude-mem is heavier and dynamic — it captures session-level activity and compresses it with embeddings. Complementary, not redundant:

| Need | Use |

|---|---|

| "Who is the user, what are their preferences" | Brain auto-memory (existing) |

| "What did the agent investigate / decide last Tuesday on this arm" | claude-mem |

| "Long-term project facts that won't change" | Brain auto-memory |

| "Compressed history of 50 prior sessions, retrievable by relevance" | claude-mem |

Risk-aware rollout plan (recommended)

  1. Pilot on ONE arm where token cost is high and engagements are long
  2. Read the upstream LICENSE at the commit you pin and verify it is OK for that arm's deliverables
  3. Measure: actual token-reduction vs claimed ~75%, retrieval quality, false positives
  4. If pilot proves out, roll to other arms one at a time
  5. Update CLAUDE.md to document the cross-session memory expectation

Related brain assets

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.