memory-dream
Skill0 starsChanged 5 months agoMITView on GitHub
Consolidate Claude Code memory stores. Supports both agents-share style git memory hierarchy and Claude Code flat project auto-memory stores. Use to dedupe, prune, refresh indexes, resolve stale entries, and review contradictory or outdated memory.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- tmstack-io/claude-skillstheir own version, first seen Aug 15, 2026
- bobmmao/agent-workflow-skillstheir own version, first seen Jun 11, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- bobmmao/agent-workflow-skills★ 0same name
- tmstack-io/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
87 rules. About 0 are common, 78 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈78
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 33
Before any destructive or broad change, show a review summary.
- Distinctive: line 35
Do not modify unrelated files.
- Distinctive: line 36
Do not modify this skill file unless the user explicitly asks to update the skill.
- Distinctive: line 40
no argument: inspect the detected memory store
- Distinctive: line 52
Always follow these rules:
- Distinctive: line 54
Do not modify AGENTS.md.
- Distinctive: line 56
Do not use git add -A.
- Distinctive: line 57
Do not stage unrelated user changes.
- Distinctive: line 58
Do not overwrite memory blindly.
- Distinctive: line 59
Do not invent facts.
- Distinctive: line 60
Do not convert uncertain inference into memory.
- Distinctive: line 61
Do not store credentials, tokens, cookies, private keys, passwords, one-time codes, API keys, session secrets, or unnecessary personal data.
- Distinctive: line 62
Do not preserve process history in final memory files.
- Distinctive: line 63
Do not add meta-comments such as "duplicated elsewhere", "not repeated here", "removed because repeated", or "learned from previous …
- Distinctive: line 64
Do not record who pointed something out, how many times it happened, session IDs, failed attempts, or "why this was learned" narratives.
- Distinctive: line 65
If a conflict cannot be resolved from reliable evidence, leave memory unchanged and list it under unresolved conflicts in the review output.
- Distinctive: line 87
Use this mode when the current directory or user-provided target contains a memory hierarchy such as:
- Distinctive: line 104
Use this mode when the real store is a flat Claude Code project memory directory, typically:
- Very specific: line 137
Every other *.md file is a recall file.
- Very specific: line 141
Do not try to refresh a notes/ index.
- Distinctive: line 142
Do not commit unless the memory directory is inside a git repository and the user explicitly asks.
- Distinctive: line 143
Before editing, create a backup outside the memory directory.
- Distinctive: line 155
If multiple memory stores are plausible, ask the user which one to consolidate.
- Distinctive: line 159
Prefer current, local, verifiable evidence.
- Distinctive: line 179
Only write strong evidence into memory.
- Distinctive: line 183
Start by inspecting the store safely.
- Distinctive: line 213
If the worktree has unrelated user changes, record them and avoid touching or staging them.
- Very specific: line 215
If $ARGUMENTS contains --dry-run, stop after review.
- Distinctive: line 237
Do not keep one-off debugging notes unless they became durable procedure.
- Distinctive: line 239
Do not scan unrelated private logs or transcripts outside the selected memory store unless the user explicitly asks.
- Distinctive: line 249
Keep only current, actionable facts and procedures.
- Distinctive: line 250
Remove obsolete entries only after verifying they are obsolete.
- Distinctive: line 251
If a path, deployment, host, service, branch, or symbol may exist outside the local environment, do not delete it automatically.
- Distinctive: line 265
If AGENTS.md defines a rule, remove duplicate copies from lower layers.
- Very specific: line 266
If MEMORY.md defines shared knowledge, remove duplicate copies from lower layers unless the lower layer adds genuinely local detail.
- Distinctive: line 267
If a note or playbook defines a procedure, other files may point to it in one short operational sentence but must not restate it.
- Distinctive: line 268
If a project file repeats general team rules, remove the repeated rule and keep only project-specific exceptions or details.
- Distinctive: line 288
Prefer 80–180 characters per hook.
- Very specific: line 311
Every recall *.md file except MEMORY.md has one index hook.
- Distinctive: line 312
Every indexed filename exists on disk.
- Distinctive: line 313
No orphan recall files exist.
- Distinctive: line 314
No duplicate index entries exist.
- Distinctive: line 315
No backup files are created inside the memory directory.
- Distinctive: line 325
When parsing the index, be conservative.
- Very specific: line 331
Do not put backup *.md files inside the memory directory, because they may be mistaken for recall files.
- Distinctive: line 333
Use a path like:
- Distinctive: line 341
If editing recall files too, copy each edited file to the backup directory before modification.
- Distinctive: line 343
After editing, show a diff against the backup:
- Distinctive: line 355
Remove repeated rules from lower layers.
- Distinctive: line 356
Keep one definition place for each rule, fact, or procedure.
- Distinctive: line 357
Keep local exceptions in lower layers.
- Distinctive: line 362
Remove long body-like summaries from the index.
- Distinctive: line 363
Keep detailed facts inside recall files.
- Distinctive: line 364
If multiple recall files repeat the same fact, keep the fact in the most specific appropriate file and remove or shorten the duplicate only …
- Distinctive: line 365
If ownership is unclear, list it in the review output.
- Distinctive: line 367
Do not write explanations about deduplication into final memory files.
- Distinctive: line 376
Keep shared facts, high-level indexes, and stable cross-project conventions.
- Distinctive: line 377
Keep notes index synchronized.
- Distinctive: line 378
Prefer short entries over long narratives.
- Distinctive: line 382
Keep it as one hook per recall file.
- Distinctive: line 383
Remove commit hashes unless the filename itself is about commit references.
- Distinctive: line 385
Remove detailed phase history.
- Distinctive: line 386
Remove "review correction" or "again checked" narratives.
- Distinctive: line 387
Remove point-in-time operational status unless the hook would be meaningless without it.
- Distinctive: line 388
Keep enough information to route retrieval correctly.
- Distinctive: line 392
Keep durable current facts.
- Distinctive: line 393
Keep project-specific commands and gotchas.
- Distinctive: line 394
Keep deployment details only if still useful.
- Distinctive: line 400
Only in hierarchy mode, regenerate the notes list with:
- Very specific: line 406
If MEMORY.md already has a notes-list section, replace the entire existing code block with the command output.
- Very specific: line 408
If no notes-list section exists, add a concise section named notes 一览 or preserve the repository's existing heading style.
- Distinctive: line 410
Do this whenever notes are added, moved, deleted, renamed, or when the existing list is stale.
- Distinctive: line 412
Do not perform this step in flat mode.
- Distinctive: line 416
Before removing or updating a stale reference, verify it.
- Distinctive: line 436
update the older entry
- Distinctive: line 437
remove the contradictory duplicate
- Distinctive: line 438
keep only the current value
- Distinctive: line 445
ask the user what the correct value should be
- Distinctive: line 447
Never choose a side just to make the memory look clean.
- Very specific: line 469
Before any edit in normal mode, and always in --dry-run, produce a concise review summary.
- Distinctive: line 521
After edits, validate before finishing.
- Distinctive: line 543
If a backup exists, show:
- Distinctive: line 553
Only hierarchy mode should normally create commits.
- Distinctive: line 555
Do not commit until the user approves after reviewing the summary.
- Distinctive: line 561
do not stage unrelated pre-existing changes
- Distinctive: line 562
use one logical commit unless there are clearly separate units
- Distinctive: line 574
Before committing, show the exact files to be staged.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
memory-dream
Consolidate memory into a smaller, current, non-duplicated, reviewable store.
This is a manual memory garbage-collection and consistency pass. It is not ordinary note-taking, not transcript summarization, and not a license to rewrite memory from guesses.
Core contract
This skill is user-triggered only.
Default behavior:
- Inspect the memory store.
- Detect the store layout before assuming paths.
- In
--dry-run, never edit files. - Without
--dry-run, edit only when evidence is strong. - Before any destructive or broad change, show a review summary.
- Do not push.
- Do not modify unrelated files.
- Do not modify this skill file unless the user explicitly asks to update the skill.
$ARGUMENTS may contain:
- no argument: inspect the detected memory store
MEMORY.md: focus on the index- a filename such as
project_tbaygo.md: focus on one recall file notes: focus on notes, if the hierarchy has notesprojects: focus on project memory, if the hierarchy has projectsauto-memory: focus on auto-memory, if the hierarchy has auto-memorysince <git-ref>: in git mode, prioritize changes after the given ref--dry-run: review only; do not edit--commit: in git mode only, prepare commits after user approval
Safety invariants
Always follow these rules:
- Do not modify
AGENTS.md. - Do not push.
- Do not use
git add -A. - Do not stage unrelated user changes.
- Do not overwrite memory blindly.
- Do not invent facts.
- Do not convert uncertain inference into memory.
- Do not store credentials, tokens, cookies, private keys, passwords, one-time codes, API keys, session secrets, or unnecessary personal data.
- Do not preserve process history in final memory files.
- Do not add meta-comments such as "duplicated elsewhere", "not repeated here", "removed because repeated", or "learned from previous mistake".
- Do not record who pointed something out, how many times it happened, session IDs, failed attempts, or "why this was learned" narratives.
- If a conflict cannot be resolved from reliable evidence, leave memory unchanged and list it under unresolved conflicts in the review output.
Technical causality may stay when it changes future behavior.
Good:
Do not run `git add -A`; it may stage unrelated user changes.Bad:
The user corrected this multiple times, so remember not to use `git add -A`.Store detection
Detect the memory store before doing any consolidation.
Mode A — git hierarchy store
Use this mode when the current directory or user-provided target contains a memory hierarchy such as:
AGENTS.md
MEMORY.md
auto-memory/MEMORY.md
auto-memory/*.md
notes/*.md
projects/*.mdAGENTS.md is read-only and must never be edited.
In this mode, git may be available. Commits are allowed only after user approval.
Mode B — Claude flat auto-memory store
Use this mode when the real store is a flat Claude Code project memory directory, typically:
~/.claude/projects/<encoded-project-path>/memory/A common encoded path is made by replacing / with -.
Example:
/home/ubuntumaps to:
/home/ubuntu/.claude/projects/-home-ubuntu/memory/This store usually looks like:
MEMORY.md
feedback_*.md
project_*.md
reference_*.md
*.mdIn flat mode:
MEMORY.mdis the index.- Every other
*.mdfile is a recall file. - There is no
AGENTS.md. - There may be no git repository.
- There are usually no
notes/,projects/, orauto-memory/subdirectories. - Do not try to refresh a
notes/index. - Do not commit unless the memory directory is inside a git repository and the user explicitly asks.
- Before editing, create a backup outside the memory directory.
Flat mode detection commands may include:
pwd
date +%F
memory_dir="$HOME/.claude/projects/$(pwd | sed 's#/#-#g')/memory"
test -d "$memory_dir" && test -f "$memory_dir/MEMORY.md" && echo "$memory_dir"
find "$HOME/.claude/projects" -path '*/memory/MEMORY.md' -print 2>/dev/nullIf multiple memory stores are plausible, ask the user which one to consolidate.
Evidence policy
Prefer current, local, verifiable evidence.
Strong evidence includes:
- current repository files
- current memory files
- tracked git history, if available
- current file paths verified by
test -e,git ls-files, orfind - current symbols verified by
rg - explicit user instructions in the current task
Weak evidence includes:
- vague recollection
- old memory entries without confirmation
- inferred intent
- relative-date statements
- point-in-time status words such as "currently", "still running", "now", "目前", "现在", "仍在"
- references to files, symbols, flags, commands, deployments, hosts, or workflows that cannot be verified locally
Only write strong evidence into memory. Put weak evidence in the review output.
Phase 0 — Prepare
Start by inspecting the store safely.
For all modes:
pwd
date +%FFor git hierarchy mode:
git status --short
git branch --show-current
git log --oneline --decorate -n 30
git diff --stat
git diff
git ls-files
find notes -type f -name '*.md' | sortFor flat mode:
cd "$memory_dir"
find . -maxdepth 1 -type f -name '*.md' ! -name 'MEMORY.md' -printf '%f\n' | sort
wc -l MEMORY.md
rg -n "today|yesterday|last week|recently|currently|still running|now|目前|现在|仍在|前回|之前|最近|昨日|今日" .If the worktree has unrelated user changes, record them and avoid touching or staging them.
If $ARGUMENTS contains --dry-run, stop after review. Do not edit.
Phase 1 — Mine
Mine the selected memory store for durable, recurring, actionable information.
Look for:
- duplicate rules
- duplicate project facts
- duplicate operational procedures
- stale file paths
- stale command names
- stale function, class, module, flag, environment variable, or script references
- contradictions between memory files
- index entries that repeat recall-file body content
- index entries with excessive detail
- relative dates such as "today", "yesterday", "last week", "recently", "前回", "之前", or "最近"
- point-in-time statuses that may now be stale
- completed task notes that no longer affect future behavior
- process history that should not be in final memory
Do not keep one-off debugging notes unless they became durable procedure.
Do not scan unrelated private logs or transcripts outside the selected memory store unless the user explicitly asks.
Phase 2 — Consolidate
Merge useful findings into the correct layer.
General rules:
- Convert relative dates into absolute dates using the current date from
date +%F. - Replace old values with newer confirmed values.
- Keep only current, actionable facts and procedures.
- Remove obsolete entries only after verifying they are obsolete.
- If a path, deployment, host, service, branch, or symbol may exist outside the local environment, do not delete it automatically; list it as uncertain in the review output.
Mode A hierarchy rules
Use this hierarchy:
AGENTS.md > MEMORY.md > auto-memory/MEMORY.md > auto-memory/*.md > notes/*.md > projects/*.mdAGENTS.md is highest authority and read-only.
Deduplicate downward:
- If
AGENTS.mddefines a rule, remove duplicate copies from lower layers. - If
MEMORY.mddefines shared knowledge, remove duplicate copies from lower layers unless the lower layer adds genuinely local detail. - If a note or playbook defines a procedure, other files may point to it in one short operational sentence but must not restate it.
- If a project file repeats general team rules, remove the repeated rule and keep only project-specific exceptions or details.
specs/ files are project design documents, not general memory. Do not edit specs/ unless the user explicitly includes that scope.
Mode B flat-store rules
Use this hierarchy:
MEMORY.md index > recall filesThis does not mean the index is where facts belong. In flat mode:
MEMORY.mdshould be a compact routing index.- Each recall file should have exactly one useful hook in
MEMORY.md. - Recall-file bodies hold the durable details.
- The index should not duplicate long project status, commit hashes, deployment history, pushed branch names, or detailed troubleshooting notes.
- The index should answer: "When should Claude open this file?"
- A good index hook is usually one short line.
- Prefer 80–180 characters per hook.
- Hooks over roughly 250 characters are candidates for compression.
Good flat index hook:
- `project_tbaygo.md`: TbayGo project memory; use for deployment topology, rollout/rollback notes, project commands, and gotchas.Bad flat index hook:
- `project_tbaygo.md`: Full multi-phase status with commit hashes, pushed origin state, rollback service details, exact host status, fixes, review corrections, and historical progress.In flat mode, do not move details into MEMORY.md. If a detail is useful, keep it in the recall file. If the recall file already contains it, remove the duplicate from the index.
Flat index health checks
In flat mode, verify index/file consistency.
Expected:
- Every recall
*.mdfile exceptMEMORY.mdhas one index hook. - Every indexed filename exists on disk.
- No orphan recall files exist.
- No duplicate index entries exist.
- No backup files are created inside the memory directory.
Useful commands:
cd "$memory_dir"
find . -maxdepth 1 -type f -name '*.md' ! -name 'MEMORY.md' -printf '%f\n' | sort
rg -n '\.md' MEMORY.mdWhen parsing the index, be conservative. Preserve the repository's existing index style unless it is clearly broken.
Backup policy for non-git flat mode
In flat mode, before editing any file, create a backup outside the memory directory.
Do not put backup *.md files inside the memory directory, because they may be mistaken for recall files.
Use a path like:
backup_dir="${TMPDIR:-/tmp}/memory-dream-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$backup_dir"
cp -p "$memory_dir/MEMORY.md" "$backup_dir/MEMORY.md"If editing recall files too, copy each edited file to the backup directory before modification.
After editing, show a diff against the backup:
diff -u "$backup_dir/MEMORY.md" "$memory_dir/MEMORY.md" || truePhase 3 — Dedup and resolve
Deduplicate from lower authority to higher authority.
In hierarchy mode:
- Remove repeated rules from lower layers.
- Keep one definition place for each rule, fact, or procedure.
- Keep local exceptions in lower layers.
In flat mode:
- Compress
MEMORY.mdinto routing hooks. - Remove long body-like summaries from the index.
- Keep detailed facts inside recall files.
- If multiple recall files repeat the same fact, keep the fact in the most specific appropriate file and remove or shorten the duplicate only when the correct owner is obvious.
- If ownership is unclear, list it in the review output.
Do not write explanations about deduplication into final memory files.
Phase 4 — Prune and index
Prune aggressively but safely.
For MEMORY.md in hierarchy mode:
- Keep it compact.
- Keep shared facts, high-level indexes, and stable cross-project conventions.
- Keep notes index synchronized.
- Prefer short entries over long narratives.
For MEMORY.md in flat mode:
- Keep it as one hook per recall file.
- Remove commit hashes unless the filename itself is about commit references.
- Remove pushed-to-origin status.
- Remove detailed phase history.
- Remove "review correction" or "again checked" narratives.
- Remove point-in-time operational status unless the hook would be meaningless without it.
- Keep enough information to route retrieval correctly.
For recall files:
- Keep durable current facts.
- Keep project-specific commands and gotchas.
- Keep deployment details only if still useful.
- Convert relative dates to absolute dates.
- Mark uncertain point-in-time state for user review instead of rewriting it.
Notes index refresh for hierarchy mode
Only in hierarchy mode, regenerate the notes list with:
find notes -type f -name '*.md' | sortIf MEMORY.md already has a notes-list section, replace the entire existing code block with the command output.
If no notes-list section exists, add a concise section named notes 一览 or preserve the repository's existing heading style.
Do this whenever notes are added, moved, deleted, renamed, or when the existing list is stale.
Do not perform this step in flat mode.
Stale reference verification
Before removing or updating a stale reference, verify it.
Useful checks:
test -e <path>
git ls-files | rg '<path-or-name>'
find . -path './.git' -prune -o -name '<name>' -print
rg --fixed-strings '<symbol-or-command>'
rg '<symbol_regex>'For deployments, hosts, remote services, market positions, and current runtime state, local verification may be insufficient. If not verifiable, do not edit automatically. List it as an unresolved stale candidate.
Conflict policy
Resolve conflicts only when newest reliable evidence is clear.
If clear:
- update the older entry
- remove the contradictory duplicate
- keep only the current value
If unclear:
- leave memory unchanged
- list the conflict in the review output
- include the files involved
- ask the user what the correct value should be
Never choose a side just to make the memory look clean.
Output hygiene
Final memory files must contain only current useful content.
Exclude:
- consolidation reasoning
- failure stories
- session IDs
- "learned on" metadata
- "the user said" history
- repeated correction counts
- obsolete task progress
- old TODOs with no future value
- duplicate-avoidance notes
- speculative guesses
- credentials or secrets
Review output
Before any edit in normal mode, and always in --dry-run, produce a concise review summary.
Use this format:
Memory Dream Review
Detected store:
- Mode:
- Path:
- Git available:
Scope:
- ...
Index health:
- ...
Changed files:
- ...
Confirmed updates:
- ...
Duplicates removed:
- ...
Stale references removed or updated:
- ...
Stale candidates needing confirmation:
- ...
Unresolved conflicts:
- ...
Intentionally not changed:
- ...
Checks run:
- ...
Next action:
- ...In --dry-run, Changed files must say that no files were changed.
The review output may contain reasoning and history. Final memory files must not.
Validation after edits
After edits, validate before finishing.
For hierarchy mode:
git diff --check
git diff --stat
git diff
git status --short
git diff -- AGENTS.mdgit diff -- AGENTS.md must be empty. If AGENTS.md changed, revert that change before continuing.
For flat mode:
cd "$memory_dir"
find . -maxdepth 1 -type f -name '*.md' ! -name 'MEMORY.md' -printf '%f\n' | sort
rg -n '\.md' MEMORY.mdIf a backup exists, show:
diff -u "$backup_dir/MEMORY.md" "$memory_dir/MEMORY.md" || trueConfirm that no backup files were created inside the memory directory.
Commit protocol
Only hierarchy mode should normally create commits.
Do not commit until the user approves after reviewing the summary.
When committing:
- stage only the files changed by this memory-dream task
- do not use
git add -A - do not stage unrelated pre-existing changes
- use one logical commit unless there are clearly separate units
- never push
Suggested commit messages:
memory: consolidate memory store
memory: refresh notes index
memory: prune stale project memory
memory: add memory-dream skillBefore committing, show the exact files to be staged.
After committing, show:
git status --short
git log --oneline -n 3In flat mode, say that no commit was created unless the user explicitly requested one and the memory store is actually inside a git repository.
Final response
End with:
- detected store mode and path
- what was consolidated
- what changed
- what remains unresolved
- whether a backup was created
- whether commits were created
- confirmation that no push was performed
- the next recommended command, if useful
Example invocations
/memory-dream --dry-run/memory-dream MEMORY.md --dry-run/memory-dream MEMORY.md/memory-dream project_tbaygo.md --dry-run/memory-dream notes --dry-run/memory-dream projects/memory-dream since HEAD~30Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

