{"slug": "claude-code-now-resumes-after-a-usage-limit-unless-your-mac-fell-asleep", "title": "Claude Code now resumes after a usage limit — unless your Mac fell asleep", "summary": "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.", "body_md": "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.\n\n```\nUsage limit reached · limit resets 3:45pm\nContinuing automatically at 3:45pm · esc to cancel\n```\n\nThat's exactly what you want for a long refactor you start before bed. There's one catch, straight from the docs:\n\nIf 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`.\n\nSo 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.\n\nThe wait itself uses almost no CPU, which is the problem: from the outside, a session waiting for a reset looks idle.\n\n**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`).\n\n**Know when the wait starts and ends.** Claude Code's hooks tell you exactly:\n\n`StopFailure` with `\"error\": \"rate_limit\"` fires when a turn ends because of a rate limit.`Notification` with `notification_type`:\n`quota_auto_resume_fired` — Claude continued after the reset`quota_auto_resume_stale` — the reset happened while the computer slept for 30+ minutes; it's waiting for Enter`quota_auto_resume_disabled` — the wait ended without continuing\nA minimal logger to see it happen:\n\n```\n{\n  \"hooks\": {\n    \"StopFailure\": [{ \"matcher\": \"rate_limit\", \"hooks\": [{ \"type\": \"command\",\n      \"command\": \"echo \\\"$(date) limit hit\\\" >> ~/claude-limit.log\" }] }],\n    \"Notification\": [{ \"matcher\": \"quota_auto_resume_fired|quota_auto_resume_stale|quota_auto_resume_disabled\",\n      \"hooks\": [{ \"type\": \"command\", \"command\": \"cat >> ~/claude-limit.log\" }] }]\n  }\n}\n```\n\nWith 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.\n\nI build [Lidnight](https://lidnight.app/en/), 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\".\n\nFor 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 \"paused\" and the session stays stopped.\n\nThe 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).\n\nLidnight'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`\n\nSources: [Claude Code hooks reference](https://code.claude.com/docs/en/hooks) · [Wait for a usage limit to reset](https://code.claude.com/docs/en/interactive-mode#wait-for-a-usage-limit-to-reset)", "url": "https://wpnews.pro/news/claude-code-now-resumes-after-a-usage-limit-unless-your-mac-fell-asleep", "canonical_source": "https://dev.to/dawonlee/claude-code-now-resumes-after-a-usage-limit-unless-your-mac-fell-asleep-17k1", "published_at": "2026-10-16 15:33:00+00:00", "updated_at": "2026-10-16 15:47:58.259072+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools"], "entities": ["Claude Code", "Anthropic", "Lidnight", "macOS", "Codex", "MCP"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/claude-code-now-resumes-after-a-usage-limit-unless-your-mac-fell-asleep", "markdown": "https://wpnews.pro/news/claude-code-now-resumes-after-a-usage-limit-unless-your-mac-fell-asleep.md", "text": "https://wpnews.pro/news/claude-code-now-resumes-after-a-usage-limit-unless-your-mac-fell-asleep.txt", "jsonld": "https://wpnews.pro/news/claude-code-now-resumes-after-a-usage-limit-unless-your-mac-fell-asleep.jsonld"}}