CLI: one headless `--model` run that needs Max Mode saves `maxMode: true`, and every later run uses Max Mode, whatever the model

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:

  1. 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 maxModeAutoEnabled is true, the CLI resets it to false, the same way an interactive parameter change already does.
  2. A per-run flag (for example --max-mode / --no-max-mode) so scripts can state it explicitly.
  3. 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 on 2026.11.19-f005e9d)
  • macOS 26.7.3, arm64
  • Pro plan, logged in with cursor-agent login
  • Default cli-config.json location, and also a scratch CURSOR_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

Hey @kevinlin, I can reproduce this. Once a --model run switches Max Mode on, later --model runs keep sending it, even for variants that don’t need it. The automatic reset only runs when you change the model inside an interactive session, and the --model startup path skips it. I’ve passed this to the team, along with your suggestions for a per-run flag and a Max Mode field in system/init.

There’s no per-run flag today, so your workaround is the right one for now: set "maxMode": false in cli-config.json before any run that shouldn’t use it. Another option is to give only the Opus 5.5 jobs their own CURSOR_CONFIG_DIR, so the flag never lands in the config your Sonnet jobs read.