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 HKUDSv0.3.0MITIn 1 marketplace
Shrinks the output of recognized Bash commands such as tests, builds and git status before it reaches Claude's context. Hooks swap the output the model reads and keep the original in ~/.tokenwise; the tokenwise CLI must be installed on PATH.
Trending plugins
7-day copy clicks
You run one by typing its /name in Claude Code.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
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.
A Claude Code plugin with two hooks on the Bash tool, both running
tokenwise hook claude:
PostToolUse replaces the output of a successful Bash call with
TokenWise's projection when a filter recognizes it (test runners,
compilers, git status/diff, grep/rg, find, ls, build tools, …).
The command runs exactly as the model wrote it; the original output is
saved under ~/.tokenwise.PreToolUse, in bypassPermissions mode only, wraps a recognizable
command as tokenwise run --host claude --session <id> --call <id> -c '<command>',
so failed calls are filtered too (see below).Verified against Claude Code 2.1.310 in real claude -p sessions:
pytest -v run (150 tests): the model read 575 bytes instead of
12,658, and answered from them. In bypassPermissions mode a failing run
went from 13,328 to 1,245 bytes, keeping the failing test's node id and
assertion. In both, the model's history keeps the original command.PostToolUseFailure,
which cannot replace output, so outside bypassPermissions failed calls
reach the model unchanged.bypassPermissions: a wrapped command
would no longer match your permission rules (Bash(pytest:*) would not
match tokenwise run … -c 'pytest', and neither would Claude Code's built-in
read-only commands), so it would prompt where it did not before, and a deny
rule would stop matching. The hook never returns a permission decision.tokenwise show <sha256> prints the original.run_in_background) is remembered when it
starts. Once it has exited, its output file (…/tasks/<id>.output, which
then ends [exited with code N]) is filtered as that command's output when
the model reads it whole with Read or cat; read while running, in part,
or after [killed], it passes. Verified on Claude Code 2.1.325: a
background pytest -v read through its output file went from 3,299 to 326
tokens, and the model named the failing test and its assertion.PostToolUse also sees Read, WebFetch, WebSearch, Agent and MCP
tools: their text is journaled as it is. A Read that repeats an earlier
one (same file and range, same text) whose result the transcript still
shows, with no compaction or clearing after it, comes back as a one-line
note pointing to it; read again right after, the file comes back whole. A
subagent's reads are always whole. Verified on Claude Code 2.1.325: a
122-line file read twice cost 2,896 tokens once, and the model answered
from the first read.tokenwise hook claude recognizes
their events and leaves them to their own TokenWise plugin, so nothing is
filtered twice.tokenwise must be on the PATH Claude Code runs hooks with
(npm install -g @tokenwise/cli, then tokenwise doctor).When an answer ends and the conversation saved more than when it was last
said, a Stop hook adds a small card: a jar with as many coins as the share it saved, saved 2,973 tokens in this conversation, and a bar for tool output 90% shorter. The share is of all the tool output TokenWise saw in
the conversation, shortened or not; it is in English whatever your locale.
Claude Code writes the compaction summary itself and no plugin may replace it, so TokenWise works around it (verified on 2.1.312):
compact reads the transcript, saves every
tool result of the span Claude Code just compacted (the subagent's
transcript when a subagent compacted), and adds the catalog of everything
the session can recall, under Claude Code's 10,000-character limit for
added context. It is stored in the transcript, so it survives a resume..mcp.json: tokenwise mcp --host claude, always
loaded) gives the model mcp__plugin_tokenwise_tokenwise__tokenwise_recall;
a PreToolUse hook lets it run without a prompt, since it only reads what
TokenWise saved.In a real run (Haiku, compaction forced at ~35k tokens) the model answered a question about a file it no longer had in context by calling the recall tool.
tokenwise setup also installs the tokenwise skill: /tokenwise shows what
TokenWise shortens and which commands are worth teaching it, and teaches it one
with you (your agent writes the rule, shows you the before and after on your
own output, and keeps it only when you say so).
7-day copy clicks
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 hkuds/tokenwise --plugin tokenwisePlugins from other owners that cover similar ground