从会话中提取持久化的工作流偏好和项目约定,然后提议对全局或项目级 CLAUDE.md 文件进行最小有效更新。
Good session learning captures durable guidance, not conversational residue.
Extract reusable lessons from the current session and propose the smallest valid update to CLAUDE.md. The goal is not to remember everything. The goal is to preserve only rules that improve future sessions while keeping the rule set small.
This skill works standalone.
It can learn from ordinary sessions or from sessions shaped by self-improving-prompt.
When paired together:
self-improving-prompt shapes task framing and execution behaviorself-improving-session reviews the resulting session and extracts durable workflow rulesThis skill should learn from behavior patterns, corrections, and repeated outcomes, not from storing the refined prompt text itself.
CLAUDE.md files after user confirmationSignalActionExplicit user correctionAdd or update a [stable] rule immediatelyExplicit durable project ruleAdd as [stable] project ruleRepeated preference seen 2 times across meaningfully different tasksAdd as [tentative]Repeated preference seen 4 times across multiple task contextsUpgrade to [stable]One-off scenario-specific choiceSkipFull prompt textNever storeCode facts, file paths, temporary stateNever storeNothing worth learningSay so directly
Prefer under-learning to over-learning. A noisy CLAUDE.md harms future sessions more than a missed weak signal.
The best outcome is often:
Look for two categories:
self-improving-prompt workflow choicesOnly treat a signal as durable if it appears reusable across tasks.
Skip:
self-improving-promptDo not learn courtesy language as a durable preference.
See references/rule-quality.md for what counts as a strong, reusable rule versus noise.
Choose the destination by scope:
~/.claude/CLAUDE.mdCLAUDE.mdCLAUDE.mdDo not mix personal workflow rules into a project convention section.
Use one consistent threshold:
[stable][tentative][stable]If the evidence is weaker than that, do not learn it.
[tentative] overwrite an existing [stable][stable]To prevent CLAUDE.md bloat:
CLAUDE.md section is already over budget, compact first and do not append new rules unless the user explicitly approves[tentative]: observed twice and likely reusable, but not well validated yet[stable]: explicitly stated or validated repeatedly[corrected: YYYY-MM-DD]: old rule superseded by explicit user correctionExample:
markdown
- Prefer concise final answers by default [stable]
- Show refined prompts only when refinement materially improves execution [stable]
- Write scope explicitly for risky code tasks [tentative]
- ~~Always use popup confirmation~~ -> Use compare-first only when refinement adds substantial value [corrected: 2026-04-14]
If self-improving-prompt emits abstract events, use them as weak evidence only.
Examples:
choose_refinedchoose_originalexplicit_no_compareexplicit_compare_firstRules:
[tentative] or [stable] rule using the thresholds aboveBy default, show the user:
Then wait for confirmation before writing.
Skip confirmation only when:
If interactive confirmation is unavailable, fall back to plain-text confirmation.
When writing rules:
Global Workflow Rules from Project ConventionsBefore adding a rule, validate it against references/rule-quality.md.
Optional session-end automation examples are documented in README.md. They are convenience setup, not a requirement of the skill itself.