Token consumption during offline period — server-side session not terminated after user exit

Open 💬 2 comments Opened Jun 19, 2026 by wangzhengjieaura

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

After exiting Claude Code at ~01:02 AM Beijing time (Jun 19), token consumption continued on the server side during the offline period. When I logged back in at ~03:00 PM Beijing time, the 5-hour rolling quota was fully depleted, and the freshly-reset 7-day quota (which reset at ~04:00 AM) was already 12% consumed — despite no local activity whatsoever during that window.

What Should Happen?

Token consumption should stop completely when the user exits Claude Code. No background processing should occur without an active local session. The 7-day quota should show 0% usage immediately after reset if no session is active.

Error Messages/Logs

Steps to Reproduce

  1. Use Claude Code actively in a session until ~01:02 AM Beijing time (2026-06-18T17:02:09Z UTC)
  2. The user manually interrupted a running task and exited Claude Code
  3. The 7-day token quota was scheduled to reset at ~04:00 AM Beijing time (2026-06-18T20:00Z UTC)
  4. No other devices were logged into the account; no scheduled routines existed (RemoteTrigger list returned empty); no background tasks or cron jobs were configured
  5. User logged back in at ~03:00 PM Beijing time (2026-06-19T07:00Z UTC)
  6. Observed: 5-hour rolling quota fully depleted; 7-day quota already at 12% used after reset

Evidence confirming zero local activity during the gap:

  • No local JSONL session files were modified between 01:02 AM and 03:18 PM Beijing time (verified by file timestamps)
  • RemoteTrigger list{"data":[],"has_more":false}
  • No other logged-in devices

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.142 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Offline window (UTC): 2026-06-18T17:02:09Z2026-06-19T07:18:00Z
Account timezone: Asia/Shanghai (UTC+8)

Key facts:

  • Last local JSONL file written: 6ebc2ee0-...jsonl at 2026-06-19T01:02:18 (Beijing) / 2026-06-18T17:02:18Z (UTC)
  • Next local JSONL file written: 29272e56-...jsonl at 2026-06-19T15:18:13 (Beijing), after user re-login
  • RemoteTrigger {action:"list"} returned {"data":[],"has_more":false} — no scheduled routines
  • No background tasks, no cron jobs, no other logged-in devices
  • 7-day quota reset at ~2026-06-18T20:00Z; by 2026-06-19T07:00Z (user re-login), 12% already consumed
  • Session ended when user typed "你在干啥?保存任务进度啊" (What are you doing? Save task progress) and interrupted the task

Please investigate server-side logs for this account during 2026-06-18T17:00:00Z2026-06-19T07:00:00Z.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗