---
name: How It Works
slug: how-it-works
category: AI Engineering
description: How It Works explains how claude-mem captures observations, when memory injection kicks in, and where data lives. Use when the user asks how claude-mem works or what it is doing.
github: "https://github.com/thedotmack/claude-mem/tree/main/plugin/skills/how-it-works"
language: JavaScript
stars: 90578
forks: 7901
install: "npx degit https://github.com/thedotmack/claude-mem/tree/main/plugin/skills/how-it-works ~/.claude/skills/how-it-works"
installs_to: ~/.claude/skills/how-it-works
source_path: plugin/skills/how-it-works/SKILL.md
collection_size: 22
category_size: 2451
collection_url: "https://dirskills.com/collections/thedotmack/claude-mem"
added: 2026-08-13T07:35:55.146Z
last_synced: 2026-08-13T07:35:55.146Z
canonical_url: "https://dirskills.com/skills/how-it-works"
---

# How It Works

How It Works explains how claude-mem captures observations, when memory injection kicks in, and where data lives. Use when the user asks how claude-mem works or what it is doing.

**Install:**

```bash
npx degit https://github.com/thedotmack/claude-mem/tree/main/plugin/skills/how-it-works ~/.claude/skills/how-it-works
```

## README

# 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`.
