schmidt.florian 82fece85f5 app: show the reset history of each long limit window (#16)
The developer asked for a detailed breakdown of every reset (feedback of
2026-10-18). Limits do not only reset at the end of their week: most Codex
weeks in the local history ended early.

- Core: a limit's samples form a window series (provider, limit name and
  length), so the history follows Codex's week across slots (D7). Instance
  spans are built once. One backward walk gives each instance, real or
  inferred, the start of the instance after it. The hour that holds a
  boundary goes to the instance that starts in it, or else to the one that
  ends in it (#9). A stale sample that would put its instance after a later
  one is ignored. The reset history lists the real instances with their
  figures, totals and early-reset hours (D12). API value uses a dated list
  price table; unknown models stay unpriced (D13).
- App: a Resets section per long window with totals, a timeline of
  burn-ups side by side with skipped time in lanes below, early resets by
  hour and weekday, and a sortable table (D8). The reset tooltip lists
  every model with its tokens and API value. Tall tooltips open beside the
  pointer, and Fluent's 320 px tooltip cap no longer wraps data values.
- Docs: D12 and D13 are new; D7 and D8 cover window series, boundary
  hours and the Resets section.

Closes #14
Closes #9
2026-10-18 11:12:38 +02:00

FinalToken

FinalToken is a tray app for Claude Code and Codex usage. It shows token history, provider limits, and pace, warns when usage runs ahead of or behind a limit, and puts selected stats on Stream Deck keys. Starting the app opens the stats panel; closing it keeps the tray app running by default.

FinalToken does not sign in to a provider, handle API keys or OAuth tokens, or read credential files. It reads the installed CLIs' usage files and runs their local commands. It never calls a provider's HTTP API itself. Missing or logged-out CLIs show as unavailable.

Requirements

  • Claude Code and/or Codex CLI installed and logged in through the CLI. Their paths can be overridden in Settings.
  • Windows 11, or Linux with X11 or XWayland. CachyOS with KDE Plasma uses XWayland.
  • For keys: Stream Deck 7 on Windows, or OpenDeck on Linux. These are optional.

Install and use

Extract the published ZIP to a folder and run FinalToken.exe on Windows or FinalToken on Linux. Keep the streamdeck folder beside the app. Open, Refresh, Settings and Quit are in the tray menu. Start with the OS is opt-in.

Data lives in %LOCALAPPDATA%\FinalToken on Windows and ~/.local/share/FinalToken on Linux. FINALTOKEN_DATA_DIR overrides it. FinalToken keeps its own history after the CLIs remove their files. A fresh install imports Claude entries from the last 60 days. snapshot.json is the shared output for the plugin and CLI.

Settings has three Stream Deck install modes: Off, Ask (default), and Automatic. Ask offers Install or Update and Not now. Automatic installs or updates the shipped plugin when a host is found; it stops and restarts a running host. Off installs nothing. Add the plugin's Stat action to a key, then select a provider and metric in its inspector. Pressing the key opens the app's panel; missing or stale data shows offline.

CLI

Run finaltoken-cli status [--json] [--no-probe]. Use ./finaltoken-cli on Linux or .\finaltoken-cli.exe in PowerShell when running from the extracted folder. It scans, probes limits and prints a snapshot. --no-probe reads usage files only. When the app holds the store lock, the CLI reads its existing snapshot without refreshing. Exit codes are 0 for success, 1 for failure and 2 for bad arguments.

Build from source

Use .NET SDK 10.0.100 or newer within .NET 10, Python 3, and the target OS's NativeAOT C++ toolchain. Run from the repository root, as described in AGENTS.md:

dotnet build FinalToken.slnx -c Release
dotnet test --solution FinalToken.slnx -c Release
python -B tools/docs/check_docs.py
python -B tools/publish.py win-x64 --out artifacts/package-win-x64

The publish directory must be empty. The tool bundles all three executables and plugin assets, then creates a ZIP beside the directory. Publish win-x64 on Windows and linux-x64 on Linux.

S
Description
No description provided
Readme MIT
865 KiB
Languages
C# 82.1%
Python 16.6%
Shell 0.6%
HTML 0.5%
JavaScript 0.2%