Claude Code Plugin

AutoContext

A Claude Code plugin that gives your AI assistant a memory for each project.

Every time you correct Claude — "no, use the other API", "you forgot to clear the cache" — autocontext saves that as a lesson. Next session, it loads those lessons before Claude starts working, so the same mistakes don't happen twice.

New in v1.1

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.

Per-skill lesson tracking Claude-powered skill rewriting Backup and rollback Cross-machine sync

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

1

You correct Claude during a session

"No, always use pytest -x here, not pytest"

Autocontext captures this as a lesson candidate

2

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

3

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

New in v1.1

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

Capture
Use skill → post-tool-use.sh tracks active skill
Correct Claude → user-prompt-submit.sh tags with skill name
Next session → session-start.sh curator adds skill/scope fields
Validate
Each session → session-end.sh bumps confidence if unchallenged
Multiple sessions → lesson reaches high confidence (0.85+)
Promote
/autocontext-review → "Promote to global" → ~/.claude/skill-lessons/
Evolve
/autocontext-evolve → scan eligible → claude -p rewrites skill
Review diff → accept/reject/edit → skill file updated
Lessons marked as folded → backup created

Five hooks, one feedback loop

Knowledge flows through five hook events that capture, validate, and surface lessons automatically.

SessionStart

Load + curate

Loads lessons, curates pending candidates, applies confidence decay.

PreToolUse

Warn

Before edits and commands, checks if relevant lessons exist. Prevents known mistakes.

UserPromptSubmit

Detect

Scans for correction patterns. Captures "no, use X instead" as lesson candidates.

PostToolUse

Check

Tracks performance baselines. Flags tautological tests and missing edge cases.

SessionEnd

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 lessons
No lessons yet. Add one below.

playbook.md

auto-generated
Ready. Click a button to simulate events.

What'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-setup

One-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-init

Initialize in a project. Creates .autocontext/, optionally seeds from CLAUDE.md.

/autocontext-review

Curate lessons interactively. Approve, edit, delete, supersede, or promote to global skill store.

/autocontext-status

Quick stats. Lesson counts, confidence averages, stalest lessons, merge driver status.

/autocontext-evolvenew

Fold 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.

1

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
2

Install autocontext

Install the plugin from the marketplace.

claude plugin install autocontext
3

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.