From claude-engram
Unified reflection pass — consolidate memory files, prune the index, and propose CLAUDE.md rule updates from recent sessions. Use when asked to 'reflect', 'consolidate memory', 'clean up memories', 'prune memories', 'find patterns', 'what have I been doing', 'update my rules', or after accumulating 5+ sessions. Memory files: writes/merges/prunes with judgment. CLAUDE.md: advisory only — never writes without explicit approval.
npx claudepluginhub sebastianbreguel/claude-engramThis skill uses the workspace's default tool permissions.
You are performing a reflection. Two outputs:
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Performs token-optimized structural code search using tree-sitter AST parsing to discover symbols, outline files, and unfold code without reading full files.
You are performing a reflection. Two outputs:
Memory directory: ${MEMORY_DIR}
${MEMORY_DIR_CONTEXT}
Session snapshots: ~/.claude/session-env/
Session transcripts: ${TRANSCRIPTS_DIR} (large JSONL — grep narrowly, don't read whole files)
ls the memory directory; skim existing topic files so you improve rather than duplicate.${INDEX_FILE} to understand the current index..claude/CLAUDE.md and global ~/.claude/CLAUDE.md. You'll check them for violations and gaps.logs/ or sessions/ subdirectories exist, review recent entries.Sources in rough priority order:
ls -t ~/.claude/session-env/precompact-*.md | head -10, read the 5 most recent (skip precompact-last.md, it's a duplicate).logs/YYYY/MM/YYYY-MM-DD.md) if present — append-only stream.grep -rn "<narrow term>" ${TRANSCRIPTS_DIR}/ --include="*.jsonl" | tail -50Extract: decisions, user corrections, tool preferences, architecture choices, rule violations.
Score each signal across six categories:
Frequency threshold:
Consider consistency (contradicted anywhere?) and scope (global vs project-specific).
Write or update memory files at the top level of the memory directory. Use the memory format and type: conventions from your system prompt's auto-memory section.
Update ${INDEX_FILE} (keep under ${INDEX_MAX_LINES} lines AND ~25KB):
- [Title](file.md) — one-line hook.Temporal review — scan verified: frontmatter fields:
verified: → add verified: [today's date].Present findings as a structured report. DO NOT write to CLAUDE.md — propose and wait.
## Reflection Report — [date]
### Strong patterns (3+ occurrences)
1. [Pattern] — evidence: [sessions/memories] — proposed rule: `[one-line imperative]`
### Emerging patterns (2 occurrences)
1. [Pattern] — evidence: [...] — proposed rule: `[...]`
### Rule violations detected
1. [Rule] violated in [context] — suggested strengthening: [how]
### Stale rules (consider removing)
1. [Rule] — not relevant recently because [reason]
### Memory health
- Consolidated: [list]
- Pruned: [list]
- Flagged for review: [list]
Return a brief summary: what was consolidated/pruned and what rules were proposed. If nothing changed, say so.${ADDITIONAL_CONTEXT?`
${ADDITIONAL_CONTEXT}`:""}