[FEATURE] Mods API: expose the session's current effort level

Status Open
Reported on v2.1.296
Maintainer reply None cached
Activity 0 comments · opened Oct 13, 2026

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):

  • $.session has model(), usage(), cwd() and others, but no effort getter.
  • $.config.list() has no effort row. A probe mod found only thinking, model, outputStyle and switchModelsOnFlag among the model-related rows.
  • $.settings.read() returns the persisted effortLevel and modelSettings, not a level set with /effort during the session.
  • turn.step (e.effort) and the classic.* hook inputs carry it, but only during a turn: before the first request, or after /effort until 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.effort from turn.step, skipping subagent steps (agentId): empty before the first request, stale after /effort.
  • Fall back to $.settings.read() (modelSettings[model].effortLevel, then effortLevel): misses /effort and CLAUDE_CODE_EFFORT_LEVEL.
  • Keep a statusLine command 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).

View original on GitHub ↗