claude-code - 💡(How to fix) Fix [FEATURE] Limit batch jobs to for example 25% of subscription tokens and using to extra tokens [3 comments, 2 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#46976Fetched 2026-04-13 05:44:48
View on GitHub
Comments
3
Participants
2
Timeline
7
Reactions
0
Timeline (top)
commented ×3labeled ×2closed ×1cross-referenced ×1
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

I want to always have tokens to work interactively, but also want to schedule large independent tasks as batch work. It is easy that the batch work consumes all the tokens.

I also want to limit batch work to only use subscription tokens, so I can easily use up all of them. It would be ok then to get extra tokens for the interactive work if I find this important.

Proposed Solution

  • Allow limiting a batch job to using only a percentage of the subscription tokens
  • Allow limiting batch jobs to only use subscriptions tokens (and never extra tokens)

This would allow me to schedule 2-3 batch jobs in parallel, and still have tokens over for interactive work. If I then find the interactive work important, I can purchase extra tokens without risking that the batch work eats up all of them.

Alternative Solutions

No response

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

  1. I am working on a geometry package
  2. I have created a project plan with multiple work items that are relatively independent
  3. I also have work items that needs to be explored interactively before including in project plan (a pre-study)
  4. I want to start 2-3 batch jobs using at most 25% of the subscriptions tokens
  5. I use remaining 25% or 50% for interactive work
  6. If the interactive work needs more tokens, then I can purchase these knowing that the batch work will not use them

Additional Context

No response

extent analysis

TL;DR

Implement a feature to limit batch jobs to use only a specified percentage of subscription tokens, allowing for concurrent batch jobs and reserved tokens for interactive work.

Guidance

  • Introduce a new CLI flag or command to specify the percentage of subscription tokens that batch jobs can use.
  • Develop a token allocation system that reserves a portion of subscription tokens for interactive work, ensuring batch jobs do not consume all available tokens.
  • Consider implementing a mechanism to dynamically adjust the token allocation based on the number of concurrent batch jobs and interactive work requirements.
  • Evaluate the feasibility of introducing a separate token pool for interactive work, allowing for more flexible token management.

Example

# Example CLI command to limit batch job token usage
claude batch --token-limit 25% --job-name geometry-package

Note: This example is hypothetical and may not reflect the actual CLI syntax or implementation.

Notes

The proposed solution requires careful consideration of token allocation and management to ensure seamless integration with existing workflows. The implementation should prioritize flexibility, scalability, and user experience.

Recommendation

Apply a workaround by manually managing token allocation for batch jobs and interactive work, until a feature to limit batch job token usage is implemented. This will allow for temporary mitigation of the issue, while a more robust solution is developed.

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