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 instructions/priyans-hu/tokenmeter/claude-mdgit clone --depth 1 https://github.com/Priyans-hu/tokenmeterWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/priyans-hu/tokenmeter/claude-md)<a href="https://agentmods.dev/instructions/priyans-hu/tokenmeter/claude-md"><img src="https://agentmods.dev/badge/instructions/priyans-hu/tokenmeter/claude-md.svg" alt="Measured on agentmods" height="20"></a>What 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.1 | $0.00661 | $0.00661 |
| Opus 5 | $0.00331 | $0.00331 |
| Sonnet 5 | $0.00132 | $0.00132 |
| Haiku 4.5 | $0.00066 | $0.00066 |
Grade A, and why
tokenmeter CLAUDE.md 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 5d 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 — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TokenMeter
macOS menu bar app for tracking Claude Code usage, rate limits, and costs. Native SwiftUI, no Electron/Tauri.
Build
cd TokenMeter
swift build -c release
Binary output: TokenMeter/.build/release/TokenMeter
Architecture
- SwiftUI MenuBarExtra — macOS 14+,
LSUIElement(no dock icon) - Swift Package Manager — single executable target, no Xcode project
- Concurrency —
@MainActorview model,actorfor services,async letfor parallel fetches
Key Components
| File | Role |
|---|---|
TokenMeterApp.swift |
App entry, MenuBarExtra with popover |
UsageViewModel.swift |
@MainActor ObservableObject — state, timer, caching, notifications |
Services/NativeUsageParser.swift |
Parses ~/.claude/projects/**/*.jsonl — costs, tokens, hourly data |
Services/UsageAPIService.swift |
Reads OAuth token from macOS Keychain, calls api.anthropic.com/api/oauth/usage |
Services/UpdateChecker.swift |
Checks GitHub releases for updates |
Models/UsageSummary.swift |
All data models: DailyUsage, HourlyUsage, RateLimitInfo, ClaudePlan |
Views/ |
SwiftUI views — dashboard, rate limits, heatmap, charts, settings |
Data Sources
-
Anthropic API (
UsageAPIService) — real rate limit utilization % and reset times- Reads OAuth token from Keychain (
kSecAttrService: "Claude Code-credentials") GET https://api.anthropic.com/api/oauth/usagewithAuthorization: Bearer <token>- Also reads
rateLimitTierfrom credential blob for plan auto-detection
- Reads OAuth token from Keychain (
-
Local JSONL (
NativeUsageParser) — costs, model breakdowns, token counts, hourly activity- Scans
~/.claude/projects/and~/.config/claude/projects/ - Deduplicates by
requestId, filters<synthetic>entries - Embedded pricing: Opus 4.5 ($5/$25), Sonnet ($3/$15), Haiku ($1/$5) per MTok
- Scans
Patterns
- API + local data fetched concurrently via
async letinrefresh() - API data preferred for rate limits; local data used as fallback
UserDefaultsfor caching summary + settingsUNUserNotificationCenterfor rate limit alerts (80% threshold, 1hr throttle)- Timer-based auto-refresh (default 5 min)
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.
- 5d ago First seen · 67 lines · 661 tokens per session scan A d9ee38c7e0fc
tokenmeter CLAUDE.md is an instructions file published in the GitHub repository Priyans-hu/tokenmeter (5 stars, last pushed 5mo ago), licensed MIT. It adds 661 tokens to every session, about $0.0033 per session on Opus 5. 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 instructions, from other repositories
FluidAudio copilot-instructions.md
Copilot instructions for FluidInference/FluidAudio, covering fluidaudio - agent development guide, build & test commands, architecture, critical rules and code style (swift-format config).
speech-swift AGENTS.md
AGENTS.md instructions for soniqo/speech-swift, covering agent instructions, communication style, workflow, running tests and benchmarks — sequential and memory-aware and git conventions.
codex-provider-sync AGENTS.md
AGENTS.md instructions for Dailin521/codex-provider-sync, covering ai / agent operator guide, vnext architecture baseline, goal, choose the interface and safe operating flow.
liney AGENTS.md
AGENTS.md instructions for everettjf/liney, covering liney repository collaboration guide, 交流语言 / communication language, project overview, repository layout and build and test.
Starcat AGENTS.md
AGENTS.md instructions for starcat-app/Starcat, covering agents.md, 🚨 硬性铁律(每次写代码前必读,违反即返工), 🌿 git 分支与 worktree(强制), 🧭 主进度索引(每次开工前必读) and 状态符号(与功能实现总览.md 同步).
skills-manager CLAUDE.md
Instructions for yibie/skills-manager, covering skills manager - development guide, tui engine: blessed, 核心原则, 参考文档 and 正确的 list 用法.