From ct
Manages CLAUDE.md and engram memory lifecycle: generates structured reflections, reviews/applies them, and consolidates memory health. Invoked via /reflect or explicit memory hygiene requests.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ct:reflectThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Structured self-reflection that compounds learning into project-specific instructions and maintains memory health across CLAUDE.md and engram.
Structured self-reflection that compounds learning into project-specific instructions and maintains memory health across CLAUDE.md and engram.
/reflect → Generate mode/reflect review → Review mode/reflect consolidate → Consolidate modeReflect on the current conversation and produce a structured entry.
Review the conversation for:
Determine the current branch and date:
git branch --show-current 2>/dev/null || echo "unknown"
date +%Y-%m-%d
Produce a reflection with exactly four categories. Each category has 1-3 items max.
→ Before finalizing each item → Is this specific enough that a teammate could act on it without asking what I mean? Does it reference a concrete tool, error, function, or behavior? Yes → Keep it. No (e.g., "Testing is important", "Always test your code") → Reject and rewrite with concrete detail.
Bad example: "Testing is important"
Good example: "The stripe.webhooks.constructEvent function throws if the raw body is parsed as JSON first — always pass the raw Buffer"
Format each item as: - [PENDING] <specific, actionable observation>
Append to .claude/REFLECTION.md using this format:
## YYYY-MM-DD — branch: <branch> — <one-line summary of work>
### Surprises
- [PENDING] <item>
### Patterns
- [PENDING] <item>
### Prompt improvements
- [PENDING] <item>
### Mistakes
- [PENDING] <item>
If the file doesn't exist yet, create it with a # Reflections header first.
If a category has nothing worth noting, write - [SKIPPED] Nothing notable this session — do not omit the category.
Check if the project has .claude/CLAUDE.md:
test -f .claude/CLAUDE.md && echo "exists" || echo "missing"
If it exists, check if @REFLECTION.md is already referenced. If not, add it:
@REFLECTION.md
If .claude/CLAUDE.md does not exist, inform the user:
"Note: No
.claude/CLAUDE.mdfound in this project. When you create one, add@REFLECTION.mdto it so reflections are loaded as context."
Show the user the reflection entry that was written. Done.
Walk through pending reflections, apply approved ones to CLAUDE.md, then review engram memories.
Read .claude/REFLECTION.md and find all lines matching - [PENDING] (case-insensitive).
If none found, report "No pending reflections to review." but still proceed to Step 4 (engram review).
For each [PENDING] entry, present it to the user with these options:
[APPROVED].→ Presenting entries → Have I received the user's response to the previous entry? No → Wait for input. Do NOT batch multiple entries in one message. Yes → Present the next entry.
For each approved entry:
[PENDING] to [APPROVED] in .claude/REFLECTION.md.claude/CLAUDE.md under a ## Learnings section. Create the section if it doesn't exist.For each rejected entry:
[PENDING] to [REJECTED] in .claude/REFLECTION.mdReport: "Reflection review complete: N approved, N rejected, N remaining."
This step is MANDATORY. It runs every time review mode is invoked, even if there were no pending reflections. Do not skip this step.
"Before we finish, let's review your engram memories for this project. This keeps your cross-session memory accurate."
4a. → Before continuing engram review → Execute mem_search with a broad query (e.g., the project name or "*") for this project, limit 20. Did the call actually execute?
No → STOP. You must call it, not assume results.
This mem_search call is the ENTIRE POINT of review mode. It runs even when no pending reflections exist, because stale engram observations accumulate independently of reflections. The mandate is load-bearing; do not skip for 'nothing to do' heuristics.
If mem_search fails (engram unavailable), report: "Engram is not reachable — skipping memory review." and end.
If no results, report: "No engram observations found for this project." and end.
4b. Filter out any observations whose title starts with [STALE] — these were already marked in a previous review.
4c. → Presenting observations → Have I received the user's response to the previous observation? No → Wait for input. Do NOT batch multiple observations in one message. Yes → Present the next observation.
If the search returns >20 observations, present the top 20 by last-updated timestamp and ask the user whether to continue through the remainder. Do not process >20 in one session without explicit confirmation.
For each non-stale observation, show title, type, and a content preview. Offer three options:
mem_update using the observation's IDmem_update with the observation's ID, prepending [STALE] to the title4d. → All observations reviewed → Scan titles and content for 2+ observations covering similar ground.
Found duplicates → Propose merging: mem_update one to contain consolidated content, mark others stale.
No duplicates → Report: "No duplicate observations found."
Do NOT skip this scan by claiming "none obvious" — compare each pair.
4e. Report summary: "Engram review: N kept, N updated, N marked stale, N merged."
Periodic CLAUDE.md health maintenance. Use when CLAUDE.md feels bloated or monthly as hygiene.
.claude/CLAUDE.md (or project root CLAUDE.md — check both, prefer .claude/ if both exist)@ imports)Present all proposed changes grouped by type:
.claude/references/[topic].md and replace with @references/[topic].md"Present as a batch. Ask the user to approve, reject, or edit each proposed change. Then apply all approved changes.
Apply all approved changes to CLAUDE.md. For extractions:
@path importThis step is MANDATORY — the same hard gate as Review Mode Step 4 applies. Do not skip.
Run the same engram review as Review Mode Step 4: call mem_search broadly, filter [STALE] observations, present each to user (Keep/Update/Mark Stale), propose merging duplicates, report summary.
npx claudepluginhub pvillega/claude-templates --plugin ctAnalyzes conversations to identify and propose targeted updates to CLAUDE.md memory files based on user corrections and misunderstandings.
Reviews conversation, extracts learnings, and persists to auto-memory or vault. Run after substantial work sessions to avoid knowledge rot.
Tracks mistakes and lessons learned through structured reflection. Automatically prompts via heartbeat to log insights and review past lessons for continuous improvement.