token-usage-monitoring-hook
Installation
SKILL.md
Token Usage Telemetry Hook Protocol (Anomaly Spike Detection)
Overview
When running autonomous agents with file inspection and browser tools, an unmonitored agent can silently ingest a 40,000-token minified JS file or 5MB raw HTML log without the developer or orchestrator noticing.
Silent token consumption causes:
- Financial Invoice Spikes: A looping agent burns $50+ in minutes.
- Invisible Performance Degradation: Sudden 15-second latency spikes caused by processing bloated input prompts.
- No Root-Cause Tracing: Developers cannot identify which specific tool call or turn introduced the token flood.
The Token Usage Telemetry Hook Protocol intercepts every model response and tool execution - logging exact input, output, and cache read metrics and triggering an alert when any single turn exceeds safe thresholds ($> 5,000\text{ tokens}$).