tkst
Track and budget Claude Code token spending from the command line
TLDR
SYNOPSIS
tkst [options] [claude [claude-args]]
DESCRIPTION
tkst (Tokenyst) is a small CLI that wraps the claude command and keeps a running ledger of token usage, computed dollar cost, and budget consumption per task. After each prompt during a session it prints a per-turn delta and the cumulative spend against the active budget, so you can stop before exceeding a cap. Tasks are user-defined buckets — typically one per ticket, feature, or experiment — that hold a budget, a list of recorded sessions, and an aggregated total.All state is stored locally under ~/.tokenyst with no cloud sync. Pricing for the supported Claude model variants is bundled with the binary and applied to the token counts reported by the claude CLI.
PARAMETERS
claude [args]
Launch the Claude CLI under tracking. Arguments after claude are forwarded verbatim.-t name, --task name
Create a new task with the given name.-b amount, --budget amount
Set the budget cap (USD) for the task, used with -t or -u.-l, --list
List every task with its budget, total spend, and recent sessions.-u name, --update name
Update an existing task; combine with -b to change the budget or --rename to change the name.-d name, --delete name
Delete the named task.-a, --allocations
Show per-session and per-task spend allocations.-ra from to, --reallocate from to
Move recorded spend from one task to another (useful after misattributed sessions).--enable
Re-enable tracking after it was disabled.--disable
Suspend tracking; the claude wrapper still passes calls through.
CONFIGURATION
~/.tokenyst/
Local data directory holding the tasks, session logs, and computed totals.~/.tokenyst/config.json
User-tunable settings such as default model pricing and currency.
CAVEATS
Cost figures depend on the bundled price list; if Anthropic changes pricing the values are estimates until the binary is updated. Token counts are read from the claude CLI output, so changes to that interface can disrupt tracking. State lives locally and is not synchronised between machines — pair with version control or a synced home directory if you want shared budgets.
HISTORY
Tokenyst was published by jher7 in 2026 in response to the proliferation of multi-agent Claude Code workflows, where per-prompt spend was previously invisible until end-of-month billing. It is distributed as an npm/pnpm package installed globally and invoked as tkst.
