← the whole session plugin/skills/smc-prediction-server/SKILL.md
Predict how the person you're working with will react to a draft message, using a local index built from your own past sessions with them — before you send it, not after.
Reaction Predictor (local, no server, no key)
Before an agent hands work back, the most useful thing it could know is how the person is going to react to it: "great, push it," or "did you actually test that?," or "that's not what I asked for." Your own history is full of exactly those reactions — each one sitting right after the agent message that provoked it. This turns that history into a lookup: give it a draft, it finds the most similar things agents said before and how you actually replied.
This ships as two working, dependency-free Node scripts (no Python, no model download, no persistent server, no API key) — a real local fallback, not a description of infrastructure you'd have to build yourself first. If you later want true semantic-embedding similarity instead of keyword overlap, see "Optional upgrade" below; the default here works the moment you run it.
Build the index (once, then periodically)
node <path-to-this-skill>/scripts/extract-pairs.js
This walks your own past Claude Code sessions for the current project (~/.claude/projects/<this-project>/*.jsonl), pairs each agent message with your actual next reply, and writes the index to the folder alignment-harness records reaction-predictor prints. It:
- Never includes hook-injected context or tool output as if it were something you typed — anything carrying a system-reminder or hook-context marker is dropped from the "your reply" side entirely.
- Redacts anything that looks like a secret (API keys, tokens, private key blocks) before writing, and tells you how many it redacted.
- Stays entirely local — nothing leaves your machine, nothing is sent anywhere.
Re-run it any time you want the index to include more recent sessions — it's not automatic.
Predict a reaction
node <path-to-this-skill>/scripts/predict.js "I finished the feature and all tests pass"
Returns the top few most similar past moments — what the agent said, and how you actually replied — ranked by keyword overlap. If nothing in your history is close, it says so plainly ("no close precedent") rather than returning a weak match dressed up as a prediction. That honesty matters more than a always-confident-looking answer: a guess presented as a finding is exactly the failure this whole harness exists to prevent.
Using it before you send something
Run a prediction on your own draft before presenting it, especially for anything that changes scope, touches something risky, or you're not fully sure how it'll land. If the closest precedents show frustration or a correction, revise before sending rather than after.
What only you can supply, and what happens without it
The only thing this needs is your own history — there's no "starter" version of this that makes sense from someone else's replies, because the whole point is predicting you, specifically.
- If the index doesn't exist yet or is thin (under ~50 pairs):
predict.jssays so plainly rather than guessing from too little. - If you have no session history at all yet on this project:
extract-pairs.jssays there's nothing to build from — this becomes useful once you've had some real sessions here. - As you keep working: re-run
extract-pairs.jsoccasionally and the index keeps improving — no separate setup step needed.
Files
scripts/extract-pairs.js— builds the local index from your own session history (the safe-extraction step: strips hook context, redacts secrets)scripts/predict.js— looks up similar past moments for a draft message- Index location: the folder
alignment-harness records reaction-predictorprints —pairs.jsonl
Optional upgrade: true semantic similarity
Keyword overlap is honest and always works, but it misses paraphrases (different words, same meaning). If you want to upgrade to sentence-embedding similarity later:
- Install a local embedding library (e.g.
sentence-transformersin Python, or an embedding model you already run for something else). - Replace
predict.js's keyword-overlap scoring with a cosine-similarity lookup over embeddings computed for each pair'sagentMessage. - Keep everything else the same — the index format, the redaction step, and the "no close precedent" honesty threshold all still apply; only the similarity metric changes.
This is real extra work (a model to download and run, an environment to manage) — most people won't need it. Keyword overlap already catches most of the value: the whole point is "does this rhyme with something you've reacted to before," and word overlap does that well for a first pass.
To Verify
node scripts/extract-pairs.js
# Should report how many pairs it found, and how many secrets (if any) it redacted.
node scripts/predict.js "I finished the work you asked for and it's all working"
# Should return your closest past reactions, or say plainly there's no close precedent.