Audit gsnote agent memory (and, read-only, user notes) for health, duplicates, stale or wrong facts, noise, leaked secrets and misplaced spaces, then clean up with the user's approval. Use when the user asks to check, validate, review or clean the memory.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Memory Health?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gscode1-memory-health)
---
name: memory-health
description: Audit gsnote agent memory (and, read-only, user notes) for health, duplicates, stale or wrong facts, noise, leaked secrets and misplaced spaces, then clean up with the user's approval. Use when the user asks to check, validate, review or clean the memory.
---
# Memory health
Audit first, change nothing until the user approves. Deletions cannot be undone.
Use the `gsnote` CLI (`--agent` = agent-memory instance; without it = user notes). Never print
tokens or the env files in `~/.config/gsnote/`.
## 1. Health
- `gsnote health --agent` and `gsnote health`: both reachable, at the expected URL.
- `gsnote search --agent "test" --broad --top-k 1`: a query search works. A 503 means the server's
embedding config no longer matches the stored vectors (see REFERENCE.md, "Changing the embedding model").
- `gsnote spaces --agent`: counts per space.
## 2. Snapshot
Audit from a full export, not search (search returns at most 50). Keep it out of the repo:
```bash
umask 077; mkdir -p ~/.local/share/gsnote/backups
gsnote export --agent -o ~/.local/share/gsnote/backups/agent-$(date +%Y%m%d-%H%M%S).json
```
The same file is the backup to restore from (`gsnote import --agent <file>` skips existing ids).
## 3. Checks
Review every memory (`id`, `content`, `category`, `space`, `created_at`). Flag:
1. **Secrets**: anything that looks like a token, key, password or private URL. Highest priority.
2. **Duplicates**: same fact twice, also reworded. For candidates, run
`gsnote search --agent "<content>" --space <space> --broad --top-k 5`.
3. **Superseded**: conflicting facts. The newest usually wins; keep the older one only if it still holds.
4. **Wrong**: in the current repository's space, check claims against the code and `git log`
(files, settings, commands or behavior that no longer exist).
5. **Noise**: what the code or git history already holds, chit-chat, logs, task status,
relative dates ("today", "this") with no absolute date, facts too vague to act on.
6. **Misplaced**: anything in `default`; `local-*` spaces (repos without a usable remote);
project facts in `global` or preferences in a project space.
User notes (instance without `--agent`) are the user's own: report secrets and exact duplicates
only, and never change them unless the user explicitly asks.
## 4. Report
One table per space: id (first 8 chars), finding, proposed action (delete / merge / move / fix / keep),
one-line reason. Then totals and the health results. Ask which actions to apply.
## 5. Apply (only what the user approved)
There is no update API:
- **delete**: `gsnote delete --agent <id>`
- **merge / fix**: save the corrected memory with the memory tool (`save_memory`), then delete the old ids.
- **move**: save the same content in the right space, then delete the old id.
Afterwards run `gsnote spaces --agent` and report the counts before and after.