memory-engine — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited memory-engine (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A memory and learning system for Claude Code, built with hooks and markdown.
Auto-detects the current project from your working directory and loads its memory.
~/.claude/scripts/hooks/session-start.jsreferences/smart-context.mdDetects pitfall patterns before context compression — retries, errors followed by fixes, user corrections.
~/.claude/skills/learned/shared-utils.js → detectPitfalls() + savePitfalls()8-step learning cycle. First 3 steps are automatic (every session). Last 5 via /reflect.
There is no real "end" to a Claude Code conversation. Memory Engine saves at three points:
mid-session-checkpoint) — most reliable, self-countedpre-compact) — pitfall detection runs here, context is fullestsession-end) — best-effort, not guaranteed to fireYou don't need to remember to run any command before closing.
Pass context between Claude Code windows without losing progress.
/handoff saves a handoff-*.md file with progress, decisions, unfinished taskssession-start.js)memory-sync.js.handoff-read.jsonLearns from user corrections — mistakes that don't show up in error logs.
/analyze) — compare user's edits against rules, log missed rules, distill new ones/reflect step 6) — same mistake 3+ times → upgrade to hard rule| Hook | File | What it does |
|---|---|---|
| SessionStart | session-start.js | Load last summary + project memory + pending handoffs + pitfall review + /reflect reminder |
| SessionEnd | session-end.js | Save summary + project index + backup (best-effort, may not fire) |
| PreCompact | pre-compact.js | Snapshot + pitfall detection + backup — the real safety net |
| UserPromptSubmit | memory-sync.js | Cross-session memory change detection + handoff detection |
| UserPromptSubmit | mid-session-checkpoint.js | Checkpoint every 20 messages |
| PreToolUse(Write) | write-guard.js | Sensitive file write warning |
| PreToolUse(Bash) | pre-push-check.js | Safety check before git push |
| — | memory-backup.sh | Bidirectional sync script (push/pull/sync) — v1.6 |
Shared logic between session-end.js and pre-compact.js is extracted into shared-utils.js.
| EN | ZH | Function |
|---|---|---|
| /save | /存記憶 | Save memory — auto-dedup, route to correct file |
| /reload | /讀取 | Load memory into current conversation |
| /todo | /待辦 | Cross-project task tracking |
| /backup | /備份 | Push local memory to GitHub (memory-backup.sh push) |
| /sync | /同步 | Bidirectional sync (memory-backup.sh sync) — v1.6 pull+push |
| /handoff | /交接 | Session handoff — pass progress to next window |
| /diary | /回顧 | Generate reflection diary |
| /reflect | /反思 | Analyze pitfalls, find patterns |
| /learn | /學習 | Manually save a pitfall |
| /analyze | /分析 | Record corrections into error notebook |
| /correct | /訂正 | Review error notebook anytime |
| /check | /健檢 | Quick health scan |
| /full-check | /大健檢 | Full audit |
| /memory-health | /記憶健檢 | Memory file stats + capacity warnings |
| /memory-search | /搜尋記憶 | Keyword search across all memory files |
| /recover | /想起來 | Restore memory from GitHub (memory-backup.sh pull) — v1.6 auto-distribute |
| /compact-guide | /壓縮建議 | When to compact and when not to |
| /overview | /全覽 | List all available commands |
~/.claude/
scripts/hooks/
session-start.js # Load recall + smart-context + handoff
session-end.js # Save summary + backup (best-effort)
pre-compact.js # Pre-compression snapshot + pitfall detection + backup
shared-utils.js # Shared functions (transcript, pitfall, backup)
memory-sync.js # Cross-session sync + handoff detection
mid-session-checkpoint.js
write-guard.js
pre-push-check.js
memory-backup.sh # Bidirectional sync (push/pull/sync) — v1.6
sessions/
{date}-{id}-session.md # Session summaries
{date}-{id}-compact.md # Pre-compact snapshots
diary/ # Reflection diaries
commands/
save.md / 存記憶.md # ...15 pairs
handoff.md / 交接.md
skills/learned/memory-engine/
SKILL.md # This file
references/
smart-context.md # Project detection rules
auto-learn.md # Pitfall detection ruleswc -l before every write. Over 170 lines → move old content to standalone files firstmemory/*.mdgit pull first, resolve conflicts if anyprojects/ directoriespull and sync modes to memory-backup.sh. The pull distributes global memory files from the backup repo into every local project directory that has a memory/ folder (newer file wins, won't overwrite local changes)projects/ paths differ. Global memory must be actively distributed, not just stored in one placereferences/smart-context.md — Project detection rulesreferences/auto-learn.md — Pitfall detection rules + auto-learn flow~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.