[FEATURE] Mods API: expose the session's current effort level
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
A mod cannot read the session's current effort level. The statusLine command gets it on stdin (StatusLineCommandInput.effort), so a status line rebuilt as a mod has no reliable source for the effort segment.
Checked on Claude Code 2.1.296 (Windows):
$.sessionhasmodel(),usage(),cwd()and others, but no effort getter.$.config.list()has no effort row. A probe mod found onlythinking,model,outputStyleandswitchModelsOnFlagamong the model-related rows.$.settings.read()returns the persistedeffortLevelandmodelSettings, not a level set with/effortduring the session.turn.step(e.effort) and theclassic.*hook inputs carry it, but only during a turn: before the first request, or after/effortuntil the next one, a mod has to guess.
Proposed Solution
$.session.effort(): Promise<ModelEffort | number | undefined>: the level the next main-loop request will send, after any downgrade for the model. Same value as StatusLineCommandInput.effort, undefined for a model without effort.
A way to redraw when it changes would also help, for example an event when /effort or a model switch changes it.
Alternative Solutions
- Cache
e.effortfromturn.step, skipping subagent steps (agentId): empty before the first request, stale after/effort. - Fall back to
$.settings.read()(modelSettings[model].effortLevel, theneffortLevel): misses/effortandCLAUDE_CODE_EFFORT_LEVEL. - Keep a
statusLinecommand just for the effort: brings back the per-render shell spawn the mod removes.
Priority
Low - Nice to have
Feature Category
Developer tools/SDK
Use Case Example
I moved my status line from a statusLine command (bash → Node wrapper → ccstatusline, 0.7–1.1 s per render) into a mod. The mod reads $.session.usage() and $.session.model() and draws in the prompt footer. Every segment matches the native line except effort, which the mod can only infer.
Additional Context
Related: #99121 (VS Code label shows the per-model effortLevel instead of the active one), #96381 (how effortLevel and /effort interact).