workspace-count-tokens

workspace-count-tokens is a skill for Claude Code, Codex from eaglesakura/agent-skills. It costs 106 tokens per session (950 once invoked), scanned A, original, MIT.

A workspace measurement skill that estimates how many tokens are used by project instructions, rules, skills, and related documentation.

In plain words
What is it for?
Use it to measure default instructions and dynamically loaded skills or documents, with results recorded in the required report format.
Why use it?
It helps identify how much context these materials occupy when comparing or managing workspace context size.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it to measure default instructions and dynamically loaded skills or documents, with results recorded in the required report format.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/eaglesakura/agent-skills/workspace-count-tokens
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 eaglesakura/agent-skills --skill workspace-count-tokens
Clone the repo
git clone --depth 1 https://github.com/eaglesakura/agent-skills

Made for: Claude Code, Codex.

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 workspace-count-tokens

README.md
[![agentmods](https://agentmods.dev/badge/skills/eaglesakura/agent-skills/workspace-count-tokens/github.svg)](https://agentmods.dev/skills/eaglesakura/agent-skills/workspace-count-tokens)
Your own site
<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.

agentmods 80×15 button for workspace-count-tokens

Your own site · 80×15
<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>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 950 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.00106 $0.00950
Opus 5 $0.00053 $0.00475
Sonnet 5 $0.00021 $0.00190
Haiku 4.5 $0.00011 $0.00095

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

Security

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 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/count_workspace_tokens.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

packages/agentic-workspace/.apm/skills/workspace-count-tokens/SKILL.md · 67 lines

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)、オープン中ファイル、会話履歴。

手順

  1. scripts/count_workspace_tokens.py実行する(自前集計よりスクリプト優先)
  2. 標準出力のレポートを assets/report.md 構成のままユーザーへ示す(3セクションを混ぜない)
    • 各セクション先頭の統計(ファイル数合計 / トークン量合計)を残す
    • トークン量合計 は常にキロトークン(例: 0.7K Tokens5.0K Tokens、小数点以下第1位)
  3. 概算である旨と未計測項目を一言添える
  4. tiktoken が無ければスクリプトの提案どおりインストールを案内する
  5. 結果を残すなら .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 に従う。トークナイザは tiktokeno200k_base、無ければ chars/4

DO / DO NOT

  • DO: デフォルトと動的(SKILL / ドキュメント)を分けて報告する
  • DO NOT: UI のコンテキスト%や課金トークンと同一視する
  • DO NOT: eval / iteration / skill-snapshot 配下を本番 SKILL として数える
Files

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.

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. 12d ago First seen · 67 lines · 106 tokens per session scan A 8b11f13e9e47

Subscribe to this mod's changes

workspace-count-tokens is a skill published in the GitHub repository eaglesakura/agent-skills (2 stars, last pushed 6d ago), licensed MIT. It adds 106 tokens to every session and 950 once invoked, about $0.0005 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens