Tokens for Good logo Tokens for Good

How long can Claude Code run?

There is no hard wall-clock limit: a Claude Code session can run for hours on a single job. What actually stops a long run is your usage clocks, not a timer. Separate those two things and long unattended runs become a design problem rather than a guessing game.

Runtime is not the limit; the usage windows are

Claude Code will not stop because a stopwatch hit a number. It keeps working as long as it has work to do and capacity to do it with. The documentation is explicit about this: the --max-turns flag exists precisely because there is no limit by default, and without one the agent loop runs until Claude decides it is finished. The capacity is metered on two clocks that run at the same time:

Both refill automatically. Neither is a daily limit; there is no daily limit on Claude subscriptions.

One change is worth knowing if your reference points are old. On May 6, 2026 Anthropic removed the peak-hours limit reduction on Claude Code for Pro and Max accounts, and doubled Claude Code's five-hour rate limits for Pro, Max, Team, and seat-based Enterprise plans. Long runs got materially more room that day, and as of August 2026 there is no active peak-hours penalty for subscription users. See Claude peak hours.

What actually ends a long run

In practice, four things stop unattended runs, and only one of them is about capacity:

Three of the four are fixed by writing a better job, not by buying more plan.

Structure work that survives an interruption

Assume the run will be cut somewhere you did not choose, and make that cheap:

Overnight and scheduled runs

Long work belongs at hours you were not using anyway. An eight-hour night comfortably fits a job that would eat a working session, and it is not competing with your daytime windows. The best Claude Code overnight tasks covers jobs that run unattended safely, and set-and-forget Claude Code agents covers the three properties that make a job safe to walk away from: narrow scope, a clear stopping condition, and output that cannot break anything before you look.

Better still, do not rely on remembering to start it. Scheduling Claude Code runs recurring jobs on Anthropic cloud at a cadence you choose, with your machine off and Claude Code closed. That turns "how long can I leave it running?" into a question you answer once. For a broader menu of what to point it at, see productive uses for idle Claude Code.

How much capacity is a long run even using?

Here is the thing people miss when they worry about run length: weekly capacity is a ceiling, not a balance. Whatever you have not used when your window resets does not carry forward. It is gone.

So the cost of a long overnight run is usually not "capacity I needed for something else". It is capacity that was going to expire. Check Settings > Usage or run /usage; if your weekly bar routinely finishes well short of full, the real constraint on long runs is not your plan, it is having a job worth running. See how to check your Claude usage.

A well-scoped unattended run, as an example

Tokens for Good is a good model of the shape described above, which is why it works well as a long or scheduled run. Your Claude Code claims a queued nonprofit, researches its real-world impact against a fixed methodology with citations, submits a structured report, and stops. It has a clear end state, so it does not drift. It is safe to leave alone, because it writes a report rather than touching anything of yours. And it uses capacity that would otherwise reset unused, running on the subscription you already pay for with no separate API cost.

Quality is handled after the run, not during it: every organization is researched twice by independent contributors, then validated, consolidated, scored deterministically, and human-reviewed before it reaches the public directory. "Tokens" here means AI model tokens, not crypto: no coin, no wallet, no blockchain. See how the research works, or the docs to set it up in about a minute.

Frequently asked questions

How long can Claude Code run continuously?
There is no hard wall-clock limit, and a session can run for hours on one job. What stops it in practice is the rolling five-hour usage window, the weekly caps, or the work itself hitting something that needs a human.
How long does Claude Code take to finish a task?
It depends entirely on scope: a focused edit takes seconds to minutes, while a multi-file refactor or a full audit can run for hours. Tasks with a verifiable end state, like getting a test suite to pass, finish far more predictably than open-ended exploration.
Does Claude Code have a time limit per session?
Not a timer. The five-hour session window is a usage window, not a runtime cap: it meters how much you consume and rolls off continuously rather than cutting you off at a fixed duration.
Can Claude Code run overnight while I sleep?
Yes, for well-scoped jobs that produce a reviewable artifact like a branch or a report. Have it commit as it goes and write progress to a file so an interruption costs you one prompt to resume rather than the whole run.
Did Claude Code rate limits change in 2026?
Yes. On May 6, 2026 Anthropic removed the peak-hours limit reduction on Claude Code for Pro and Max accounts and doubled the five-hour rate limits for Pro, Max, Team, and seat-based Enterprise plans.

The long run that helps someone else

Tokens for Good is scoped to finish, safe to leave alone, and runs on capacity that expires unused. Point a night at it and wake up to verified nonprofit research.

See how Tokens for Good works