Skill evolution: skills that rewrite themselves
AutoContext now tracks which skills are active when corrections happen. Lessons accumulate per-skill with confidence scores. When enough evidence builds up, run /autocontext-evolve and Claude will rewrite the skill file itself, weaving validated lessons into the existing content.
The cold start problem
Every new Claude Code session forgets what the last one learned. You correct the same mistakes, re-explain the same patterns, and lose time to errors that should have been caught.
Session amnesia
Each session starts cold. Schema, conventions, and gotchas — all forgotten.
Developer drift
Your Claude and your teammate's Claude learn different things. Changes conflict.
Repeat mistakes
Same API pattern errors, same missing trailing slashes, same wrong assumptions.
Lazy tests
Tests that describe current behavior instead of specifying desired behavior.
What it looks like in practice
You correct Claude during a session
"No, always use pytest -x here, not pytest"
Autocontext captures this as a lesson candidate
Next session, Claude is about to run pytest
Autocontext injects a warning: "lesson: always use pytest -x in this project"
Claude follows the lesson instead of repeating the mistake
Over time, lessons gain or lose confidence
Lessons that keep proving useful get stronger. Lessons that go stale or get contradicted fade out.
Your project builds a curated knowledge base automatically
How skill evolution works
The lesson loop above captures project-specific knowledge. Skill evolution takes it further: lessons that apply to a skill itself get folded back into the skill file, so the skill permanently improves.
You use a skill and correct Claude
"No, always set a User-Agent header when scraping news sites" — while using the web-scraping skill.
Autocontext tags the correction with the active skill name
The lesson gains confidence over multiple sessions
Each session that uses the lesson without contradicting it bumps its confidence score. Across projects, evidence accumulates.
Validated 5+ times across 2 projects → high confidence
You promote it to the global skill store
During /autocontext-review, select "Promote to global" on a high-confidence skill-tagged lesson. It moves from your project's local store to ~/.claude/skill-lessons/.
Now available across all projects that use this skill
Run /autocontext-evolve to rewrite the skill
Claude reads the current skill file and all eligible lessons, then generates an improved version with the lessons woven in naturally. You review a diff and approve, reject, or edit.
The skill file itself gets better — not just a sidecar
The cycle repeats
New corrections happen, new lessons accumulate, and the skill keeps improving. Each evolution builds on the last. Every backup is timestamped, and --rollback can undo any change.
Skills get better every time you use them
The full data flow
Five hooks, one feedback loop
Knowledge flows through five hook events that capture, validate, and surface lessons automatically.
Load + curate
Loads lessons, curates pending candidates, applies confidence decay.
Warn
Before edits and commands, checks if relevant lessons exist. Prevents known mistakes.
Detect
Scans for correction patterns. Captures "no, use X instead" as lesson candidates.
Check
Tracks performance baselines. Flags tautological tests and missing edge cases.
Persist
Bumps confidence on validated lessons. Saves candidates for next session. Pure file I/O.
Lesson lifecycle
Watch how lessons are created, validated, and aged. Click the buttons to simulate session events.
lessons.json
0 lessonsplaybook.md
auto-generatedWhat's included
Test quality rules
Catches tautological tests, missing edge cases, bare assertions, and mock-as-assertion patterns.
Cross-developer sharing
Lessons sync via git with a custom merge driver. Additive counters, tag union, tombstone deletion.
Confidence decay
Lessons that aren't validated lose confidence over time. Stale knowledge fades. Fresh knowledge stays.
Performance baselines
Tracks test and build timing. Flags regressions above 10%. Stores baselines per command.
Skill evolution
Skills improve themselves. Lessons accumulate per-skill, then get folded back into the skill's markdown via Claude-powered rewriting.
12-step setup wizard
Interactive wizard covers identity, test rules, loading, persistence, staleness, injection mode, correction sensitivity, baselines, playbook, multi-machine, skill learning, and evolution settings.
CLAUDE.md seeding
Already have a CLAUDE.md full of gotchas? Seed your initial lessons from it automatically.
Five commands,
zero friction.
Everything runs through slash commands. The hooks do the heavy lifting in the background.
/autocontext-setupOne-time wizard. 12 steps covering identity, test rules, loading, persistence, staleness, pre-edit warnings, correction sensitivity, performance baselines, playbook generation, multi-machine support, skill learning, and evolution settings.
/autocontext-initInitialize in a project. Creates .autocontext/, optionally seeds from CLAUDE.md.
/autocontext-reviewCurate lessons interactively. Approve, edit, delete, supersede, or promote to global skill store.
/autocontext-statusQuick stats. Lesson counts, confidence averages, stalest lessons, merge driver status.
/autocontext-evolvenewFold validated lessons into skill files. Claude rewrites the skill with lessons woven in naturally. Supports --rollback, --export, and --import for backup and cross-machine sync.
Get started
You need Claude Code installed. Open your terminal and run claude --version to check.
Add the plugin source
This tells Claude Code where to find the plugin. You only need to do this once.
claude plugin marketplace add https://github.com/jamditis/claude-skills-journalism
Install autocontext
Install the plugin from the marketplace.
claude plugin install autocontext
Set up and initialize
Run the setup wizard, then initialize in your project.
/autocontext-setup # one-time global config
/autocontext-init # per-project initialization
New in v1.1 — skill evolution
Skills are no longer static. Corrections accumulate per-skill and get folded back into the skill's actual content.
Per-skill lesson tracking
When you correct Claude while using a skill, the correction is tagged with which skill was active. Lessons accumulate with context.
Global skill store
Lessons are promoted from per-project storage to a global store at ~/.claude/skill-lessons/. Knowledge transfers across projects.
Claude-powered rewriting
Run /autocontext-evolve and Claude rewrites the skill file with validated lessons woven in naturally. Review the diff before accepting.
Backup and rollback
Every evolution creates a timestamped backup. Restore any skill with --rollback if the changes don't work out.
Cross-machine sync
Export and import skill lessons between machines with --export and --import. Union merge keeps everything consistent.
Fully opt-in
Disabled by default. Enable via /autocontext-setup step 11, or set skill_learning.enabled: true in config. Zero overhead if you don't use it.
Inspired by
greyhaven-ai/autocontext
A closed-loop system for improving agent behavior over repeated runs. Persistent playbooks, curator agents, and confidence-scored knowledge shaped how this plugin handles lesson persistence and validation.
karpathy/autoresearch
AI agents running autonomous research loops. The pattern of accumulating structured knowledge across sessions and reinforcing successful strategies influenced the session lifecycle design.