Where does the bug appear (feature/product)?
Cursor CLI
Describe the Bug
In print mode (cursor-agent -p --model <slug>), the CLI turns Max Mode on when the chosen variant needs it: the model has supportsNonMaxMode: false, or the variant has isMaxMode: true. Since v2026.08.11 that is intended (“max-context variants are no longer clamped down”).
The problem: the CLI also saves that value to cli-config.json as "maxMode": true, "maxModeAutoEnabled": true. No headless path sets it back to false. The next run on any slug reads the saved flag and sends Max Mode. That includes slugs that run fine without it, such as Sonnet 5.5 and GPT-5.4 Mini.
The only thing that clears it is changing the model parameters by hand in an interactive session. A script or CI job that runs Opus 5.5 once leaves every later headless run in Max Mode for good.
Nothing in the run’s output says Max Mode is on. system/init.model reads Claude Sonnet 5.5 300K High either way, and no event has a Max Mode field. The only place to notice is usage draining faster than expected on the dashboard.
Actual behavior: maxMode: true stays saved after the first run that needed it, and every later headless run on any model sends Max Mode until someone clears it interactively. Users pay Max Mode rates without asking for them and without any sign in the CLI output.
Steps to Reproduce
These use an empty config directory and send no model request. With an empty prompt, the CLI loads and saves the model, then exits 1 with No prompt provided for print mode.
export CURSOR_CONFIG_DIR="$(mktemp -d)"
cd "$(mktemp -d)" && git init -q
show() { python3 -c 'import json,os;c=json.load(open(os.environ["CURSOR_CONFIG_DIR"]+"/cli-config.json"));print("maxMode=",c.get("maxMode"),"maxModeAutoEnabled=",c.get("maxModeAutoEnabled"))'; }
probe() { cursor-agent -p --model "$1" --mode ask --trust --output-format stream-json "" </dev/null >/dev/null 2>&1; echo -n "$1: "; show; }
probe claude-sonnet-5-5-high # does not need Max Mode
probe claude-opus-5-5-high # needs Max Mode
probe claude-sonnet-5-5-high # does not need it, but now gets it
probe gpt-5.4-mini-medium # same
Output on build 2026.11.22-e9042b2:
claude-sonnet-5-5-high: maxMode= False maxModeAutoEnabled= None
claude-opus-5-5-high: maxMode= True maxModeAutoEnabled= True
claude-sonnet-5-5-high: maxMode= True maxModeAutoEnabled= True
gpt-5.4-mini-medium: maxMode= True maxModeAutoEnabled= True
Starting from a config with "maxMode": false, the same Sonnet 5.5 slug saves false and runs without Max Mode. The flag left behind by the earlier run decides it.
Real runs (with a prompt) behave the same: each -p run saves model, selectedModel, modelParameters.<model> and maxMode, and the model request sends the saved maxMode.
Expected Behavior
One of these:
- A Max Mode that was switched on automatically for one headless run applies to that run only and is not saved. Or, when the next run’s variant doesn’t need Max Mode and
maxModeAutoEnabledistrue, the CLI resets it tofalse, the same way an interactive parameter change already does. - A per-run flag (for example
--max-mode/--no-max-mode) so scripts can state it explicitly. - At least make it visible: a Max Mode field in
system/init, so a caller can tell a Max Mode run from a normal one.
Operating System
MacOS
Version Information
- Cursor CLI
2026.11.22-e9042b2(also seen on2026.11.19-f005e9d) - macOS 26.7.3, arm64
- Pro plan, logged in with
cursor-agent login - Default
cli-config.jsonlocation, and also a scratchCURSOR_CONFIG_DIR(as above)
For AI issues: which model did you use?
claude-opus-5-5-high sets it; then affects any slug (e.g. claude-sonnet-5-5-high, gpt-5.4-mini-medium)
Additional Information
Impact: We drive cursor-agent -p from a script that picks a model per task (some on Opus 5.5, most on Sonnet 5.5). After the first Opus job, every Sonnet job ran in Max Mode. We only found out from fast usage drain and by reading ~/.cursor/cli-config.json by hand.
Workaround: Before each headless run, set "maxMode": false in cli-config.json, or give each run its own CURSOR_CONFIG_DIR.
Request ID: the repro sends no model request, so there is none. Happy to provide one from a real run if needed.
Does this stop you from using Cursor
No - Cursor works, but with this issue