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 Jimmynycuv1.0.1MITIn 1 marketplace
Finds where a Claude Code session wasted tokens (uncached context, context bloat, oversized tool output, redundant reads, wrong-tier routing) and coaches the fix. Adds a live cost/context statusline and a non-blocking end-of-session coach.
Claude loads one when your task matches it, or you run it by name.
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 that shows exactly where a session wasted tokens — and how to fix it. It runs locally and reads your own session log, so no prompt ever leaves your machine.
It flags waste (uncached context, context bloat, oversized tool output, output-heavy turns, failed tool calls, wrong-tier routing, redundant reads, very long single thread) — eight patterns in all, not quality. There is no score, no ranking, no judgment — just "here's what cost you, here's the fix."
The plugin ships three surfaces, all backed by one engine (scripts/analyze.py):
| Surface | What it is | When it fires |
|---|---|---|
/token-efficiency-coach:coach | Slash command — runs the full audit and coaches the fix | When you run it |
| End-of-session coach | SessionEnd hook — saves a report you can review | Automatically, when a session ends (never blocks) |
| Live statusline | scripts/statusline.py — $cost · ctx tokens · cache-hit% · ⚠ | After every assistant message (you wire this up once) |
This plugin is distributed through the jimmy-tools marketplace, whose manifest lives
at the repo root (.claude-plugin/marketplace.json).
# 1) Add the marketplace from GitHub (registers as: jimmy-tools)
claude plugin marketplace add Jimmynycu/token-efficiency
# 2) Install the plugin from that marketplace
claude plugin install token-efficiency-coach@jimmy-tools
Developing from a local clone instead? Point marketplace add at the repo root
(claude plugin marketplace add .), then install the same way.
Validate before publishing (run from the repo root):
claude plugin validate ./plugins/token-efficiency-coach --strict
The hooks (and the statusline, once wired) execute shell commands, so Claude Code will
ask you to accept the workspace trust dialog the first time — the same gate as any
shell-executing setting. If you set disableAllHooks: true, both the hooks and the
statusline are disabled.
/token-efficiency-coach:coachRun it any time a session felt expensive or slow:
/token-efficiency-coach:coach
/token-efficiency-coach:coach /path/to/session.jsonl
With no argument it auto-finds the latest session for the current project; pass a path
to audit a specific transcript. The command injects the engine's ranked report into the
prompt, then Claude relays it and offers to apply the top fix. It adds zero analysis
logic — all of it lives in scripts/analyze.py.
The command is namespaced by the plugin and lives at
skills/coach/SKILL.md, so the typed name is/token-efficiency-coach:coach.disable-model-invocation: truekeeps it a manual command — analyzing spend never auto-fires.
Configured in hooks/hooks.json (referenced by plugin.json):
SessionEnd → end-of-session coach (non-blocking)When a session ends, scripts/session_end_coach.sh reads the session's
transcript_path from the hook's stdin, runs scripts/analyze.py on it, and saves
the full report to:
$CLAUDE_PLUGIN_DATA/last-session-coach.txt
It prints one benign pointer line and always exits 0. SessionEnd is structurally
non-blocking — its exit code and JSON are ignored by Claude Code — so the coach can
never trap your session. (That is also why the coach is on SessionEnd and not
Stop, which can block.) To read the saved report live, just run
/token-efficiency-coach:coach.
PostToolUse → gentle oversized-output warning (optional, async)After a Read/Bash/Grep/WebFetch call, scripts/warn_large_output.sh checks the
size of that one tool result. If it's large enough to meaningfully bloat context (and be
re-billed every later turn), it appends a single gentle note to
$CLAUDE_PLUGIN_DATA/efficiency-warnings.log. It is declared async: true, so it runs
in the background and adds zero latency to the tool call, and it always exits 0.
It is pure sugar — the full audit is the SessionEnd coach's and the command's job.
Neither hook ever emits decision JSON, uses exit code 2, or uses
asyncRewake. By design, nothing this plugin does can block you.
A plugin cannot register a top-level statusLine — the manifest has no such field,
and a plugin's bundled settings.json honors only agent / subagentStatusLine. So the
plugin ships the script and you wire it into your own settings. The
/token-efficiency-coach:coach command will offer to walk you through this.
Why a stable copy? ${CLAUDE_PLUGIN_ROOT} is not expanded inside a user
statusLine command (that variable only exists for plugin-launched hook/MCP
subprocesses), and the installed plugin lives in a versioned cache path that changes on
every update. So copy (or symlink) the script to a stable location and point at that:
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 jimmynycu/token-efficiency --plugin token-efficiency-coachPlugins from other owners that cover similar ground