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.
npx agentmods add instructions/krulewis/tokencast/claude-mdgit clone --depth 1 https://github.com/krulewis/tokencastWrote 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.
[](https://agentmods.dev/instructions/krulewis/tokencast/claude-md)<a href="https://agentmods.dev/instructions/krulewis/tokencast/claude-md"><img src="https://agentmods.dev/badge/instructions/krulewis/tokencast/claude-md.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01446 | $0.01446 |
| Opus 5 | $0.00723 | $0.00723 |
| Sonnet 5 | $0.00289 | $0.00289 |
| Haiku 4.5 | $0.00145 | $0.00145 |
Grade A, and why
tokencast CLAUDE.md 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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.
tokencast
A Claude Code skill that automatically estimates Anthropic API token costs when a development plan is created, and learns from actual usage over time to improve accuracy via calibration factors.
Repo
- GitHub:
krulewis/tokencast - PyPI package version: 0.1.4
- Distribution: MCP server via
uvx tokencast(registered in MCP Registry asio.github.krulewis/tokencast) - SKILL.md: Retained as algorithm reference doc, but no longer installed as a Claude Code skill. MCP server is the primary interface.
Key Files
| Path | Purpose |
|---|---|
SKILL.md |
Algorithm reference doc — estimation formulas, output template (v2.1.0, no longer installed as skill) |
references/heuristics.md |
Token budgets, pipeline step decompositions, complexity multipliers, parallel discount parameters — all tunable parameters live here |
references/pricing.md |
Model pricing per million tokens, cache rates, step→model mapping |
references/calibration-algorithm.md |
Calibration algorithm documentation |
references/examples.md |
Worked estimation examples |
scripts/tokencast-learn.sh |
Stop hook — reads session JSONL, computes actuals, calls update-factors.py |
scripts/tokencast-midcheck.sh |
PreToolUse hook — warns if trending toward pessimistic band |
scripts/tokencast-agent-hook.sh |
PreToolUse+PostToolUse hook — writes sidecar timeline for per-agent step attribution |
scripts/update-factors.py |
Computes and persists calibration factors from session data |
scripts/sum-session-tokens.py |
Parses session JSONL, computes per-step actuals via sidecar |
scripts/calibration_store.py |
Storage abstraction for history.jsonl and factors.json |
scripts/tokencast-status.py |
Calibration health dashboard (v2.0) |
calibration/ |
Calibration data — gitignored; contains history.jsonl, factors.json, active-estimate.json |
src/tokencast/__init__.py |
Package exports (eager imports — lazy migration was not needed; CI fix was GNU xargs compat) |
src/tokencast/api.py |
Public API layer — dict-based routing; estimate_cost(), report_session(), report_step_cost() |
src/tokencast/estimation_engine.py |
Core estimation: compute_estimate(params, calibration_dir) |
src/tokencast/file_measurement.py |
File size bracket measurement: measure_files(), assign_bracket() |
src/tokencast/pricing.py |
Cost computation: compute_cost_from_usage(usage, model) |
src/tokencast/heuristics.py |
Tunable parameters (derived from references/heuristics.md) |
src/tokencast/session_recorder.py |
build_history_record() — shared by shell and MCP paths |
src/tokencast/step_names.py |
Step name resolution: resolve_step_name() (handles alias mapping) |
src/tokencast/telemetry.py |
Opt-out PostHog telemetry (endpoint hardcoded, install ID at ~/.tokencast/install_id, no-telemetry file at ~/.tokencast/no-telemetry) |
src/tokencast/calibration_store.py |
Storage abstraction for history and factors |
src/tokencast/parse_last_estimate.py |
Reconstitution of minimal estimates from last-estimate.md (package module) |
src/tokencast/tokencast_status.py |
Calibration health dashboard utilities (package module) |
src/tokencast/update_factors.py |
Calibration factor computation and persistence (package module) |
src/tokencast_mcp/server.py |
MCP server: main(), build_server(), tool dispatcher |
src/tokencast_mcp/tools/ |
MCP handlers: estimate_cost, get_calibration_status, get_cost_history, report_step_cost, report_session, disable_telemetry |
src/tokencast_mcp/tools/disable_telemetry.py |
Handler for disable_telemetry tool — creates ~/.tokencast/no-telemetry file (v0.1.5+) |
docs/wiki/ |
GitHub wiki source — Home, How-It-Works, Installation, Configuration, Calibration, Roadmap, Attribution |
docs/attribution-protocol.md |
Framework-agnostic attribution protocol spec (v1) |
docs/phase-1-execution-plan.md |
Owner decisions and story inventory (Phase 1 completed) |
README.md |
Repo root README (PyPI package docs) |
pyproject.toml |
Package metadata; entry point tokencast-mcp = "tokencast_mcp.server:main" |
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.
- 4d ago First seen · 85 lines · 1,446 tokens per session scan A decb5420dbec
tokencast CLAUDE.md is an instructions file published in the GitHub repository krulewis/tokencast (2 stars, last pushed 4mo ago), licensed MIT. It adds 1,446 tokens to every session, about $0.0072 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.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
next.js AGENTS.md
Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.