MOD brewcode mods

Plan-mode effort

Claude Code 2.1.301+ Works on Team orgs brewmod-plan-effort

By default xhigh while Claude plans. Your session effort everywhere else.

Claude Code terminal, session effort high: Shift+Tab into plan mode shows no row, the first prompt shows a toast and a teal plan-mode row (Claude Code's plan-mode colour) above the prompt, and Shift+Tab out removes the row.
Recorded in a real Claude Code 2.1.301 session (session effort high), sped up where the title bar shows ⏩.

View README on GitHub (opens in a new tab)

Install

Requires Claude Code 2.1.301+ (run claude update first) and node on the PATH.

Install prompt- if Claude refuses, paste this into the chat

Execute these commands in this Claude Code session, one by one, show full output for each, do not skip any, do not summarize:

1. claude plugin marketplace add https://github.com/kochetkov-ma/claude-brewcode
2. claude plugin install brewmod-plan-effort@claude-brewcode

After all commands succeed, run `/reload-plugins`. If `/reload-plugins` is unavailable, tell me to type `exit` and run `claude` again. Run the commands now.

Run /reload-plugins afterwards.

Update, dev mode

Update prompt- if Claude refuses, paste this into the chat

Execute these commands in this Claude Code session, one by one, show full output for each, do not skip any, do not summarize:

1. claude plugin marketplace update claude-brewcode
2. claude plugin update brewmod-plan-effort@claude-brewcode

After all commands succeed, run `/reload-plugins`. If `/reload-plugins` is unavailable, tell me to type `exit` and run `claude` again. Run the commands now.

Dev mode without installing: claude --plugin-dir ./brewmod-plan-effort

Use it

You doYou get
Shift+Tab twice from the default mode (manual mode on → accept edits on → plan mode on), or /planNothing shows at the keypress itself: Claude Code gives mods no live mode signal, so the mod learns plan mode at the first prompt or tool batch. From that prompt, requests run at xhigh, a row in Claude Code’s plan-mode colour (teal) appears above the prompt and a toast shows once per plan visit
Shift+Tab out of plan modeThe row disappears at once (about 0.1 s), because the hint line Claude Code draws names the mode just left. The next request is already at your session effort. The status line keeps showing your session effort: the mod raises effort per request and never changes the session setting
Shift+Tab back into plan mode, then a promptA second plan visit: the row and the toast show again
Approve the planThe next request is back at your session effort, nothing to undo
/plan-effort maxPlan-mode level set to max, same as the planEffort option in /config; the row updates to the new level

What you see

WhereTextWhen
Toast, 5 sbrewmod-plan-effort: plan mode · effort raised to xhighOnce per plan visit (leaving and re-entering plan mode starts a new one), only when the mod raised the effort
No rowDefault or any other mode; before the first prompt of a plan visit; after Shift+Tab out of plan mode

In plan mode the row above the prompt, drawn in Claude Code’s plan-mode colour (the planMode theme colour: teal on a dark theme, a darker teal on a light one), and the session line of the /plan-effort status block follow the session effort:

Session effortRow above the promptsession line
Below planEffort (here high)plan mode · effort xhigh for this mode · change: /plan-effort <level>high -> raised to xhigh in plan mode
At or above planEffort (here max)plan mode · effort max, already >= xhighmax not raised, session already >= plan effort
None: the model takes no effort levelplan mode · effort not raised: model takes no effort levelnone not raised, model takes no effort level
A number (here 3)plan mode · effort not raised: 3 is not an effort level3 not raised, 3 is not an effort level
No request seen yetno rown/a until the next request

Claude Code adds the brewmod-plan-effort: prefix to the toast and to the first line of command output; the mod supplies the text after it.

The row stays through turns and typing, sits above any other prompt-area UI and steps aside while a survey is open. With brewmod-placeholders loaded, it stays visible above the placeholders band in either load order. The row takes one row from the band’s budget, so the band below keeps its full layout and does not overflow in fullscreen.

/plan-effort prints a status block:

status
plan effort  xhigh  (medium | high | xhigh | max)
session      high   -> raised to xhigh in plan mode
mode now     plan
/plan-effort <level>   set the plan-mode effort
/plan-effort           show this status

plan effort shows the configured level and the allowed levels; mode now is one of:

mode nowMeaning
plan (or the other mode name from the state file)Mode recorded at the last prompt or tool batch
unknown until the next promptNo state file yet
plan mode left (Shift+Tab); known at the next promptYou left plan mode by Shift+Tab; the new mode is learned at the next prompt

Commands

CommandResult
/plan-effort (also status)The status block above
/plan-effort helpThe status block under the head help · in plan mode, main-session requests below the plan effort are sent at it; never lowered; subagents and the session effort setting are left alone
/plan-effort <medium|high|xhigh|max>Sets planEffort and prints plan effort: <old> -> <new> plus the status rows
/plan-effort <other word>Prints unknown '<arg>' plus the status rows

/config has one option, planEffort (default xhigh). In claude -p there is no /config row: the command prints plan effort: cannot set it here (no /config row, e.g. under -p) · set: /config in an interactive session, or settings.json pluginConfigs.

Good to know

  • Your session /effort setting is never written, and subagents keep their own effort.
  • The mod only raises: a session already at or above planEffort stays as it is.
  • Rejecting a plan keeps the raise, because Claude is still in plan mode.
Technical details how it works, verification

How it works. The bundled command hook hooks/mode.mjs runs on UserPromptSubmit and PostToolBatch and writes the main loop permission mode to .state/mode-<session_id>.json in the plugin root (subagent payloads are ignored, files older than 7 days are pruned). The turn.step event fires before every model request; in plan mode the module raises effort to planEffort, and records the mode and the session effort in $.state for the row. The row is drawn in the AbovePrompt component in the planMode theme colour, the one Claude Code uses for plan mode; a hook on the PromptHint component clears it when the hint line names plan mode on as the mode just left. Ranks run low, medium, high, xhigh, max; equal, higher, numeric and absent efforts pass through. The rewrite covers one request, so leaving plan mode needs no cleanup. The AbovePrompt hook passes one row less (maxRows - 1) to the hooks beneath it, so a placeholders band sized to its slot fits under the row, also in fullscreen.

Team organizations. Claude Code’s builtin security layer bypasses the classic.* hooks of a user-installed mod, while a bundled command hook still runs. That is why the mode comes from mode.mjs. Enterprise organizations were not run.

Failure mode. A missing or unreadable state file counts as not in plan mode; no hook blocks a prompt or a tool batch.

Verified Claude Code 2.1.300 and 2.1.301

Effort rewrite on 2.1.300. Current path (command hook), claude -p --model sonnet. Source: count of "effort":"xhigh" in the session transcript, run on a --plugin-dir copy and on a copy installed from a git marketplace.

ProfileModexhigh requests
Team orgplan4
Team orgdefault0 (session level)
Maxplan4
Maxdefault0 (session level)

Subagent, reject, approve and Team-org checks, same version, session effort high, effort read per request from the session transcript:

CheckProfileMeasured
Explore subagent in plan modeMaxsubagent request at high while the main loop ran xhigh
Reject the plan at ExitPlanModeMaxnext main request still xhigh
Approve the planMaxnext main requests back at high
/plan-effort max, then plan modeTeam orgplan-mode main requests at max, toast shown

Plan-mode row, toast and Shift+Tab behaviour, checked live on Claude Code 2.1.301 with both mods loaded in both load orders, session effort high: 78 of 78 checks passed over 10 sessions, at 120x40 and 80x24, with no hooks module did not load in the 10 debug logs. Those 10 sessions ran before the row took the plan-mode colour; the text and behaviour rows below did not change.

Row colour, checked on the 6.9.5 build (fingerprint 8d91c3c7, Claude Code 2.1.301) in the 225-case live run of brewmod-placeholders with this mod loaded: the row plan mode · effort xhigh for this mode · change: /plan-effort <level> is drawn with the terminal colour 38;5;73 on a dark theme, the same colour as the placeholders band’s plan-mode rows. The light theme was checked on the band’s plan-mode rows (38;5;30), which use the same planMode key; the row itself was not captured on a light theme. Unit tests: 71 pass, 0 fail.

SessionResult
Default modeno row, cold or after a turn
--permission-mode plannone at launch; with the first prompt the toast shows during the turn and the row appears above the prompt; the row stays through turns, typing, the placeholders band and /plan-effort <level>
Shift+Tab out of plan moderow gone 112-130 ms later (8 runs, 100 ms polls), footer no longer plan
Shift+Tab back into plan mode, then a promptrow and toast again (second plan visit)
defaultMode: bypassPermissionsbypass: none; Shift+Tab into plan: none until a prompt; after the prompt: row and toast; Shift+Tab out: gone
/plan-effortstatus, help head, max and back to xhigh with the row following; after Shift+Tab out, mode now reads plan mode left (Shift+Tab); known at the next prompt
Session effort maxthe already >= xhigh variant

Plan approval through ExitPlanMode (row gone at the next main request) is covered by unit tests only. The desktop surface, an installed (non --plugin-dir) copy and a Team-organization profile were not checked for the row.

Prompt cache, measured on Claude Code 2.1.301 with claude -p --model sonnet --effort high (claude-sonnet-5-5), one run with the mod and one control run without it. Each run is 15 requests from a context of about 62-64k tokens, with plan mode entered and left three times (headless set_permission_mode, the same mode change as Shift+Tab).

MeasureControl (no mod)With the mod
Context at the baseline request62,506 tokens64,633 tokens
Requests1515
Cache misses00
Effort on the 6 plan-mode requestshighxhigh
Effort on all other requestshighhigh
Cache writes after the baseline request13,882 tokens12,380 tokens

Each of the 6 effort flips (3 high to xhigh, 3 xhigh to high) read the whole previous prefix from cache, apart from 25, 25, 62, 0, 0 and 0 tokens. The 25-token gap also appears on plain default-mode turns in both runs. The lower write count with the mod comes from a roughly 2.4k-token deferred_tools_delta attachment that Claude Code sent at a different point in each run, not from the effort. The mod run also carries about 2.1k more context at the baseline, from the mods’ own surface; the source was not itemized.

Limits: one run per arm and one model; only high to xhigh flips (a max plan effort, a medium session and Opus were not re-run); requests were seconds apart, so cache expiry between slow turns is not covered; the mode flips were headless, not a real Shift+Tab in the terminal. The finding is that an effort change does not invalidate a hot cache.

The /plan-effort command and the toast were checked live on 2.1.301; unit tests cover planEffort set to high or max and an unknown value that counts as unset.

Limitations
LimitationDetail
Short visitA plan-mode visit that starts and ends between two prompt or tool-batch checkpoints is not seen
Row textOne line, truncated at the end on a narrow terminal

Mods overview

All brewcode mods and how they load.

Source on GitHub

Mod manifest, hooks module, and tests.

Prompt placeholders

The other brewcode mod: expand short codes in your prompt.

Project page

The mod on brewcode.app.

Update: /brewtools:plugin-update - FAQ