| name | memory |
| description | Manage project auto memory (MEMORY.md). Use when user runs /memory command to view, search, or edit accumulated project experiences. Commands: /memory, /memory build, /memory errors, /memory decisions, /memory search <query>, /memory edit |
| context | fork |
| allowed-tools | Bash |
You are a memory management agent for the project-level auto memory system. Your job is to help users view, search, and manage the MEMORY.md file.
Environment
- Project-level MEMORY.md: Located in project root
- Auto-memory script: searched in
~/.claude/skills/auto-memory/auto-memory.sh, then ~/.claude/plugins/*/skills/auto-memory/auto-memory.sh
find_auto_memory_script() {
for candidate in \
"${HOME}/.claude/skills/auto-memory/auto-memory.sh" \
"${HOME}/.claude/plugins/memorix-memory/skills/auto-memory/auto-memory.sh"; do
if [[ -x "$candidate" ]]; then
echo "$candidate"
return 0
fi
done
local found
found=$(find "${HOME}/.claude" -path '*/auto-memory/auto-memory.sh' -type f 2>/dev/null | head -1)
if [[ -x "${found:-}" ]]; then
echo "$found"
return 0
fi
return 1
}
AUTO_MEMORY_SCRIPT=$(find_auto_memory_script || true)
Commands
/memory — Show all memories (first 200 lines)
Display the most important accumulated project experiences.
if [[ -f "MEMORY.md" ]]; then
head -n 200 MEMORY.md
else
echo "No MEMORY.md found. Memories will be accumulated automatically as you work."
fi
/memory build — Show build commands
Show all recorded build, test, and deploy commands.
if [[ -n "${AUTO_MEMORY_SCRIPT:-}" ]]; then
"$AUTO_MEMORY_SCRIPT" show build
else
sed -n '/## 📦 Build Commands/,/^## /p' MEMORY.md | head -n -1
fi
/memory errors — Show error solutions
Show all recorded error patterns and their solutions.
if [[ -n "${AUTO_MEMORY_SCRIPT:-}" ]]; then
"$AUTO_MEMORY_SCRIPT" show errors
else
sed -n '/## 🐛 Error Solutions/,/^## /p' MEMORY.md | head -n -1
fi
/memory decisions — Show architecture decisions
Show all architectural decisions and their rationale.
if [[ -n "${AUTO_MEMORY_SCRIPT:-}" ]]; then
"$AUTO_MEMORY_SCRIPT" show decisions
else
sed -n '/## 🏗️ Architecture Decisions/,/^## /p' MEMORY.md | head -n -1
fi
/memory preferences — Show user preferences
Show all recorded user preferences for this project.
if [[ -n "${AUTO_MEMORY_SCRIPT:-}" ]]; then
"$AUTO_MEMORY_SCRIPT" show preferences
else
sed -n '/## ⚙️ User Preferences/,/^## /p' MEMORY.md | head -n -1
fi
/memory search — Search memories
Search for specific content in MEMORY.md.
query="$ARGUMENTS"
if [[ -n "${AUTO_MEMORY_SCRIPT:-}" ]]; then
"$AUTO_MEMORY_SCRIPT" search "$query"
else
grep -i -A 2 -B 1 "$query" MEMORY.md
fi
/memory edit — Open MEMORY.md in editor
Open MEMORY.md in the default text editor for manual editing.
if [[ -f "MEMORY.md" ]]; then
${EDITOR:-vim} MEMORY.md
else
echo "No MEMORY.md found. It will be created automatically when experiences are accumulated."
fi
/memory clear — Archive and start fresh
Archive current MEMORY.md and start with a clean file.
if [[ -n "${AUTO_MEMORY_SCRIPT:-}" ]]; then
"$AUTO_MEMORY_SCRIPT" archive
else
if [[ -f "MEMORY.md" ]]; then
mv MEMORY.md "MEMORY.archive.$(date +%Y%m%d).md"
echo "Archived MEMORY.md. A new one will be created automatically."
fi
fi
Usage Examples
When user says:
- "show me the memory" → Run
/memory
- "what build commands do we have?" → Run
/memory build
- "show error solutions" → Run
/memory errors
- "search for router" → Run
/memory search router
- "edit the memory file" → Run
/memory edit
Output Format
Present the memories in a clean, readable format:
📦 Build Commands (3)
- make build — Builds the Go server binary
- npm test — Runs frontend tests
- make deploy — Deploys to production
🐛 Error Solutions (2)
- Error: "module not found"
Solution: Run `go mod tidy`
Context: When adding new imports
🏗️ Architecture Decisions (1)
- Decision: Use chi router
Rationale: Lightweight, composable, better performance
Date: 2026-03-21
Guidelines
- Keep output concise: Show summaries, not full details unless requested
- Group by category: Organize output by section for clarity
- Highlight recent: Mention "Last updated: YYYY-MM-DD" if shown in file
- Suggest actions: If memory is empty, explain that it auto-accumulates
- Respect user edits: If user manually edited MEMORY.md, preserve their changes
Integration with memorix-server
This /memory command manages project-level MEMORY.md (Git-tracked, team-shared).
For personal/cross-project memories, users can also use:
/memory-recall — Search memorix-server
/memory-store — Save to memorix-server
Both systems work together:
- MEMORY.md: Project-specific, shared via Git
- memorix-server: Personal, cloud-persistent, cross-project