Feature request: Add switch in claude code to determine total tokens in a given file
Resolved 💬 4 comments Opened Jun 24, 2025 by ivan-velikanov Closed Jan 7, 2026
For claude pro, there is no straightforward way to measure the tokens size of a given file. This feature is already there but not exposed. It would be nice to expose this through the command line terminal claude code tool.
Something like
claude -m sonnet --count_tokens ~/somefile.md
returns the number of tokens in the file ( ~/somefile.md) as per sonnet's architecture.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗