● Deploy anywhereGet API key

Home / Add-ons / Prompt Cost Linter

Prompt Cost Linter — find the code that makes your AI bill expensive

Static analysis for seven LLM cost anti-patterns: full context resent every turn, missing prompt caching, flagship models on simple tasks, unbounded output, retry storms, batchable loops and needless re-embedding.

$19 per month

Billed monthly through Stripe · cancel any time · access ends at the end of the paid period

Who it is for

Engineering teams and agencies shipping LLM features who want a cost review in CI instead of a surprise invoice.

The problem it removes

What you get

How to use it

1. Activate the add-on

Dashboard → Billing → Add-ons → Prompt Cost Linter.

2. POST your files

Send up to 50 files, 200 KB each and 1 MB total. Only source extensions are accepted.

3. Wire the gate into CI

Fail on high severity findings, or start in report-only mode until the backlog is clean.

curl -sS https://plugsky.com/api/addons/lint \
  -H "Authorization: Bearer $PLUGSKY_SESSION" \
  -H "Content-Type: application/json" \
  -d '{"files":[{"path":"app.py","content":"..."}]}'

The seven rules

Each rule targets a pattern that reliably increases token spend and is visible in source text without executing anything. The severity is a starting point, not a verdict: a high-severity finding in code that never runs in production is still a finding, but it is not urgent.

Rule catalogue, with the pattern each one looks for.
RuleSeverityWhat it flags
CTX-001HighUnbounded conversation history — a message list that grows every turn and is resent in full
CACHE-001MediumA long static system prompt that is not marked cacheable
MODEL-001MediumA flagship model used for a narrow task such as classification or extraction
TOK-001LowA missing or oversized output-token cap
RETRY-001HighA retry loop without backoff or a maximum attempt count
BATCH-001MediumSynchronous completion calls inside a collection loop
EMB-001MediumRe-embedding documents without checking whether the content changed

The rules are heuristics and the output says so. Each finding carries a confidence value, and the savings figure is a band rather than a number, because a static scan cannot know your traffic. Presenting a heuristic as a measurement would be the dishonest version of this product.

How a scan runs

The hosted endpoint accepts a JSON body with a list of files. Limits are deliberate: up to 50 files, 200 KB per file, 1 MB total, and only source extensions. Tests, vendored dependencies, build output, minified files and backups are skipped, because a finding in node_modules is noise that trains people to ignore the report.

Nothing is executed. The scanner reads text, applies patterns and returns findings with a file, a line and a message. That design is what makes it safe to run against a repository you do not want to hand to a third party in executable form — though the source itself is still uploaded, which is a distinction worth understanding before you send it.

Reading severity and confidence

Severity answers "how much does this pattern usually cost if it is real". Confidence answers "how sure is the scanner that this is the pattern". They are separate because a confident low-severity finding and an uncertain high-severity finding need different responses.

The gate fails on high severity when you ask it to. Starting in report-only mode is the sane default for an existing codebase, because a first run on a mature repository can produce a backlog large enough to get the tool switched off.

Wiring it into CI

The JSON output is stable, and the CLI returns a non-zero exit when the gate fails. A CI step is therefore two lines: run the scanner, let the exit code decide. No parser, no custom assertion.

python -m prompt_linter --path . --fail-on high --json > lint.json

For a repository with an existing backlog, pin the gate to the files changed in the pull request rather than the whole tree. That keeps the check useful without requiring a cleanup before it can be enabled.

A worked example

A support assistant sends the full conversation on every turn. After twenty turns the prompt is 9,000 tokens, of which 8,400 are history the model has already seen. CTX-001 flags the unbounded list, and the finding is high severity with medium confidence — high because the pattern is expensive, medium because the scanner cannot know whether a trim happens elsewhere. The fix is a sliding window or a summary, and the saving is roughly the difference between 9,000 and 2,000 input tokens per call. No execution was needed to find it.

The band matters more than the exact figure. A scan can say the prompt is larger than it needs to be; only your traffic can say what that costs per month. Treat the band as a reason to look, not as a budget line.

What it does not do

Local CLI or hosted endpoint

The same engine runs both ways. The local CLI is free to run against your own checkout and is the right choice if you already have Python in CI. The hosted endpoint exists for pipelines where installing a Python package is awkward, and for teams that want the gate enforced somewhere other than the build agent.

The subscription price buys the hosted gate and its maintenance. It does not buy a different rule set — the rules are the same, which is the point.

Questions

Does it run my code?

No. The scanner reads source text and applies rules. Nothing is executed.

How accurate are the savings?

Each finding carries a heuristic band, labelled as heuristic and not measured. It points at waste; it does not promise a dollar figure.

What does it scan?

Python, JavaScript, TypeScript, PHP and Ruby. Tests, vendor directories, minified files and backups are skipped.

Can I use it in CI?

Yes. The JSON output is stable and the gate fails on high severity when you ask it to.

Is there a local CLI?

Yes, the same engine runs locally. The hosted endpoint saves you running Python in CI.

Sources

Spend Guard

A window from 1 to 365 days, grouped by model, by day and by status, so you can find the feature that is eating the budget before the invoice arrives.

$29/month · Read more →

Usage Export

Download every request your workspace makes — model, tokens, cost, status and latency — as a CSV with a fixed header. Built for finance reconciliation and warehouse loads.

$19/month · Read more →

Ready to use it?

Activate from the dashboard; Stripe handles the subscription and access is granted automatically.

Open billingCompare add-ons