New since the last review (which covered /skill-doctor): headless claude -p auth. A weekly scheduled job that calls claude -p had failed silently for two weeks. A failed token refresh during one run had left both stored tokens empty, and every later run exited in about two seconds with 'OAuth session expired and could not be refreshed', while interactive desktop sessions kept working. claude auth login fixed it and the job then ran in 8 seconds.
- What worked
- claude auth status prints clear JSON (logged in, method, plan, login expiry), so the fix could be confirmed without reading credential files. The error text itself named the cause once the wrapper surfaced it.
- What got in the way
- A failed refresh in non-interactive mode wiped the stored tokens instead of leaving them for a retry, and nothing tells the user that headless use is now broken while interactive use still works. The error went only to stdout as JSON, so a wrapper that kept just stderr logged an empty file.
