cd /news/developer-tools/promptshrink · home topics developer-tools article
[ARTICLE · art-100478] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

PromptShrink

Developer Heloisa Pe Garcia has released PromptShrink, an open-source prompt pre-processor that cuts LLM token usage by up to 60% in production. The tool minifies code, strips comments, and trims verbose prompts before they reach APIs like OpenAI, Anthropic, and Gemini, with a dashboard to visualize savings and a browser extension for ChatGPT, Claude.ai, Google AI Studio, and Poe.

read2 min views1 publishedAug 17, 2026

How I Cut LLM Token Usage by Up to 60% in Production

If you work with LLM APIs (OpenAI, Anthropic, Gemini), you know the pain: every call costs money, and a big chunk of that cost is pure waste — verbose prompts, code pasted with no filtering, repeated context the model doesn't even need to understand the task. That's why I built PromptShrink: a prompt pre-processor that trims the excess before it ever hits the API, without losing what actually matters for the model to understand.

The real problem

Every time you feed a code snippet or a long prompt to an LLM, you're paying per token, not per character. Comments, whitespace, formatting meant for humans — all of that is dead weight the model doesn't need to do its job. At scale (thousands of calls per month), that adds up to a real bill.

What PromptShrink does

Packages entire repositories, minifying code and stripping comments, ready to paste as context into any LLM

Simulates real dollar savings, comparing your current spend against the optimized version

Visualizes everything on a dashboard — tokens saved, % reduction, active rules

Plugs straight into your code via a Python SDK

Becomes a browser extension, adding a "Shrink" button directly on ChatGPT, Claude.ai, Google AI Studio, and Poe

In practice

bash

promptshrink repo --path ./src --save-to-file context.txt

promptshrink calc --calls 100000 --tokens 800 --model gpt-4o

Running calc on a scenario of [insert your real number here, e.g. "100k calls/month with gpt-4o"], the estimated savings came out to [$X per month] — just by trimming what's unnecessary before it reaches the model.

Try it out The project is open source, with a CLI, a FastAPI backend, and a Python SDK. If you're running LLMs in production and want to stop paying for tokens that add zero value, check it out:

🔗 github.com/HeloisaPeGarcia/PromptShrink

Feedback and PRs are very welcome — this is my first published project like this, so every contribution helps make it better.

── more in #developer-tools 4 stories · sorted by recency
── more on @promptshrink 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/promptshrink] indexed:0 read:2min 2026-08-17 ·