token-usage-tracker

Token usage logging, alerting, and context-compression utilities for OpenClaw. Use when you want to track per-call token usage, normalize timestamps, and reduce context sent to LLMs via summarization/compression.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "token-usage-tracker" with this command: npx skills add gerhardvr26/oken-usage-tracker

token-usage-tracker

Quick start

  1. Configure defaults in skill-config.json (timezone, log_folder).
  2. Install scripts (examples provided) into your workspace and wire the interceptor into your message pipeline.
  3. Use scripts/context_summarizer.py before sending large contexts to reduce token usage.

What this skill provides

  • Logging: token_tracker.py writes per-call token usage to a JSONL log. Includes timestamp normalization.
  • Interceptor: token_interceptor.py example that normalizes timestamps and forwards sanitized messages to the tracker.
  • Alerts: token_alerts.py example for threshold-based alerts (no external posting by default).
  • Compression: context_summarizer.py produces short summaries to reduce token payloads.
  • Utilities: migration and cleanup scripts (convert timestamps, dedupe log entries).

When to use

  • Use this skill when you want transparent per-call token accounting, to keep token usage low, or to protect sensitive/verbose contexts by summarizing before sending to the model.

Files

  • scripts/
    • token_interceptor.py — example interceptor (normalizes timestamps)
    • token_tracker.py — logging helper
    • token_alerts.py — alert examples
    • context_summarizer.py — compression helper
    • migrate_timestamps.py — migration utility
    • dedupe_log.py — dedupe utility
  • references/
    • examples/systemd/ — example unit files (install manually)
  • skill-config.json — configurable defaults
  • README.md — usage and install notes

Configuration

See skill-config.json for defaults. The skill exposes:

  • timezone: default UTC
  • log_folder: default ./skills/logs (relative to OpenClaw workspace)
  • compression settings: summary_target_tokens, max_context_tokens

Security and installation

  • The scripts are examples and safe by default. They do not change system state or install services automatically.
  • Example systemd/unit files are provided in references/systemd/ — apply them manually after review.

License: MIT (adapt as you prefer)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Signalradar

SignalRadar — Monitor Polymarket prediction markets for probability changes and send alerts when thresholds are crossed. Use when user asks to "add a Polymar...

Registry SourceRecently Updated
5522Profile unavailable
General

ProxyGate Status

Use when checking ProxyGate status — balance, usage, listings, tunnel health, earnings, seller profile, or job status. Make sure to use this skill whenever s...

Registry SourceRecently Updated
80Profile unavailable
General

Token Optimizer Pro

Monitor OpenClaw token usage, analyze usage patterns, estimate cost, and provide practical optimization suggestions. Use when reviewing token consumption by...

Registry SourceRecently Updated
1350Profile unavailable
General

Openclaw Guardian

一键安装包含配置安全、容灾、监控和上下文优化的 OpenClaw 系统全链路守护套件。

Registry SourceRecently Updated
1910Profile unavailable