count_tokens_folder
Count tokens across all text files in a folder, recursively skipping dependency and binary files, to obtain a total token count for a project.
Instructions
Count tokens across all text files in a folder, recursively.
Skips dependency/VCS/build directories (.git, node_modules, .venv, ...)
and binary files (by extension, then a content sniff). Non-UTF-8 text
falls back to UTF-16 (BOM) or cp1252. Returns the sum of per-file counts.
Args:
folder_path: Absolute path to the folder.
model: Model or encoding name. Empty uses ANTHROPIC_TOKEN_COUNT_MODEL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | ||
| folder_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |