token-forecast

token-forecast is a skill for Claude Code from msiShariful/claude-token-inspector. It costs 40 tokens per session (815 once invoked), scanned A, original, MIT.

A token estimator that predicts how much context a file, directory, URL, or pasted text would consume before it is loaded.

In plain words
What is it for?
Use it before reading large files, folders, web pages, test files, or pasted code to plan what to load.
Why use it?
It lets you judge whether external content or a large code area may crowd the AI session before opening it.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the token-inspector plugin — 8 skills shipped together

Good fit Use it before reading large files, folders, web pages, test files, or pasted code to plan what to load.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/msishariful/claude-token-inspector/token-forecast
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add msiShariful/claude-token-inspector --skill token-forecast
Clone the repo
git clone --depth 1 https://github.com/msiShariful/claude-token-inspector

Made for: Claude Code.

Or install token-inspector, the plugin that ships this one along with the rest of its 8 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for token-forecast

README.md
[![agentmods](https://agentmods.dev/badge/skills/msishariful/claude-token-inspector/token-forecast.svg)](https://agentmods.dev/skills/msishariful/claude-token-inspector/token-forecast)
Your own site
<a href="https://agentmods.dev/skills/msishariful/claude-token-inspector/token-forecast"><img src="https://agentmods.dev/badge/skills/msishariful/claude-token-inspector/token-forecast.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 815 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.00815
Opus 5 $0.00020 $0.00407
Sonnet 5 $0.00008 $0.00163
Haiku 4.5 $0.00004 $0.00081

Measured 8d ago against content hash 25a4d08e8ff7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

token-forecast scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/token-forecast/SKILL.md · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Token Forecast

Estimate the token cost of something before it enters your context window. Help the user make an informed decision about whether to load it.

What to forecast

The user may provide:

  • A file path (e.g., src/api/routes.ts)
  • A directory (e.g., src/components/)
  • A glob pattern (e.g., **/*.test.ts)
  • A URL they plan to fetch
  • Pasted content (code block or text they've included in the message)
  • A description (e.g., "my node_modules folder")

If the user provided a file path or directory and you can see the file contents or directory listing in context, use actual character counts. Otherwise, use reasonable estimates based on file type and typical sizes.

Estimation method

  • Prose / markdown: 1 token ≈ 4 characters
  • Dense code (JS, TS, Python, etc.): 1 token ≈ 3.5 characters
  • Minified / compiled code: 1 token ≈ 2.5 characters
  • JSON / config: 1 token ≈ 3 characters
  • Binary / images: not tokenizable — flag as "not readable"

For directories, estimate per file then sum. If the directory is large, sample a few representative files and extrapolate.

Output format

Start with a forecast headline:

📦 Forecast: {name} — ~{N} tokens ({size_label})

Size labels:

Token range Label
< 1,000 Tiny
1,000–5,000 Small
5,000–20,000 Medium
20,000–60,000 Large
60,000–150,000 Very large
> 150,000 Massive — likely too big

Then a budget impact line showing how this fits into the current context:

📊 Budget impact: {current}% used + {forecast}% more = {total}% total (~{remaining_after} tokens remaining after load)

Then a recommendation:

{emoji} {recommendation}

Recommendation rules:

  • If total after load < 60%: ✅ Safe to load — plenty of budget remaining.
  • If total after load 60–75%: ⚠️ Loadable but context will be getting full. Consider closing other files first.
  • If total after load 75–90%: 🟠 Risky — you'll have limited room for responses. Load only if essential.
  • If total after load > 90%: 🔴 Do not load — this will critically fill your context. Use a subsection or start a new conversation.

Read the full file on GitHub · 87 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 87 lines · 40 tokens per session scan A 25a4d08e8ff7

Subscribe to this mod's changes

token-forecast is a skill published in the GitHub repository msiShariful/claude-token-inspector (4 stars, last pushed 3mo ago), licensed MIT. It adds 40 tokens to every session and 815 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.