agentleFS
egorfedorovegorfedorov/claude-context-optimizer/skills/token-check/SKILL.md

token-check

Skill127 starsChanged 5 months agoMITView on GitHub

Estimate how many tokens a pasted text, an attached file or the conversation so far takes, what it means for the context window and usage limits, and how to cut it. Use when the user asks how big something is in tokens, why they keep hitting limits, or whether a file is too large to send.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When a conversation is long, start fresh from a handoff (the fresh-start skill).

    line 40

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Token check

Give a quick, honest estimate and the cheapest way to get the same result. These are estimates; say so. Exact counts come from the API's token counter.

Estimate

  • English prose: about 4 characters per token, roughly 750 words per 1,000 tokens. A full page of text is 500–700 tokens.
  • Code, JSON, logs: about 3 characters per token.
  • Cyrillic, CJK and other non-Latin scripts: about 1.5–3 characters per token, so the same text costs noticeably more than in English.
  • Images: on the order of 1,500 tokens each at typical sizes. PDFs: the text, plus an image's worth for pages read as images.

Give a range (for example "about 18–24K tokens"), and compare it with the context window: 1M tokens on current Opus, Sonnet and Haiku 5.5 models, 200K on older Haiku.

Explain the real cost

In a conversation, everything already in it is re-sent with every new message. A 20K-token document pasted early is paid for again on each of the next 30 messages, about 600K tokens in total. That, not the first send, is what uses up limits.

Ways to cut it, cheapest first

  1. Send only the part that matters: the section, the function, the failing lines of a log.
  2. Strip what carries no meaning: minified code, base64, repeated log lines, boilerplate.
  3. Summarize a long document once, then continue from the summary.
  4. When a conversation is long, start fresh from a handoff (the fresh-start skill).
  5. In Claude Code: read files with offset/limit, let the context-optimizer scout subagent do wide exploration on Haiku, and run /cco audit to see where a session's tokens actually went.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.