# fix\(shared\): a model-scoped Claude limit no longer blocks other Claude models · PR \#32016 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/32016)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: open

Source repository: Unavailable fork

Source branch: fix/claude-model-scoped-limit

Target branch: main

Head commit: 17129b2318bf53346f1d811f51c2932188ae3785

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/32016)

[Commits](https://git.cafe/pingdotgg/t3code/pull/32016/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/32016/diffs?format=markdown)

## Description

---

## Problem

When Claude's model-scoped weekly bucket is used up (**Weekly · Fable**, window id `seven_day_fable`), T3 Code treats every Claude model as out of usage. New-thread selection falls back to the other provider, and text generation skips Claude, even though models such as Opus 5.5 still work. Reproduction details: #32015.

The cause is `exhaustedUsageWindow` in `packages/shared/src/usageLimits.ts`. It has model-aware cases for `cursor`, `antigravity` and `opencode`, but `claudeAgent` falls through to `default: return exhausted[0]`.

## Change

Add a `claudeAgent` case. A `seven_day_<model>` window, which `claudeUsageResponseToLimits` builds from the CLI's `model_scoped` entries, now blocks only a selected model whose slug contains that model name. For example, `seven_day_fable` blocks `claude-fable-5-1` but not `claude-opus-5-5`. Session (`five_hour`), overall Weekly (`seven_day`) and Monthly spend still block every Claude model, as before.

## Scope and approval

Fixes #32015. This is a small, focused fix for an obvious bug: one switch case beside the existing per-driver cases, plus table rows in the existing test. It changes no contracts or UI.

## Verification

- Added four `claudeAgent` rows to the existing "matches %s pools %s to %s" table in `packages/shared/src/usageLimits.test.ts`:
  - Fable bucket at 100% with Opus selected: Opus stays selected.
  - Fable bucket at 100% with Fable selected: falls back.
  - Overall `seven_day` at 100% with Opus selected: falls back.
  - `five_hour` at 100% with Opus selected: falls back.
- `vp test run packages/shared/src/usageLimits.test.ts`: 66 passed. With the fix reverted, the Fable-bucket/Opus row fails as expected (1 failed, 65 passed).
- `vp check` on both files and `vp run typecheck` in `packages/shared` both pass.
- Not checked: the running app against a live account whose Fable limit is used up.

Written with Claude Opus 5.5 in Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

