Long-running Claude Code sessions are the whole point. You kick off a refactor, a test suite, a documentation pass — two focused hours of work — and you let it run. The expectation is that it finishes. The reality, without the right setup, is that you wake up to a frozen terminal, an abandoned session, and a half-complete diff. Here is the end-to-end recipe so the job you start before bed is still progressing — or cleanly finished — by morning.
Why overnight jobs fail without preparation
Claude Code sessions stall in four distinct ways:
- Rate limits hit a hard wall. Each account has a rolling usage budget. When one exhausts its budget mid-task, the session takes an error and stops.
- Heartbeat staleness. A session that hasn't produced output for a while can look stuck to an external monitor, even when it's genuinely mid-computation.
- Confirmation prompts block progress. Claude Code can pause to ask before a destructive or ambiguous step. An unattended session waits indefinitely.
- Tool truncation. When a tool response exceeds size limits, context can be silently truncated, leaving incomplete state.
A correct setup addresses all four — but only if the pre-flight is right. Pooling the accounts you already pay for is the foundation, and the rotation extension we ship is a free install to put it in place before your first run.
Pre-flight checklist
Five minutes here prevents a wasted night.
1. Verify your account pool size
The watchdog can only rotate to another account if there is one. A pool of one is no pool at all — the watchdog detects the limit, attempts rotation, finds nothing, and surfaces an alert. For overnight work the effective minimum is two accounts; three or more gives real headroom on an aggressive job. See the account pool guide for adding accounts, and the FAQ for which tiers each account in the pool can use.
2. Confirm the watchdog is active
In the dashboard, check the Accounts panel; the watchdog indicator should show an active polling state. If it looks inactive, open VS Code settings and verify it's enabled. The watchdog polls every 30 seconds and detects four classes of session death: heartbeat-stale, tool-truncation, ended-with-pending-tasks, and rate-limit. Run the current release before an overnight job so you're past the early false-positive on healthy idle sessions.
3. Configure Claude Code for unattended operation
Claude Code has settings that control whether it pauses for confirmation. For a job you want to run autonomously:
- Set
dangerouslySkipPermissionsappropriately for your use case — understand what you're allowing. - Decide whether the job touches files you'd want a confirmation gate on. If not, remove the gate.
- Confirm the working directory is the one you intend; Claude Code operates relative to the open workspace.
Auto-Nudge for unattended runs. Claude sometimes pauses on a "Want me to continue?" or a multiple-choice prompt that's an obvious next step. Auto-Nudge detects those high-confidence stop patterns and re-injects the turn so the session keeps going instead of waiting for you — exactly what you want on a job running while you sleep. A loop guard prevents runaway nudging. See the changelog for the current detection set.
4. Start the proxy
The local HTTP proxy sits between Claude Code and the Anthropic API. It reads the rate-limit headers on every response and rotates accounts before any limit is hit, rather than waiting for a 429 to arrive — the difference between a smooth handoff and a broken context. Confirm it's running from the status-bar indicator in VS Code; a green indicator means it's active and routing traffic.
5. Run a short smoke test first
Before committing to a full night, run a five-minute version that intentionally pushes token usage, and watch the dashboard confirm rotation events fire. That validates your pool, proxy, and watchdog in one pass.
Queuing the job
With the pre-flight done, starting the job is straightforward:
- Open the relevant workspace in VS Code.
- Verify the status bar shows the proxy active and the pool populated.
- Launch your Claude Code session with the task description.
- Confirm it appears in the Session Explorer — that's the session ID you'll check in the morning.
- Leave VS Code open. The proxy and watchdog run as long as it is.
What happens overnight
The watchdog checks every 30 seconds. When it detects a stall or rate-limit event, it fires a reason-aware resume — the session is relaunched with context about why it was interrupted, not as a cold start. The proxy handles rotation transparently: from Claude Code's perspective it's talking to a single endpoint, while the proxy decides which account's credentials to attach to each request based on current rate-limit state, switching before any limit is actually reached. You walk away, and the work keeps moving. For jobs that span several accounts across the night, the Session Explorer shows each resume event and which account handled each segment.
Checking results in the morning
When you sit back down:
- Check the Session Explorer. The files-touched graph shows what the job reached; auto-derived tags summarize which domains were modified.
- Review the rotation log. Clean rotation events are expected and healthy — they mean the job was large enough to warrant pooling.
- Check for open alerts. If the watchdog hit something it couldn't auto-recover, the reason field tells you exactly which class of stall occurred.
Realistic scope for overnight jobs
A pool of three accounts with the proxy running handles genuinely large work. Good candidates:
- Full-codebase static-analysis pass with fix-and-iterate — read all violations, fix each in order, rerun, iterate. This is the kind of job that hits limits three or four times across several hours.
- Documentation generation across a large library — read source, generate docblocks, commit incrementally.
- Test-suite expansion — write tests for every public method in a module, run them, fix failures.
What doesn't benefit: small, fast tasks. The value here is specifically removing the human-as-watchdog bottleneck for work large enough to take hours.
Frequently asked questions
How long can Claude Code run without interruption?
With a single account and no rotation, a session runs until that account's budget is exhausted — often within a few hours of heavy use. With a multi-account proxy and a pool of two or more, the effective run time scales with pool size, and the watchdog detects stalls and resumes automatically, so a correctly configured job can run for many hours unattended.
Do I have to restart Claude Code when it hits a limit?
No. The watchdog detects the rate-limit event and triggers an automatic resume on a different account from your pool, silently, with no prompt to interrupt the automation. A single-account setup will still detect the stall and alert you, but transparent rotation needs a pool of at least two.
What developers are reporting
What breaks unattended runs is permission prompts that don't stay dismissed. GitHub issue #47180 reports scheduled tasks that "re-prompt for folder access and tool permissions, even though I have previously selected 'Always allow'" — every run needing manual intervention. Auto-Nudge plus the watchdog are what keep an overnight job actually moving.
Closing
An overnight job is only worth starting if it's still alive in the morning. A populated account pool, the watchdog, the proxy, and Auto-Nudge are what turn "I hope it finished" into "it finished." That's the setup the watchdog and rotation engine we ship give you out of the box.
Ready to run one tonight? The 14-day Premium Trial is $0 today, cancel anytime before day 15 — it adds the watchdog, Session Explorer, and Auto-Nudge on top of rotation. Prefer no card? Download Free: the 7-day free trial includes full Pro access, no credit card.