/optimise:optimise [an expectation to work on]from optimise
Measures friction in Claude Code prompt history, interviews the user to find expectation failures, proposes minimal changes, and trials them with real prompt replays before applying.
Ships in optimise. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Change how Claude behaves only when a trial shows the change helps. Resolve
scripts/ from this skill's directory. Run each script with Bash
run_in_background: true and read its output when it ends. <work> is a
new scratch folder for this run. Talk in the conversation language. Never
edit the user's real instructions before step 6.
node scripts/measure.cjs --weeks 8. It counts, per week,
what the user typed: bare approvals (go), status questions, doubts,
repeats, swearing, requests to explain. Show the table and the two or
three counters that are high or rising. A --signals <file.json> gives
the user's own patterns and the prompts to skip (sent by other sessions).<work>/expectations.md as one sentence plus the check that counts it
(a key of scripts/grade.cjs, or a file state). An expectation no check
can count is kept apart and said so: it cannot be trialled.CLAUDE.md, rules, the output style, text injected by plugins and hooks.
Name one cause, with the passages:
paths: rule that did not load;node scripts/arm.cjs before and node scripts/arm.cjs after
copy the instructions (add --style <file> for an output style). Apply
the proposed changes to the after copy only. Write <work>/cases.json:
prompts taken from the user's history, each with its expect and, when
it should act, a files probe on a small fixture project. Every run is
a full session on the user's plan, on the model of their settings
(--model only to match the model they really use). Price it first:
one run of one case (--only <id> --runs 1), then cost x cases x arms
x runs. Above a few dollars, show that estimate and ask the go before
the batch. Then
node scripts/replay.cjs --arms before=<dir>,after=<dir> --cases <work>/cases.json --out <work>/run --runs 3.
Add a control: a third arm pointing at the same folder as before
(control=<before dir>). Identical instructions that score differently
show the noise of a case: a gap between before and after no wider
than the gap between before and control proves nothing. Raise
--runs or rewrite the case.
Read the replies in <work>/run/results.json, not only the table: a
case that proves nothing is said so and rewritten. A change is confirmed
when after beats before on its expectation and loses on no other
check. A change the trial does not confirm is dropped, and said so.chore(rules): optimise <file>.
git revert undoes it.{
"fixture": "fixture",
"defaults": { "maxLineLength": 80 },
"allowedTools": ["Bash(ls:*)"],
"cases": [
{ "id": "rename-question",
"prompt": "can you rename total to sum in calc.js?",
"expect": { "notEndsWith": "Go ?" },
"files": { "done": { "path": "calc.js", "match": "function sum" } } }
]
}
fixture is a folder beside the file, copied fresh into every run. A run
may edit only its own folder; a shell command outside allowedTools is
refused. Never give a case a tool that reaches a real account, database or
remote.
A run loads the instructions only: no skills, no hooks, no plugins, no conversation before the prompt. It shows how the instructions read a prompt, not a whole session. Say this with every result.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mirkobozzetto/arsenal --plugin optimiseOther plugins' skills for the same job