OAuth tokens from ccr_inference (Cowork/CCD scheduled tasks) accumulate without cleanup

Status Closed — not planned
Maintainer reply None cached
Activity 11 comments · opened Mar 24, 2026 · closed Apr 22, 2026

Description

OAuth tokens created by Claude Desktop's background Claude Code Runner sessions (ccr_inference) accumulate on the account without being revoked when the background session ends. Over normal usage, 30+ stale tokens pile up visible at https://claude.ai/settings/claude-code.

Steps to Reproduce

  1. Enable coworkScheduledTasksEnabled and ccdScheduledTasksEnabled in Claude Desktop config (both default to true)
  2. Use Claude Desktop normally for a few days
  3. Visit https://claude.ai/settings/claude-code
  4. Observe 30+ ccr_inference sessions listed, most from completed/dead background runs

Expected Behavior

Background ccr_inference sessions should revoke their OAuth token when the session completes or is cleaned up. The settings page should show only active sessions.

Actual Behavior

Every background session creates a new OAuth token that persists indefinitely. No automatic cleanup occurs. There is also no "Revoke All" button to bulk-clear them.

Environment

  • Claude Desktop v1.1.8359
  • Claude Code v2.1.78
  • macOS 15 (Darwin 25.3.0)

Additional Context

  • No revoke all option exists on the settings page — users must click through each one individually
  • The accumulation is confusing and looks like session stealing to users who notice it
  • Feature request: either auto-revoke on session end, or add a "Revoke All" bulk action

View original on GitHub ↗

11 Comments

trek-e · 5 months ago

Screenshot Evidence

The settings page shows two distinct token types accumulating:

  1. user:ccr_inference — minimal-scope tokens from Cowork/CCD background sessions (3 created within 1 minute of each other)
  2. Full-scope tokens (user:file_upload, user:inference, user:mcp_servers, user:profile, user:sessions:claude_code) — from regular Claude Code CLI sessions, also accumulating without cleanup

The visible page shows ~10 tokens in just the last hour. Scrolling reveals many more going back days/weeks. No bulk revoke option exists — each must be deleted individually via the trash icon.

This confirms the tokens are never auto-revoked when sessions end, regardless of whether it's a background ccr_inference session or a normal CLI session.

github-actions[bot] · 5 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/28214
  2. https://github.com/anthropics/claude-code/issues/34198

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

trek-e · 5 months ago

Additional Finding: Token Revocation Cascade

Revoking stale ccr_inference tokens from the settings page also kills the active Claude Code CLI session, forcing a re-login. This suggests:

  1. Background ccr_inference sessions and active CLI sessions may share a refresh token chain
  2. Revoking any one token in the chain invalidates the others
  3. Users cannot safely clean up stale tokens without losing their current session

This makes the token accumulation problem worse — not only do tokens pile up, but attempting to manually clean them up causes active session disruption.

Also observed: a Cloudflare MCP OAuth popup appeared unprompted with no Claude Code sessions actively running. The cloudflare-bindings and cloudflare-builds MCP servers are bundled SDK servers with no user toggle to disable them. Background ccr_inference sessions may be triggering MCP auth flows autonomously.

trek-e · 5 months ago

Correction: Forced Re-login Without User Action

The active CLI session was forced to re-login without any manual token revocation. No tokens were revoked from the settings page. This means:

  • Background ccr_inference sessions spawning may be rotating/invalidating the active session's OAuth token
  • The user experiences this as being "logged out every ~10 minutes" — which aligns with the Cowork scheduled task interval
  • The Cloudflare MCP auth popup also appeared unsolicited at the same time, suggesting a background session was actively running

This is the original reported symptom: recurring forced logouts every ~10 minutes with no user action. The token accumulation on the settings page is a symptom of the same root cause — background sessions are churning through OAuth tokens and destabilizing the active session.

trek-e · 5 months ago

Workaround (Destructive)

The only current workaround is to disable both Cowork features in claude_desktop_config.json:

"coworkScheduledTasksEnabled": false,
"ccdScheduledTasksEnabled": false

This stops the forced logouts but completely disables the Cowork/CCD scheduled tasks feature. Users shouldn't have to choose between background tasks and a stable active session.

trek-e · 5 months ago

Onset: Started After Latest Claude Desktop Update

This issue began after updating to Claude Desktop v1.1.8359. The user had been running for months without forced logouts prior to this update. The Cowork/CCD scheduled tasks feature likely changed its OAuth token handling in this release.

trek-e · 5 months ago

Full Version Info

  • Claude Desktop: v1.1.8359 (Electron 40.4.1)
  • Claude Code CLI: v2.1.81
  • macOS: 26.3.1 (Build 25D2128, Darwin 25.3.0)
  • Architecture: arm64 (Apple Silicon)
trek-e · 5 months ago

Not a Duplicate — Different Severity

This issue is related to but distinct from #28214 and #34198:

  • #28214 reports token accumulation (cosmetic/UI problem — tokens pile up)
  • #34198 requests token revocation on logout (feature request for devcontainers)
  • This issue (#38074) reports that Cowork background sessions actively disrupt the running CLI session, forcing re-login every ~10 minutes. This is a session stability bug, not just token accumulation.

Additional findings unique to this issue:

  1. Active Claude Code CLI sessions are force-logged-out when background ccr_inference sessions rotate tokens
  2. Unsolicited MCP OAuth popups (Cloudflare) appear from background sessions the user didn't initiate
  3. Regression — started specifically after Claude Desktop v1.1.8359 update
  4. Only workaround is completely disabling Cowork/CCD scheduled tasks
trek-e · 5 months ago

workaround in #4 does not work, have to close and not use the MacOS app while using Claude Code

github-actions[bot] · 4 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.