协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
manage-memory【开发与工程】Organize, extract, prune, and verify Claude Code persistent memory files. Covers MEMORY.md as a concise index, topic extraction to dedicated files, staleness detection, accuracy verification against project state, and the 200-line truncation constraint. Use when MEMORY.md is approaching the 200-line limit, after a session produces durable insights wo…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Maintain Claude Code's persistent memory directory so it stays accurate, concise, and useful across sessions. MEMORY.md is loaded into the system prompt on every conversation — lines after 200 are truncated, so this file must be a lean index pointing to topic files for detail.
~/.claude/projects/<project-path>/memory/)Read MEMORY.md and list all files in the memory directory:
wc -l <memory-dir>/MEMORY.md
ls -la <memory-dir>/
Check the line count against the 200-line limit. Inventory existing topic files.
Got: Clear picture of total lines, number of topic files, and which sections exist in MEMORY.md.
If fail: If the memory directory doesn't exist, create it. If MEMORY.md doesn't exist, create a minimal one with a # Project Memory header and a ## Topic Files section.
Compare memory claims against current project state. Common staleness patterns:
Use Grep to spot-check key claims:
# Example: verify a skill count claim
grep -c "^ - id:" skills/_registry.yml
# Example: verify a file still exists
ls path/claimed/in/memory.md
Got: A list of entries that are stale, with the correct current values.
If fail: If you can't verify a claim (e.g., it references external state you can't check), leave it but add a (unverified) note rather than silently preserving potentially wrong information.
For new entries, apply these filters before writing:
Exception: If the user explicitly asks to remember something, save it immediately — no need to wait for multiple confirmations.
Got: A filtered list of entries worth adding, each meeting durability + non-duplication + verification + actionability criteria.
If fail: If unsure whether an entry is worth keeping, err toward keeping it briefly in MEMORY.md — it's easier to prune later than to rediscover.
When a section in MEMORY.md exceeds ~10-15 lines, extract it to a dedicated topic file:
<memory-dir>/<topic-name>.md with a descriptive header## Topic Files
- [topic-name.md](topic-name.md) — Brief description of contents
Naming conventions for topic files:
viz-architecture.md, not VizArchitecture.mdpatterns.md, not session-2024-12.mdpatterns.md rather than creating one file per factGot: MEMORY.md stays under 200 lines. Each topic file is self-contained and readable without MEMORY.md context.
If fail: If a topic file would be fewer than 5 lines, it's probably not worth extracting — leave it inline in MEMORY.md.
Apply all changes: remove stale entries, add new entries, update counts, and ensure the Topic Files section lists all dedicated files.
MEMORY.md structure should follow this pattern:
# Project Memory
## Section 1 — High-level context
- Bullet points, concise
## Section 2 — Another topic
- Key facts only
## Topic Files
- [file.md](file.md) — What it covers
Guidelines:
code, bold) for scanabilityGot: MEMORY.md is under 200 lines, accurate, and has working links to all topic files.
If fail: If you can't get under 200 lines after extraction, identify the least-frequently-used section and extract it. Every section is a candidate — even the project structure overview can go to a topic file if needed, leaving a 1-line summary.
Run a final check:
wc -l <memory-dir>/MEMORY.md
# Check for broken links
for f in $(grep -oP '\[.*?\]\(\K[^)]+' <memory-dir>/MEMORY.md); do
ls <memory-dir>/$f 2>/dev/null || echo "BROKEN: $f"
done
# Check for orphan files
ls <memory-dir>/*.md | grep -v MEMORY.md
Got: Line count under 200, no broken links, no orphan files, spot-checked claims are accurate.
If fail: Fix broken links (update or remove). For orphan files, either add a reference in MEMORY.md or delete them if they're no longer relevant.
.md files in memory directory (every file is linked from MEMORY.md)patterns.md, viz-architecture.md) is far more useful for retrieval than date-based files.write-claude-md — CLAUDE.md captures project instructions; memory captures cross-session learningprune-agent-memory — the inverse of manage-memory: auditing, classifying, and selectively forgetting stored memorieswrite-continue-here — write a structured continuation file for session handoff; complements memory as a short-term context bridgeread-continue-here — read and act on a continuation file at session start; the consumption side of the handoffcreate-skill — new skills may produce memory-worthy patternsheal — self-healing may update memory as part of integration stepmeditate — meditation sessions may surface insights worth persisting