Score and rank patterns by effectiveness after reuse. Adjust confidence up on success, down on failure, and update usage statistics. Triggers: score pattern, rate pattern, pattern feedback, pattern worked, pattern failed
neural-session-train to batch-update patterns used in the current sessionpat-retry-backoff)memory/patterns/pat-[slug].jsonLocate the pattern file at memory/patterns/pat-[slug].json. Read the current values:
confidence (current score)usage_count (total times applied)success_count (times it led to success)failure_count (times it led to failure)last_used (timestamp of last application)Classify the outcome:
Update the confidence score based on outcome:
| Outcome | Adjustment | Rationale |
|---|---|---|
| Success | confidence += 0.05 | Reinforces the pattern |
| Partial success | confidence += 0.02 | Mild reinforcement |
| Failure | confidence -= 0.10 | Penalises more heavily to avoid repeated failures |
Clamp the result: confidence = max(0.0, min(1.0, confidence))
usage_count += 1
if outcome == success:
success_count += 1
elif outcome == failure:
failure_count += 1
last_used = [current ISO timestamp]
Save the updated values back to memory/patterns/pat-[slug].json. Preserve all other fields unchanged.
Update the pattern's entry in memory/patterns/index.json with the new confidence and last_used values.
If the updated confidence drops below 0.1:
neural-pattern-pruneAppend to logs/claude_log.md:
### Pattern Scored — [timestamp]
- Pattern: [name] (pat-[slug])
- Outcome: [success/partial/failure]
- Confidence: [old] → [new]
- Usage: [count] total ([successes] success, [failures] failure)
memory/patterns/pat-[slug].json with new confidence and usage statsmemory/patterns/index.jsonlogs/claude_log.md