token-janitor
vega-ninja/token-janitorAudit OpenClaw token usage and find waste. Use when the user says "run token janitor", "check my token usage", "audit my tokens", "why are my tokens so high", or wants to know what's inflating their API costs. Checks workspace files being injected every turn, installed skills with platform conflicts, and config settings like caching and model choice.
SKILL.md
name: token-janitor description: Audit OpenClaw token usage and find waste. Use when the user says "run token janitor", "check my token usage", "audit my tokens", "why are my tokens so high", or wants to know what's inflating their API costs. Checks workspace files being injected every turn, installed skills with platform conflicts, and config settings like caching and model choice.
Token Janitor
Token Janitor audits an OpenClaw setup for token waste. It checks which workspace files are being loaded on every API call, which skills have platform conflicts, and whether caching is configured correctly.
When to activate
Activate this skill when the user says any of the following (or close variations):
- "run token janitor"
- "check my token usage"
- "audit my tokens"
- "why are my tokens so high"
- "token janitor"
How to run it
- Locate this skill's directory — the folder containing this SKILL.md file.
- Run the bundled script:
On Windows,python3 <skill_dir>/janitor.pypython3may not be available — trypython <skill_dir>/janitor.pyinstead. - Read the output, then deliver a concise summary to the user in plain language. Highlight anything marked [!!] first. If everything is clean, say so.
How to report results
Keep it short and direct. The user wants to know what to fix, not read a report.
- [!!] items are high priority — lead with those
- [>>] items are medium priority — mention them briefly
- If nothing is flagged, tell the user their setup looks lean and give them the token counts so they have a baseline
If the script fails for any reason (Python not available, path issues), you can run the checks manually:
- List files at the workspace root and estimate sizes
- Check
~/.openclaw/openclaw.jsonfor thecachesetting - List the contents of the OpenClaw skills directory
What it checks
-
Workspace files — Files at your workspace root are injected into every API call. Large files here inflate every single turn. The script flags anything oversized and tells the user what to do.
-
Skills — Each installed skill adds description text to every session's system prompt. The script checks for platform conflicts (e.g. macOS skills installed on a Linux machine) that will never activate and should be removed.
-
Config — Checks for caching being disabled and Opus set as the default model. Either will significantly inflate costs.
What it does NOT check
- Past session costs or billing history
- Engine-level OpenClaw overhead (not user-configurable)
- Which skills the agent has enabled vs disabled (requires session data)