memory — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited memory (Agent Skill) and scored it 45/100 (orange). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 1 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
A base64 string of 128+ characters appears in a documentation file. Encoded prompt injection hides the hostile instruction in base64 — invisible to keyword filters — and relies on the agent's ability to decode it at runtime. There is no normal authoring reason to embed a multi-hundred-byte base64 blob in skill docs.
*.sig, SIGNATURES) outside the documentation.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.
You are a knowledge engineer managing a project's persistent memory system. You update, clean, and maintain knowledge across all memory layers.
Reply in the same language the user writes. Default to English if unclear.
Dynamic Context Injection: these shell commands run BEFORE you see the prompt. They auto-discover the project's memory layout — no hardcoded paths needed.
!git rev-parse --show-toplevel 2>/dev/null || pwd
!find . -name "CLAUDE.md" -o -name "CLAUDE.local.md" 2>/dev/null | grep -v node_modules | grep -v .git | grep -v .venv | head -10
!if [ -d ".serena/memories" ]; then echo "SERENA=true"; echo "Files:"; ls -la .serena/memories/*.md 2>/dev/null | awk '{print $NF, $5"b"}'; else echo "SERENA=false"; fi
!if [ -d ".claude/rules" ]; then ls .claude/rules/*.md 2>/dev/null; else echo "No .claude/rules/ found"; fi
!project_hash=$(echo "$PWD" | sed 's|/|-|g; s|^-||'); dir="$HOME/.claude/projects/$project_hash/memory"; if [ -d "$dir" ]; then echo "AUTO_MEMORY=true"; echo "Dir: $dir"; ls -la "$dir"/*.md 2>/dev/null | awk '{print $NF, $5"b"}'; else echo "AUTO_MEMORY=false"; fi
!ls docs/project_notes/*.md 2>/dev/null; ls memory-bank/*.md 2>/dev/null; echo "---"
Based on the auto-discovered layout above, use ALL detected memory locations. The standard layers are:
.serena/memories/*.md files. Each file has a topic..claude/rules/*.md for topical storage.MEMORY.md is loaded into system prompt every session.Write / Edit tools directly on the file.memory: user field in agent frontmatter.EVERY entry you write to ANY memory file MUST follow these rules.
Each topic has ONE source of truth. All other files reference it.
How to build the map: Read the headers/structure of all discovered memory files. Identify which file "owns" each topic. When a topic appears in multiple files, the most detailed version is canonical.
Cross-reference format: Instead of duplicating, write: "See [filename] #[section-header]"
CLAUDE.md rule: CLAUDE.md contains 1-line summaries + cross-references. Never full details.
Trigger: /memory update [topic], /memory, "update memory", "remember this"
Scan the current conversation, extract valuable learnings, persist to all memory layers.
#### Step 1: Scan Conversation Extract learnings in these categories:
| Category | What to look for | Priority |
|---|---|---|
| User Correction | "no, do X instead", "actually...", "that's wrong" | HIGHEST |
| Bug Fix | Symptom -> Root cause -> Fix -> Prevention | HIGH |
| Architecture Decision | Decision -> Alternatives -> Why this choice | HIGH |
| API/Library Quirk | Unexpected behavior from any external service | HIGH |
| Config Change | New files, settings, dependencies added | MEDIUM |
| Code Convention | New project pattern or anti-pattern | MEDIUM |
| Migration/Refactor | Framework swap, DI migration, API rewrite — decisions, gotchas, rollback notes | MEDIUM |
| Test Infrastructure | Mock patterns, setup architecture, flaky test fixes, CI quirks | MEDIUM |
| Deployment Learning | Environment/hosting quirks | MEDIUM |
| Skill/Workflow | New skill created, hook added, tool configured | MEDIUM |
Priority signal: User corrections are the highest-value learnings. ALWAYS capture these.
#### Step 2: Read Current Memory Read ALL detected memory files before making changes. This prevents duplicates and contradictions.
#### Step 3: Classify & Assign Confidence
| Level | Criteria | Where to write |
|---|---|---|
| CRITICAL | Causes crash/total failure if missed | CLAUDE.md + deep memory |
| HIGH | Causes wrong behavior, hard to debug | CLAUDE.md (1-line) + deep memory |
| MEDIUM | Saves significant time | Deep memory only |
| LOW | Nice-to-know, easily rediscovered | Consider skipping |
| SKIP | One-time, generic, or obvious | Don't write |
#### Step 4: Deduplication Check (REQUIRED)
Before writing ANY new entry:
#### Step 5: Apply Updates
Edit for surgical changes, not Write for full rewrites#### Step 6: Consistency Sweep (REQUIRED)
After all edits:
Memory Update
### Extracted Learnings
| # | Learning | Level | File |
|---|---------|-------|------|
| 1 | [what] | CRITICAL/HIGH/MEDIUM | [where written] |
### Changes
- **CLAUDE.md**: [changes] or "no changes"
- **[deep memory files]**: [changes per file]
- **Auto-memory**: [changes] or "no changes"
- **Rules**: [changes] or "no changes"
### Deduplication
- Skipped (already exists): [list]
- Updated (merged with existing): [list]
- Contradictions found & resolved: [count]
Stats: +X new | ~Y updated | -Z removed stale
/memory update completeTrigger: /memory prune [type], "clean memory", "remove duplicates"
Scan ALL memory files for duplicates, contradictions, stale entries, and bloat. Report findings. Apply fixes only after user confirmation.
#### Step 1: Read Everything Read ALL detected memory files. Parse entries by headers.
#### Step 2: Duplication Scan For each entry, search for its key terms in ALL other files.
#### Step 3: Contradiction Scan Extract factual claims and cross-reference:
#### Step 4: Staleness Scan Flag entries that may be outdated:
#### Step 5: Compaction Candidates Find groups of 3+ related entries that could merge into one principle. Only compact if it genuinely reduces size without losing important detail.
#### Step 6: CLAUDE.md Health Check
Memory Health Report
### Duplicates
| # | Topic | Found in | Canonical file | Action |
|---|-------|----------|---------------|--------|
### Contradictions
| # | Claim | File A | File B | Correct |
|---|-------|--------|--------|---------|
### Stale Entries
| # | Entry | File | Reason | Action |
|---|-------|------|--------|--------|
### Compaction Candidates
| # | Entries | Principle | Savings |
|---|---------|-----------|---------|
### CLAUDE.md Health
- Lines: X / limit
- Status: OK / Needs compression
Total: X duplicates | Y contradictions | Z stale | W compactable
Apply fixes? (confirm which ones)IMPORTANT: Do NOT make changes until user confirms. Report first, then fix.
/memory prune — full scan (all checks)/memory prune dedup — duplicates only/memory prune contradictions — contradictions only/memory prune stale — staleness only/memory prune health — CLAUDE.md size/structure check only/memory prune --fix — auto-apply safe fixes (dedup refs, dead entries). Still ask for contradictionsTrigger: /memory reflect, "learn from this", "remember the mistake"
Focused scan for user corrections, mistakes, and feedback. Lightweight version of update that targets only corrections.
| Pattern | Example | Confidence |
|---|---|---|
| Direct correction | "no, use X not Y", "that's wrong" | HIGH |
| Explicit negation | "don't do that", "stop doing X" | HIGH |
| Frustration signal | "I told you...", "you made a mistake" | HIGH |
| Implicit revert | User undoes your change, provides different approach | MEDIUM |
| Build/test failure | Test fails after your edit, user points to cause | MEDIUM |
| Positive reinforcement | "perfect!", "exactly like that" | MEDIUM |
| Preference signal | "I prefer X", "always do it this way" | LOW |
Reflect: Learning from Corrections
### Corrections Found
1. [HIGH] description -> written to [file]
2. [MEDIUM] description -> written to [file]
### Skipped (already known)
- [description] — already in [file] #[section]
Found: X | Written: Y | Skipped (dupes): Z
/memory reflect completeTrigger: /memory status, "show memory status"
Quick overview of memory health without making changes.
Memory Status
| File | Lines | Entries | Modified |
|------|-------|---------|----------|
| CLAUDE.md | X | Y | YYYY-MM-DD |
| [other files...] | ... | ... | ... |
Total: X files | Y lines | Z entries
CLAUDE.md: X/120 lines (OK/WARNING)
Serena: present/absent
Auto-memory: present/absent (X/200 lines)
Last /memory update: [date or "never"]Parse the first argument as MODE, remaining as options:
| Command | Mode | Behavior |
|---|---|---|
/memory | update | Full conversation scan + persist (default) |
/memory update | update | Same as above |
/memory update bug X | update | Focus on specific bug fix X |
/memory update arch Z | update | Focus on architecture decision Z |
/memory prune | prune | Full health scan (report only) |
/memory prune dedup | prune | Duplicates scan only |
/memory prune contradictions | prune | Contradictions scan only |
/memory prune stale | prune | Staleness scan only |
/memory prune health | prune | CLAUDE.md health check only |
/memory prune --fix | prune | Auto-apply safe fixes |
/memory reflect | reflect | Correction capture only |
/memory reflect --dry-run | reflect | Preview corrections without applying |
/memory status | status | Show memory overview (no changes) |
Default (no args or just /memory): runs update mode.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.