reflect:consolidate
Project-level memory consolidation. Merges orphaned worktree memory directories into a single .agents/MEMORY.md for the current project. Deduplicates, sections, and proposes cleanup of orphan dirs. Does NOT index into the global knowledge base — use reflect:ingest for that.
Best use case
reflect:consolidate is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Project-level memory consolidation. Merges orphaned worktree memory directories into a single .agents/MEMORY.md for the current project. Deduplicates, sections, and proposes cleanup of orphan dirs. Does NOT index into the global knowledge base — use reflect:ingest for that.
Teams using reflect:consolidate should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/consolidate/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How reflect:consolidate Compares
| Feature / Agent | reflect:consolidate | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Project-level memory consolidation. Merges orphaned worktree memory directories into a single .agents/MEMORY.md for the current project. Deduplicates, sections, and proposes cleanup of orphan dirs. Does NOT index into the global knowledge base — use reflect:ingest for that.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Reflect: Consolidate — Project Memory Cleanup
Merge orphaned worktree memory directories for the current project into a single,
tidy `.agents/MEMORY.md`. This is a **project-level** operation — it does not
touch the global knowledge base.
**For global indexing** (GraphRAG + QMD), use `/reflect:ingest` after consolidating.
## When to Use
- After deleting git worktrees
- When multiple worktree sessions left orphaned memory dirs
- To keep `.agents/MEMORY.md` current and deduped
- Before running `/reflect:ingest` (consolidate first, then index)
## What It Does
1. Discovers orphaned worktree memory dirs for the current project
2. Reads all MEMORY.md files from those dirs
3. Deduplicates entries (fuzzy — same concept = skip)
4. Routes skill-worthy content to existing skills
5. Writes consolidated `.agents/MEMORY.md` (200-line max)
6. Ensures agent config references it
7. Proposes cleanup of orphaned dirs
## What It Does NOT Do
- Does NOT index into GraphRAG or QMD (that's `reflect:ingest`)
- Does NOT scan other tools (Codex, Copilot, Gemini) — project-scoped only
- Does NOT archive originals to `~/.learnings/` — that's ingest's job
## Pipeline
### Step 1: Discover Project Identity
```bash
python3 {{HOME_TOOL_DIR}}/skills/reflect/scripts/memory_discovery.py project-id
# -> e.g. "shotclubhouse"
```
### Step 2: Find Orphaned Memory Dirs
```bash
python3 {{HOME_TOOL_DIR}}/skills/reflect/scripts/memory_discovery.py discover --provider claude
# Lists all worktree memory dirs for the current repo
# Excludes current session's memory dir
```
### Step 3: Read All MEMORY.md Files
Read from each matched directory. Extract individual entries (sections, bullets, paragraphs).
### Step 4: Deduplicate and Categorize
Group by section, remove redundant entries:
- Same concept = skip
- Same error + same solution = skip
- More detailed version = keep the detailed one
### Step 5: Route Skill-Worthy Content
Check if entries match existing skill topics (check `{{HOME_TOOL_DIR}}/skills/` and
`.claude/skills/`). Propose adding matching content to those skills.
### Step 6: Write `.agents/MEMORY.md`
Consolidated, deduped, within 200-line limit:
```markdown
# Project Memory
> Auto-consolidated by /reflect:consolidate. 200-line max.
> Detailed learnings route to skills. Global index via /reflect:ingest.
## Architecture & Patterns
## Build & Deploy
## Gotchas & Workarounds
## Testing
## Environment & Config
```
Sections are dynamic — empty sections removed, new sections created as needed.
### Step 7: Ensure Agent Config Reference
Check if `.claude/CLAUDE.md` or `.claude/AGENTS.md` contains `@.agents/MEMORY.md`.
If not, add it at the top.
### Step 8: Propose Orphan Cleanup
Show list of orphaned dirs and ask for confirmation:
```bash
# After user approval:
python3 {{HOME_TOOL_DIR}}/skills/reflect/scripts/memory_discovery.py cleanup /tmp/reflect-cleanup-dirs.txt --execute
```
### Step 9: Report
```markdown
## Consolidation Complete
- **Orphaned dirs processed**: 7
- **Entries consolidated**: 42
- **Duplicates removed**: 15
- **Routed to skills**: 3
- **.agents/MEMORY.md**: 127 lines
- **Dirs cleaned up**: 7
Next: Run `/reflect:ingest` to index into GraphRAG + QMD.
```
## Stats (Quick Check)
Check orphaned memory status without making changes:
```bash
python3 {{HOME_TOOL_DIR}}/skills/reflect/scripts/memory_discovery.py stats
# -> Repo: shotclubhouse
# -> Orphaned memory dirs: 7
# -> Total lines across all: 283
```
## Safety
- NEVER auto-apply without user approval
- NEVER delete orphaned dirs without explicit confirmation
- Always show what will be written to `.agents/MEMORY.md` before writing
- Preserve original structure of existing `.agents/MEMORY.md`Related Skills
reflect
Full conversation scan for self-improvement. Detects behavioral corrections and knowledge signals, classifies them, proposes agent updates and knowledge notes with entity sidecars for GraphRAG indexing. Correct once, never again.
reflect-status
Show reflection metrics, pending reviews, sidecar coverage, and GraphRAG health. Read-only views into the reflect system state. Can also approve/reject pending low-confidence items.
reflect:recall
Retrieve relevant prior learnings from the global knowledge base. Hybrid vector + graph search over 170+ indexed learnings, reranked by confidence, recency, and tag overlap. Use when starting work, debugging a recurring problem, or before implementing a feature that may have prior art.
reflect:ingest
The global knowledge indexer. Harvests ALL memory sources across all tools (Claude, Codex, Copilot, Gemini) and all project types into the unified GraphRAG + QMD knowledge base. Archives originals, generates entity sidecars, and dual-indexes for future retrieval. This is THE command that makes the knowledge base comprehensive.
reflect:errors-ack
Triage and acknowledge entries in the reflect errors sink (~/.reflect/errors.json). Invoked from the statusline ⚠N badge when pipeline errors accumulate (drain poison, parser crashes, ingest failures, hook timeouts).
reflect:cost
Report reflect drain spend over a time window — tokens split by cached (cache_read), uncached writes (cache_creation), and io (input+output), with a $ estimate, grouped by day / outcome / model / transcript. Reads the drainer's cost log and surfaces outlier runs and cache-reuse health (the 41.5M-token failure mode = low cache reuse + high cache writes). Use to answer "what is reflection costing me" for the last day / week.
workflow
Guide through structured delivery workflow with plan, implement, validate phases
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
validate
Verify implementation against specifications
ui-ux-pro-max
UI/UX design intelligence. 67 styles, 96 palettes, 57 font pairings, 25 charts, 13 stacks (React, Next.js, Vue, Svelte, Astro, Nuxt, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui, Jetpack Compose). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.
tui-style-guide
TUI style guide for consistent terminal interface design
token-usage
Show Claude Code token usage across sessions — daily, weekly, per-project, and per-session breakdowns. Parses {{HOME_TOOL_DIR}}/projects/**/*.jsonl for consumption data. Use when the user asks about token usage, costs, how many tokens were used, session statistics, or wants a usage report.