SLOPSHOPPER

tool-counter

Count tool calls alongside the Claude Code spinner.

newspinnerguard
A shopper browsing a rack in a slop shop
Preview · a replayed session in a sandbox
claude · ~/work/app · tool-counter
› fix the failing auth test and add an audit log call ⏺ Read(src/auth.ts) ⎿ Read 6 lines ⏺ Update(src/auth.ts) ⎿ Added 2 lines, removed 1 line ⏺ Bash(bun test) ⎿ 3 pass, 1 fail ● Done. refresh now rejects expired claims and logs an audit event. ✻ Worked for 42s · done 4:20 PM ✻ Thinking · 9 tool calls… ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── › ? for shortcuts
README

tool-counter

Part of OpenMod Lab, by Jerry Wang. MIT licensed.

Requires Claude Code 2.1.287+. Inspect the source before loading; native mods run with your user permissions.

claude plugin validate ./plugins/tool-counter
claude --plugin-dir ./plugins/tool-counter

Counts observed tool calls and appends the count to the spinner. No command is registered. Reload/session restart clears the counter. Learning example based on the counting pattern in Anthropic’s official tutorial.

Source 1 files
hooks/register.js 21 lines
1// OpenMod Tool Counter · MIT
2// A tiny first mod: count calls and extend the spinner.
3let calls = 0;
4
5export function register(on) {
6  on('tool.call', async ($, e, next) => {
7    calls += 1;
8    $.ui.invalidate('ui.render');
9    return next(e);
10  });
11
12  on('ui.render', { component: 'Spinner' },
13    async ($, e, next) => {
14      return next({ ...e, props: {
15        ...e.props,
16        suffix: ' · ' + calls + ' tool calls'
17      }});
18    }
19  );
20}
21