By umxr
Self-Adapting Generative Engine — autonomous learning plugin that captures session events, reflects on outcomes, builds project-scoped knowledge, and self-evaluates its own rules
Organizes, deduplicates, and maintains the SAGE-Code knowledge base. Enforces size limits, merges redundant entries, and updates the project README and CLAUDE.md.
Evaluates the effectiveness of SAGE-Code heuristics by correlating them with session outcomes. Promotes, demotes, or prunes rules based on evidence.
Analyzes session event logs and extracts generalized heuristics into knowledge files. Dispatched by sage-replay when unprocessed session logs are found.
Run SAGE-Code meta-evaluation to score heuristic effectiveness and prune ineffective rules. Triggers automatically every 10 sessions or daily.
Manually trigger SAGE-Code reflection on the current session's events. Use when you want to process learnings without waiting for the next session.
Initializes SAGE-Code for the current session. Processes pending reflections from previous sessions, then loads relevant project knowledge based on current git context. Runs automatically at session start.
Show what SAGE-Code has learned about this project. Displays heuristic counts, confidence breakdown, top learnings, and recent additions.
Matches all tools
Hooks run on every tool call, not just specific ones
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Self-Adapting Generative Engine for Code
A Claude Code plugin that makes Claude autonomously learn and improve within each project.
Grounded in peer-reviewed research: Reflexion (NeurIPS 2023), Contextual Experience Replay (ACL 2025), SAGE (Neurocomputing 2025), and the ICML 2025 position on metacognitive learning.
SAGE-Code observes your Claude Code sessions and builds project-specific knowledge over time:
Everything is fully autonomous — no manual intervention needed.
/plugin marketplace add umxr/sage-code
/plugin install sage-code@sage-code-marketplace
Or add to your ~/.claude/settings.json:
{
"extraKnownMarketplaces": {
"sage-code-marketplace": {
"source": { "source": "github", "repo": "umxr/sage-code" }
}
},
"enabledPlugins": {
"sage-code@sage-code-marketplace": true
}
}
On your first session in any project, SAGE will automatically initialize a .sage/ directory and begin learning.
| Command | Description |
|---|---|
/sage-status | View what SAGE has learned about your project |
/sage-reflect | Manually trigger reflection on current session |
/sage-meta | Run meta-evaluation to score and prune heuristics |
┌─────────────────────────────────────────────────────┐
│ Layer 5: META-LEARNING (Self-Evaluation) │
│ Periodic subagent evaluates rule effectiveness │
│ Promotes, demotes, prunes heuristics │
├─────────────────────────────────────────────────────┤
│ Layer 4: REPLAY (Session Start) │
│ Scores knowledge against current task context │
│ Injects top 10-15 relevant heuristics │
├─────────────────────────────────────────────────────┤
│ Layer 3: KNOWLEDGE (Evolving Files) │
│ Structured markdown files with confidence scores │
│ Categories: pitfalls, strategies, preferences... │
├─────────────────────────────────────────────────────┤
│ Layer 2: REFLECTION (Subagent) │
│ Analyzes session events at session end │
│ Extracts and generalizes heuristics │
├─────────────────────────────────────────────────────┤
│ Layer 1: CAPTURE (Hooks) │
│ Passively observes session events │
│ Writes structured JSONL event log │
└─────────────────────────────────────────────────────┘
SAGE creates a .sage/ directory in your project:
.sage/
├── knowledge/ # Learned heuristics (committed to git)
│ ├── pitfalls.md # Errors and anti-patterns to avoid
│ ├── strategies.md # Proven effective approaches
│ ├── preferences.md# User style and workflow preferences
│ ├── architecture.md# Project structure knowledge
│ └── conventions.md# Coding conventions
├── events/ # Session logs (gitignored, personal)
├── meta/ # Scores, config, history (committed)
└── README.md # Auto-generated summary
Heuristics progress through confidence levels based on evidence:
npx claudepluginhub umxr/sage-code --plugin sage-codeSelf-improving Claude Code plugin — learns from corrections across sessions via reflexio
Self-evolving Claude Code system that learns from corrections, manages context, and improves every session
A continuous, zero-friction learning layer: the agent learns about you and improves its own skills across every session, and can share anonymized, provenance-verified learnings to a global pool. Inspired by Hermes Agent.
Self-learning system for Claude Code that captures corrections and updates CLAUDE.md automatically
Curate auto-memory, promote learnings to CLAUDE.md and rules, extract proven patterns into reusable skills.
Automatic context engineering — observes your coding sessions and generates rules, suggestions, skills, and hooks so Claude gets smarter on your codebase over time