cd /news/developer-tools/do-not-invent-a-5-hour-window-in-a-c… · home topics developer-tools article
[ARTICLE · art-71509] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Do Not Invent a 5-Hour Window in a Codex Usage Tracker

A developer at Agent Island warns against hardcoding a 5-hour window label in a Codex usage tracker, as the provider no longer exposes that period. The primary tile should display the weekly window and its reset time, and each provider needs separate state to avoid hiding failures.

read2 min views1 publishedJul 24, 2026

An old quota tile can keep looking correct long after the provider stops reporting the data behind it.

Codex currently exposes a weekly usage window. It does not expose the former five-hour window. Keeping a permanent "5h" card in the interface would turn stale product history into current telemetry.

The primary tile should describe the weekly window and its reset time. The layout can expand when only one period exists instead of preserving an empty second slot.

Do not hardcode the label from a previous API response shape:

bad:  tile.title = "5h"
good: tile.title = providerPeriodLabel

The percentage may be displayed as used or remaining. Either way, it answers one question: how much weekly capacity is left?

A combined Claude and Codex dashboard still needs separate provider state.

If Claude refreshes successfully while Codex fails, a single green "updated" status hides the Codex failure. Each provider needs its own value, error, and refresh timestamp.

Persisted values can prevent an empty screen during startup, but old data must not refresh its age. Show the last successful sync and the provider-specific error.

Codex session records can contain token usage events. A local ledger can parse them, separate input, output, and cached-token categories, and deduplicate records that reappear during later scans.

The event timestamp controls daily and weekly attribution. The scan timestamp only tells us when the record was observed.

This local ledger does not explain the provider quota percentage one for one. Provider rules and local log coverage have different boundaries.

For recognized model identifiers, a dated price snapshot can produce estimated API value. Unknown models should remain unpriced instead of inheriting the rate of a convenient neighbor.

The estimate is not subscription spend. Included usage, price changes, missing events, and provider-side aggregation prevent exact reconciliation.

Ask these questions before trusting a Codex usage tracker:

I help run Agent Island. The Codex weekly window, local ledger, and report behavior described here is verified on macOS in v1.7.1. This is not a Windows-parity or Codex quota-alarm claim.

The canonical guide contains the full data-boundary discussion:

── more in #developer-tools 4 stories · sorted by recency
── more on @agent island 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/do-not-invent-a-5-ho…] indexed:0 read:2min 2026-07-24 ·