Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/omrikais/cctally/refresh-usagegit clone --depth 1 https://github.com/omrikais/cctallyWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01868 |
| Opus 5 | $0.00000 | $0.00934 |
| Sonnet 5 | $0.00000 | $0.00374 |
| Haiku 4.5 | $0.00000 | $0.00187 |
Grade A, and why
refresh-usage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.
cctally refresh-usage
Force-fetch 7-day and 5-hour rate-limits from the Anthropic OAuth usage API and
persist them via the same path record-usage uses.
Normally not needed because cctally hook-tick calls the same OAuth-fetch
path automatically. Manual invocation is mostly for force-refresh / debugging.
Difference from hook-tick
refresh-usage busts the status-line cache file
(/tmp/claude-statusline-usage-cache.json) on success, so the next status-line
tick re-fetches. hook-tick calls a non-busting variant of the same fetch path
to avoid interfering with the status-line cache.
User-Agent
cctally refresh-usage sends User-Agent: claude-code/<discovered-version> by
default. Anthropic gates the OAuth /usage endpoint behind a per-User-Agent
rate-limit; presenting the official Claude Code UA bypasses that gate so the
fetch returns 200 instead of 429 during active sessions.
The discovery chain (first hit wins):
- Active executable.
claude --version 2>/dev/null(5 s timeout), parsed against\d+\.\d+\.\d+(?:-[A-Za-z0-9.]+)?. - Versions directory glob.
~/.local/share/claude/versions/filtered to semver-shaped entries; highest semver wins. - Frozen sentinel. A pinned fallback version baked into the script.
The default can be overridden via the oauth_usage.user_agent config field —
see Honesty mode below.
Flags
--quiet— suppress text output--json— emit structured envelope--color {auto,always,never}— color discipline--timeout N— HTTP timeout (default 5s)
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success or rate-limited (graceful fallback emitted) |
| 2 | No OAuth token (run claude once to authenticate) |
| 3 | Network / HTTP failure (non-429) |
| 4 | Malformed response |
| 5 | record-usage failure |
A 429 response from the OAuth usage API is not an error from the user's
perspective — there is no actionable retry without changing UA. The command
serves last-known data from weekly_usage_snapshots, prints a freshness
indicator, and exits 0. See the next section for the exact output shape.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 178 lines · 0 tokens per session scan A 18be0b300195
refresh-usage is a command published in the GitHub repository omrikais/cctally (5 stars, last pushed 3d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,868 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.