Pick the effort for one Claude Code prompt: `$low` for routine, `$max` for hard. The prompt cache is kept, and the next prompt is back on your usual effort.

Pick the effort for one Claude Code prompt.<br> Same model, same prompt cache. The next prompt is back on your usual effort.

$low rename fetchAll to loadAll routine: think less, answer sooner
$high why does this test flake? a bit more care
$max find the race in the order book hard: think as long as it takes
/plugin install once --marketplace DzmitryShut/once
Answer y to add the marketplace, then pick a scope. In a session that is already open, run /reload-plugins. From a shell: claude plugin install once --marketplace DzmitryShut/once. In the desktop app: + next to the prompt, Plugins, Add marketplace.
Needs Claude Code 2.1.287 or later, the first version that runs mods.
Start a prompt with $ and a level: $low, $medium, $high, $xhigh or $max, in any case. The prefix is cut before the model sees the text. No /effort before the prompt and no /effort back after it.
Anything else goes through as typed, so $HOME is wrong and costs $5 are safe.
The prompt cache belongs to the model, not to the effort. $low and $max keep reading the session's cache, so the only thing a switch changes is how long the model thinks.
| Prompt | Session of 30-40k tokens | Session of 160-175k tokens |
|---|---|---|
no prefix, xhigh | $0.032 | $0.085 |
$low | $0.022 | $0.079 |
$max | $0.061 | $0.111 |
Measured on an Opus 5.5 session at xhigh, one file read per prompt, Claude Code's own cost estimates at API prices (full results, script).
On a code review question in a fresh session, medium cost 27% less than xhigh and low 42% less, and they answered in 23 s and 15 s against 36 s. Only xhigh found the real bug. So: $low for routine prompts, $xhigh or $max where a miss is expensive.
once used to switch the model too. That turned out to be a trap: another model starts with an empty cache and rewrites the whole conversation into its own. In a 160k session one $haiku prompt cost $0.160 against $0.085 for staying on Opus.
For a quick question to another model, use aside: $haiku what does git reset --soft do? asks a subagent with a fresh context and puts the answer in your chat. Both mods use $ and work side by side.
prompt.submit, turn.step and turn.complete, as claude plugin validate lists them.$ and a level: the prefix is cut before the model sees the text.effort on the model requests of the one turn that prompt starts, tool calls included, and stops when the turn ends. Interrupt a turn before it reaches the model and the override is dropped.Third-party marketplaces do not update on their own: run claude plugin update once@once, or turn on auto-update for the marketplace in /plugin under Marketplaces. Remove it with claude plugin uninstall once@once.
claude --plugin-dir /path/to/once
claude plugin validate .
claude plugin test .
node bench/cache.mjs [--model opus] [--effort xhigh] [--pad 95000]
All of it is hooks/register.ts. The benchmark runs a real session and spends real tokens, more with --pad.
hooks/register.ts 57 lines1import type { Register } from 'claude-code'
2
3// `$low fix it`, `$max fix it`: the prefix is stripped and the main agent's
4// model requests for that one prompt use that effort. The session's own
5// effort is never touched, so the next prompt runs on it as before. Effort
6// keeps the prompt cache, so a switch costs nothing extra.
7
8const EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max'] as const
9type Effort = (typeof EFFORTS)[number]
10
11const PREFIX = /^\$(\w+)\s+(\S[\s\S]*)$/
12
13const isEffort = (s: string): s is Effort => (EFFORTS as readonly string[]).includes(s)
14
15function parse(text: string): { effort: Effort; text: string } | undefined {
16 const [, spec, rest] = PREFIX.exec(text) ?? []
17 const effort = spec?.toLowerCase()
18 if (!effort || !rest || !isEffort(effort)) return undefined
19 return { effort, text: rest }
20}
21
22export const register: Register = on => {
23 // Armed by a prompt, bound to the main loop's turn at its next model request.
24 let pending: { effort: Effort; during?: string } | undefined
25 let active: { effort: Effort; turnId: string } | undefined
26
27 on('prompt.submit', async ($, e, next) => {
28 if (e.command || e.isMeta) return next(e)
29 const parsed = parse(e.text)
30 if (!parsed) return next(e)
31 pending = { effort: parsed.effort, during: e.turnId }
32 const entered = await next({ ...e, text: parsed.text })
33 if (entered.drop !== undefined) pending = undefined
34 return entered
35 }).catch(($, e, next) => next(e))
36
37 on('turn.step', async function* ($, e, next) {
38 if (e.agentId !== undefined) return yield* next(e)
39 if (pending) {
40 active = { effort: pending.effort, turnId: e.turnId }
41 pending = undefined
42 }
43 if (active?.turnId !== e.turnId) return yield* next(e)
44 return yield* next({ ...e, effort: active.effort })
45 })
46
47 on('turn.complete', ($, e, next) => {
48 if (e.agentId === undefined) {
49 if (active?.turnId === e.turnId) active = undefined
50 // A prompt typed over this turn waits for the next one; any other
51 // pending prompt never reached a model request (the turn was aborted).
52 if (pending && pending.during !== e.turnId) pending = undefined
53 }
54 return next(e)
55 })
56}
57