Self-evolving skill system — learn reusable patterns from experience via Read-Write Reflective Learning
npx claudepluginhub tmdgusya/momentoSelf-evolving skill system — learn reusable patterns from experience via Read-Write Reflective Learning
A Claude Code plugin that lets your agent learn from experience. Based on the Read-Write Reflective Learning framework from the Memento-Skills paper.
"If the model weights are frozen, all adaptation must come from the input — the prompt, the context, or in our case, the memory."
Every time you complete a task with Claude Code, patterns emerge — ways of handling API errors, debugging strategies, project-specific workflows. Normally, these patterns vanish when the session ends.
Memento-Skills captures them as learned skills — structured markdown files that persist across sessions. Each skill tracks its own utility score, so the system knows which patterns actually work and which need improvement.
Session Start Session End
│ │
▼ ▼
┌──────────┐ ┌─────────┐ ┌──────────────────┐
│ Read │───▶│ Act │───▶│ Reflect (Write) │
│ (hook) │ │ (task) │ │ /memento reflect │
└──────────┘ └─────────┘ └────────┬─────────┘
Load metrics │
+ skill table ┌──────┴──────┐
│ │
Update Create new
metrics learned skill
│ │
▼ ▼
metrics.json SKILL.md
│ │
└──────┬──────┘
│
Next session's
hook loads these
Memento-Skills: Let Agents Design Agents (Zhou et al., 2026)
The paper introduces a self-evolving agent system built on the Stateful Reflective Decision Process (SRDP). The key insight: if you treat reusable skills (stored as structured markdown) as external memory, a frozen LLM can continuously improve without parameter updates.
| Concept | Paper | This Plugin |
|---|---|---|
| Skill Memory | Markdown files encoding behavior + context | learned-*/SKILL.md files |
| Read Phase | Retrieve relevant skill via trained router | SessionStart hook injects skill table with utility scores |
| Write Phase | Reflect on outcome, update skill library | /memento reflect — self-evaluate + update metrics |
| Skill Router | Contrastive embedding model (InfoNCE + offline RL) | Claude's natural language matching + utility scores |
| Utility Tracking | U(skill) = n_success / (n_success + n_failure) | metrics.json with per-skill scoring |
| Skill Discovery | Auto-create when no skill matches | /memento create |
| Skill Optimization | Failure attribution + file-level rewriting | /memento optimize |
| Convergence | Proven under KL-regularised soft policy iteration | Heuristic (utility trends over time) |
Starting from just 5 atomic skills, the system:
# 1. Add the marketplace
claude plugins marketplace add tmdgusya/momento
# 2. Install the plugin
claude plugins install memento-skills@momento
# 3. Restart Claude Code to activate
claude plugins list
# Should show: memento-skills@momento Version: 0.1.0 Status: ✔ enabled
claude plugins uninstall memento-skills@momento
claude plugins marketplace remove momento
jq recommended for full metrics table in session hook (falls back to basic mode without it)bc for utility threshold comparisons/memento reflect — Learn from What You Just DidAfter completing a task, reflect on what worked:
> /memento reflect
Analyzing this session...
Task: Implemented retry logic for API timeout handling
Self-evaluation: SUCCESS — completed in one pass, user accepted without corrections
Pattern discovered: "API retry with exponential backoff + circuit breaker"
This pattern required non-obvious domain knowledge and would help future tasks.
Want me to capture this as a learned skill? I'll use /memento create.
/memento create — Capture a Reusable Pattern> /memento create
Should this be a global skill (all projects) or project skill (this project only)?
> global