cd /news/ai-agents/claude-code-now-resumes-after-a-usag… · home › topics › ai-agents › article
[ARTICLE · art-151449] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Claude Code now resumes after a usage limit — unless your Mac fell asleep

Claude Code v2.1.234+ now automatically resumes a session after a usage limit resets, but the auto-continue fails if the Mac slept for more than about 30 minutes during the wait, leaving the session stalled on a "Press enter to continue" prompt. A developer who builds Lidnight, a menu bar app that keeps a MacBook awake with the lid closed while AI agents work, documented the behavior along with Claude Code hooks — StopFailure with error "rate_limit" and Notification types quota_auto_resume_fired, quota_auto_resume_stale and quota_auto_resume_disabled — that signal when a wait starts and ends.

by read3 min views2 publishedOct 16, 2026

If you're on a Claude subscription, recent versions of Claude Code (v2.1.234+) do something quietly great: when a usage limit stops Claude mid-task, the session waits and continues the task on its own after the limit resets.

Usage limit reached · limit resets 3:45pm
Continuing automatically at 3:45pm · esc to cancel

That's exactly what you want for a long refactor you start before bed. There's one catch, straight from the docs:

If it slept for more than about 30 minutes and the limit reset while it slept, the first line reads Your usage limit has reset and the second reads Press enter to continue.

So if your MacBook goes to sleep during the wait — lid closed, or just idle sleep — you wake up to a prompt asking you to press Enter, and the work hasn't moved. The 5-hour window means the wait can easily be a few hours.

The wait itself uses almost no CPU, which is the problem: from the outside, a session waiting for a reset looks idle.

DIY: if you're at a desk on power, caffeinate -i in another terminal (or caffeinate -w <pid> for the Claude process) blocks idle sleep for as long as Claude runs. Closing the lid on battery is different — macOS sleeps on lid close unless you're in clamshell mode with an external display, and the only switch for that is sudo pmset -a disablesleep 1 (remember to set it back to 0).

Know when the wait starts and ends. Claude Code's hooks tell you exactly:

StopFailure with "error": "rate_limit" fires when a turn ends because of a rate limit.Notification with notification_type: quota_auto_resume_fired — Claude continued after the resetquota_auto_resume_stale — the reset happened while the computer slept for 30+ minutes; it's waiting for Enterquota_auto_resume_disabled — the wait ended without continuing A minimal logger to see it happen:

{
  "hooks": {
    "StopFailure": [{ "matcher": "rate_limit", "hooks": [{ "type": "command",
      "command": "echo \"$(date) limit hit\" >> ~/claude-limit.log" }] }],
    "Notification": [{ "matcher": "quota_auto_resume_fired|quota_auto_resume_stale|quota_auto_resume_disabled",
      "hooks": [{ "type": "command", "command": "cat >> ~/claude-limit.log" }] }]
  }
}

With those two signals you can keep the Mac awake from the rate_limit stop until quota_auto_resume_fired (or a few minutes past the 5-hour window), and let it sleep otherwise.

I build Lidnight, a menu bar app that keeps a MacBook awake with the lid closed while AI agents work and lets it sleep when they're done. It installs the StopFailure hook too: when Claude Code stops on a rate limit, the session shows "limit · resumes in 2h 14m" and the Mac stays awake through a 5-hour wait, so the automatic continue actually happens. quota_auto_resume_fired puts it back to "working".

For the cases Claude Code won't continue on its own — a weekly limit, a stale/ disabled wait, or Codex — Lidnight sends a one-line "please continue" after the reset through official features (Claude Code's cross-session messaging, codex queue). You choose per AI whether that should happen; set it to "d" and the session stays stopped.

The same docs pass also turned up two notification types I now count as "waiting for you": elicitation_url_dialog (an MCP server asks you to open a URL) and agent_needs_input (a background session needs input).

Lidnight's AI Auto mode is free (you turn it on); Pro adds auto-start, phone approvals and more — a one-time $9.99 (50% off through Oct 31) with a 7-day trial. brew install whereisdw/tap/lidnight

Sources: Claude Code hooks reference · Wait for a usage limit to reset

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-now-resu…] indexed:0 read:3min 2026-10-16 · —