Skip to content
Back to skills

Oken Usage Tracker

ASecurity

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.

  • 21 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 7, 2026
documentationsecurity

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill oken-usage-tracker --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Oken Usage Tracker?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Oken Usage Tracker
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-oken-usage-tracker/badge)](https://www.skillsdirectory.com/skills/modbender-oken-usage-tracker)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: token-usage-tracker
description: 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.
---

# 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)

Files in this skill

  • README.md812 B
  • SKILL.md2.3 KB
  • references/systemd/token-interceptor.service.txt230 B
  • scripts/context_summarizer.py1.2 KB
  • scripts/dedupe_log.py982 B
  • scripts/migrate_timestamps.py1.5 KB
  • scripts/token_alerts.py870 B
  • scripts/token_interceptor.py2.4 KB
  • scripts/token_tracker.py1.3 KB
  • skill-config.json183 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in documentation →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.