Cursor CLI authentication fails in long-running interactive sessions; restarting process fixes it

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

Cursor CLI intermittently reports Error: Authentication error during previously functioning interactive sessions.

The error can occur after as little as 1–2 hours or after an overnight session (less than 12 hours old).

The CLI remains logged in, and new agent processes authenticate successfully.

Steps to Reproduce

  1. Start an interactive Cursor CLI session using agent.
  2. Work normally for several hours, potentially leaving the session idle overnight.
  3. The existing session eventually reports Error: Authentication error.
  4. Run agent status in a separate terminal — authentication is valid.
  5. Run agent -p “Reply with exactly OK” — succeeds.
  6. Resume the failed conversation using agent --resume= — succeeds immediately.

Expected Behavior

Long-running interactive sessions should maintain or refresh authentication automatically without requiring a process restart.

Operating System

MacOS

Version Information

Product: Cursor CLI
Operating system: macOS, Apple Silicon (M4)
CLI version: 2026.10.22-27dcf5f
Date: 27 October 2026

Additional Information

Actual behaviour

The existing interactive process loses usable authentication even though the user remains logged in and new processes authenticate successfully.

Diagnostics

agent status: Logged in successfully

agent -p “Reply with exactly OK”: Returns OK

agent update: Already up to date

No CURSOR_ environment variables present

No logout, credential deletion or reinstallation required

Resuming the same conversation in a new CLI process restores functionality

Suspected cause

Possible stale authentication state or failed token refresh within a long-running CLI process.

Impact

Interrupts development sessions and requires manually restarting the CLI process. Work can resume, but the failure is disruptive and potentially affects unattended agent workflows.

Additional information

Similar symptoms have been reported in earlier Cursor CLI/ACP authentication issues.

Reproducibility: Intermittent, observed multiple times.

Workaround: Restart CLI and resume the existing session.

About Cursor CLI

CLI Version 2026.10.22-27dcf5f
Latest 2026.10.22-27dcf5f (up to date)
Model Auto
Subscription Tier Ultra
OS Darwin (arm64)
Terminal iterm2
Shell zsh

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hi @Brian_Davis1,

Your stored login is fine; this is on the CLI side. A running agent process keeps the sign-in it loaded at startup and doesn’t recover if a request comes back unauthenticated mid-session. A new process reads your login fresh, which is why agent status, agent -p and --resume all work. I’ve flagged this for the team.

For now, restarting and resuming the conversation (agent --resume=<session-id>) is the right workaround, and you don’t need to log out or log in again.

One thing that would help pin down why the session gets rejected in the first place: next time it happens, send one more message in the same session before you restart, and let us know whether that second attempt fails too.

Thanks Colin - it appears to be happening more and more frequently and at much shorter time intervals. e.g. make a code change with the agent cli, spend 30seconds with the browser to test the change, back to the agent cli, Error: Authentication error.
I just tested sending the same query 5 times, all failed. Then tried a different query. Also failed. I have read other people online have reported occasional success waiting a few minutes before a retry but personally I’ve not seen that work. For me, once it fails, the only choice is to ctrl-c back to the command line and restart the agent.
This is happening 20-30 times a day for me now and is getting very tiresome. To be clear, this is new behaviour over the last couple of weeks. I am a heavy user of this setup and have been using the CLI since launch, this never used to happen.
In case it makes a difference, I’m using the cli in iterm2 and herdr.

Regards

Brian