TokenPress
A formatter that optimizes source code for agentic coding based on tokenizers
What does it do?
TokenPress is a source formatter for agentic coding that transforms a program into an equivalent representation using fewer input tokens. By default, it reduces spaces, blank lines, and indentation; an optional setting can also remove comments and docstrings. It does not save output that fails validation or alter identifiers or string contents.
Key features
- Optimize source representation for tokenizers
- Prevent saving output that fails validation
- Preserve identifiers and string contents
- Provide Default and Aggressive transformation settings