with one click
project-maintenance
Archive completed plans, deduplicate stale memory, and clean auto-memory at the end of a project. Use when the user wants to wrap up a plan, clean up files, or run a memory cleanup pass.
Menu
Archive completed plans, deduplicate stale memory, and clean auto-memory at the end of a project. Use when the user wants to wrap up a plan, clean up files, or run a memory cleanup pass.
Design, build, and evaluate MCP servers end-to-end. Use when user says 'design an MCP server', 'decompose MCP tools', 'write a tool schema', 'implement an MCP server in Rust', 'call an MCP server from an agent', or 'evaluate MCP quality'. Five modes: DESIGN (decomposition, contracts), SCHEMA (JSON Schema), IMPLEMENT (Rust + rmcp), CLIENT (agent as consumer), QUALITY (8-dimension rubric, forked orchestrator spawns 8 parallel judge subagents).
Run a Plan-Do-Check-Act (PDCA) cycle to test a hypothesis with measurable success criteria. Use when user says 'run a PDCA cycle', 'test this hypothesis', 'A/B test this change', 'validate the improvement worked', or 'standardize this change'.
Review a PR, simplify complex code, polish prose, or capture a project learning. Use when the user wants to improve the quality of an artifact (code, doc, PR) or consolidate insights into memory. Do NOT use for bug diagnosis or for creating new features.
Analyze Claude Code session transcripts to extract metrics, diagnose behavioral anti-patterns, and file GitHub issues from findings. Use when user says 'parse session log', 'session metrics', 'review session for anti-patterns', 'capture a session', 'cross-analyze artifacts', or 'create a meta-issue'. Modes: CAPTURE, INSPECT, REVIEW, ISSUE, CROSS-ANALYZE, ADJUDICATE.
Drive the Claude Code CLI from Bash — headless sessions, structured output, model/permission control, and code reviews. Use when an agent needs to run Claude programmatically.
Create, optimize, and test Claude Code skills, including metadata refinement and trigger benchmarking.
| name | project-maintenance |
| description | Archive completed plans, deduplicate stale memory, and clean auto-memory at the end of a project. Use when the user wants to wrap up a plan, clean up files, or run a memory cleanup pass. |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash |
| when_to_use | Use when wrapping up plans, deduplicating files, or running memory cleanup. CONTRAST: refine MEMORIZE (general insights); rules-orchestration SYNC (codify rules); rules-orchestration AUDIT (audit rules). |
| argument-hint | [plan-archive|memory-audit|memory-dedup|memory-archive|memory-clean] [path] [--abandoned] [--days 30] |
SUMMARY.md is created (PLAN-ARCHIVE).SUMMARY.md yet) — plan-lifecycle EXECUTE mode first.rules-orchestration AUDIT mode.refine MEMORIZE.Default behavior: completed plans linger in .principled/plans/phases/, memory files in ~/.claude/projects/*/memory/ and ~/.claude/agent-memory/ accumulate duplicates and stale entries. The next planning cycle inherits bloated context and the next session loads noise.
With this skill: closure work is a first-class step. Plans ship to .principled/attic/ with learnings distilled into .principled/memory/learnings.md; memory files are deduplicated, stale entries archived, and the next cycle starts clean. Destructive operations default to a dry-run report; the agent then waits for explicit user confirmation before applying any change.
Why it matters: archive-preserve-distill is the only step that converts ephemeral execution into durable knowledge. Without it, every plan rediscovers the same lessons and every session loads the same stale context.
.principled/memory/learnings.md (one writer, ad-hoc insights)..principled/attic/ and distills plan-specific learnings into the same file (the other writer, plan-specific)..principled/memory/learnings.md; promotes durable entries into committed rules. Run PLAN-ARCHIVE (or MEMORIZE) before SYNC..claude/rules/ hierarchy; this skill's memory modes audit ~/.claude/... and .principled/memory/.IF user says "archive plan", "wrap up plan", "ship plan", "done with plan", or names a plan path → PLAN-ARCHIVE
IF user says "dedup", "deduplicate", "merge memories", "duplicate memories" → MEMORY-DEDUP
IF user says "memory audit", "memory health", "memory overview" → MEMORY-AUDIT
IF user says "archive memory" or "stale memory" → MEMORY-ARCHIVE
IF user says "clean memory", "memory cleanup", "memory maintenance" → MEMORY-CLEAN (dedup + archive in one pass)
IF user names a plan path with --abandoned or --force → PLAN-ARCHIVE with abandonment flag
IF ambiguous → ask: "Which mode? plan-archive, memory-audit, memory-dedup, memory-archive, memory-clean"
Project hygiene hub with five modes spanning two concerns: plan archival (close the plan lifecycle) and memory hygiene (clean Claude's working memory).
| Mode | Concern | What It Does |
|---|---|---|
| PLAN-ARCHIVE | Plans | Discovery → Archive → Condense → Report |
| MEMORY-AUDIT | Memory | Discover locations, score health, flag issues |
| MEMORY-DEDUP | Memory | Find and merge duplicate memory files |
| MEMORY-ARCHIVE | Memory | Move stale entries to archive with manifest |
| MEMORY-CLEAN | Memory | Full maintenance: dedup + archive in one pass |
The closure step in the plan lifecycle. Preserves plan artifacts and distills learnings into reusable knowledge. Copy (never move) originals — plans stay accessible in their original location.
PLAN.md, SUMMARY.md, related scratchpad files.ROADMAP.md or directory structure.SUMMARY.md MUST exist at the same path as PLAN.md. If missing, emit {"status": "failed", "reason": "no-summary", "retry_possible": false, "completed_portion": "discovery", "remediation": "Run plan-lifecycle EXECUTE mode to produce SUMMARY.md, or run /archive with --abandoned flag if the plan was intentionally abandoned."} and STOP. Do NOT proceed.--abandoned or --force, accept the plan as abandoned. Archive bundle includes a STATUS.md placeholder noting the abandonment and reason (sourced from the user); learnings extraction is limited to whatever PLAN.md captured.
Execution flags — there are no flag-based auto-confirm switches. PLAN-ARCHIVE recognizes --abandoned (or --force) to override the SUMMARY.md precondition. MEMORY-ARCHIVE and MEMORY-CLEAN recognize --days N to override the default 30-day age threshold. The agent always presents a planned-action summary and waits for the user to say "yes" or "proceed" before any file move or delete. This is the safety boundary for all destructive operations. Enforcement: Phases 2 (Archive) and 3 (Condense) MUST NOT execute until Phase 1's precondition passes. This is a hard gate, not a warning..principled/attic/{milestone}/{plan-id}/.templates/archive-bundle.md.PLAN.md, SUMMARY.md, scratchpad files).references/learning-taxonomy.md — you MUST read this reference BEFORE classifying any learning. Do NOT skip it..principled/memory/learnings.md with date and plan reference.Present summary:
.principled/attic/{milestone}/{plan-id}/After archival, consider starting a new cycle with plan-lifecycle PLAN mode to scope the next phase or feature. Archive preserves context; planning resumes momentum.
Do NOT archive:
SUMMARY.md)Discover and analyze all Claude Code memory locations. Default mode for memory hygiene — run before DEDUP, ARCHIVE, or CLEAN to understand the landscape.
references/memory-locations.md for the full path list and detection rules. Do NOT skip this reference; paths vary by Claude Code version and platform.Memory Audit Report
===================
Locations scanned: 5
Total files: 47
Total size: ~1.2MB
~/.claude/projects/foo/memory/: GREEN
~/.claude/agent-memory/critic/: YELLOW (2 duplicates)
.principled/scratch/: RED (1 contradiction, 3 orphans)
Find and merge duplicate memory entries. Use after AUDIT confirms duplicates exist.
keep_newest).keep_newest / merge / archive_older.trash command for local removal) — never in-line within this mode.scripts/dedup.py accepts a positional directory argument and --threshold (-t, default 0.7) and --format (-f, default json). The script is read-only — it never modifies files. Resolution actions are applied by the agent after reviewing the script's output.
# Dry-run (default): discover and report duplicates as JSON
python3 scripts/dedup.py ~/.claude/projects --threshold 0.7
# Text output for human review
python3 scripts/dedup.py ~/.claude/agent-memory --threshold 0.7 --format text
To apply a keep_newest resolution: the older file is moved via MEMORY-ARCHIVE mode (with a manifest entry recording the dedup group and the keep_newest decision). Never call the dedup script in an apply mode — it does not have one.
Duplicate Group: 3 files, similarity 87%
- ~/.claude/projects/foo/memory/MEMORY.md (updated YYYY-MM-DD)
- ~/.claude/agent-memory/critic/MEMORY.md (updated YYYY-MM-DD)
- .principled/scratch/context.md (updated YYYY-MM-DD)
Recommendation: Keep newest (context.md), archive older
Action: Move older to ~/.claude/archive/memory/projects/YYYY-MM/
Archive stale memory entries. Use when AUDIT reports entries older than the threshold or for projects/agents that no longer exist.
--days).~/.claude/archive/memory/{category}/{date}/.archived: YYYY-MM-DDTHH:MM:SSZ
entries:
- original: ~/.claude/projects/old-project/memory/MEMORY.md
archived: ~/.claude/archive/memory/projects/YYYY-MM/old-project-memory.md
reason: project deleted
- original: ~/.claude/agent-memory/deprecated-agent/
archived: ~/.claude/archive/memory/agents/YYYY-MM/deprecated-agent/
reason: agent no longer used
Full maintenance: deduplication + archiving in one pass. The default for "clean up my memory" requests.
DEDUP and ARCHIVE are run as separate steps. The agent orchestrates: runs dedup.py for discovery, then invokes MEMORY-ARCHIVE for the destructive step.
# Step 1: discover duplicates (read-only)
python3 scripts/dedup.py ~/.claude/projects --threshold 0.7
python3 scripts/dedup.py ~/.claude/agent-memory --threshold 0.7
# Step 2: archive stale entries (see MEMORY-ARCHIVE for the manifest flow)
# The agent moves files per the manifest, then updates MEMORY.md indexes.
After both steps complete, present the summary and a recovery pointer to the archive manifest.
rm -rf memory files.references/learning-taxonomy.md — categories, confidence scoring, extraction signals. Required reading in PLAN-ARCHIVE Phase 3.references/memory-locations.md — full list of Claude Code memory paths, detection rules, and per-platform variations. Required reading in MEMORY-AUDIT.templates/archive-bundle.md — structure for archived plan artifacts. Used in PLAN-ARCHIVE Phase 2.scripts/dedup.py — Jaccard-similarity duplicate detection. Used in MEMORY-DEDUP and MEMORY-CLEAN..principled/attic/ (follows existing attic convention)..principled/memory/learnings.md (follows existing memory convention).{"status": "failed" | "success", "reason": "...", "completed_portion": "...", "retry_possible": true/false}
| status | reason | mode | retry_possible |
|---|---|---|---|
failed | no-completed-plans | PLAN-ARCHIVE | false |
failed | no-summary | PLAN-ARCHIVE | false |
failed | archive-write-failed | PLAN-ARCHIVE | true |
failed | learnings-conflict | PLAN-ARCHIVE | true |
failed | plan-not-found | PLAN-ARCHIVE | true |
failed | memory-locations-unreachable | MEMORY-AUDIT | true |
failed | dedup-threshold-invalid | MEMORY-DEDUP | true |
failed | archive-manifest-write-failed | MEMORY-ARCHIVE | true |
failed | backup-location-unwritable | MEMORY-CLEAN | false |