GitHub issue #13821 in cline/cline, created 2026-09-04 by hernan-vm and titled "CLI rotates refreshToken on refresh — third-party probes get 401 "re-authenticate" even though the CLI works fine", reports that third-party tools reading the local providers settings file intermittently get a 401 re-authenticate response from the Cline API even though the user CLI session is valid, and that opening the CLI again fixes it with no user action. The report gives the root cause as access tokens expiring after about 1 hour, the CLI rotating the refresh token and rewriting the settings file on refresh, and a probe running with a stale snapshot of an expired access token plus an already rotated refresh token getting a 401 on its own refresh call and reporting session expired. The report adds that the settings file can hold multiple OAuth providers, one of which may be in a dead window of an expired access token plus a rotated refresh token while another is fresh, so a tool that only tries its preferred provider fails even when a valid session exists. The report says this affects ClinePass usage and limits monitoring in particular, and suggests fixes of exposing a local endpoint returning the current account token or proxying authenticated GET requests, keeping the previous refresh token valid for a short grace period, or documenting the token lifetime and rotation contract. The report also describes a workaround of cascading over all providers in the settings file, trying each valid access token first and then each refresh token, and says 11 unit tests run every 15 minutes in a SwiftBar menubar plugin with zero manual re-auths since.
Verbatim Excerpts from Cited Records
“Third-party tools that read `~/.cline/data/settings/providers.json` (usage probes, status bars like ClaudeBar/SwiftBar, monitors) intermittently get `401 ... re-authenticate` from `api.cline.bot` even though the user's CLI session is perfectly valid.”
“When the CLI refreshes, it **rotates the refreshToken** and rewrites `providers.json`.”
“A probe that runs with a stale snapshot (expired accessToken + already-rotated refreshToken) gets a 401 on its own refresh call and reports "session expired".”
“Seconds later the user opens the CLI, its refresh succeeds, and the probe works again.”
Counter-record: Issue remains open as of 2026-12-02 (last updated 2026-12-01T21:12:44Z). 3 comments read in total. linear-code[bot] (2026-09-04) linked the report to CLINE-3172 and relayed that triage is passing it to engineering. sparkdark-lab (2026-12-01) commented Helpful. No maintainer response beyond the triage note appears in the surveyed thread. The claim documents only the original report, not a verified current state.
Falsification probe: If GitHub issue #13821 is closed as fixed, as a duplicate, or as not planned, if the author edits the opening body so the quoted sentences no longer match verbatim, or if the author posts a retraction of the report, this claim drops to Withdrawn.
Audit verification: Verified 100% continuous verbatim substring against official GitHub REST API by
scripts/verify_claim_verbatim.py.