SLOPSHOPPER

once

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.

prompt
v0.2.1MITupdated 2026-10-23DzmitryShut/once
A shopper browsing a rack in a slop shop
README

once

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

license claude code mod

once in a Claude Code session

$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

Install

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

Use

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.

Effort is free to switch

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.

PromptSession of 30-40k tokensSession 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.

Another model?

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.

What it touches

  • Hooks: prompt.submit, turn.step and turn.complete, as claude plugin validate lists them.
  • It reads every prompt you send and changes only one that starts with $ and a level: the prefix is cut before the model sees the text.
  • It sets 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.
  • Your session settings, model and subagents stay as they are.
  • No network calls and no model calls of its own. Nothing is written to disk.

Update and remove

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.

Develop

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.

License

MIT

Source 1 files
hooks/register.ts 57 lines
1import 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