Repository navigation
fix: detect claude individual spend limit in default patterns - #426
Merged
Merged
Conversation
claude code emits "You've hit your individual spend limit · run /usage-credits to raise it" on team plans when a member's extra-usage budget is exhausted. "individual spend" sits between "your" and "limit", so the existing "You've hit your limit" default cannot substring-match it. patternError returned nil and the run died with the raw "claude exited with error: command wait: exit status 1" instead of a limit diagnostic. add the wording to both default lists, mirroring 3c461d3 and d70c894: claude_error_patterns for a graceful exit when --wait is not configured, and claude_limit_patterns so wait_on_limit retries through the reset window. the phrase is long and specific, so it does not reintroduce the narrated-prose false positives fixed in #419 and #321. Related to #425
CLAUDE.md said the claude_error_patterns / codex_error_patterns defaults live in "llms.txt and the embedded config". llms.txt carries the limit-pattern defaults only — the error-pattern list appears nowhere in it, and the file that does mirror it is the README config table. the line is the map a pattern addition follows, so the wrong pointer sends the next contributor to a file that has nothing to update and leaves the README table advertising a default list that no longer ships. name the actual carriers on both lines: embedded config plus the README table, and llms.txt for limit patterns only.
There was a problem hiding this comment.
Pull request overview
Updates ralphex’s default Claude pattern detection so a newer Claude Code quota message (“You’ve hit your individual spend limit …”) is treated as a limit/error pattern, enabling correct diagnostics and optional --wait retry behavior.
Changes:
- Add
You've hit your individual spend limitto embedded defaultclaude_error_patternsandclaude_limit_patterns. - Add unit tests covering the miss with older patterns and the match with the new pattern.
- Fix documentation pointers in
CLAUDE.mdand update docs/defaults references (README.md,llms.txt).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates the documented default claude_error_patterns / claude_limit_patterns to include the new spend-limit string. |
| pkg/executor/executor_test.go | Adds TestMatchPattern cases for the individual spend limit wording (including the · separator). |
| pkg/config/values_test.go | Updates embedded-default expectations to include the new pattern in both Claude error and limit lists. |
| pkg/config/defaults/config | Extends the embedded default config’s claude_error_patterns and claude_limit_patterns values/comments. |
| llms.txt | Updates the documented default Claude limit patterns list to include the new spend-limit string. |
| CLAUDE.md | Corrects where defaults are documented (error patterns not in llms.txt) and clarifies limit-pattern default sources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vitalijb
added a commit
to vitalijb/ralphex
that referenced
this pull request
Aug 8, 2026
fix: detect claude individual spend limit in default patterns (umputun#426)
echeg
pushed a commit
to echeg/loopai
that referenced
this pull request
Sep 24, 2026
…n#426) * fix: detect claude individual spend limit in default patterns claude code emits "You've hit your individual spend limit · run /usage-credits to raise it" on team plans when a member's extra-usage budget is exhausted. "individual spend" sits between "your" and "limit", so the existing "You've hit your limit" default cannot substring-match it. patternError returned nil and the run died with the raw "claude exited with error: command wait: exit status 1" instead of a limit diagnostic. add the wording to both default lists, mirroring 3c461d3 and d70c894: claude_error_patterns for a graceful exit when --wait is not configured, and claude_limit_patterns so wait_on_limit retries through the reset window. the phrase is long and specific, so it does not reintroduce the narrated-prose false positives fixed in umputun#419 and umputun#321. Related to umputun#425 * docs: name the real carriers of the pattern defaults in CLAUDE.md CLAUDE.md said the claude_error_patterns / codex_error_patterns defaults live in "llms.txt and the embedded config". llms.txt carries the limit-pattern defaults only — the error-pattern list appears nowhere in it, and the file that does mirror it is the README config table. the line is the map a pattern addition follows, so the wrong pointer sends the next contributor to a file that has nothing to update and leaves the README table advertising a default list that no longer ships. name the actual carriers on both lines: embedded config plus the README table, and llms.txt for limit patterns only. (cherry picked from commit 407fe8f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
claude code emits
You've hit your individual spend limit · run /usage-credits to raise it, or visit claude.ai/admin-settings/usageon team plans when a member's extra-usage budget runs out. That wording is not a superstring of any existing default: "individual spend" sits between "your" and "limit", soYou've hit your limitcannot substring-match it.result is the failure from #425 -
patternErrorreturns nil and the run dies with the rawclaude exited with error: command wait: exit status 1instead of a limit diagnostic.add the string to both default lists, same shape as d70c894 (#361, session limit) and 3c461d3 (#336, org monthly limit):
claude_error_patternsfor a graceful exit when--waitis not set,claude_limit_patternssowait_on_limitretries through the reset window.on whether a spend cap belongs in the limit list: 3c461d3 already put the org monthly quota there, with the stated reason that
wait_on_limitshould retry through a monthly reset window. A team-plan individual spend cap is the same class, and--waitstays opt-in.the phrase is long and specific, so it doesn't reintroduce the narrated-prose false positives fixed in #419/#321.
second commit is unrelated to the fix itself but was turned up while making it: CLAUDE.md claimed the
claude_error_patternsdefaults live inllms.txt, which carries the limit-pattern defaults only. The error list is mirrored in the README table instead. That line is the map a pattern addition follows, so the wrong pointer would send the next one to a file with nothing to update.covered by two
TestMatchPatterncases - one pins that the older entries genuinely miss this wording, one pins that the new string matches the real message including its·separator and trailing text.Related to #425