hmem — Claude Code MCP server: what it does, how to install
Keeps project knowledge in a SQLite store across sessions and devices, loading detail only when the agent asks for it.
claude mcp add --env HMEM_STORAGE_DIR=<HMEM_STORAGE_DIR> --transport stdio hmem-humanlike-memory-for-ai-agents -- npx -y hmem-mcpWhat hmem — Humanlike Memory for AI Agents does
hmem gives an agent a working memory instead of a blank slate at the start of every chat. A single load_project() call returns a compressed briefing: stack, open bugs, recent decisions, next step — and this works the same way across Claude Code, Codex, Cursor, GitHub Copilot, Windsurf, Cline, Zed and Gemini CLI.
Entries sit in five tiers of detail. Tier one is a one-line summary per entry and loads every time; tiers two through five — a paragraph, full context, extended notes, and the raw original text — only load when the agent actually drills into a record. Conversations get captured automatically through a stop hook, and a background Haiku subagent wakes up every few exchanges to pull out lessons and errors and write a handoff note for whoever picks up the project next.
The server also installs a skills layer: behavior files covering reading, writing, curating and migrating memory entries, updatable on their own schedule via npx hmem update-skills. Setup requires pointing HMEM_STORAGE_DIR at a storage path, since that's where the SQLite database lives.
What it helps with
- pick up a project's context without re-reading the codebase
- carry memory across Claude, Gemini and other providers
- keep a record of bugs and decisions that the next session actually sees
- get a project briefing in one call instead of recapping manually
- clean up stray or duplicate entries piling up in memory
Example prompts for the agent
- Load project P0048 and tell me where we left off last session
- Run the hmem skill update to pull the latest versions
- Search memory for the rename_id bug we fixed
How to install hmem — Humanlike Memory for AI Agents
Platform CLI
claude mcp add --env HMEM_STORAGE_DIR=<HMEM_STORAGE_DIR> --transport stdio hmem-humanlike-memory-for-ai-agents -- npx -y hmem-mcpReplace <…> with your own values
Platform CLI
codex mcp add hmem-humanlike-memory-for-ai-agents --env HMEM_STORAGE_DIR=<HMEM_STORAGE_DIR> -- npx -y hmem-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"hmem-humanlike-memory-for-ai-agents": {
"command": "npx",
"args": [
"-y",
"hmem-mcp"
],
"env": {
"HMEM_STORAGE_DIR": "<HMEM_STORAGE_DIR>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"hmem-humanlike-memory-for-ai-agents": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"hmem-mcp"
],
"env": {
"HMEM_STORAGE_DIR": "<HMEM_STORAGE_DIR>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e HMEM_STORAGE_DIR=<HMEM_STORAGE_DIR> hmem-humanlike-memory-for-ai-agents npx -y hmem-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about hmem — Humanlike Memory for AI Agents
How do I install hmem in Claude Code?
Run claude mcp add hmem-mcp -- npx -y hmem-mcp, or set the storage path explicitly with claude mcp add --env HMEM_STORAGE_DIR=<HMEM_STORAGE_DIR> --transport stdio hmem-humanlike-memory-for-ai-agents -- npx -y hmem-mcp.
What does hmem do?
It stores project knowledge — stack, bugs, decisions, tasks — in SQLite and loads it in tiers of detail so an agent doesn't re-read the codebase every session. The memory carries over between different AI tools and devices.
Is there anything to set up before running hmem?
You need to set the HMEM_STORAGE_DIR environment variable to a storage path, since the server writes its SQLite database there.