Count tool calls alongside the Claude Code spinner.

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.
hooks/register.js 21 lines1// 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