activememory/ctx/ctx-consolidate
Claude Code and agent skill by activememory/ctx
- community
Checking that the SKILL.md file is still in the repository.
Consolidate redundant entries in LEARNINGS.md or DECISIONS.md. Use when ctx drift reports high entry counts or entries overlap.
Install
npx vskill@latest install activememory/ctx/ctx-consolidateSKILL.md
Analyze entries in LEARNINGS.md and/or DECISIONS.md, group overlapping entries by topic, and (with user approval) merge groups into denser consolidated entries. Originals are archived, not deleted.
Key Distinction
Consolidation != archival. Archival moves old entries to the archive directory. Consolidation replaces verbose entries with tighter ones: the file stays useful, just denser. The originals move to archive as a paper trail.
When to Use
- When
ctx driftreports entry counts above threshold
(default: 30 learnings, 20 decisions)
- When you notice 3+ entries about the same topic
- When the user asks "clean up learnings", "consolidate context",
"reduce noise in decisions"
- Before a release, to keep context lean
When NOT to Use
- When there are fewer than 10 entries (nothing meaningful to group)
- When the user wants to delete entries (offer archival instead)
- Automatically: always require user approval before modifying files
- Mid-task when the user is focused on shipping
Execution
Step 1: Parse Entries
Read the target file(s):
Then read the files directly:
- LEARNINGS.md (in the context directory)
- DECISIONS.md (in the context directory)
Parse entries by their ## [YYYY-MM-DD-HHMMSS] Title headers. Each entry extends from its header to the line before the next header or end of file.
Step 2: Extract Keywords and Group
For each entry, extract keywords from its title and body:
- Split text on whitespace and punctuation
- Lowercase everything
- Filter out stop words (the, and, for, with, from, are, was, etc.)
and words shorter than 3 characters
- Deduplicate
Build a keyword-to-entries map. Entries sharing 2 or more non-trivial keywords are candidates for the same group.
Grouping rules:
- Minimum group size: 2 entries (nothing to consolidate with 1)
- Maximum group size: 8 entries (larger groups suggest the topic
needs splitting, not merging)
- An entry can only belong to one group (assign to the best match)
Step 3: Present Candidates
Show the user what you found. Format:
Wait for the user to approve, modify, or reject each group. Do NOT proceed without explicit confirmation.
Step 4: Generate Consolidated Entries
For each approved group, write a consolidated entry that:
- Uses today's timestamp in
YYYY-MM-DD-HHMMSSformat - Appends "(consolidated)" to the title
- Lists the date range of originals in a
**Consolidated from**line - Distills each original into 1-2 lines
- Preserves all unique information (nothing is lost)
Format:
Step 5: Execute Approved Merges
For each approved group:
- Add the consolidated entry at the top of the file (below
the # Learnings or # Decisions header)
- Remove the original entries from the source file
- Append originals to archive at
archive/learnings-consolidated-YYYY-MM-DD.md in the context directory (or decisions-consolidated-YYYY-MM-DD.md)
No index rebuild is needed: the quick-reference index is computed on demand by ctx index <file>, never stored in the file.
Step 6: Report Results
Archive Format
The archive file uses the same Markdown format as the source file. Each archived entry keeps its original timestamp and content, preceded by a header noting which consolidated entry replaced it:
What This Skill Does NOT Do
- Automatic consolidation: always requires user approval
- Cross-file consolidation: learnings stay in LEARNINGS.md,
decisions stay in DECISIONS.md
- Delete entries: always archives originals as a paper trail
- Semantic understanding via embeddings: uses keyword matching,
which is sufficient for structured entries with consistent formatting
- Consolidate TASKS.md or CONVENTIONS.md: use
ctx task archive
for tasks; conventions rarely need consolidation
Quality Checklist
Before reporting results:
- [ ] Presented all candidate groups before making changes
- [ ] Waited for explicit user approval per group
- [ ] Each consolidated entry preserves all unique information
- [ ] Original entries are archived, not deleted
- [ ] Reported what changed and where archives were written
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinginternal/assets/claude/skills/ctx-consolidate/SKILL.md
Popularity
- Repository stars
- 70
- Repository forks
- 14
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/activememory/ctx/ctx-consolidate)