Search

PythonReactSEOPDF
OpenClaw

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.

gerhardvr260 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install gerhardvr26/oken-usage-tracker

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

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 information

Source
github
Repository
openclaw/skills
Path
skills/gerhardvr26/oken-usage-tracker
Version
—
Commit
d707e6af568e1a84854bd1f996e60b127e220166
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

README

token-usage-tracker

Overview

This skill provides a set of example scripts to track per-call token usage, normalize timestamps, and compress large contexts before sending them to an LLM.

Installation (manual)

  1. Review scripts in scripts/ and adjust paths/config as needed.
  2. Copy desired scripts into your active workspace or reference them from the skill folder.
  3. Optionally set up systemd units found in references/systemd/ (examples only).

Defaults

  • Timezone: UTC
  • Log folder: ./skills/logs (relative to OpenClaw workspace)

Notes

  • The scripts are intentionally minimal and well-commented. They are safe to read and run but will not modify system services automatically.
  • If you want, I can package this into a .skill file and run local tests. Say "package" to proceed.

Extracted content

SKILL.md
# 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)
README
token-usage-tracker

Overview

This skill provides a set of example scripts to track per-call token usage, normalize timestamps, and compress large contexts before sending them to an LLM.

Installation (manual)

1. Review scripts in `scripts/` and adjust paths/config as needed.
2. Copy desired scripts into your active workspace or reference them from the skill folder.
3. Optionally set up systemd units found in `references/systemd/` (examples only).

Defaults

- Timezone: UTC
- Log folder: ./skills/logs (relative to OpenClaw workspace)

Notes

- The scripts are intentionally minimal and well-commented. They are safe to read and run but will not modify system services automatically.
- If you want, I can package this into a .skill file and run local tests. Say "package" to proceed.

Related skills

OpenClaw

xint

0xnyk

X Intelligence CLI — search, monitor, analyze, and engage on X/Twitter. TypeScript + Bun. AI agent skill.

OpenClaw

bambu-studio-ai

heyixuan2

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...

OpenClaw

flightclaw

jackculpan

Track flight prices from Google Flights with this OpenClaw skill. Search routes, monitor prices, and get alerts when prices drop.

OpenClaw

openclaw-trading-assistant

openclaw-trade

openclaw trading assistant| openclaw trading skill | nof1.ai & openclaw [moltbot] collaboration | We get the best practices from alpha arena trading seasons and bring it to clawdbot All top AI agents, realtime...