Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By kenhuangusv0.2.0MITIn 1 marketplace
Per-session token tally. Records usage totals in the store and prints the turn total; it is not a token stream or a server-side audit chain.
Code that runs inside Claude Code on every session, as you, unsandboxed.
1 critical to review before installing
JavaScript or TypeScript that runs inside Claude Code as you, unsandboxed. Read from its source, it sees, changes or blocks tool calls.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Per-session token tally. It records usage totals in $.store and prints the
turn total after the answer.
/plugin install token-tally --marketplace kenhuangus/claude-code-security-mods
Try it in one session without installing: claude --plugin-dir ./mods/token-tally.
After each answer a line such as Token tally: this turn=15, session total=15.
appears in the transcript. It is not sent to the model. Type /token-tally for the
full counts (turns, tools, input, output, cache, total).
turn.complete: run next(e) first, then read e.usage, add it to this
session's tally in $.store, and print the line with $.ui.log. The answer
is returned unchanged.tool.call (no matcher): run next, then increment the tool count in
$.store, then return the result.command.run with matcher { command: "token-tally" }: return the totals as text./token-tally works. It is registered on $ at session.start
($.command.register). 0.1.0 shipped a markdown command file, which only creates a
prompt skill; the command.run hook never fired.turn.complete itself without
calling next, so every other plugin's turn.complete hook (and the engine's
own) never ran for the turn. It now calls next(e) and leaves the answer alone.$.store is shared across sessions on the
machine, so one key added every session together and called it the session total.
The tally is now keyed on $.session.id().e.agentId set) are not added to the session's total.$.store (4 MiB total, shared across sessions on the machine) and
can be reset by clearing the store. One small entry stays behind per session.input_tokens, output_tokens, cache_read_input_tokens and
cache_creation_input_tokens, as TurnUsage declares them.npm run check
claude plugin validate ./mods/token-tally
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub kenhuangus/claude-code-security-mods --plugin token-tallyPlugins from other owners that cover similar ground