End-of-session pattern training. Review all tasks completed in the session, extract new patterns, score reused patterns, update usage counts, and produce a training report. Triggers: session train, end of session learn, train patterns, session review, learn from session
session-closelogs/claude_log.md contains entries from the current sessionmemory/patterns/ directory exists with index.jsonmemory/sona-config.json exists for learning rate referenceScan logs/claude_log.md and state/STATE.md for all tasks completed in the current session. For each task, capture:
For each task that used an existing pattern from memory:
neural-pattern-score logic to update confidence and usage statsFor each task that did NOT use an existing pattern:
neural-pattern-extract logic to create a new patternAfter adding new patterns, scan for near-duplicates:
neural-pattern-prune handle itIf 5 or more pattern-use events occurred this session:
neural-learn-rate logic to adjust the rate if warranted## Session Training Report — [timestamp]
### Tasks Reviewed: [N]
### Patterns Reused
| Pattern | Task | Outcome | Confidence Change |
|---------|------|---------|-------------------|
| pat-retry-backoff | Fix timeout errors | success | 0.65 → 0.70 |
### New Patterns Extracted
| Pattern | Source Task | Tags | Confidence |
|---------|-----------|------|-----------|
| pat-docker-layer-cache | Optimize build time | docker, performance | 0.50 |
### Patterns Flagged
- Near-duplicate: pat-new-approach ≈ pat-existing-approach (80% tag overlap)
### Learning Rate
- Session accuracy: [x.xx]
- Rate adjustment: [old] → [new] ([converge/explore/hold])
### Memory Store Summary
- Total patterns: [N]
- Average confidence: [x.xx]
- Patterns above 0.7: [N] (reliable)
- Patterns below 0.2: [N] (candidates for pruning)
state/STATE.md under the session sectionlogs/claude_log.mdmemory/patterns/ with new scores and entriesmemory/patterns/index.jsonmemory/sona-config.json (if learning rate was adjusted)state/STATE.md and logs/claude_log.md