Fly-Pluche

TokXray — AI skill for Claude Code

AI community

Find where AI coding sessions waste tokens.

How to install TokXray

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

What TokXray does

Find where AI coding sessions waste tokens. TokXray scans local logs from Claude Code, Codex, Antigravity, and other coding agents to flag prompt cache misses, costly tool calls, repeated file reads, and subagent overhead.

Alternatives in AI

  • Tokentab — A CLI that reads Claude Code, Codex, and Gemini CLI session logs and works out how much they cost, by model, p 226 ★
  • Agf — Local-first TUI to find, search, and resume AI coding-agent sessions across Claude Code, Codex, Grok Build, Ki 148 ★
  • AI Agent Session Center — Real-time dashboard that turns AI coding agent sessions (Claude Code, Gemini CLI, Codex) into animated 3D robo 82 ★

README

English | [简体中文](./README_CN.md)

TokXray

**CodexBar watches your quota. ccusage totals your bill. TokXray X-rays what you wasted — and prescribes how to fix it.**

TokXray is a cross-platform Token Waste & Cache Invalidation Profiler & Doctor for **Claude Code, Codex, Antigravity, DeepSeek Harness (DSH), Cursor, OpenCode, and Gemini CLI**. Run `npx tokxray` to find which turns rebuilt a warm cache, which tools returned expensive results, and how much of a session's cost came from delegated work.

![TokXray Burn Checkup Card](./docs/assets/demo-card-en.png)

*Example report generated from synthetic sessions.*

Quickstart

Requires **Node.js >= 22.5.0** for built-in `node:sqlite`. On early Node 22 releases that gate SQLite, set `NODE_OPTIONS=--experimental-sqlite` or use a newer runtime.

npx tokxray                       # Terminal report in English
npx tokxray --lang zh             # Chinese report
npx tokxray --since 7 --html --redact  # Explore the last seven days offline
npx tokxray --png                 # Terminal report and local burn checkup card
npx tokxray --json                # Machine-readable report on stdout
npx tokxray --redact --since 7    # Shortened paths for recently active sessions

Dollar amounts are **API-equivalent estimates** based on logged usage and model pricing, and on Pro, Max, or Team subscriptions, avoidable usage consumes your 5-hour and weekly quotas faster.

From a local checkout, run `npm ci`, then `npm run build` and `node ./bin/tokxray.js`. The local command accepts the same flags.

How platform parsing and deduplication work

Source Status What counts as one turn or session
Claude Code · ~/.claude Verified Reads projects//.jsonl and nested subagents/agent-*.jsonl. Streaming updates with the same message.id contribute the maximum of each usage counter once. The parser unions tool_use blocks by block.id and joins each tool_result by its matching `tool