skills/reflect/SKILL.md
Extract learnings from today's Claude Code conversations and save them to CLAUDE.md or auto-memory. Use when asked to "reflect on today", "what did I learn today", "extract learnings", "save what I learned", "learn from today", "reflect on this session", "capture insights", or at the end of a work session when the user wants to preserve discoveries, corrections, and decisions as persistent knowledge.
npx skillsauth add antjanus/skillbox reflectInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reflection activated - I'll analyze today's conversations, extract learnings, and help you save them where they'll be most useful.
Reads today's Claude Code conversation history for the current project, identifies corrections, discoveries, architecture decisions, and debugging breakthroughs, then presents each learning for the user to save to their preferred location (project CLAUDE.md, global CLAUDE.md, or auto-memory).
Core principle: Conversations contain valuable knowledge that evaporates when sessions end. Capture it before it's gone.
| Mode | Command | What it does | Use when |
|------|---------|-------------|----------|
| Default | /reflect | Analyze current project's today conversations | End of work session or during breaks |
| Global | /reflect global | Analyze ALL projects' conversations from today | End of day, reviewing cross-project work |
Always use when:
Useful for:
Avoid when:
1. Determine project slug
The project slug is derived from the git repo root path with / replaced by - and prefixed with -:
/Users/jane/projects/myapp → -Users-jane-projects-myappIf unsure, list ~/.claude/projects/ and match by checking the cwd field in conversation files.
2. Find today's conversation files
For default mode (current project only):
# List JSONL files modified today in the project directory
ls -lt ~/.claude/projects/{project-slug}/*.jsonl
Filter to files modified today (compare file mtime with current date). Skip files under 1KB (abandoned sessions).
For global mode (all projects):
# Read history.jsonl and find all today's session IDs
# Then locate their full JSONL files across all project directories
Parse ~/.claude/history.jsonl entries where timestamp falls within today's date range. Group by project and sessionId. Then read the full JSONL files from each project's directory.
3. Parse conversation content
For each JSONL file, read line by line and extract messages:
type is "user" or "assistant"isSidechain: true (subagent noise)isCompactSummary: true (machine-generated summaries)type is "progress" or "file-history-snapshot" (metadata)message.content (string or array of content blocks)type: "text") and thinking blocks (type: "thinking")Focus on extracting the conversation flow - user requests, Claude responses, corrections, and outcomes.
Verification before analyzing:
Read through the parsed conversations and identify these categories of learnings:
Category 1: Corrections (highest value) User corrected Claude's approach or output. Look for:
Category 2: Discoveries New information that wasn't known before:
Category 3: Architecture Decisions Choices made about how to structure code:
Category 4: Debugging Breakthroughs Root causes found during debugging:
Category 5: Workflow Insights Process or tooling discoveries:
For each learning, extract:
project (specific to this codebase), global (useful everywhere), or memory (transient working knowledge)Verification before presenting:
Present learnings to the user one at a time using this format:
### Learning #N: [Title]
**Category:** [Correction | Discovery | Architecture Decision | Debugging Breakthrough | Workflow Insight]
**Context:** [What prompted this]
**Learning:** [The actionable insight]
**Suggested scope:** [project | global | memory]
For each learning, ask the user via AskUserQuestion:
Question: "Where should this learning be saved?"
Options:
1. Project CLAUDE.md - Save under ## Learnings in ./CLAUDE.md
2. Global CLAUDE.md - Save under ## Learnings in ~/.claude/CLAUDE.md
3. Auto-memory - Save to project's MEMORY.md (working knowledge)
4. Skip - Don't save this one
When saving to CLAUDE.md (project or global):
## Learnings section## Learnings before the last section (or at the end)## Learnings
- **[Title]** — [Learning text] _(captured [date])_
When saving to auto-memory:
MEMORY.md from the auto-memory directory## Session Learnings section## Session Learnings
- **[Title]** — [Learning text] _(captured [date])_
If MEMORY.md is approaching 200 lines, warn the user: "MEMORY.md is near the 200-line auto-load limit. Consider moving older entries to a topic file."
After saving all learnings, present a summary:
## Reflection Complete
**Learnings saved:**
- [N] to project CLAUDE.md
- [N] to global CLAUDE.md
- [N] to auto-memory
- [N] skipped
**Files modified:**
- [list of files that were written to]
Verification:
## Learnings section if needed, don't restructure the file.A well-extracted learning has these properties:
Saved to ~/.claude/CLAUDE.md as:
## Learnings
- **Use dataclasses not TypedDict for structured config** — Prefer `@dataclass` over `TypedDict` for structured configuration objects — dataclasses provide runtime validation, default values, and `__post_init__` hooks that TypedDict lacks. _(captured 2026-03-21)_
</Good>
<Bad>
```
We used dataclasses today. They're good.
```
Why this is bad: Not actionable, no context, no comparison to the alternative, no rationale. </Bad>
Why this is bad: Doesn't explain what the fix was, so it won't help prevent the same issue next time. </Bad>
No significant learnings found in today's conversations. The sessions were routine work (commits, minor fixes) without corrections, discoveries, or decisions worth capturing.
Sessions analyzed: 3 Time range: 09:00 - 14:30
</Good>
<Bad>
ERROR: No learnings detected. Reflection failed.
**Why this is bad:** Finding no learnings is a valid outcome, not an error.
</Bad>
---
## Troubleshooting
### Problem: No conversation files found for today
**Cause:** No Claude Code sessions were run today in this project, or the project slug doesn't match.
**Solution:**
- List `~/.claude/projects/` and look for a matching slug
- Check if the repo root path matches the expected slug format
- Try `/reflect global` to scan all projects
- If truly no sessions today, report: "No conversations found for today."
### Problem: Very large JSONL files (>1MB)
**Cause:** Long sessions produce large files.
**Solution:**
- Read only `type: "user"` and `type: "assistant"` lines
- Skip `progress`, `file-history-snapshot`, and `isSidechain: true` entries
- Focus on the last 50 user messages if the file is extremely large
- Consider processing in chunks
### Problem: CLAUDE.md has no ## Learnings section
**Cause:** First time saving learnings to this file.
**Solution:**
- Add `## Learnings` section at a logical position (before "Do Not" section if one exists, or at the end)
- Don't restructure existing content
- Add a brief intro line: learnings captured from work sessions
### Problem: MEMORY.md over 200 lines
**Cause:** Auto-memory has accumulated a lot of content.
**Solution:**
- Warn the user that only the first 200 lines are auto-loaded
- Suggest moving older or topic-specific entries to separate files (e.g., `debugging.md`)
- Link from MEMORY.md: `See [debugging notes](./debugging.md) for detailed debugging patterns`
### Problem: Learnings seem trivial or obvious
**Cause:** AI extraction is overly aggressive on minor points.
**Solution:**
- Apply a significance threshold: skip learnings that are common knowledge
- Focus on corrections (user explicitly said something was wrong) and debugging breakthroughs (actual problems solved)
- When in doubt, present it to the user - they can skip trivially
---
## Integration
**This skill works with:**
- **track-session** (replaces remember) - `/track-session resume` reconstructs context from past sessions. `/reflect` extracts and persists learnings from today's sessions. Use `/track-session resume` when returning to a project, `/reflect` when ending a session.
- **track-session** - If a session is active, `/reflect` can include SESSION_PROGRESS.md context when analyzing what was learned during tracked work.
- **track-roadmap** - Architecture decisions captured by `/reflect` often relate to roadmap features in progress.
**Workflow pattern:**
Work session → /reflect → Save learnings → /track-session save → End session
**How this skill differs from related commands:**
| Command | Purpose | Use when |
|---------|---------|----------|
| `/reflect` | Extract and save learnings from today | End of session, want to preserve knowledge |
| `/track-session resume` | Reconstruct context and continue work | Starting a session, need to catch up |
| `/memory` | View/edit Claude's auto-memory directly | Manual memory management |
| `claude --continue` | Resume last conversation | Want to keep the same context window |
---
## References
- [Claude Code Memory Documentation](https://code.claude.com/docs/en/memory) - Official auto-memory system docs
- [claude-reflect](https://github.com/BayramAnnakov/claude-reflect) - Inspiration for correction detection patterns
- [Claudeception](https://github.com/blader/Claudeception) - Autonomous skill extraction approach
- [claude-mem](https://github.com/thedotmack/claude-mem) - Full session capture and compression
development
EXPERIMENTAL. Mine recent Claude Code transcripts for friction events, cluster them by active skill, propose patches for skills with 3+ friction events, validate each patch via headless replay, scrub the report through /publish-check, and present an EVOLUTION_REPORT.md for human review on a branch (never auto-merge). Use when asked to "evolve my skills", "audit skills against recent friction", "propose skill improvements from transcripts", "run the skill evolution pipeline", or as part of a weekly skill-quality cadence.
testing
Manual QA tracking — things tests can't verify. Use when asked to "create a QA list", "set up QA for this project", "what should I QA", "track manual QA", "audit the QA list", or "start manual QA".
development
Multi-source web research with cited synthesis in chat. Use when asked to "research X", "deep research on Y", "deep dive on Z", "investigate this topic", "compare X and Y", "pros and cons of X", or "survey the landscape of Y".
development
Use this skill whenever the user wants a multi-agent review of local changes — triggers include "review my code", "review these changes", "do a code review", or "check my changes before I commit". Writes REVIEW.md. Do NOT use for an open PR by number (use /review) or a security-specific pass (use /security-review).