brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
manage-memoryOrganize, 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 worth pre…
Independent GitHub snapshot · Automated classification · Original documentation governs
Maintain Claude Code's persistent memory directory so it stays accurate, concise, useful across sessions. MEMORY.md loaded into system prompt on every conversation — lines after 200 are truncated. File must be lean index pointing to topic files for detail.
~/.claude/projects/<project-path>/memory/)Read MEMORY.md and list all files in memory directory:
wc -l <memory-dir>/MEMORY.md
ls -la <memory-dir>/
Check line count against 200-line limit. Inventory existing topic files.
Got: Clear picture of total lines, number of topic files, which sections exist in MEMORY.md.
If fail: Memory directory doesn't exist? Create it. MEMORY.md doesn't exist? Create minimal one with # Project Memory header and ## 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: List of entries stale, with correct current values.
If fail: Can't verify claim (e.g., it references external state you can't check)? Leave it but add (unverified) note rather than silently preserving potentially wrong information.
For new entries, apply these filters before writing:
Exception: User explicitly asks to remember something? Save immediately — no need to wait for multiple confirmations.
Got: Filtered list of entries worth adding, each meeting durability + non-duplication + verification + actionability criteria.
If fail: Unsure whether entry is worth keeping? Err toward keeping briefly in MEMORY.md — easier to prune later than to rediscover.
When section in MEMORY.md exceeds ~10-15 lines, extract to dedicated topic file:
<memory-dir>/<topic-name>.md with 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 self-contained and readable without MEMORY.md context.
If fail: Topic file would be fewer than 5 lines? Probably not worth extracting — leave inline in MEMORY.md.
Apply all changes: remove stale entries, add new entries, update counts, ensure 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 under 200 lines, accurate, has working links to all topic files.
If fail: Can't get under 200 lines after extraction? Identify least-frequently-used section, extract it. Every section is candidate — even project structure overview can go to topic file if needed, leaving just 1-line summary.
Run 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 accurate.
If fail: Fix broken links (update or remove). Orphan files? Either add reference in MEMORY.md or delete if no longer relevant.
.md files in memory directory (every file linked from MEMORY.md)patterns.md, viz-architecture.md) far more useful for retrieval than date-based files.write-claude-md — CLAUDE.md captures project instructions. Memory captures cross-session learningprune-agent-memory — inverse of manage-memory: auditing, classifying, selectively forgetting stored memorieswrite-continue-here — write structured continuation file for session handoff. Complements memory as short-term context bridgeread-continue-here — read and act on continuation file at session start. Consumption side of 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