360 Secure SkillHub
360 安全技能中心

Token Audit

该 Skill 是一个本地 Python 脚本,可扫描指定工作区中的文件,估算在 GPT-4、Claude、Gemini、Llama、Mistral、Qwen 等模型下的 token 数量与费用,给出按文件大小的明细、异常臃肿文件提示及优化建议,支持文本与 JSON 输出,声明零依赖且无需 API key。

分类:数据
justincredible-tech
justincredible-tech
热度 24.09
最近更新 2026-05-20 03:28:24

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add justincredible-tech/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