agentleFS
stoa-platformstoa-platform/stoa/.claude/skills/memory-consolidate/SKILL.md

memory-consolidate

Skill9 starsChanged 7 months agoApache-2.0View on GitHub

Consolidate memory files — remove stale facts, resolve contradictions, verify paths. Inspired by Claude Code's autoDream pattern.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 13 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the memory index and all referenced topic files:

    line 17
  2. Distinctive:

    Check if the file still exists in the codebase

    line 25
  3. Distinctive:

    If NOT: flag as stale, note the memory file and line

    line 26
  4. Distinctive:

    If YES but content has changed significantly: flag as potentially outdated

    line 27
  5. Distinctive:

    Use Glob and Grep to verify existence.

    line 29
  6. Distinctive:

    Stale path: Remove or update the reference

    line 50
  7. Distinctive:

    Contradiction: Keep the more recent/accurate version, remove the other

    line 51
  8. Distinctive:

    Outdated fact: Update if current state is clear, otherwise flag for human review

    line 52
  9. Distinctive:

    Ensure MEMORY.md stays under 120 lines:

    line 57
  10. Distinctive:

    Keep index entries under ~150 chars each

    line 60
  11. Distinctive:

    NEVER delete a memory file entirely — consolidate into existing files

    line 77
  12. Distinctive:

    NEVER change facts about infrastructure (IPs, credentials, service names) without verification

    line 78
  13. Distinctive:

    Keep the consolidation under 2 minutes — don't read every file in the codebase

    line 81

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Memory Consolidation — autoDream Pattern

CAB-2005: Inspired by Claude Code's autoDream process revealed in the March 2026 source leak. During idle periods, autoDream merges disparate observations, removes logical contradictions, and converts vague insights into verified facts.

This skill performs the same operation on STOA's memory system.

Step 1: Read All Memory Files

Read the memory index and all referenced topic files:

  1. ~/.claude/projects/-Users-torpedo-hlfh-repos-stoa/memory/MEMORY.md (index)
  2. All .md files referenced in MEMORY.md (topic files)
  3. memory.md (project root — session state)

Step 2: Verify File References

For each file path mentioned in any memory file (backtick-quoted paths like path/to/file.ext):

  1. Check if the file still exists in the codebase
  2. If NOT: flag as stale, note the memory file and line
  3. If YES but content has changed significantly: flag as potentially outdated

Use Glob and Grep to verify existence. Do NOT read every referenced file — just check existence.

Step 3: Detect Contradictions

Scan for contradictions across memory files:

  • Version conflicts: e.g., "ADR numbering: next ADR-048" in one file vs "ADR-060" in another
  • Status conflicts: item marked DONE in one file but IN PROGRESS in another
  • Port/URL conflicts: different ports or URLs for the same service
  • Date conflicts: timeline inconsistencies

Step 4: Detect Stale Facts

Flag facts that are likely outdated:

  • References to cycles older than 2 cycles ago still marked "CURRENT"
  • TODO items with dates more than 2 weeks in the past
  • "Active" items that haven't been updated in 30+ days
  • Infrastructure references (IPs, service names) that may have changed

Step 5: Apply Fixes

For each issue found:

  • Stale path: Remove or update the reference
  • Contradiction: Keep the more recent/accurate version, remove the other
  • Outdated fact: Update if current state is clear, otherwise flag for human review
  • Stale TODO: Move to completed or remove if no longer relevant

Step 6: Compact MEMORY.md

Ensure MEMORY.md stays under 120 lines:

  • Move completed ticket details to completed-tickets.md
  • Move resolved infra details to infra-status.md
  • Keep index entries under ~150 chars each

Step 7: Report

Output a summary:

Memory Consolidation Report:
- Files scanned: N
- Stale paths removed: N
- Contradictions resolved: N
- Stale facts updated: N
- MEMORY.md lines: N/120
- Items flagged for human review: N (list)

Rules

  • NEVER delete a memory file entirely — consolidate into existing files
  • NEVER change facts about infrastructure (IPs, credentials, service names) without verification
  • Flag uncertain changes for human review rather than guessing
  • This skill is safe to run via /loop 30m memory-consolidate for periodic maintenance
  • Keep the consolidation under 2 minutes — don't read every file in the codebase

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.