architecture
Use when the user asks to improve architecture, find refactoring opportunities, surface deepening opportunities, consolidate…
Use this skill when performing manual memory consolidation (Dream-equivalent). Reviews, consolidates, and prunes memory files under ~/.claude/projects/*/memory/. Run after major refactors, every 5+ sessions, or when memory quality degrades (broken links, stale references,
Claude Code
$ npx -y skills add Kanevry/session-orchestrator --skill memory-cleanup --agent claude-code
Codex
$ npx skills add Kanevry/session-orchestrator --skill memory-cleanup -a codex -y
Cursor
$ npx skills add Kanevry/session-orchestrator --skill memory-cleanup -a cursor -y
Gemini CLI
$ npx skills add Kanevry/session-orchestrator --skill memory-cleanup -a gemini-cli -y
GitHub Copilot
$ npx skills add Kanevry/session-orchestrator --skill memory-cleanup -a github-copilot -y
OpenCode
$ npx skills add Kanevry/session-orchestrator --skill memory-cleanup -a opencode -y
Windsurf
$ npx skills add Kanevry/session-orchestrator --skill memory-cleanup -a windsurf -y
name: memory-cleanup
user-invocable: true
argument-hint: "[--dry-run | --apply-pending]"
tags: [memory, maintenance, meta, dream]
model: sonnet
model-preference: sonnet
model-preference-codex: gpt-5.4-mini
model-preference-cursor: claude-sonnet-4-6
args-schema:
- flag: --dry-run
description: "Produce complete-body proposal in .orchestrator/pending-dream.md, no mutations."
- flag: --apply-pending
description: "Consume .orchestrator/pending-dream.md (atomic apply)."
description: >
Use this skill when performing manual memory consolidation (Dream-equivalent). Reviews, consolidates, and prunes memory files
under ~/.claude/projects/*/memory/. Run after major refactors, every 5+ sessions, or when memory
quality degrades (broken links, stale references, contradictions, MEMORY.md > 200 lines).
Invoke with /memory-cleanup.The user invoked `/memory-cleanup` with arguments: **$ARGUMENTS**. Parse them before anything else — two optional, mutually-exclusive flags are recognised (`--dry-run`, `--apply-pending`, see PRD #502); passing both is an error, and the absence of both selects the legacy interactive 4-phase mode. The per-flag behaviour, the exact status lines and the exit codes are in § Argument Handling (Phase 0) below; the interactive default runs Phases 1-4 (Orient → Gather Signal → Consolidate → Prune & Index) against `~/.claude/projects/<encoded-cwd>/memory/` and reports per § Output.
Sidecar producer/consumer contract: session-start's `maintenance-due` probe uses `scripts/lib/auto-dream.mjs` to report when cleanup is due; the former session-end Phase 3.6.5 nudge was retired in #1288. Neither path generates the sidecar. The only real producer of `.orchestrator/pending-dream.md` is a manual `/memory-cleanup --dry-run` run; `--apply-pending` is the operator-confirmed consumer in a later session. The sidecar file is single-writer — concurrent sessions cannot collide because the writer holds the session-lock. <!-- path-check: example -->
Implements the 4-phase memory consolidation process modelled after Claude Code's Auto Dream feature. Run after major refactors, framework migrations, or every 5+ sessions in a repo.
The memory system lives at `~/.claude/projects/<encoded-cwd>/memory/` and consists of:
The four memory types are `user`, `feedback`, `project`, `reference` (see global `auto memory` instructions for semantics). This skill never invents new types.
This skill accepts two optional flags. Default (no flag) runs the interactive 4-phase consolidation defined below.
| Flag | Behavior | |---|---| | `--dry-run` | Run Phases 1-3 read-only; instead of mutating MEMORY.md / topic files, write a complete-body MEMORY.md proposal (single fenced block — never a unified-diff) to `.orchestrator/pending-dream.md` (atomic). Exit 0. <!-- path-check: example --> | | `--apply-pending` | Read `.orchestrator/pending-dream.md`; refuse if older than 14 days (`stale`) or if MEMORY.md changed since the producing --dry-run (`stale-index`, #788); apply diff; delete pending file; print `auto-dream applied: -<X> lines, +<Y> entries`. Exit 0. <!-- path-check: example --> |
Flags are mutually exclusive — passing both is an error. Absence of both = legacy interactive mode (Phases 1-4 below).
**`--dry-run` flow:**
**`--apply-pending` flow:**
Your coding agents get an agreed plan, a check after each round of changes and a handover to the next session. A free, MIT-licensed workflow plugin for people running Claude Code, Codex CLI, Cursor IDE or Pi on a git repository.
Use when the user asks to improve architecture, find refactoring opportunities, surface deepening opportunities, consolidate…
Use this skill when running an autonomous session-orchestration loop. Chains session-start → session-plan → wave-executor →…
Use this skill when scaffolding the minimum repository structure required by session-orchestrator. Invoked automatically by the…
Use when you have a feature idea but the scope or UX is still ambiguous — runs a lightweight Socratic design dialogue (3-5 AUQ…
Use when detecting drift between CLAUDE.md (or AGENTS.md, the Codex CLI alias) / _meta narrative and live repository state. Ten…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.