how-it-works — Claude Code skill: what it does, how to install
Explains how claude-mem works behind the scenes. It covers tool observation logging, local file storage, and memory injection timing.
npx skills add thedotmack/claude-mem --skill how-it-works -a claude-codeWhat how-it-works does
This skill guides the agent when asked about the internal mechanics of claude-mem. The system converts Read, Edit, and Bash tool executions into compressed observations, summarizing them at session end. Relevant details get injected into future prompts. You can also run /learn-codebase to process the entire repository in roughly 5 minutes.
All data remains in ~/.claude-mem on your local machine. That directory holds the SQLite database, vector index, settings, and runtime logs. Network traffic is restricted to your chosen AI provider (Claude, OpenRouter, or Gemini) for compression, plus a single sign-in request to cmem.ai during signup.
Memory injection will not help on the very first run. Context injection activates strictly on your second session in a project.
What it helps with
- explain how claude-mem captures tool observations
- locate local storage paths for SQLite files and logs
- determine when context injection activates across project sessions
Example prompts for the agent
- how does claude-mem work under the hood?
- where does claude-mem store its sqlite database and logs?
- what is claude-mem doing with my bash commands?
How to install how-it-works
1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill how-it-works -a claude-code2Manually: put the files in place
~/.claude/skills/how-it-works/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/how-it-works/
1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill how-it-works -a codex2Manually: put the files in place
.agents/skills/how-it-works/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill how-it-works -a cursor2Manually: put the files in place
.cursor/skills/how-it-works/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install thedotmack/claude-mem how-it-works2Manually: put the files in place
.github/skills/how-it-works/SKILL.md1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill how-it-works -a gemini-cli2Platform CLI
gemini skills install https://github.com/thedotmack/claude-mem --path plugin/skills/how-it-worksManually: put the files in place
.devin/skills/how-it-works/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill how-it-works -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set15
The whole set →Similar
Questions about how-it-works
How to install how-it-works in Claude Code?
Run npx skills add thedotmack/claude-mem --skill how-it-works -a claude-code.
What does how-it-works do?
It equips the assistant with exact instructions to answer questions about claude-mem architecture, observation storage, and prompt injection.
Where does claude-mem store project data?
All files live locally in ~/.claude-mem. It stores the SQLite database, vector index, and logs, which are cleanly removed via npx claude-mem uninstall.
Source text
SKILL.md · Apache-2.0
--- name: how-it-works description: Explain how claude-mem captures observations, when memory injection kicks in, and where data lives. Use when the user asks "how does claude-mem work?" or "what is this thing doing?". --- # 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). Local installs contact cmem.ai once, at signup, to create the sign-in link; nothing else is sent to cmem.ai. The SQLite database, vector index, logs, and settings all live under that directory and are removed cleanly on `npx claude-mem uninstall`.
© thedotmack · Apache-2.0 · thedotmack/claude-mem