Repository navigation
Decaf 0.2.1 — Recover missing Codex tokens
Decaf 0.2.1 fixes missing Codex tokens and rebuilds affected history from the logs still on your Mac.
What was wrong
Parent tasks and subagents can share a Codex root session while keeping separate token counters. Decaf 0.2.0 mixed those counters and skipped some valid usage as a regression. It also missed completed-response records, including some compaction usage.
This patch gives each thread its own counter and counts completed responses once. Copied responses and overlapping legacy counters are deduplicated. Includes PR #1.
Recover your recorded tokens
-
Quit Decaf from the coffee cup menu.
-
Update with Homebrew, or download Decaf-0.2.1.dmg below and replace the app in Applications.
brew update brew upgrade --cask AlanY1an/decaf/decaf
-
Reopen Decaf and wait for the usage import to finish. Open Usage Statistics → Monthly, select Codex, and browse the affected months.
The first launch automatically backs up your old Codex cache and rebuilds usage from available active and archived logs. You do not need to uninstall, delete the cache, or start new Codex tasks to recover older recorded usage.
Recovery requires the original logs to remain on this Mac. Deleted or remote-only logs cannot be reconstructed. Corrected totals may increase or decrease after deduplication; token counts do not convert directly to a subscription's weekly allowance percentage. Your original cache stays in ~/Library/Application Support/Decaf/Backups/ as codex-usage.json.before-v4-…. Backup/read failures retain the original cache. Claude Code's cache format is unchanged.
If an import warning remains, open the read-status line and Copy support summary for a bug report. Please do not upload raw conversation logs or credentials.
Requires macOS 14 or later. The DMG supports Apple Silicon and Intel.
中文:找回之前漏算的 Codex tokens
0.2.1 修复了父任务与子代理计数混用导致的漏算,并补上已完成响应(包括部分上下文压缩响应)的用量;重复记录只计一次。
退出 Decaf,运行上面的 Homebrew 升级命令,或下载 DMG 替换「应用程序」里的 Decaf,然后重新打开。等待导入完成后,进入 Usage Statistics → Monthly,选择 Codex 查看受影响的月份。
首次启动会自动备份旧缓存并重读历史日志,无需卸载、删缓存或重新运行任务。 只要原始日志仍在本机,之前被跳过的用量就能重新核算。已删除或只存在于远程的日志无法恢复;去重也可能让数字降低。旧缓存保留在上面的 Backups 目录中。