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
npx -y skills add dynamic/throughline --skill consolidate-memoryAssembled 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
- Duplicates: Similar descriptions (>80% text similarity) across multiple files → Merge into canonical entry
- Stale entries: Files with
originSessionIdolder than 90 days without updates → Flag for review/update - Unindexed orphans:
.mdfiles present but not linked in MEMORY.md → Add to index or mark obsolete - Index orphans: MEMORY.md links to non-existent files → Remove from index
Phase 1: Determine Scope
- Find the current project's memory directory:
$CLAUDE_MEMORY_DIRif set, else~/.claude/projects/<project-slug>/memory/ - Inventory
MEMORY.md+ all*.mdtopic files in the memory directory - Parse MEMORY.md index to build a map of indexed files vs actual files
- 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
descriptionfield or first heading paragraph) using any sequence comparison method - similarity > 90% flags as duplicate candidate, 80-90% as manual review - Extract
originSessionIdfrom frontmatter and compare against staleness threshold (90 days default) - older files with no recentupdatedAtare 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:
| File | Problem | Evidence | Proposed Action | Confidence |
|---|---|---|---|---|
| project_x.md | Duplicate | 92% similar to project_y.md | Merge into project_y.md | High |
| project_old.md | Stale | Created 180 days ago | Review and update or delete | Medium |
| orphan.md | Unindexed | Not in MEMORY.md | Add to index | High |
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:
- For merges: Combine content into canonical file, delete duplicates, update MEMORY.md
- For stale entries: Present for manual update (or flag in MEMORY.md)
- For unindexed orphans: Add to MEMORY.md index with appropriate description
- For index orphans: Remove dead links from MEMORY.md
- Record pass in
DATA/HANDOFF.mdunder "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
consolidateskill mines handoff session logs for recurring lessons and proposes promotions into durable homes, with human gatesconsolidate-memoryskill handles memory file hygiene (this skill)- Clear division of responsibilities for maintainability