ranjan-mohanty

Tokenscope — AI skill for Claude Code

AI community

Find the money your AI coding agent wasted: cache rebuilds, loops, re-reads and giant tool outputs, with fixes, plus a flame graph of token spend.

How to install Tokenscope

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

What Tokenscope does

Find the money your AI coding agent wasted: cache rebuilds, loops, re-reads and giant tool outputs, with fixes, plus a flame graph of token spend. Claude Code, Codex, Gemini CLI, OpenCode, Cline, Roo, Copilot CLI and more. Zero dependencies, 100% local.

Alternatives in AI

  • AI Marketing Skills — The marketing fundamentals that make AI actually make you money, written in my own voice, as a ready-to-instal 226 ★
  • Waldzell MCP — Waldzell AI's monorepo of MCP servers 202 ★
  • AI Toolkit — Professional-grade AI coding toolkit: 94 skills, 44 agents, multi-platform (Claude, Cursor, Windsurf, Copilot 167 ★

README

tokenscope

**Your AI coding agent wasted money last month. tokenscope shows exactly where.**

*ccusage tells you what you spent. tokenscope tells you what you wasted.*

`npx tokenscope`

Zero dependencies · runs 100% locally · Claude Code, Codex, Gemini CLI, OpenCode, Cline, Roo, Copilot CLI and more · MIT

[![CI](https://github.com/ranjan-mohanty/tokenscope/actions/workflows/ci.yml/badge.svg)](https://github.com/ranjan-mohanty/tokenscope/actions/workflows/ci.yml) [![npm](https://img.shields.io/npm/v/tokenscope?color=cb3837&logo=npm)](https://www.npmjs.com/package/tokenscope) [![npm downloads](https://img.shields.io/npm/dm/tokenscope?color=cb3837)](https://www.npmjs.com/package/tokenscope) [![node](https://img.shields.io/badge/node-%3E%3D22-339933?logo=node.js&logoColor=white)](package.json) [![license: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE) [![GitHub stars](https://img.shields.io/github/stars/ranjan-mohanty/tokenscope?style=social)](https://github.com/ranjan-mohanty/tokenscope/stargazers)

![npx tokenscope in a terminal: estimated waste first, with a fix for each finding, then spend by project, model, session and tool](docs/demo.gif)

Recorded from the real CLI on synthetic logs (`npm run demo:gif`).


You know the bill. You don't know which part was **wasted**:

  • your prompt cache expiring every time you spend 10 minutes reading the agent's answer, so a 500k-token context is re-written at cache-write price instead of read at cache-read price
  • the agent running npm test five times in a row and getting the same failure back every time
  • the same 2,000-line file read 40 times without anyone editing it
  • a 60k-token log cat-ed into context, then paid for again on every later request

tokenscope reads the session logs your agents already keep on disk, finds these patterns, estimates what each one cost, and tells you how to stop it. Then it shows the full spend as a flame graph, so you can