Skip to content

Claude Code

mor ships as a Claude Code plugin. Installing it gives you the MCP server (memory tools), slash commands (/mor:remember, /mor:consolidate, /mor:review), and skills automatically.

Terminal window
claude plugin marketplace add github:laat/mor
claude plugin install mor

If you prefer to configure the MCP server without the plugin, add to your Claude Code MCP config:

{
"mcpServers": {
"memory": {
"command": "mor",
"args": ["mcp"]
}
}
}

See MCP Server for available tools and filtering options.

Claude Code has its own built-in memory system. To make it check mor first, add this to ~/.claude/CLAUDE.md:

## Memory
When the user asks to recall, find, check, or reuse something they
previously saved or remembered — use the `mor` MCP server tools
(`memory_search`, `memory_read`, `memory_list`). This is the user's
primary memory store containing code snippets, files, and reference
notes. Always check mor before saying something wasn't found.

Auto-surface relevant memories on each prompt via a UserPromptSubmit hook. Instead of injecting full content, it outputs lightweight hints (title, ID, description) so Claude can decide whether to read more via MCP tools.

Requires mor serve running. Add to ~/.claude/settings.json:

{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "http",
"url": "http://localhost:7677/hooks/memberberry"
}
]
}
]
}
}

If you configured mor serve with a bearer token, add the Authorization header:

{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "http",
"url": "http://localhost:7677/hooks/memberberry",
"headers": {
"Authorization": "Bearer $MOR_TOKEN"
},
"allowedEnvVars": ["MOR_TOKEN"]
}
]
}
]
}
}

Standalone alternative that doesn’t require mor serve:

Terminal window
mkdir -p ~/.claude/hooks && curl -sO --output-dir ~/.claude/hooks https://mor.yapping.no/hooks/memberberry.sh && chmod +x ~/.claude/hooks/memberberry.sh
Script source
#!/usr/bin/env bash
# Memberberry hook for Claude Code
# Hints at relevant mor memories so Claude can choose to read them.
#
# Configure in ~/.claude/settings.json:
# "hooks": {
# "UserPromptSubmit": [{ "command": "/path/to/memberberry.sh" }]
# }
set -euo pipefail
input=$(cat)
session_id=$(echo "$input" | jq -r '.session_id')
prompt=$(echo "$input" | jq -r '.prompt')
# Skip short prompts and slash commands
if [ ${#prompt} -lt 10 ] || [[ "$prompt" == /* ]]; then
exit 0
fi
cache_dir="/tmp/mor-memberberry"
mkdir -p "$cache_dir"
cache_file="$cache_dir/$session_id"
touch "$cache_file"
hits=$(mor find "$prompt" --limit 3 --json 2>/dev/null) || exit 0
# Filter out already-surfaced memories
new=$(echo "$hits" | jq --slurpfile seen <(jq -R . "$cache_file") '
[.[] | select(.id as $id | $seen | map(select(. == $id)) | length == 0)]
')
count=$(echo "$new" | jq 'length')
[ "$count" -eq 0 ] && exit 0
# Record surfaced IDs
echo "$new" | jq -r '.[].id' >> "$cache_file"
# Output hints — just enough for Claude to decide whether to read more
echo ""
echo "[mor] Potentially relevant memories (use mor MCP tools to read if needed):"
echo "$new" | jq -r '.[] | " - \(.title) [\(.id[0:8])]" + (if .description then " — \(.description)" else "" end)'

Then add to ~/.claude/settings.json:

{
"hooks": {
"UserPromptSubmit": [
{
"command": "~/.claude/hooks/memberberry.sh"
}
]
}
}

Requires jq and mor on PATH.

  • Searches top 3 memories per prompt
  • Deduplicates within a session (won’t re-surface the same memory)
  • Skips short prompts (<10 chars) and slash commands