From reflect
Consolidates orphaned git worktree memory directories into project's .agents/MEMORY.md. Deduplicates entries, sections content, proposes orphan dir cleanup. Use after worktree deletions or before reflect:ingest.
npx claudepluginhub stevengonsalvez/agents-in-a-box --plugin reflectThis skill is limited to using the following tools:
Merge orphaned worktree memory directories for the current project into a single,
Organizes, extracts, prunes, and verifies Claude Code persistent memory files: MEMORY.md index, topic extraction, staleness detection, accuracy checks. Use near 200-line limit, after insights, or project changes.
Optimizes Claude Code memory files in 4 interactive steps: removes duplicates by cross-referencing CLAUDE.md/rules, migrates entries to persistent configs, compresses, and validates with cleanup. Run in main conversation to declutter memory.
Deduplicates and consolidates CLAUDE.md memory files: finds redundancies within/across files, detects misplaced instructions, proposes fixes via user interaction, implements approved changes per hierarchy.
Share bugs, ideas, or general feedback.
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.
.agents/MEMORY.md current and deduped/reflect:ingest (consolidate first, then index).agents/MEMORY.md (200-line max)reflect:ingest)~/.learnings/ — that's ingest's jobpython3 {{HOME_TOOL_DIR}}/skills/reflect/scripts/memory_discovery.py project-id
# -> e.g. "shotclubhouse"
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
Read from each matched directory. Extract individual entries (sections, bullets, paragraphs).
Group by section, remove redundant entries:
Check if entries match existing skill topics (check {{HOME_TOOL_DIR}}/skills/ and
.claude/skills/). Propose adding matching content to those skills.
.agents/MEMORY.mdConsolidated, deduped, within 200-line limit:
# 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.
Check if .claude/CLAUDE.md or .claude/AGENTS.md contains @.agents/MEMORY.md.
If not, add it at the top.
Show list of orphaned dirs and ask for confirmation:
# After user approval:
python3 {{HOME_TOOL_DIR}}/skills/reflect/scripts/memory_discovery.py cleanup /tmp/reflect-cleanup-dirs.txt --execute
## 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.
Check orphaned memory status without making changes:
python3 {{HOME_TOOL_DIR}}/skills/reflect/scripts/memory_discovery.py stats
# -> Repo: shotclubhouse
# -> Orphaned memory dirs: 7
# -> Total lines across all: 283
.agents/MEMORY.md before writing.agents/MEMORY.md