SLOPSHOPPER

usage-probe

Writes the session's plan rate limits to the file named by THAI_SYLLABUS_USAGE_OUT

new
★ 1v0.1.0no licenseupdated 2026-10-07cehbz/thai-language-anki/tools/claude-mods/usage-probe
A shopper browsing a rack in a slop shop
README

usage-probe

A Claude Code mod (≥ 2.1.287) for tools/quota_pacer.py: after each turn it writes $.session.usage()'s rateLimits (five_hour, seven_day), context and cost, with read_at, as JSON to the file named by THAI_SYLLABUS_USAGE_OUT. No UI. Loaded per call with --plugin-dir.

Source 1 files
hooks/register.js 14 lines
1// Writes the plan's rate-limit windows to the file named by THAI_SYLLABUS_USAGE_OUT
2// once a turn completes; rateLimits is empty before the first response.
3export function register(on) {
4  on('turn.complete', async ($, e, next) => {
5    const result = await next(e)
6    const path = await $.env.get('THAI_SYLLABUS_USAGE_OUT')
7    if (path) {
8      const { rateLimits, context, cost } = await $.session.usage()
9      await $.fs.write(path, JSON.stringify({ read_at: new Date().toISOString(), rateLimits, context, cost }, null, 2) + '\n')
10    }
11    return result
12  })
13}
14