cd /news/ai-tools/your-ai-coding-limits-ran-out-early-… · home › topics › ai-tools › article
[ARTICLE · art-172422] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=· neutral

Your AI Coding Limits Ran Out Early? Find What Is Burning Them

A developer published a guide for diagnosing why Claude Code and Codex subscription usage limits run out early, pointing to Anthropic and OpenAI documentation on usage reporting. The guide walks through Claude Code's /usage breakdown of skills, subagents, plugins and MCP servers, Codex's /status and /usage commands, and a status-line script that surfaces five-hour and seven-day rate-limit percentages.

recommendation

Run /usage (Claude Code) or /usage weekly (Codex) to find which skills, subagents, plugins or MCP servers drive most consumption, then add a status-line script showing five-hour and seven-day rate-limit percentages.

more in playbook: Controlling LLM cost
by read6 min views2 publishedNov 19, 2026

You open Claude Code or Codex in the morning, do what feels like a normal amount of work, and by early afternoon you've hit your limit. The obvious fixes are a bigger plan or a different model. Before either, find out what actually used the allowance. Usually it isn't the prompts you typed.

In an earlier article I covered seven levers to cut a coding agent's token bill, mostly from the API side. This one is for subscription plans with usage windows: check what the tool already reports, look at the five usual burners, then set a simple model mix.

Claude Code details come from Anthropic's docs (costs, errors, status line, model configuration, subagents); Codex details from OpenAI's pricing FAQ, CLI commands and model selection pages.

In Claude Code, the error message tells you which ceiling you hit, and they need different fixes:

You've hit your session limit or You've hit your weekly limit./model doesn't get you back in. You wait for the reset time in the message.You've hit your Opus limit or You've hit your Sonnet limit. The errors page adds a detail worth knowing: usage counts against the session and weekly allowances at the same time, and one burst of heavy activity, such as a large workflow fanout, can use up the weekly allowance before the session window resets.

If you see a 429 instead, the docs suggest running /status: a stray ANTHROPIC_API_KEY in your environment can route requests through a low-tier API key instead of your subscription.

Claude Code. Run /usage. On a Pro, Max, Ultra, Team or Enterprise plan it shows a breakdown of what counts against your limits: usage attributed to skills, subagents, plugins and individual MCP servers, plus recommendations for anything behind 10% or more of recent usage. Three details matter when you read it:

d or w to switch between the last 24 hours and the last 7 days. On v2.1.305 or later, f applies the recommendations it can act on, showing you each change first.

Codex. In the CLI, /status shows the active model and token usage, and per the pricing FAQ your remaining limits during a session. /usage weekly (or daily, cumulative) opens your token activity, and the usage dashboard shows current limits and reset times.

To keep the numbers in view, Claude Code's status line receives JSON on stdin that includes rate_limits.five_hour and rate_limits.seven_day (subscribers only, after the first API response). A minimal script, saved as ~/.claude/statusline.py and set as the statusLine command in your settings:

#!/usr/bin/env python3
"""Claude Code status line: model, effort, context, cache hits and plan limits."""
import json
import sys

data = json.load(sys.stdin)
parts = [data["model"]["display_name"]]

effort = (data.get("effort") or {}).get("level")
if effort:
    parts[0] += f" ({effort})"

ctx = (data.get("context_window") or {}).get("used_percentage")
if ctx is not None:
    parts.append(f"ctx {ctx:.0f}%")

hit = (data.get("prompt_cache") or {}).get("hit_ratio")
if hit is not None:
    parts.append(f"cache {hit:.0%}")

rate = data.get("rate_limits") or {}
for key, label in (("five_hour", "5h"), ("seven_day", "7d")):
    used = (rate.get(key) or {}).get("used_percentage")
    if used is not None:
        parts.append(f"{label} {used:.0f}%")

print(" | ".join(parts))

I ran it on the example input from the status line docs (the docs' sample values, not my usage), then on the same input without rate_limits and prompt_cache. Real output, Python 3.13.5:

$ python3 statusline.py < sample-input.json
Opus (high) | ctx 8% | cache 91% | 5h 24% | 7d 41%
$ python3 statusline.py < sample-input-api-user.json
Opus (high) | ctx 8%

Now you see the 5-hour number move while you work, not afterwards.

1. Model and speed choice. Anthropic's cost docs say Sonnet handles most coding tasks well and costs less than Opus, and that a switch to Opus also applies to subagents that inherit your session's model. On the Codex side, the pricing FAQ is explicit about speed: Fast mode uses included subscription usage at 2.5x the rate of Standard mode for the same model. If /fast is on out of habit, that's the first thing to check.

2. Always-loaded context. Instruction files and tool listings ride along with every request. OpenAI's tips for making Codex limits last longer include reducing the size of your AGENTS.md (by nesting files in the repo) and limiting MCP servers, because every MCP server adds context to your messages. I covered the trimming in Your Agent's Context Fills Up Before You Type.

3. MCP and tool output. Tool results are added to the conversation and re-sent with later requests. In Claude Code's /usage attribution, an MCP server's share counts only the requests that consumed one of its tool results, so a server with a high share is one whose output keeps landing in context. The docs' fixes: prefer CLI tools such as gh where they exist, and push verbose work such as test runs and log reading into a subagent or a hook that returns only the lines you need.

4. Parallel and background work. Every subagent, workflow agent and teammate sends its own requests, and all of it draws from the same windows. Some of it runs while you're not typing: a session-scoped scheduled task fires on its interval even when the session is idle, a message from another of your sessions arrives as a new turn, and goal check-ins start new turns while background work is pending. Each of these sends your full context. /usage has a Loops row for the heaviest scheduled tasks (v2.1.242+), and /tasks shows which model each subagent runs on.

5. Retries and rework. Claude Code already retries transient API failures by itself, up to 10 times with backoff. The retries that cost you are the ones you trigger: re-prompting the same failing approach, or letting the agent go a long way in the wrong direction before you notice. The docs' answers: plan mode before complex changes, Escape as soon as it drifts, /rewind to a checkpoint, and a verification target (a test, an expected output) so it checks its own work.

Set defaults so the expensive model is a choice you make on purpose.

Claude Code:

opusplan alias: Opus in plan mode, Sonnet for execution.model: haiku in their definition. To force one model onto every subagent, teammate and workflow agent, set CLAUDE_CODE_SUBAGENT_MODEL and CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1 (v2.1.257+)./clear, since a switch mid-conversation starts with a cold cache. Codex:

/model [model] --reasoning=<level>, and confirm with /status./usage (Claude Code) or /usage weekly plus the dashboard (Codex), before changing anything./tasks. This covers the diagnosis for subscription limits. LLM Cost Control: The Builder's Guide to Cutting Your Token Bill is the full playbook for when you build on a metered LLM API: how token billing works, the seven cost levers in the order to apply them (measure, cache, scope, control output, route, batch, budgets), prompt caching done right, model routing, a worked end-to-end example, a 30-day plan, emergency cost triage and a pre-launch checklist.

This article was written with the assistance of AI and reviewed by the author. Claude Code behavior is described from Anthropic's official documentation (costs, errors, status line, model configuration and subagents pages), and Codex behavior from OpenAI's official pricing FAQ, CLI command reference and model selection pages, all fetched on 16 Nov 2026. The status line output is the script's real output on the sample input published in the status line docs, not on my own usage. PromptMaster guides are independent and not affiliated with or endorsed by Anthropic or OpenAI.

── more in #ai-tools 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/your-ai-coding-limit…] indexed:0 read:6min 2026-11-19 · —