Extracts durable workflow preferences and project conventions from a session, then proposes the smallest valid update to global or project CLAUDE.md files. Trigger when the user asks to remember rules
by @lq434239
Extracts durable workflow preferences and project conventions from a session, then proposes the smallest valid update to global or project CLAUDE.md files. T...
clawhub install self-improving-sessionπ About This Skill
name: self-improving-session description: Extracts durable workflow preferences and project conventions from a session, then proposes the smallest valid update to global or project CLAUDE.md files. Trigger when the user asks to remember rules, when repeated preference patterns appear, or at session end for non-trivial sessions.
self-improving-session
> 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.
Security and Runtime
CLAUDE.md files after user confirmationQuick Reference
| Signal | Action |
|--------|--------|
| Explicit user correction | Add or update a [stable] rule immediately |
| Explicit durable project rule | Add as [stable] project rule |
| Repeated preference seen 2 times across meaningfully different tasks | Add as [tentative] |
| Repeated preference seen 4 times across multiple task contexts | Upgrade to [stable] |
| One-off scenario-specific choice | Skip |
| Full prompt text | Never store |
| Code facts, file paths, temporary state | Never store |
| Nothing worth learning | Say so directly |
Core Principle
Prefer under-learning to over-learning. A noisy CLAUDE.md harms future sessions more than a missed weak signal.
The best outcome is often:
Step 1: Scan the Session
Look for two categories:
A. Workflow preferences and corrections
self-improving-prompt workflow choicesOnly treat a signal as durable if it appears reusable across tasks.
B. Project rules and conventions
Step 2: Filter Noise
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.
Step 3: Classify Scope
Choose the destination by scope:
~/.claude/CLAUDE.mdCLAUDE.mdCLAUDE.mdDo not mix personal workflow rules into a project convention section.
Step 4: Apply Confidence Rules
Use one consistent threshold:
[stable][tentative][stable]If the evidence is weaker than that, do not learn it.
Step 5: Merge Carefully
[tentative] overwrite an existing [stable][stable]Rule Budget
To prevent CLAUDE.md bloat:
CLAUDE.md section is already over budget, compact first and do not append new rules unless the user explicitly approvesConfidence Markers
[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:
- 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]
Event Consumption from self-improving-prompt
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 aboveConfirmation Before Writing
By 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.
Output Format
When writing rules:
Global Workflow Rules from Project ConventionsBefore adding a rule, validate it against references/rule-quality.md.
Notes
Optional session-end automation examples are documented in README.md. They are convenience setup, not a requirement of the skill itself.
π Tips & Best Practices
Optional session-end automation examples are documented in README.md. They are convenience setup, not a requirement of the skill itself.