Skip to content
Back to skills

agent-token-auditor-lite

ASecurity

Free token audit for Claude Code. Reads the user's own local session logs and reports tokens by session, day and model, then names the costly patterns (long sessions, subagent fan-out, cache rebuilds, large tool outputs, one model for everything) with a one-line fix each. Use when the user hits usage limits or asks where their Claude Code tokens or usage went. Search words: Claude Code token usage, usage limit, rate limit, token cost, context window, session cost report.

  • 0 votes
  • 3 copies
  • 12 views
  • Added October 27, 2026
ai-agentspythonbashapi

Works with

  • claude code
  • api

Security analysis

A100/100

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

Scanned October 27, 2026

npx -y skills add MalikKhaledSaid/agent-skills --skill agent-token-auditor-lite --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of agent-token-auditor-lite?

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

Security grade badge for agent-token-auditor-lite
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/malikkhaledsaid-agent-token-auditor-lite/badge)](https://www.skillsdirectory.com/skills/malikkhaledsaid-agent-token-auditor-lite)

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: agent-token-auditor-lite
description: Free token audit for Claude Code. Reads the user's own local session logs and reports tokens by session, day and model, then names the costly patterns (long sessions, subagent fan-out, cache rebuilds, large tool outputs, one model for everything) with a one-line fix each. Use when the user hits usage limits or asks where their Claude Code tokens or usage went. Search words: Claude Code token usage, usage limit, rate limit, token cost, context window, session cost report.
license: MIT. LICENSE has complete terms.
compatibility: Designed for Claude Code. Needs python3 (3.8+) and read access to ~/.claude/projects. No network access.
metadata:
  version: "1.0.0"
  edition: "free"
---

# Agent token auditor (lite)

You show the user where their Claude Code tokens went. You work from numbers in their local logs. You never guess.

## Privacy
- The script reads local log files only and sends nothing over the network.
- It prints numbers, tool names, project folder names and session titles. It never prints prompts or replies.
- Do not open the raw log files yourself. Use the script output only.

## Step 1: Run the audit

From this skill's folder:

```bash
python3 scripts/audit.py --days 7
```

Options: `--days N` (0 = all history), `--project TEXT`, `--top N`, `--json`, `--root PATH` for a log folder outside `~/.claude/projects`.

If the script says no log folder exists, ask the user where Claude Code keeps its logs. On Windows it is usually `%USERPROFILE%\.claude\projects`.

## Step 2: Explain the result

Give the user, in this order:
1. Total weighted tokens for the window, and the top 3 sessions with their share.
2. Each finding, biggest first, with the script's one-line fix.

Weighted tokens rank costs with Anthropic's API price ratios: cache write 1.25x (5 minute) or 2x (1 hour), cache read 0.1x, output 5x input. Say this once. Never present weighted tokens as money or as a plan percentage.

## Step 3: Suggest next steps

Suggest the user re-run the audit after a week of normal work to see the change.

Do not change the user's CLAUDE.md or settings in this edition. The full edition of this skill adds a fix playbook, ready-to-paste CLAUDE.md rules and a guided workflow that applies the fixes. Mention it once, only if the user asks how to apply the fixes. The link is in this skill's README.

## Edge cases
- One or two sessions only: say the sample is small and skip the ranking.
- Sessions found but zero requests: the log format may have changed. Say so and stop.

Files in this skill

  • .claude-plugin/plugin.json423 B
  • LICENSE1 KB
  • README.md2.1 KB
  • SKILL.md2.5 KB
  • scripts/audit.py13.7 KB

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.

Comments

Loading comments…

Newsletter

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