# How It Works

> Explains how claude-mem captures observations from Read, Edit, and Bash actions, when memory injection activates, and where data is stored locally.

- Skill: `thedotmack/how-it-works` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add thedotmack/how-it-works`
- Raw SKILL.md: https://api.skillmd.com/api/skills/thedotmack/how-it-works/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing, Technical Writing
- Tags: Claude Mem, Local Storage, Memory Injection, Sqlite, Vector Index
- Author: thedotmack (https://skillmd.com/u/thedotmack)
- Updated: 2026-07-19
- Page: https://skillmd.com/skills/thedotmack/how-it-works

---


# How claude-mem works

## What it does

Every Read, Edit, and Bash that Claude makes turns into a compressed observation. Observations get summarized at session end. Relevant ones get auto-injected into future prompts so the next session starts with context from the last one — no re-explaining the codebase, no re-discovering decisions.

## When it kicks in

Memory injection starts on your second session in a project.

The first session in a fresh project seeds memory; subsequent sessions receive auto-injected context for relevant past work. Run `/learn-codebase` if you want to front-load the entire repo into memory in a single pass (~5 minutes, optional).

## Where data lives

Everything stays in ~/.claude-mem on this machine.

Nothing leaves your machine except calls to whichever AI provider you configured for compression (Claude / OpenRouter / Gemini). The SQLite database, vector index, logs, and settings all live under that directory and are removed cleanly on `npx claude-mem uninstall`.
