Back to directory

tokenu

A command-line tool, modeled on the Unix du command, that reports how many language-model tokens each file and directory in a project consumes, to help budget context before feeding a folder to an LLM or coding agent.

tokenu

tokenu counts token usage per file and directory, the way du reports disk usage, to answer how much of a language model's context window a given folder would consume. It is run with npx and prints a directory tree of token counts, so a developer can see before pasting a folder into a prompt which parts of a project are the most expensive.

Its output helps find unexpectedly large files such as generated JSON, lockfiles or bundles, and a JSON output mode lets the counts be piped into an autonomous agent so it can plan which files to read within a set token budget, or used as a pre-read hook that warns or blocks before a tool like Claude Code loads an oversized file. It can also compare how the same files tokenize under different model encodings, to estimate cost differences before switching models.

More in CLI tools

See all 181
  • grev

    github.com

    A set of Unix coreutils-style filters — grep, sort, cut and more — that answer a plain-language question about each record instead of matching a pattern, using a small decision model.

  • A Node.js script that exports a Google Doc to HTML and CSS with high fidelity, preserving headings, spacing, alignment, bullet lists, images and right-to-left text.

  • gpusched

    github.com

    A VRAM-aware GPU job scheduler for a single machine: declare how much memory each shell command needs, and it places jobs the moment a GPU has room and reports when a guess was wrong.