leantext: up to 99% fewer tokens when your coding agent reads the web A developer released leantext, an open-source tool that strips navigation, footers, scripts and hidden markup from web pages, PDFs and Office files before a coding agent reads them, cutting token counts by up to 99% on pages such as PyPI's NumPy listing (92,348 tokens to 755) while preserving all code blocks and tables. The tool verifies each conversion against the source's structure and falls back to the original page when extraction looks suspicious or savings fall under 15%, and a Claude Code hook routes Read and curl calls through cached Markdown conversions. In end-to-end runs inside Claude Code, the agent answered 21 of 21 tasks correctly with leantext enabled. Your coding agent opens a docs page to answer one question. It gets the navigation bar, the sidebar, the footer, hidden menus, scripts and markup. Somewhere in there is the answer, and you pay for all of it, in tokens, in context window and in latency. On PyPI's NumPy page, the project description is about 2,000 tokens. The whole page, converted to Markdown the usual way, is 92,348. Most of it is a hidden list of every file in every release, with hashes, that you never see in a browser. leantext removes that noise before it reaches your agent, checks that nothing important went with it, and tells you what it saved. https://github.com/shouvik12/leantext https://github.com/shouvik12/leantext Point it at a URL or a file. Markdown comes out on stdout. leantext https://docs.stripe.com/api/customers/create --report Create a customer Request curl curl https://api.stripe.com/v1/customers \ -u "<