Repair common issues with the memory system. Cleans up orphan temp files, stale sessions, lock files, and old logs.
View on GitHubZ-M-Huang/cc-obsidian-mem
cc-obsidian-mem
January 24, 2026
Select agents to install to:
npx add-skill https://github.com/Z-M-Huang/cc-obsidian-mem/blob/main/plugin/skills/mem-repair/SKILL.md -a claude-code --skill mem-repairInstallation paths:
.claude/skills/mem-repair/# Memory Repair Skill
Clean up and repair common issues with the cc-obsidian-mem memory system.
## When to Use
- Getting errors about temp files or stale sessions
- Sessions not starting properly
- `--continue` picking up wrong sessions
- Sessions stuck in "processing" status
- Want to clean up all temp files and start fresh
## Usage
```
/mem-repair
/mem-repair full
```
## Workflow
1. **Show Current Status**
First, show what will be cleaned:
```bash
# Windows (cmd)
dir "%TEMP%\cc-obsidian-mem-*.txt" 2>nul || echo No temp files
dir "%TEMP%\cc-mem-agent-*.txt" 2>nul || echo No legacy temp files
dir "%USERPROFILE%\.cc-obsidian-mem\locks\*" 2>nul || echo No lock files
# macOS/Linux
ls -la /tmp/cc-obsidian-mem-*.txt 2>/dev/null || echo "No temp files"
ls -la /tmp/cc-mem-agent-*.txt 2>/dev/null || echo "No legacy temp files"
ls -la ~/.cc-obsidian-mem/locks/* 2>/dev/null || echo "No lock files"
```
2. **Clean Up Temp Files**
Remove orphan temp files from crashed sessions:
```bash
# Windows (cmd)
del /q "%TEMP%\cc-obsidian-mem-*.txt" 2>nul
del /q "%TEMP%\cc-mem-agent-*.txt" 2>nul
# macOS/Linux
rm -f /tmp/cc-obsidian-mem-*.txt
rm -f /tmp/cc-mem-agent-*.txt
```
3. **Clean Up Stale Lock Files**
```bash
# Windows (cmd)
del /q "%USERPROFILE%\.cc-obsidian-mem\locks\*" 2>nul
# macOS/Linux
rm -f ~/.cc-obsidian-mem/locks/*
```
4. **Clean Up Old Log Files** (optional, if user requests full cleanup)
```bash
# Windows (cmd)
del /q "%TEMP%\cc-obsidian-mem-*.log" 2>nul
# macOS/Linux
rm -f /tmp/cc-obsidian-mem-*.log
```
5. **Clean Up Database Sessions** (if sqlite3 is available)
```bash
# Mark stale processing sessions as failed (stuck > 30 min)
sqlite3 ~/.cc-obsidian-mem/sessions.db "UPDATE sessions SET status = 'failed' WHERE status = 'processing' AND updated_at < datetime('now', '-30 minutes');"
# Mark orphan active sessions as failed (active > 24 hours)
s