Claude Agent SDK 5-Hour Limit Drain: Evidence and Checks

Compare the reported five-hour allowance gap between Claude Agent SDK apps, claude -p, and interactive Claude Code. Inspect client labels and usage events, understand the limits of community workarounds, and move unattended jobs to API billing or eligible Max and Team API credits.

Contents
Claude Agent SDK 5-Hour Limit Drain: Evidence and Checks

If Claude Agent SDK apps or claude -p drain your five-hour allowance early, compare the same job in interactive Claude Code. Community tests report roughly 1.6×–2.97× faster consumption, but they do not establish a universal multiplier. For recurring automation, documented API billing gives you a separate usage balance and measurable token charges.

As of 2026-10-27, Anthropic issue #97074 remains open. The reports provide evidence of different allowance consumption between client entrypoints. They do not establish whether Anthropic intends that difference or considers it a defect.

What the controlled reports actually measured

Several authors reported a larger five-hour allowance increase for comparable work through claude -p or Agent SDK apps. These are separate experiments with different versions, models, token mixes, and comparison clients.

ReportTest conditionsReported result
qvarker, September 25Max; Claude Code 2.1.282; claude-opus-5; high effortAbout 1.8× faster allowance consumption in headless mode than the interactive terminal
kler, October 17Team; Claude Code 2.1.300; claude-opus-5-5; high effortsdk-ts: 2.97×; sdk-cli: 2.83×, compared with a harness using the claude-vscode label
Theo’s T3 Code report, October 25One Max account; matched workload; interactive terminal, T3 Code, and claude -pApproximately 1.6×–1.7× faster consumption through SDK/headless routes after the report’s cache comparison
frostfire575, October 26Windows 11; Claude Code 2.1.310; claude-opus-5-5; low effortAbout 2.4× more allowance per weighted token through claude -p than the interactive terminal

The largest result needs a specific qualification: kler’s harness emulated the VS Code extension’s label. It did not drive the actual extension interface. Its result isolates a label-related difference within that experiment.

The dollar figures in qvarker’s report are API-equivalent estimates used to normalize work. They are not additional subscription charges. A lower “dollars of work per 1%” means the allowance disappeared faster.

Weekly allowance needs separate treatment. Theo recorded the same two-percentage-point weekly increase in each run. Frostfire575’s weekly meter moved only from 0% to 1%, which was too coarse for a conclusion. The evidence supports unchanged weekly consumption in Theo’s experiment, not a guarantee for every account.

What sdk-cli and sdk-ts actually prove

The entrypoint identifies the calling client; its presence does not disclose Anthropic’s server-side accounting formula.

The published @anthropic-ai/claude-agent-sdk 0.3.311 package contains this default in sdk.mjs:

if(!c.CLAUDE_CODE_ENTRYPOINT)c.CLAUDE_CODE_ENTRYPOINT="sdk-ts"

The SDK therefore supplies sdk-ts when that environment value is absent. Community transcripts record sdk-cli for ordinary claude -p runs and cli for the interactive terminal.

In qvarker’s network comparison, requests differed in cc_entrypoint inside the x-anthropic-billing-header system block. The author also observed differences in the User-Agent and one beta flag.

That is a community observation of request contents. It is not an officially documented billing-header interface or proof that one field explains every difference.

The Claude Code 2.1.311 changelog does not announce a fix for this allowance discrepancy. That omission cannot establish whether server-side behavior has changed.

How to check your own workflow

Measure the actual client, authentication route, and workload before changing your configuration.

Confirm authentication and comparison conditions

Check the environment used by the application’s Claude process. An API key can take precedence over subscription authentication in -p mode, according to the authentication reference.

Record the executable, CLI version, SDK package version, account plan, exact model ID, and effort setting. A frontend may launch a different binary from the one in your terminal.

For the comparison:

  • Use the same account, project snapshot, prompt list, tools, and cache settings.
  • Pause other activity on that account.
  • Start fresh sessions and keep both runs within the same five-hour window.
  • Stop the comparison if the window resets or usage switches to paid extra usage.

Use a representative task, such as summarizing the same source files. Keep the input, output, cache-read, and cache-write totals separate. Equal output length alone does not establish equal work.

Capture the meter and recorded entrypoint

Preserve the complete rate-limit payload because its available fields differ across versions.

The following Bash probe requires jq and an existing subscription login. It consumes allowance. It checks telemetry and authentication; the one-word response does not measure a multiplier.

set -o pipefail
claude --version
claude auth status | jq '{authMethod}'
claude -p "Reply with exactly OK." \
  --model claude-sonnet-5-5 \
  --max-turns 1 \
  --disallowedTools "*" \
  --output-format stream-json --verbose |
jq -c '
  if .type == "rate_limit_event" then
    {type, session_id, rate_limit_info}
  elif .type == "result" then
    {type, subtype, is_error, session_id,
     usage, modelUsage, total_cost_usd, result}
  else empty end
'

The CLI reference documents these flags and the authentication-status command. A successful response should include a result record with subtype: "success" and is_error: false.

The issue’s instrumented builds used this path:

rate_limit_event.rate_limit_info.unifiedWindows.five_hour.utilization

However, unifiedWindows is absent from the public 0.3.311 SDK event type. That type declares fields such as rateLimitType and utilization instead. Do not interpret a missing field or missing event as zero consumption. Use the account’s Usage page when the stream provides no usable reading.

Keep measurements from the same interface and scale. Event utilization and the SDK’s separate usage-control response are different schemas; their numbers are not interchangeable.

Use the returned session_id to locate its transcript. The session documentation places transcripts under ~/.claude/projects/<encoded-cwd>/<session-id>.jsonl. A custom CLAUDE_CONFIG_DIR changes that root.

Inspect only the recorded entrypoint with Bash:

read -r -p "Transcript path: " CLAUDE_TRANSCRIPT
jq -r 'select(.entrypoint? | type == "string") | .entrypoint' \
  "$CLAUDE_TRANSCRIPT" | sort -u

An empty result means the field was unavailable. It does not identify the session as interactive.

For the terminal comparison, launch genuine interactive Claude Code from a clean shell. qvarker reported that a tmux server inherited CLAUDE_CODE_ENTRYPOINT and passed it to later terminal sessions. Check the resulting transcript rather than assuming the interface determines the label.

Compare allowance per workload unit

Compare percentage points per matched workload unit, rather than minutes spent or the number of prompts.

Frostfire575 reported 1.43 million weighted tokens for a five-point terminal increase. The headless run used 1.32 million weighted tokens for an eleven-point increase. Using those reported figures:

Headless / terminal = (11 / 1.32) / (5 / 1.43) = 2.38

That calculation explains the reported 2.4× result. It uses the author’s weighted-token measure and applies only to that comparison.

One-point changes are too coarse for a useful small-run comparison. Repeat ordinary work in the reverse order if necessary, while avoiding a reset or overlapping account activity.

Use final results from fresh sessions for cost estimates. Do not sum cumulative result records from resumed sessions. The cost-tracking documentation distinguishes token accounting from actual billing; neither total_cost_usd nor modelUsage is a subscription allowance meter.

If your gap disappears after matching cache behavior or removing overlapping activity, investigate those causes first.

Should you change CLAUDE_CODE_ENTRYPOINT?

Treat client relabeling as an unsupported experiment.

On October 26, qvarker and oviano reported lower consumption with their own tool names. Their comparisons put the default sdk-cli consumption roughly 1.9×–2.4× higher.

Those reports do not establish an approved way to obtain a different allowance. A custom label changes attribution that appears relevant to accounting. Its treatment could change, and its policy status remains unresolved.

Do not label your application cli or claude-vscode to obtain another client’s treatment. Those names identify different clients.

The associated T3 Code pull request #25597 was open and unmerged when checked on 2026-10-27. Its existence does not establish a released T3 Code fix or Anthropic approval.

For interactive work, test the genuine terminal client. For automation that must keep structured input and output, evaluate API billing.

Which balance pays for Agent SDK automation?

Authentication determines whether a job consumes subscription allowance or API credit.

Anthropic’s October 7 billing update preserves subscription usage for Agent SDK, claude -p, and third-party apps. It also permits eligible Max and Team API credits for self-run SDK and claude -p jobs authenticated with a linked Console organization’s API key.

Keep these balances distinct:

Billing routeWhat the job consumes
Claude subscription loginSubscription allowances, including the five-hour window
Enabled extra usage, also called usage creditsSeparately paid continuation after included allowance
Anthropic API keyThe Console organization’s eligible API credits or paid API balance
Independent API gatewayThat provider’s balance and billing rules

API billing removes the job’s dependency on the subscription five-hour allowance. API rate limits, spend limits, and available funds still apply.

As of 2026-10-27, the monthly API credit program lists:

Eligible planMonthly API credit
Max 5x$100 USD
Max 20x$200 USD
Team Standard$20 USD per seat
Team Premium$100 USD per seat

Team credits form one pool capped at $500 USD. Pro is not eligible. New subscribers must spend seven days on an eligible plan.

To claim credits, open Settings > Billing for Max or Organization settings > Billing for Team. Select Link organization under API credits. You need the required subscriber/owner role and Console billing permissions. Create the API key in that linked organization.

The program excludes interactive Claude Code, extra usage, and runs started by the Claude Code GitHub Action, IDE extensions, or Claude desktop app. Adding -p does not remove those exclusions.

The Platform credit documentation explains that unused credits expire without rollover. Included credits are used before purchased credits. After exhaustion, purchased funds or applicable invoicing can continue service; otherwise requests stop. They do not fall back to charging subscription allowance.

Run an API-billed check before moving recurring jobs

Verify one direct API-key run and its Console usage before migrating a queue.

Use a Bash terminal configured for direct Anthropic access. Check existing ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and cloud-provider settings first. These can select another endpoint or credential source.

Create an API key in the intended Console organization. Enter it without echoing it:

read -rs ANTHROPIC_API_KEY && export ANTHROPIC_API_KEY
claude --bare -p \
  --model claude-sonnet-5-5 \
  --tools "" \
  --max-turns 1 \
  --max-budget-usd 1.00 \
  --output-format json \
  "Reply with exactly OK."

The programmatic-use documentation states that --bare skips subscription OAuth credentials and discovered customizations. This makes it suitable for the API check. It would change the authentication route in a subscription comparison.

Expect a successful JSON result containing the reply. Then check the correct organization’s usage and balance in the Console. The CLI’s cost estimate alone cannot prove that promotional credits paid for the request.

If authentication fails, check the key and active provider. If the balance is exhausted, inspect Console billing. API rate-limit or spend-limit errors require attention to those limits, even when subscription allowance remains.

The $1.00 CLI budget is an estimated stopping threshold. A request can pass it, so also set a suitable Console spend limit.

For a budget example, Anthropic’s current pricing lists claude-sonnet-5-5 at $2 per million uncached input tokens and $10 per million output tokens. As of 2026-10-27, one million input tokens plus 100,000 output tokens therefore gives an estimated token charge of:

(1 × $2) + (0.1 × $10) = $3

This assumes standard synchronous global routing, no cache use, and no separately charged server tools. It excludes applicable taxes. For repeated context, calculate cache writes and reads at their separate rates.

An independent gateway is another route. BetterToken’s live catalog listed claude-sonnet-5-5 and claude-opus-5-5 on 2026-10-27. Its Claude Code guide uses your own BetterToken key and the base URL https://bettertoken.ai, without /v1. Compare its current prices and required tool compatibility against your workload. Anthropic’s included API credits do not transfer to that separate billing route.

Ready to optimize your LLM workflow?

Join thousands of developers building faster, smarter, and more cost-effective AI applications with BetterToken.

Get Started for Free