keienhrri-bit

Claude Code Usage Audit — Security skill for Claude Code

Security community

Where did my Claude Code usage go.

How to install Claude Code Usage Audit

This entry records only its repository, not the path inside it, so there is no exact command to give. Open keienhrri-bit/claude-code-usage-audit and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Code Usage Audit does

Where did my Claude Code usage go? Reads local Claude Code and Codex logs and splits the main agent's usage into setup, dispatch and work, with per-hand-off cost and prompt-cache rewrite causes. No network, no dependencies.

Alternatives in Security

  • ThinkWatch — Self-hosted AI API and MCP gateway for organizations: SSO and RBAC, per-user identity for MCP tool calls, PII 817 ★
  • OpenTag — Open-source, channel-native agent gateway for Slack 499 ★
  • Node9 Proxy — The Execution Security Layer for the Agentic Era 209 ★

README

claude-code-usage-audit

Reads the session logs Claude Code and Codex keep on your machine and shows where the main agent's usage went: maintaining your agent setup, handing work to other agents, or the actual work.

npx github:keienhrri-bit/claude-code-usage-audit --since 2026-01-01

English | [简体中文](README.zh-CN.md)

== Where the main agent's usage went ==
category       turns  raw tokens  raw share  API-equiv  share
orchestration      2         63k        14%     $0.029   2.2%
dispatch           9        259k        60%      $0.53    40%
work               4        113k        26%      $0.79    58%

== Cache rewrites ==
4 rewrites, 114k tokens written; $0.79 more than reading them from cache (58% of all API-equiv)
cause                events  tokens  excess
idle-1h                   1     34k   $0.27
waiting-on-subagent       1     33k   $0.26
compaction                1     22k   $0.17
model-switch              1     25k  $0.098

== Hand-offs (tasks) ==
4 tasks; main agent spent $0.53 on them (40% of main), median $0.074 per task
marker           tasks  retries  main API-equiv  worker API-equiv
codex-exec           2        1           $0.25        not linked
claude-subagent      1        0           $0.28            $0.004
agy                  1        0           $0.00        not linked

Part of the output for the synthetic logs in `examples/` (full output under [Example](#example)). Subagents, the cost of each hand-off and prompt-cache rewrites are listed separately from the main agent.

Version 0.1.0. Not published on npm. All numbers are token counts from local logs, plus API-equivalent dollar estimates at list prices. They are not your bill and not the percentage `/usage` shows.

Why

If you build tooling around Claude Code (skills, subagents, hooks, scripts that hand work to other CLIs), part of your usage goes into the tooling and the hand-offs rather than the work. Daily totals don't show that split. This tool answers three