ClaudeMods
☰
KO
● 0 명 접속 중 · 조회 0 회
후원프로젝트 제출
GitHub 저장소 · 작성자 DannyMac180

effort-modes

mode-registry를 통해 ui(낮은 effort), api(중간), review(코드 리뷰와 보안용 최대) 세 모드를 제공하고 turn.step 훅으로 모드에 따라 메인 스레드의 effort를 다시 씁니다.

DannyMac180@DannyMac180

DannyMac180/skills/tree/main/modsmith/templates/effort-modes

번역 완료

이 mod 소개

effort-modes는 작업 종류에 따라 세 가지 모드를 제공하는 Claude Code 플러그인입니다. ui(레이아웃, 스타일링, 문구와 작은 UI 변경을 위한 낮은 effort), api(엔드포인트, 핸들러와 데이터 작업을 위한 중간), review(코드 리뷰와 보안을 위한 최대)가 있습니다. /mode ui, /mode api, /mode review, /mode off로 전환하며 /mode, 선택기와 푸터 라벨을 제공하는 mode-registry 플러그인이 필요합니다. 메인 스레드에서 모드가 활성화된 동안 모든 모델 요청의 effort를 플러그인이 다시 씁니다. 서브에이전트, effort 설정이 없는 모델, 이미 실행 중인 턴은 건드리지 않습니다(mode는 turn.start에서 한 번 읽음). 플러그인은 자체 모델 호출을 하지 않지만 effort를 바꾸면 프롬프트 캐시의 메시지 부분이 한 번 깨집니다. Claude Code 2.1.287과 claude-opus-5-5에서 측정한 결과 한 번 전환할 때 약 10k 캐시 토큰을 다시 썼고(캐시 비용 약 ~$0.05, 해당 턴 전체 약 ~$0.11), 비용은 대화 길이에 따라 증가합니다. README는 턴마다 자동 라우팅하지 말고 작업 경계에서 전환하라고 권하며, 이 모드가 아직 사용할 수 없는 더 저렴한 beta 메시지별 effort API를 언급하고 mode-registry 및 다른 turn.step 훅과의 조합을 설명합니다. claude plugin validate/test로 설치하고 --plugin-dir로 로드합니다. function hooks는 얼리 액세스이므로 CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1이 필요할 수 있습니다.

설치

먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.

claude plugin marketplace add DannyMac180/skills
claude plugin install effort-modes
원문 / README

effort-modes

Three modes that set how hard Claude thinks, picked by the kind of work:

| Mode | Effort | For | | --- | --- | --- | | ui | low | layout, styling, copy, small UI changes | | api | medium | endpoints, handlers, data work | | review | max | code review and security |

Switch with /mode ui, /mode api, /mode review and /mode off. This plugin needs mode-registry, which provides /mode, the picker and the footer label. effort-modes lists mode-registry under dependencies, so without the registry Claude Code doesn't load it at all and says why ("Dependency "mode-registry" is not installed", in claude --debug; checked on 2.1.287 with --plugin-dir). If the registry goes away mid-session, the hooks still pass every request through unchanged (covered by a kit test, not tried live).

How it works

On every model request of the main thread, while one of these modes is active, the plugin rewrites the request's effort (turn.step, next({ ...e, effort })). With no mode active, or a mode another plugin offered, it passes the request on unchanged. It never touches:

  • subagents (a step with agentId), which keep the effort they were started with and have caches of their own
  • models without an effort setting (a step where e.effort is absent)
  • a turn already running. The mode is read once at turn.start, so a picker press mid-turn takes effect on the next turn and one turn never changes effort between its steps.

What it costs

effort-modes makes no model calls of its own. Switching modes is not free, though, and you should know where the cost lands.

Changing effort breaks the messages part of the prompt cache, once. Effort is a top-level request parameter. Anthropic's caching docs say a change to it invalidates the cached conversation (the system prompt and tools stay cached on most models). The next request re-writes the whole conversation to the cache at the cache-write rate instead of reading it at the cache-read rate. After that, the cache is warm again at the new effort.

Measured on Claude Code 2.1.287, claude-opus-5-5, one headless session of about 37k tokens (a probe plugin beneath effort-modes logged each request's effort and usage):

| Turn | Effort sent | Cache read | Cache write | | --- | --- | --- | --- | | 2 (no switch, control) | medium | 33,323 | 3,406 | | 3 (after /mode review) | max | 23,387 | 13,528 | | 4 (same mode) | max | 36,915 | 115 | | 5 (after /mode off) | medium | 37,030 | 176 |

Turn 3 is the switch: about 10k tokens that were cached had to be written again (the conversation; the system prompt and tools stayed cached). The session's cost grew about $0.11 on that turn, against about $0.009 for a steady turn like turn 4. At Opus 5.5's list prices ($4/MTok input, cache writes 1.25x, cache reads $0.20/MTok) the cache part of that is about 10k x ($5.00 - $0.20)/MTok, roughly $0.05; the rest is max effort's extra thinking and output. The cache part scales with the conversation's length: switching at 200k tokens re-writes about 200k, roughly $1 at those prices (arithmetic, not measured).

Turn 5, switching back down, did not miss in this run. A likely reason, not verified: cache entries are keyed by the effort they were written at, and turn 2's medium-effort entry was still inside its 5-minute lifetime, so going back to medium found it. If that is right, returning to an effort you used in the last few minutes is cheap and anything else is a rebuild. Don't rely on it: plan on one rebuild per switch in either direction.

Two more costs to keep in mind:

  • review at max effort thinks more, which costs more output tokens on every turn while it's on. That's the point of the mode, but leave it when the review is done.
  • Fork-based mods may lose their cache hit while a mode is on. $.model.fork reuses the main thread's cache "as the main thread last sent it". Whether a fork also sends the rewritten effort has not been checked. If it doesn't, a fork (quiz, supervisor) would miss the conversation cache while a mode is active. Check usage.cache_read_input_tokens on your fork's result.

What to do with this: switch at task boundaries ("now review this branch"), not every prompt. Don't wire an auto-router that flips effort turn by turn: each flip is a full conversation re-write.

The cheaper route this mod can't use. The API has a beta per-message effort (mid-conversation-output-config-2026-07-01). It changes effort from a point in the conversation without breaking the cache, on Opus 5 / 5.5, Sonnet 5.5 (with thinking on) and Fable 5.1. A mod would need to append a system message with output_config and empty content. $.session.append only appends text blocks in this release, and turn.step only exposes the top-level effort. If the engine ever exposes it, switch to it.

Why not prompt guidance instead of effort? Adding a "think harder about security" note costs nothing extra in cache terms if it's appended (a user-role row through $.session.append), and a lot if it's put in the system prompt, which sits ahead of the whole conversation. But a note doesn't change how much the model thinks. Effort does, and the engine lets a mod set it, so this mod sets effort and adds no prompt text.

Composes with

  • mode-registry: required, and listed under dependencies in plugin.json. effort-modes offers its modes by hooking state.set on the registry's catalog, and reads mode-registry.active. Because of that dependency, the engine writes mode-registry's contract into .claude-plugin/types/mode-registry/ when it loads this plugin from your folder, so tsc -p tsconfig.json type-checks e.value and active with no copied types. Before the first load (or without the dependency) tsc reports them as unknown/never.
  • Other mode offerers. effort-modes only acts on its own three ids, so a router or artifact mode from another plugin passes straight through. Only one mode is active at a time.
  • Other turn.step hooks. effort-modes passes the stream on with yield* next(...) and never reads or rewrites a chunk. A model router hooking the same event composes with it: whichever is registered first (outermost) sees the original request, and the one beneath sees the rewrite. If both rewrite effort, the inner one wins.

Install / load

claude plugin validate templates/effort-modes
claude plugin test templates/effort-modes            # 5 tests
claude --plugin-dir templates/mode-registry --plugin-dir templates/effort-modes

Function hooks are early access. If your build doesn't load hooks modules by default, set CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1. That setting loads every installed plugin's hooks module.

비슷한 프로젝트