CLI persistent sessions ignore TMPDIR / hardcode /tmp (EACCES)

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

Persistent session state is created under a hardcoded path /tmp/cursor-agent-persist-, and TMUX_TMPDIR is forced to /tmp. Environments where /tmp is not writable (or where TMPDIR points elsewhere) get EACCES on mkdir. Node’s os.tmpdir() already respects $TMPDIR, but the persist path does not use it. agent resume then fails with “could not verify its persistent session” even when no persistent session exists.

Steps to Reproduce

  1. Run Agent CLI where $TMPDIR is writable but creating directories under /tmp fails with EACCES
  2. CLI version 2026.10.16-e3cb207 (or current)
  3. Run: agent resume
  4. Observe: EACCES: permission denied, mkdir ‘/tmp/cursor-agent-persist-’

Expected Behavior

Persist/tmux state root should use os.tmpdir() (respect $TMPDIR) instead of a hardcoded /tmp, consistent with other CLI temp directories.

Operating System

Windows 10/11
MacOS
Linux
iOS
Other

Version Information

CLI:
Version: 2026.10.16-e3cb207

Additional Information

In the bundled CLI, persist state uses a constant “/tmp” for the state root and TMUX_TMPDIR. Other CLI code paths already use os.tmpdir(). Suggested fix: use os.tmpdir() for the persist root so $TMPDIR is respected. Repro is any environment where mkdir under /tmp fails with EACCES while $TMPDIR is writable.

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey @Thorsten_Ruppenstein, thanks for the report and for tracking down the cause.

You’re right: the persistent session state directory is currently created under a fixed /tmp path rather than respecting $TMPDIR, and resume checks that directory even when you’ve never started a persistent session. I’ve passed this along to the team.

In the meantime, if someone with admin rights on the machine can pre-create the directory for you, resume should work again:

  1. Find your user id with id -u
  2. Create /tmp/cursor-agent-persist-<your uid> owned by your user
  3. Set its permissions to 700 (chmod 700 /tmp/cursor-agent-persist-<your uid>)

Starting a new chat (without resume) should not be affected. Could you also share which OS this is on and how /tmp is restricted (read-only mount, sandbox, container)? That helps us make sure the fix covers your setup.