Your first correction
rematch learns only from sessions in which you corrected the agent. This page walks through one: what you type, what you see in the next session, and how to ask why.
The example is a real run on a scratch repository. It is one session on a toy repo, not a measured gain.
-
Correct the agent the way you normally would.
You ask for a function in
src/lib.py; the agent adds it. You answer:That’s wrong. Every public function here needs a Google-style docstring and must be exported in
__all__.The turn is pre-labelled as a negation. When the session ends, it is flagged for reflection. Other signals that flag a session: “revert that”, interrupting the agent, or three tool errors in any six results.
-
Open the next session.
A reflection runs in the background (about 20 s, up to 3 model calls). It may stage nothing, for example after a
scoperedirect, an editor answer ofKEEP_BASE, or a reply that still fails lint after its one retry. When it does stage something, one line appears at the top of the session:staged skill src-lib-public-functions in my-repo: Use when adding or modifying public functions in src/lib.py.Behind that line, the redirect was classified
correction(0.86), and one editor call wrote a skill that passed lint:A reflection with gemini-4-argon as classifier and editor. Output condensed to the lines that matter. -
Work on the same kind of task again.
The skill is now provisional: a skill that hasn’t proven itself yet. It loads only in sessions whose repo, file types and task words match the one that produced it. In this run the agent exported and documented the next function unprompted; that is one session, not a measured gain.
Staged is not kept. Later matched sessions can still retire it (what happens next).
-
Ask why.
/rematch why/rematch:rematch-whyrematch library why --textFor the last session it shows which entries loaded, whether each predicate hit, the redirects it saw with their class, and the running counters:
The next matched session: whyexplains the load and the count;lsshows the counts raw.
In Claude Code, the staged line arrives as a rematch digest message at session start. Codex sessions are reflected after rematch import --history --harness codex and rematch reflect --history.