360 Secure SkillHub
360 安全技能中心

Token Audit

这是OpenClaw工作区的token消耗分析工具,核心功能为扫描工作区文件,估算GPT-4、Claude等6大模型的token数量与调用成本,识别冗余文件、臃肿上下文等成本驱动因素,并给出优化建议。典型场景是开发者需控制AI模型调用成本时使用,支持扫描整个工作区或指定路径,输出可选控制台文本或JSON格式,工具免费、零依赖,无需API密钥。

justincredible-tech
justincredible-tech
热度 26.71
最近更新 2026-05-20 03:28:24
分类:数据依赖:代码执行 / 读写文件应用场景:数据处理 / 财务 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add token-audit
Metadata
name
token-audit
version
0.2.0
description
Workspace token consumption analyzer for OpenClaw agents. Scans workspace files, estimates token counts across 6 major models (GPT-4, Claude, Gemini, Llama, Mistral, Qwen), and surfaces hidden cost drivers. Identifies bloated context, redundant files, and optimization opportunities. Free, zero dependencies, no API keys.
author
Cael (@CaelMaximus)
license
MIT
tags
["security","tokens","cost","optimization","workspace","caelguard"]

Token Audit

Analyze your OpenClaw workspace token consumption and costs across multiple models.

Usage

Scan your workspace

python3 scripts/token-audit.py

Scan a specific path

python3 scripts/token-audit.py --workspace /path/to/workspace

JSON output

python3 scripts/token-audit.py --json

What It Finds

  • Total token count per model (GPT-4, Claude 3, Gemini, Llama 3, Mistral, Qwen)
  • Per-file token breakdown sorted by size
  • Estimated costs per model at current pricing
  • Files that are disproportionately large vs their utility
  • Optimization recommendations

Part of Caelguard

Free, open-source agent security toolkit. See also: shellguard-scanner