Quick Hack: Save up to 99% tokens in Coding Agents

Dev.to / 5/1/2026

💬 OpinionDeveloper Stack & InfrastructureTools & Practical Usage

Key Points

  • Coding agent users can face frustration from strict token limits, especially short session/time quotas on plans like “Plus,” and the article shares a workaround to extend sessions.
  • The package “distill” claims to reduce token usage by up to 99% by compressing command/output text with an LLM (local or hosted) before it reaches the target coding model.
  • The guide includes practical Windows installation steps (using bun, building the binaries, and copying the distill.exe into the right path) plus a quick verification command.
  • The author lists known issues: the latest Windows build may not yet be published to npm, and the tool silently fails with newer “reasoning” models (e.g., GPT-5 family), so users should currently prefer non-reasoning models like gpt-4o, gpt-4.1, or gpt-5-chat-latest.

Anyone using coding agents like Codex must be aware of the pains of stricter token limits. I am on the Plus plan and the 5-hour limits are so short, they are really annoying. Came across a package called distill - https://github.com/samuelfaj/distill - which claims to reduce token usage by 99%. Behind the scenes, it works by by compressing command output using a LLM (local or hosted) before it reaches the model. Well, I started using it and it is helping in extending my sessions. Sharing in case it helps others stretch their limits a bit further.

Known Issues -

  • The latest build supports Windows but hasn't been published in npm yet. If you stumble upon it, just like me, use the commands in this comment to set it up (or just copy them from the end of this post).

  • It silently fails for newer, reasoning models, like the GPT-5 family. I have submitted this issue to add support for the newer models and working on a fix (hope the maintainer is open to contribution!). Meanwhile, use it with the non-reasoning models like gpt-4o, gpt-4.1 or gpt-5-chat-latest

Windows Install Commands

  1. Install bun - npm install -g bun
  2. Clone and install - git clone https://github.com/samuelfaj/distill.git; cd distill; npm install
  3. Build the binary - npm run build:bins
  4. Add to path -
   New-Item -ItemType Directory -Force packages\distill-win32-x64\bin | Out-Null
   Copy-Item .dist\bun-windows-x64\distill.exe packages\distill-win32-x64\bin\distill.exe -Force

Once that's done, try verifying -

PS D:\custom_pnpm\distill> distill --version
1.4.1