Overview
The Muse Code integration gives your Muse agent the same memory as Claude Code. The next Muse session starts where the last one left off. It does five things:- Observation recording: Muse’s lifecycle hooks send each tool call to the Claude-Mem worker, and the observer writes observations about it
- Context: the
SessionStarthook returns your memory ashookSpecificOutput.additionalContext, the same envelope Claude Code uses. This also runs after a compaction (SessionStartwithsourceset tocompact) - Session summaries: the
Stophook writes a summary from the last assistant message Muse sends - MCP search tools: the Claude-Mem MCP server gives Muse the
mcp__claude_mem__*memory search tools (Muse writes the server name with an underscore) - Read and subagent context: before a
read_filein the main session, thePreToolUsehook adds the file’s memory timeline as context and never blocks the read. A new subagent starts with your memory timeline
Muse Code reads user hooks from the
hooks key and MCP servers from the mcpServers key in ~/.config/muse/settings.json. The installer adds Claude-Mem’s hooks and the claude-mem MCP server to that file. It keeps your other Muse settings, hooks and MCP servers.Requirements
- Muse Code (the
musecommand), version 1.4.25 (the version tested). The integration was verified on macOS. Windows and Linux are untested. - Any Muse model. The hooks do not depend on the model Muse uses.
- Claude-Mem runs on your computer. You do not need CMEM Pro.
Installation
~/.config/muse/settings.json, saves a backup next to it (settings.json.bak-YYYYMMDD, once per day, readable only by you), and writes the new file in one step. If the file does not exist, the installer creates it with schema_version set to 1. If the file is not valid JSON, or hooks or mcpServers is not an object, or one of the events Claude-Mem uses is not a list, the installer stops and changes nothing.
Start a new Muse session so Muse reads the new settings.
Verify
- Run
npx claude-mem muse-code status. It printsMuse Code hooks: installed. It printsincompletewhen a hook or theclaude-memMCP server is missing,not installedwhen neither is there, andunreadable settingswhen the file cannot be read. See Troubleshooting. - Start a new Muse session in a project and ask the agent to read a file.
- Watch the observation arrive in the viewer.
- In a new session in a trusted folder, ask Muse to search your memory. It uses the
mcp__claude_mem__*tools.
What is captured and sent
- Captured: your prompts, each tool call (name, input and result, including failed calls), and the last assistant message of each turn.
- 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 and summaries. 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 (the Muse name, such assearch, works), or runnpx claude-mem muse-code uninstall.
Event mapping
Each hook is a shell command (the Bun runtime plus the worker script, both quoted), uses the matcher
* (except PreToolUse, which uses ^read_file$), and has its own timeout in seconds: 60 for the worker start and context, 15 for session-init and file-context, 120 for observation and summarize, 20 for subagent-context, and 30 for subagent-stop and session-end.
Tool names
Muse names its tools in snake_case. Claude-Mem maps the ones that have a direct Claude Code counterpart:
Every other tool keeps its Muse name. This includes the MCP tools (
mcp__<server>__<tool>) and subagent_spawn and subagent_wait. For Read, Write and Edit, Claude-Mem adds a file_path to the tool input. It is the path Muse sends, resolved from the folder Muse works in. The original path stays.
Subagents
Work done inside a Muse subagent is recorded under the parent session, so one task stays in one session. Muse runs subagents only in a trusted folder. When a subagent starts, Claude-Mem adds your memory timeline to it. Muse does not give a subagent its parent’s context, so the timeline is not sent twice. Muse’s own goal-reminder run, which happens after each turn, is not your work. Claude-Mem ignores it and sends it no timeline.Limits
- Muse app: the Muse app (cloud) has no official setting for a custom MCP server, so this integration does not cover it. It works with the Muse Code CLI.
- User level only: the hooks go into
~/.config/muse/settings.jsonso they run in every folder, trusted or not. Claude-Mem does not write a project.muse/hooks.jsonor a Muse plugin. Either one next to the user hooks would run every hook twice. - Memory search needs a trusted folder: Muse loads MCP servers, including the user-level
claude-memserver, only in a trusted workspace. In an untrusted folder the hooks still record your work and load memory at session start, but themcp__claude_mem__*tools are not there. Trust the folder in Muse, or startmusewith--trust-workspace. - Read context only, never blocks: before a
read_filein the main session, thePreToolUsehook adds the file’s memory timeline as context. A subagent’sread_filegets no file context. The hook never blocks or rewrites the read. The File Read Gate block text names Claude Code’s MCP tools, and Muse loads MCP only in a trusted folder, so a block could send the model to tools it does not have. - No
PermissionRequest: Claude-Mem has no handler for it. - No transcript: Muse sends no transcript file, so the summary comes from the last assistant message.
- No
~expansion: Muse does not expand~in a file path. It reads<folder>/~/x, and Claude-Mem records the same path. - Some tools pass through: Muse tools
apply_patchandbash_inputare not mapped. When asked to useapply_patch, Muse usededit_fileinstead, so the tool was not seen in testing. An edit made withapply_patchmay not be recorded as a modified file. - Settings written at the same moment: if Muse writes
settings.jsonwhile the installer does, the last writer wins. - macOS only: only macOS was verified.
Troubleshooting
- Hooks do not run: run
npx claude-mem muse-code status, then start a new Muse session. Muse reads the settings when a session starts. - Muse has no
mcp__claude_mem__*tools: the folder is not trusted. Trust it in Muse, or startmusewith--trust-workspace. - Status says incomplete: a hook or the
claude-memMCP server was removed from~/.config/muse/settings.json. The status line names what is missing. Runnpx claude-mem muse-code installagain. - Status says unreadable settings:
~/.config/muse/settings.jsonis not valid JSON, orhooksormcpServersis not an object. Fix the file, then runnpx claude-mem muse-code install. - Bun not found: the hooks run Bun by its absolute path. If you moved or reinstalled Bun, run
npx claude-mem muse-code installagain. - More detail: Claude-Mem writes its logs to
~/.claude-mem/logs/.
Uninstall
claude-mem MCP server from ~/.config/muse/settings.json. Your other settings, 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.
