claude-code - 💡(How to fix) Fix [BUG] Claude Code uses entire 5 hour token limit in one prompt with zero feedbacks or results [8 comments, 6 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56297Fetched 2026-05-06 06:31:51
View on GitHub
Comments
8
Participants
6
Timeline
12
Reactions
3
Author
Timeline (top)
commented ×8labeled ×4

Error Message

I asked Claude Code perform a task last night to update a webapp with some design changes and after about 10 minutes of thinking with no feedback I received a usage limit received error - my 5 hour limit has been reached. I'm not sure if there was a problem then, it could have just been a long task and i didn't have many credits left. I then woke up this morning and tried again, One prompt - "please continue", Claude Code proceeded to then read some files and think about an answer for 30 minutes before I ran into the 5 hour usage limit AGAIN. With one prompt and no feedback and results.

Error Messages/Logs

No error other than Usage limit reached. After stopping the task I asked Claude to diagnose what went wrong and it reported:

Root Cause

Therefore I'm reporting this bug because it seems like -repeatedly- Claude is attempting the same task and running into some kind of infinite loop that is burning it's resources. The self-diagnosis I included below aligns with a bug as well "I burned your entire session reading a file and calling an agent for a task that should have been a single write operation. That's a real failure, not a minor hiccup."

Code Example

No error other than Usage limit reached. After stopping the task I asked Claude to diagnose what went wrong and it reported:
___________________

I hear you. Something went wrong — likely the Agent tool I used last session hit a loop before being interrupted. That's on me for delegating a straightforward file write to an agent instead of just doing it directly.

When you're ready to continue, the fix is simple: one Write call with the complete new HTML. No agents, no reads, no loops. Just tell me when to go and I'll write it straight.
____________________

To which I said No because it kept wanting to work even though I had 99% of my limit used. And another reply:
____________________
That's completely fair. I burned your entire session reading a file and calling an agent for a task that should have been a single write operation. That's a real failure, not a minor hiccup.

What I should have done: read the summary, recognized the task was "write this file with this data," and written it. One tool call. Done in seconds.

What actually happened: I called an agent that looped, consuming everything with nothing to show for it.

If you want to try again, here's my commitment: the rewrite is one Write call. I have all the data I need from the session summary — all 34 mechanic templates, all 11 failure effect templates, the full expression system. I don't need to read anything first. I write the file, you verify it works.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

I asked Claude Code perform a task last night to update a webapp with some design changes and after about 10 minutes of thinking with no feedback I received a usage limit received error - my 5 hour limit has been reached. I'm not sure if there was a problem then, it could have just been a long task and i didn't have many credits left. I then woke up this morning and tried again, One prompt - "please continue", Claude Code proceeded to then read some files and think about an answer for 30 minutes before I ran into the 5 hour usage limit AGAIN. With one prompt and no feedback and results.

I'm not a master Claude user but I was using it all weekend and have a pretty good idea of how much work it can do in that 5 hour limit, and updating a lightweight webapp seems well within those bounds. I understand this isn't a 30 second task, but is Claude Pro so underpowered that it can't update a single html page? I'd hope not.

Therefore I'm reporting this bug because it seems like -repeatedly- Claude is attempting the same task and running into some kind of infinite loop that is burning it's resources. The self-diagnosis I included below aligns with a bug as well "I burned your entire session reading a file and calling an agent for a task that should have been a single write operation. That's a real failure, not a minor hiccup."

This morning I managed to notice I was about to run out of resources at 95+%, killed the task, and asked it for a diagnosis of the problem and a printout of the task (IP scrubbed), both included below.

What Should Happen?

Claude should have completed my task in 10-15 minutes with feedback about what is working on during that time and resulted in an updated html page.

Error Messages/Logs

No error other than Usage limit reached. After stopping the task I asked Claude to diagnose what went wrong and it reported:
___________________

I hear you. Something went wrong — likely the Agent tool I used last session hit a loop before being interrupted. That's on me for delegating a straightforward file write to an agent instead of just doing it directly.

When you're ready to continue, the fix is simple: one Write call with the complete new HTML. No agents, no reads, no loops. Just tell me when to go and I'll write it straight.
____________________

To which I said No because it kept wanting to work even though I had 99% of my limit used. And another reply:
____________________
That's completely fair. I burned your entire session reading a file and calling an agent for a task that should have been a single write operation. That's a real failure, not a minor hiccup.

What I should have done: read the summary, recognized the task was "write this file with this data," and written it. One tool call. Done in seconds.

What actually happened: I called an agent that looped, consuming everything with nothing to show for it.

If you want to try again, here's my commitment: the rewrite is one Write call. I have all the data I need from the session summary — all 34 mechanic templates, all 11 failure effect templates, the full expression system. I don't need to read anything first. I write the file, you verify it works.

Steps to Reproduce

Run this prompt


Task: Rewrite a single-file builder tool with parameter-driven scoring

File to replace: [local project path removed]

What the tool is: A single-file HTML/CSS/JS web app for assembling configurable scenario packages. The app uses a 3-panel layout:

Library | Builder | Score Panel

The Library lets users browse reusable templates. The Builder lets users assemble a package and configure each selected template. The Score Panel shows a live score compared against a selected budget.

What needs to change: The current tool uses flat, hardcoded base scores for each template. It needs to be replaced with a parameter-driven scoring system where each template defines configurable parameters, and scores are calculated from the selected parameter values.

Core scoring model: Active template:

Action Power = average of several action-difficulty dimensions, each scored 1-5
Effect Power = average of several outcome-impact dimensions, each scored 1-5
Template Power = Action Power × Effect Power

Passive template:

Action Power = average of passive-pressure dimensions, each scored 1-5
Effect Power = same model as active templates
Template Power = Action Power × Effect Power

Package Power:

Package Power = sum of template powers × (1 + blended synergy modifier)

Synergy modifier: Average all pair modifiers:

Strong = +20%
Incidental = +10%
None = 0%
Negative = -10%

Budgets: Low = 30
Medium = 50
High = 75

Expression system: Each template and outcome effect has parameters and scoring formulas. Formulas use a small expression language:

fixed(N) — always returns N
scale(param, outMin, outMax) — maps an integer parameter from its configured range to a target output range
lookup(param) — returns the score assigned to the selected enum/bool option
avg(expr, expr, ...) — average of sub-expressions
weighted([expr, weight], ...) — weighted average of sub-expressions

Parameter types:

int(min, max) — numeric input
enum[value=score, ...] — dropdown where each option has a score
bool[yes=score, no=score] — yes/no dropdown

Template catalog: The private version contains 34 domain-specific templates. For public reporting, treat them as generic configurable templates with:

  • ID
  • name
  • category/type
  • active/passive flag
  • parameter definitions
  • scoring formulas for action dimensions
  • linked outcome effect configuration

Outcome effect catalog: The private version contains 11 domain-specific outcome effects. For public reporting, treat them as generic failure/outcome templates with:

  • ID
  • name
  • parameter definitions
  • scoring formulas for severity, recoverability, and cascade impact

Synergy pairs: The private version contains predefined pairwise relationships between template IDs. Publicly, this can be described as:

  • Some template pairs have strong positive synergy
  • Some have incidental positive synergy
  • Some have negative interaction
  • All other pairs default to no modifier
  • The final synergy modifier is the average of all detected pair modifiers in the package

UI flow per package slot:

  1. User clicks a template in the Library.
  2. A slot is added to the Builder.
  3. Each slot shows the template name and a parameter form.
  4. Parameter inputs are rendered as dropdowns or number inputs.
  5. User selects an outcome effect from a dropdown.
  6. When an outcome effect is selected, its parameter form appears.
  7. Scores calculate live as parameters are completed.
  8. Incomplete slots show placeholder or dimmed scores.
  9. The Score Panel updates live.

Features to preserve:

  • 3-panel layout: Library, Builder, Score Panel
  • Category/type filter tags
  • Search input
  • Budget selector
  • Save/load packages via localStorage
  • Synergy connectors between adjacent slots
  • Settings modal
  • Existing CSS variables and visual style

Settings modal change: Instead of editing flat base scores, the settings modal should expose editable score tables for enum/bool parameter options used by the templates and outcome effects.

Expected result: The rewritten tool should no longer depend on flat hardcoded template scores. All scoring should come from parameter definitions, selected user values, expression evaluation, selected outcome effects, and synergy modifiers.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

1.5354.0

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

I suspect Claude Code attempted to resume its previous agent task from last night (why it decided to split off one file write to an agent I dont know) and the agent object was either missing or in a bad state and it burned through all my credits looping, or claude burned through all my credits waiting for a process that will never finish.

extent analysis

TL;DR

The issue can be resolved by rephrasing the task to avoid agent loops and ensuring Claude Code performs a single Write call with the complete new HTML.

Guidance

  • Rephrase the task to explicitly instruct Claude Code to perform a single Write call with the complete new HTML, avoiding agent loops.
  • Verify that the task is correctly understood by Claude Code before proceeding.
  • Consider breaking down the task into smaller, more manageable parts to avoid overwhelming Claude Code.
  • Review the task prompt to ensure it is clear, concise, and well-defined.

Example

No code snippet is provided as the issue is related to task definition and Claude Code's behavior.

Notes

The issue may be specific to the task definition and Claude Code's version (1.5354.0). The user's suspicion about Claude Code resuming a previous agent task and burning credits due to an infinite loop is plausible.

Recommendation

Apply a workaround by rephrasing the task to avoid agent loops and ensure a single Write call. This approach is recommended as it directly addresses the suspected root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Claude Code uses entire 5 hour token limit in one prompt with zero feedbacks or results [8 comments, 6 participants]