Analyze accumulated feedback memories and turn recurring patterns into permanent controls (rules, permissions, hooks) or common-mistakes entries. Use when the user says "improve", "iyileştir", "apply feedback", "kurallaştır", or "turn feedback into rules".
Target area: $ARGUMENTS
Before analyzing feedback, check the overall lifecycle health:
Common-mistakes capacity: Read .claude/rules/common-mistakes.md and count items.
docs/learnings/README.md before proceeding to Step 1.Old learnings: Glob docs/learnings/*.md (exclude README.md). Check file dates in filenames (YYYY-MM-DD prefix).
docs/archive/ and continue.Duplicate memories: Glob memory/*.md. Check for files with overlapping descriptions or topics.
After health check, proceed to feedback analysis.
Glob memory/*.md. For each file, read the YAML frontmatter. Keep only files where type: feedback.
If no feedback memories exist, stop:
No feedback memories found in memory/.
Feedback memories are created automatically when you correct Claude during a session.
Nothing to improve yet — keep working and check back later.
Read the content of each feedback memory. Extract the area/topic from:
description field in frontmatterGroup feedback files by area. Count entries per area.
If $ARGUMENTS is not empty, filter to only the matching area. If no match, list available areas and ask which one.
If $ARGUMENTS is empty, continue with all areas.
For each area, apply thresholds:
| Count | Recommendation |
|---|---|
| 1-2 | Skip — not a pattern yet, memory is sufficient |
| 3-4 | Suggest adding to common-mistakes.md |
| 5+ | Suggest creating a permanent control via /new-rule |
Print a summary:
=== Feedback Analysis ===
<area>: <N> feedback entries → <recommendation>
<area>: <N> feedback entries → <recommendation>
<area>: <N> feedback entries → Skip (not a pattern yet)
Which area do you want to act on? (or "all" for batch processing)
If only one area qualifies (3+), print the recommendation and proceed directly to Step 5 without asking.
Before acting, verify constraints:
Read .claude/rules/common-mistakes.md — count current items
/graduate firstGlob .claude/rules/*.md — estimate total token budget
Check if a control already exists for this area
.claude/rules/ for files matching the area keywordSynthesize the feedback entries into a single, concise mistake description
Show the proposed entry to the user:
Proposed common-mistakes entry:
N. **<Title>** — <What goes wrong and the correct approach>
Source: <N> feedback memories (<list file names>)
Add this to common-mistakes.md?
Wait for user approval. If rejected, stop — leave memories unchanged.
Edit .claude/rules/common-mistakes.md — append the new numbered item
Proceed to Step 7 (cleanup)
Synthesize feedback entries into a control description
Show the proposed control to the user:
Proposed control from <N> feedback entries:
Name: <area>-conventions
Surface: <rule / permissions / hook / hybrid>
Scope: <global or path-specific if rule is involved>
Content:
- <directive 1>
- <directive 2>
- ...
Create this control? (I'll use /new-rule to scaffold it properly)
Wait for user approval. If rejected, stop — leave memories unchanged.
Provide the control details so the user can invoke /new-rule <name> with context,
or directly apply changes following /new-rule surface classification
After successfully creating a control or common-mistake entry:
List the feedback memory files that were consumed
Ask the user:
These feedback memories are now captured as a <control/common-mistake>:
- memory/<file1>.md
- memory/<file2>.md
- ...
Delete them? (They're redundant now — the rule enforces the behavior every session)
If yes → delete the files and remove their entries from memory/MEMORY.md
If no → leave them (user may want to keep for reference)
=== Done ===
Action: <Added to common-mistakes.md / Created control <name>>
Source: <N> feedback memories from <area>
Cleaned up: <N files deleted / no files deleted>
Remaining feedback areas with patterns:
<area>: <N> entries (run /improve <area> to process)