Overview
The AtomCode integration gives your AtomCode agent memory from Claude-Mem. It does four things:- Observation recording: AtomCode’s lifecycle hooks send each tool result to the Claude-Mem worker, and the observer writes observations about it
- Context: the
SessionStarthook returns your memory ashookSpecificOutput.additionalContext, the Claude Code envelope AtomCode accepts - MCP search tools: the Claude-Mem MCP server gives AtomCode the
mcp__claude-mem__*memory search tools - Read context: before a
read_file, thePreToolUsehook adds the file’s memory timeline as context and never blocks the read
AtomCode reads global hooks from the
hooks key in $ATOMCODE_HOME/hooks.json and MCP servers from the mcpServers key in $ATOMCODE_HOME/mcp.json. $ATOMCODE_HOME defaults to ~/.atomcode. The installer adds Claude-Mem’s hooks and the claude-mem MCP server to those files. It keeps your other hooks and MCP servers.Requirements
- AtomCode (the
atomcodecommand). - Claude-Mem runs on your computer. You do not need CMEM Pro.
Installation
hooks.json and mcp.json, saves a backup next to each (hooks.json.bak-YYYYMMDD, once per day, readable only by you), and writes each new file in one step. If a file does not exist, the installer creates it. If a file is not valid JSON, or hooks or mcpServers is not an object, the installer stops and changes nothing.
AtomCode allows // and /* */ comments in both files. Claude-Mem can’t rewrite a file with comments without losing them, so the installer stops and says the file is not plain JSON. Remove the comments, or add the entries by hand.
Start a new AtomCode session so AtomCode reads the new hooks.
Verify
- Run
npx claude-mem atomcode status. It printsAtomCode hooks: installed. It printsincompletewhen a hook or theclaude-memMCP server is missing,not installedwhen neither is there, andunreadable configwhen a file cannot be read. See Troubleshooting. - Run
atomcode hooks listto see the hooks AtomCode loaded. - Start a new AtomCode session in a project and ask the agent to run a command.
- Watch the observation arrive in the viewer.
What is captured and sent
- Captured: your prompts and each tool call’s name and result, including failed calls.
- Where it goes: the hooks send this to the Claude-Mem worker on your computer. The worker sends it to the observer you chose with
CLAUDE_MEM_PROVIDER(by default Claude, through your Claude account) to write observations. Memory is stored in~/.claude-mem/. - Opt out: wrap text in
<private>tags to keep it out of memory, list tools inCLAUDE_MEM_SKIP_TOOLSto skip them, or runnpx claude-mem atomcode uninstall.
Event mapping
Each hook is an entry in AtomCode’s flat
hooks map, named claude-mem-…. Its command is the Bun runtime plus the worker script, both quoted. Each has its own timeout_ms: 60000 for the worker start and context, 15000 for session-init and file-context, 120000 for observation and summarize, and 30000 for session-end. AtomCode matchers are |-separated globs, not regular expressions, so the PreToolUse entry uses the plain name read_file.
Tool names
AtomCode names its tools in snake_case. Claude-Mem maps the ones that have a direct Claude Code counterpart:
Every other tool keeps its AtomCode name. This includes the MCP tools (
mcp__<server>__<tool>), task, skill, ls and apply_patch.
Limits
- Results without arguments: AtomCode’s
PostToolUseandPostToolUseFailurehooks send the tool’s result and its call id, but not the tool’s arguments. Observations from AtomCode therefore don’t carry the command that ran or the file path that was edited, only what the tool returned. - No session summaries yet: AtomCode’s
Stophook sends no last assistant message, and itstranscript_pathpoints to AtomCode’s own session log, which Claude-Mem can’t read yet. Thesummarizehook therefore writes no summary for AtomCode sessions. Observations and context are not affected. - Global hooks only: the hooks go into
$ATOMCODE_HOME/hooks.jsonso they run in every project. Claude-Mem does not write a project.hooks.json. AtomCode runs a project file only after you trust the project, and one next to the global hooks would run every hook twice. - Read context only, never blocks: before a
read_file, thePreToolUsehook adds the file’s memory timeline as context. It never blocks or rewrites the read. The File Read Gate block text names Claude Code’s tools, so a block could send the model to tools AtomCode does not have. - Files written at the same moment: if AtomCode writes
hooks.jsonormcp.jsonwhile the installer does, the last writer wins.
Troubleshooting
- Hooks do not run: run
npx claude-mem atomcode statusandatomcode hooks list, then start a new AtomCode session. - Status says incomplete: a hook or the
claude-memMCP server was removed. The status line names what is missing. Runnpx claude-mem atomcode installagain. - Status says unreadable config, or install says a file is not plain JSON:
hooks.jsonormcp.jsonhas comments or is not valid JSON, orhooksormcpServersis not an object. Fix the file, then runnpx claude-mem atomcode install. - Files are somewhere else: set
ATOMCODE_HOMEto the folder AtomCode uses before you run the installer. - Bun not found: the hooks run Bun by its absolute path. If you moved or reinstalled Bun, run
npx claude-mem atomcode installagain. - More detail: Claude-Mem writes its logs to
~/.claude-mem/logs/.
Uninstall
hooks.json and the claude-mem MCP server from mcp.json. Your other hooks and MCP servers stay. npx claude-mem uninstall does the same as part of a full uninstall. Your memory in ~/.claude-mem/ is not deleted.
