claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Failure loop during sleep consumes weekly usage with no output (subagent suspected)

Open piper-wolf opened this issue 1 month ago • 1 comments

Bug Description This session hit some kind of failure loop while my computer was asleep and seems to have eaten up 40% of my weekly usage without actually doing anything. Would appreciate a usage reset since I didn't get any useful work output from the agent while it was in this failure loop. Root cause may be related to the fact that a subagent was running rather than the main agent, I think the subagent was where this churn occured.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.302
  • Feedback ID: 3cfd5a77-0b30-438d-b7bf-f7115d6086c4

piper-wolf avatar Oct 18 '26 16:10 piper-wolf

If you want to check whether sleep is what set off the loop (which would also help whoever triages this), you can line up the subagent's request times against the Mac's power log:

# when the Mac slept / dark-woke / fully woke (local time)
pmset -g log | grep -E '^\S+ \S+ \S+ (Sleep|DarkWake|Wake) '

# when the subagent was actually sending (UTC); bucketed per minute
grep -ho '"timestamp":"[^"]*"' ~/.claude/projects/*/<session-id>/subagents/*.jsonl | cut -c14-29 | uniq -c

If the bursts sit inside short DarkWake windows (a few seconds to ~30 s each), it looks like the same pattern reported in #102597 and #102780: each maintenance wake lets the in-flight request retry, then the Mac drops back to sleep before it finishes. If the bursts are spread out while the Mac was fully awake, it's more likely a plain subagent retry loop, and that's worth saying here because it would be a different bug.

For the next unattended run, the cheapest guard is to keep the machine in one state for as long as the session lives, e.g. from another terminal caffeinate -i -w "$(pgrep -nx claude)" (lid open; on battery with the lid closed this isn't enough). It won't fix a genuine retry loop, and only Anthropic can look at the usage reset via your feedback ID.

Disclosure: I build Lidnight, a Mac menu bar app that keeps the Mac fully awake while Claude Code sessions are working and lets it sleep once they're idle: https://lidnight.app/en/

whereisdw avatar Oct 19 '26 02:10 whereisdw