agentsclimarketplace

Consolidate memory

Skill dynamic/throughline/skills/consolidate-memory

Memory file hygiene and consolidation for project memories - detects duplicates, stale entries, unindexed orphans, and index orphans in ~/.claude/projects/<project-slug>/memory/From its SKILL.md

Install
npx -y skills add dynamic/throughline --skill consolidate-memory

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

3.8 KB, as published. Nobody here has run it

Consolidate Memory Files

Goal: Memory file hygiene pass that detects duplicates, stale entries, and index drift - proposing cleanup actions with human approval gates.

Data directory (resolve once): $THROUGHLINE_DATA_DIR if set, else <project-root>/.claude/throughline/. Below, DATA refers to that path.

Handles memory file hygiene for project memories, scanning for duplicates, stale entries, unindexed orphans, and index orphans in ~/.claude/projects/<project-slug>/memory/.

Problem Types Scanned

  1. Duplicates: Similar descriptions (>80% text similarity) across multiple files → Merge into canonical entry
  2. Stale entries: Files with originSessionId older than 90 days without updates → Flag for review/update
  3. Unindexed orphans: .md files present but not linked in MEMORY.md → Add to index or mark obsolete
  4. Index orphans: MEMORY.md links to non-existent files → Remove from index

Phase 1: Determine Scope

  1. Find the current project's memory directory: $CLAUDE_MEMORY_DIR if set, else ~/.claude/projects/<project-slug>/memory/
  2. Inventory MEMORY.md + all *.md topic files in the memory directory
  3. Parse MEMORY.md index to build a map of indexed files vs actual files
  4. Load topic files and extract frontmatter for analysis of originSessionId, type, and metadata

Phase 2: Extract Candidates

Scan for the four problem types listed above:

  • Calculate text similarity between descriptions (frontmatter description field or first heading paragraph) using any sequence comparison method - similarity > 90% flags as duplicate candidate, 80-90% as manual review
  • Extract originSessionId from frontmatter and compare against staleness threshold (90 days default) - older files with no recent updatedAt are stale
  • Cross-reference actual files against indexed entries in MEMORY.md
  • Identify any dead links in the index

Phase 3: Propose Promotions (Human Gate)

Present candidates in a markdown table format:

FileProblemEvidenceProposed ActionConfidence
project_x.mdDuplicate92% similar to project_y.mdMerge into project_y.mdHigh
project_old.mdStaleCreated 180 days agoReview and update or deleteMedium
orphan.mdUnindexedNot in MEMORY.mdAdd to indexHigh

For duplicates, show content comparison and suggest a canonical file to merge into.

For stale entries, present the age and context for manual review decision.

Phase 4: Apply Approved Changes

After human approval:

  1. For merges: Combine content into canonical file, delete duplicates, update MEMORY.md
  2. For stale entries: Present for manual update (or flag in MEMORY.md)
  3. For unindexed orphans: Add to MEMORY.md index with appropriate description
  4. For index orphans: Remove dead links from MEMORY.md
  5. Record pass in DATA/HANDOFF.md under "Consolidation passes"

Safety Guidelines

  • Never delete files without explicit approval
  • Never auto-merge without human gate
  • Always preserve original files until merge is approved
  • Maintain backward compatibility of file format and frontmatter structure

Configuration

  • Similarity threshold: 80% by default (configurable)
  • Staleness threshold: 90 days by default (configurable)

Relationship to Other Skills

  • consolidate skill mines handoff session logs for recurring lessons and proposes promotions into durable homes, with human gates
  • consolidate-memory skill handles memory file hygiene (this skill)
  • Clear division of responsibilities for maintainability

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.