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 skills add eaglesakura/agent-skills --skill workspace-count-tokensgit clone --depth 1 https://github.com/eaglesakura/agent-skillsWrote 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/skills/eaglesakura/agent-skills/workspace-count-tokens)<a href="https://agentmods.dev/skills/eaglesakura/agent-skills/workspace-count-tokens"><img src="https://agentmods.dev/badge/skills/eaglesakura/agent-skills/workspace-count-tokens/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/eaglesakura/agent-skills/workspace-count-tokens"><img src="https://agentmods.dev/badge/skills/eaglesakura/agent-skills/workspace-count-tokens.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00106 | $0.00950 |
| Opus 5.5 | $0.00042 | $0.00380 |
| Sonnet 5.5 | $0.00021 | $0.00190 |
| Haiku 4.5 | $0.00011 | $0.00095 |
Grade A, and why
workspace-count-tokens 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 2mo 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.
What it actually says
Workspace / Count Tokens
ファイルベースでトークン量を概算する。課金トークンや Cursor UI 表示との一致は保証しない。 出力は必ず assets/report.md の見出し・表カラムに従う。
いつ使うか
- デフォルト Context や SKILL / docs のトークン概算を測る・比較するとき
- 「コンテキストサイズ」「SKILL が何トークンか」を知りたいとき
いつ使わないか
- 会話全体・ツール結果込みの実リクエスト課金を監査するとき
- 単一ファイルの厳密カウントだけで足りるとき
計測対象
| 区分 | デフォルト(常時) | 動的(最大) |
|---|---|---|
AGENTS.md / alwaysApply rules / .cursorrules |
本文 | - |
| 非 always の rule | description のみ | - |
SKILL.md |
description のみ | 全文(他 SKILL 経由の追加ロードは含めない) |
docs/ doc/ references/ |
含めない | 全文 |
User Skills(--include-user-skills) |
description | 全文 |
含めない: システムプロンプト、ツール/MCP スキーマ、User Rules(Settings)、オープン中ファイル、会話履歴。
手順
scripts/count_workspace_tokens.pyを 実行する(自前集計よりスクリプト優先)- 標準出力のレポートを assets/report.md 構成のままユーザーへ示す(3セクションを混ぜない)
- 各セクション先頭の統計(
ファイル数合計/トークン量合計)を残す トークン量合計は常にキロトークン(例:0.7K Tokens、5.0K Tokens、小数点以下第1位)
- 各セクション先頭の統計(
- 概算である旨と未計測項目を一言添える
tiktokenが無ければスクリプトの提案どおりインストールを案内する- 結果を残すなら
.ai-agent/tmp/へ(workspace-agent-temporary)
# 推奨依存
python3 -m pip install tiktoken
# または: python3 -m venv /tmp/tokencount && /tmp/tokencount/bin/pip install tiktoken
# SKILL_DIR は本 SKILL.md があるディレクトリ
SCRIPT="$SKILL_DIR/scripts/count_workspace_tokens.py"
python3 "$SCRIPT" --root .
# multi-root は --root を繰り返し。ユーザー SKILL 込みは --include-user-skills。JSON は --json。
パス解決は workspace-resolve-file-path に従う。トークナイザは tiktoken の o200k_base、無ければ chars/4。
DO / DO NOT
- DO: デフォルトと動的(SKILL / ドキュメント)を分けて報告する
- DO NOT: UI のコンテキスト%や課金トークンと同一視する
- DO NOT: eval / iteration / skill-snapshot 配下を本番 SKILL として数える
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 2mo ago First seen · 67 lines · 106 tokens per session scan A 8b11f13e9e47
workspace-count-tokens is a skill published in the GitHub repository eaglesakura/agent-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 106 tokens to every session and 950 once invoked, about $0.0004 per session on Opus 5.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.
workspace-count-tokens compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| workspace-count-tokenseaglesakura/agent-skills | Skill | 2 | 1mo ago | MIT | A | 106 | Claude Code, Codex |
| imagegenopenai/codex | Skill | 134k | today | Apache-2.0 | A | 113 | Codex |
| local-ai-agentsmicrosoft/ai-agents-for-beginners | Skill | 79k | today | MIT | A | 200 | Claude Code, Codex |
| playwright-climicrosoft/playwright | Skill | 99k | today | Apache-2.0 | A | 19 | Claude Code |
| systematic-debuggingobra/superpowers | Skill | 314k | 4d ago | MIT | A | 21 | Claude Code |
| next-cache-components-adoptionvercel/next.js | Skill | 143k | today | MIT | A | 95 | Claude Code |
| chat-pet-sprite-creationmicrosoft/vscode | Skill | 195k | today | MIT | A | 53 | Claude Code, Codex |