Claude Code 5-hour limit: keep your place.

Understand the usage window, save a useful handoff, and continue with smaller sessions or Codex while preserving the evidence of what changed.

Hitting a usage limit halfway through a change is frustrating because the unfinished work has two parts: the files on disk and the reasoning that explains them. Your next useful move is to preserve both. You can review the diff, run a local check, write a handoff, or continue with another tool while the allowance resets. The aim is to make the next session useful immediately, without asking it to rediscover the whole morning.

First, identify the limit you actually hit

Anthropic’s usage and length limits documentation, checked on October 14, 2026, describes paid-plan session limits that reset every five hours, plus weekly limits. Allowance depends on factors including your plan, model, effort, and conversation complexity. Usage across Claude surfaces, including Claude Code, counts toward the same allowance. Five hours describes a reset window; it does not promise five hours of continuous agent work or a fixed number of prompts.

A context warning is different: it concerns how much information fits into one conversation. Starting a fresh chat or compacting an old one does not refill an account’s usage allowance. Check the exact message and the reset time shown for your account before choosing what to do next. A weekly limit may still apply after a session window resets.

Inside Claude Code, inspect usage and context separately:

/usage
/context

These are interactive Claude Code commands, not shell commands. Anthropic’s costs guide documents usage monitoring and context management. For API or cloud-provider access, read the billing or rate-limit message for that provider; a subscription reset time is not a universal explanation for every failed request.

Make the current state easy to recover

Let an active file write finish or stop the agent cleanly before switching tools. Open another shell in the same project and inspect the state. These commands do not change your files. They show the location, branch, current commit, and both staged and unstaged changes:

pwd
git branch --show-current
git rev-parse HEAD
git status --short
git diff --stat
git diff --cached --stat

Read the actual diff next. A status line cannot tell you whether a half-finished edit is safe. Note untracked files as well: they are absent from ordinary diff output. Avoid a reflexive reset, clean, or stash while another process is still working. Keep a reviewed checkpoint commit if your project permits it; otherwise record the files that are unfinished. Neither option requires another model request.

Write a handoff that can survive a new conversation

Save a short note in your project’s agreed handoff location, or in a private local note outside the repository. Make it specific enough that another tool can verify it. Keep credentials and customer data out. Here is an example template; the paths and commands describe an illustrative project, not your repository:

Goal: reject expired password-reset links.
Branch and commit: record the actual values from Git.
Changed: src/auth/reset.ts; tests/auth/reset.test.ts.
Verified: record the exact command, result, and time.
Unfinished: browser error message and expired-link check.
Constraint: do not edit billing or rotate any secrets.
Next: read the diff, then reproduce the expired-link case.

Separate observations from guesses. “The unit test passed before the last edit” is useful; “tests pass” hides a gap. Include a failed approach if it prevents repeating expensive work, but leave out the transcript of every attempt. The receiving agent needs the goal, current evidence, restrictions, and next action. It can read the code for details. A handoff is a map to evidence, not proof by itself.

Use smaller sessions before you hit the wall

Give each session a bounded outcome: identify the bug, implement one change, or verify one user flow. Start by naming the relevant files and the acceptance check. Ask for a plan before an open-ended rewrite. When a search returns hundreds of lines, narrow the next search to a directory or symbol instead of repeatedly loading the same output. These habits reduce unnecessary work without claiming a predictable quota saving.

At a natural break in the same task, you can ask Claude to preserve the essentials while compacting. For an unrelated task, save the handoff before clearing. Anthropic documents both in its interactive command reference:

/compact Keep the goal, changed files, exact checks, and open questions.
/rename reset-link-fix

Compaction is a summary, so inspect what it retained. Do not make the summary your only record of a critical constraint. Our context habits guide covers keeping standing instructions and file reads focused. Smaller sessions are an organizational habit, not a way around provider limits.

Continue in Codex with a deliberate handoff

If you already have Codex access and available allowance, it can continue from the same files and your note. Stop Claude from editing first. Start Codex in the intended worktree, ask it to read the handoff and current diff, and require it to restate the unfinished work before making changes. Do not assume it can see Claude’s conversation or that the two tools interpret every instruction identically.

codex -C ../app-reset

Replace that example path with your actual worktree. Check codex --help if your installed version differs. Switching providers uses the other provider’s account and limits; it does not add Claude allowance. For simultaneous tasks, follow the side-by-side Mac setup and keep separate working directories.

In XAgents, sleep and resume keep idle sessions available, and the Claude ↔ Codex handoff offers an editable brief when switching providers. Review that brief just as you would a written note. These features help preserve your place; they do not bypass usage limits or guarantee that every detail transfers.

When the allowance resets, verify before continuing

You can also use the waiting time for manual review, documentation, or local tests. Those activities may reveal that the next model request can be much smaller. Paid overage, where available, is a separate spending decision: inspect your account’s current terms and caps before enabling it. Waiting is a valid choice when the task is not urgent.

To return to Claude, open the intended project folder and run claude --resume to select the conversation. Check its name, then read the current Git status before asking it to continue. If Codex changed the files, explain those changes and supply the latest evidence. The session resume guide covers finding the right conversation. Finish by recording the next concrete check, so another interruption leaves a clear place to restart.

Keep reading

The XAgents team