You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
• ccusage is counting Codex transcript records as if they were unique API calls. On
this system, that is not valid.
The short version: Codex forked/subagent session files copy parent history into each
child JSONL. For 2026-06-21, I found 99 Codex session files, and 98 of them contain
the same parent session id. A large child file starts with two session_meta records,
one for the child and one for the parent, then immediately replays thousands of
token_count rows at the child creation timestamp. One file alone has 14,741
token_count rows and a cumulative total_token_usage ending at about 2.19 billion.
So bunx ccusage codex daily --since 20260621 --until 20260621 sees those copied rows
as same-day usage. I ran the equivalent native binary offline and it reports:
totalTokens: 44,867,297,211
costUSD: 33,780.93
That number is inflated because it is summing duplicated serialized history, not
actual sampling events. The better source is Codex’s logs_2.sqlite “post sampling
token usage” events, then matching those to the relevant last_token_usage entries.
Using that method, yesterday looked like about 13.52M actual tokens and roughly
US$16.32 at GPT-5.5 API pricing with cached-input pricing.
This issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies lgtmi, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open.
Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: resolved. A later merged change or the current main implementation covers this request. This item is kept for history and does not need to be reopened.
Activity
pullfrog commentedon Jun 21, 2026
github-actions commentedon Jun 21, 2026
This issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies
lgtmi, your future issues will stay open. If a maintainer replieslgtm, your future issues and PRs will stay open.See CONTRIBUTING.md.
fix(codex): dedupe replayed usage (#1435)
ryoppippi commentedon Aug 31, 2026
Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: resolved. A later merged change or the current
mainimplementation covers this request. This item is kept for history and does not need to be reopened.