leantext cuts up to 99% of tokens when coding agents read the web
Open-source tool leantext strips navigation, hidden menus and scripts from web pages, PDFs and Office files before an AI agent reads them. On PyPI's NumPy page it reduces 92,348 tokens to 755 (99%), and Stripe API docs from 3,958 to 1,194 (70%).
- PyPI NumPy page: 92,348 → 755 tokens, 99% saved
- Stripe API docs: 3,958 → 1,194 tokens, 70% saved
- Verifies code blocks and tables survive, otherwise falls back to original
- Runs as a Claude Code hook, licensed Apache-2.0
Read next
Software