Token Consumer banner
Shult Shult

Token Consumer

Development community

Description

Measure and shrink the token cost of Claude Code skills, tier by tier: the always-on system-prompt tax, the per-invocation body, and on-demand references, each priced at the rate it is actually billed.

Installation

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

README

tokc — token consumption analyzer for Claude Code skills

[![CI](https://github.com/Shult/token_consumer/actions/workflows/ci.yml/badge.svg)](https://github.com/Shult/token_consumer/actions/workflows/ci.yml) [![PyPI](https://img.shields.io/pypi/v/tokc.svg)](https://pypi.org/project/tokc/) [![Python](https://img.shields.io/pypi/pyversions/tokc.svg)](https://pypi.org/project/tokc/) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Measures what a skill actually costs you, tier by tier, and tells you where to cut.

  29 skill(s)   tokenizer: o200k_base x1.180 (default)

  SKILL                   T1/sess   T2/use      T3  ALWAYS-ON TAX                  $/mo
------------------------------------------------------------------------------
  project-artifact            241    5,415    8.5k  ████████████████████████ !   $2.99
  receipts                    159    4,865     20k  ████████████████         !   $2.40
  hook-development            140    4,548     16k  ██████████████               $2.20
  ...
------------------------------------------------------------------------------
  TOTAL                     2,787   99,352    294k                               $45.65

  Always-on tax
    2,787 tokens ride in the system prompt of every request, in every session,
    whether or not any skill fires.
    -> 2.9M billed token-equivalents/month at 200 sessions x 40 requests

  Listing budget  (characters, not tokens)
    ████████████████████████████████████████  10,577 / 8,000 chars  (132%)
    window 200,000 tokens x 4 chars/token -- model `sonnet`, ~/.claude/settings.json
    ! 2,577 chars over budget -- 6 skill(s) ship as `- name`, description omitted
      demoted, least-used first: plugin-structure, project-artifact, receipts, ...

Why this exists

Existing tools estimate skill cost by asking Claude — which costs tokens and gives different numbers each run — or by running `tiktoken` over `SKILL.md`, which **undercounts Claude by 15-20%*