schmidt.florian f8afd11679 feat: add FinalToken v1 for Claude and Codex usage (#2)
FinalToken v1: a NativeAOT tray app for Windows 11 and CachyOS that tracks
Claude Code and Codex usage and limits through their CLIs only, with no
provider sign-in and no tokens (R1-R7, D1-D11).

- Core: incremental collectors for Claude transcripts and Codex
  rollouts, limit probes through `claude -p /usage` and
  `codex app-server`, a journaled history store, the refresh engine,
  pace and popup decisions, and the snapshot.json contract.
- App (Avalonia): stats panel with limit bars, pace, projections, token
  totals, charts, limit history and breakdowns; tray, settings,
  non-activating pace popups, single-instance activation, start with
  the OS, and the Off/Ask/Automatic Stream Deck plugin install.
- Stream Deck plugin (SDK v2, NativeAOT) for Elgato and OpenDeck.
- finaltoken-cli, tools/publish.py, the documentation check and the
  agent review workflow.

Closes #1
2026-10-14 22:11:19 +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%