Uninstall tokenstat
Leaving should be as easy as arriving. A tool that is awkward to remove is a tool worth thinking twice about installing, so there is a one-liner for it, and every file it touches is named below for anyone who would rather do it by hand.
The one-liner
# macOS / Linux
curl -fsSL https://tokenstat.ai/uninstall.sh | bash
# Windows
irm https://tokenstat.ai/uninstall.ps1 | iex
That removes every scheduler entry and the binary, in that order, and leaves your archive alone. Run it and you are done, unless you also want the data gone.
Removing the data too
Your local archive holds the usage you have scanned, including days your coding tools have already deleted from their own logs. Nothing else has a copy. So deleting it is a separate, deliberate step rather than part of the default.
# macOS / Linux
curl -fsSL https://tokenstat.ai/uninstall.sh | bash -s -- --purge --yes
# Windows
$env:TOKENSTAT_PURGE="1"; $env:TOKENSTAT_YES="1"; irm https://tokenstat.ai/uninstall.ps1 | iex
--yesis not decoration. A piped uninstall has no terminal to prompt on, so--purgewithout it skips the purge rather than deleting your history on the strength of a command you may have pasted without reading. Run the script directly instead of piping it and it will ask you properly.
Export first if there is any chance you will want the numbers back:
tokenstat export --format json --out tokenstat-archive.json
Flags
| Flag | Environment variable | What it does |
|---|---|---|
--purge |
TOKENSTAT_PURGE=1 |
Also delete the local data directory |
--yes, -y |
TOKENSTAT_YES=1 |
Non-interactive. Required with --purge when piped |
--bin-dir DIR |
TOKENSTAT_BIN_DIR |
Where the binary lives, if you moved it |
Doing it by hand
Everything the script does, in the order it does it. Schedule first, so nothing tries to run a binary that is about to disappear.
1. The schedule
There are up to three entries. ai.tokenstat.scan is always there, ai.tokenstat.sync only if you linked a machine to an account, and ai.tokenstat.update only if you turned automatic updates on. Removing one you never had is harmless, so the loops below cover all three.
# macOS
for u in scan sync update; do
launchctl bootout gui/$(id -u) ai.tokenstat.$u
rm -f ~/Library/LaunchAgents/ai.tokenstat.$u.plist
done
# Linux
for u in scan sync update; do
systemctl --user disable --now ai.tokenstat.$u.timer
rm -f ~/.config/systemd/user/ai.tokenstat.$u.{service,timer}
done
systemctl --user daemon-reload
# Windows
schtasks /Delete /TN "ai.tokenstat.scan" /F
schtasks /Delete /TN "ai.tokenstat.sync" /F
schtasks /Delete /TN "ai.tokenstat.update" /F
2. The binary
rm ~/.local/bin/tokenstat # macOS and Linux
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\tokenstat" # Windows
3. The data, if you want it gone
| Platform | Data directory |
|---|---|
| macOS | ~/Library/Application Support/ai.tokenstat.tokenstat |
| Linux | ~/.local/share/tokenstat |
| Windows | %APPDATA%\tokenstat\tokenstat\data |
4. The keychain entry, on macOS
If you ever linked a machine for sync, there is a keychain item under the service name ai.tokenstat.sync. The --purge run clears it on a best-effort basis. Otherwise delete it in Keychain Access, or leave it. It is an API token that stops working the moment the machine is unlinked.
What this does not touch
A hosted profile on tokenstat.ai is a separate thing. Removing the local install does not delete an account, and deleting an account does not touch your local archive. If you want the hosted side gone as well, export or delete it from /settings/data, where deletion is a real cascade rather than a flag on a row.
Your coding tools are untouched. tokenstat only ever read their logs. Removing it changes nothing about Claude Code, Codex, or anything else on the machine.
Related
- Install tokenstat on macOS, Linux, or Windows is the reverse of this page.
- What leaves your machine when you sync covers the hosted side, and how to remove that too.
More in Getting started
