Tool · Free

Turn context pressure into an explicit mode and budget.

A free zero-dependency set of pure functions that combines weighted signals into a 0–1 pressure score, maps it to three modes, and tracks token estimates, spend, remaining budget, and overage.

flux@store: ~/run
$ context-budget --run
✓ provide weighted pressure signals
✓ compute a 0–1 score
✓ map the score to a mode
› track estimate, spend, remaining, and over
done — output ready ▍
Free
Price
Full · compressed · emergency
Modes
No disk or network
I/O

How it works

The exact pipeline, end to end.

1
Provide weighted pressure signals
2
Compute a 0–1 score
3
Map the score to a mode
4
Track estimate, spend, remaining, and over
Included
Pressure functions, mode mapping, Budget helper, docs
Setup
Choose weights and thresholds
Operation
Pure functions; no disk/network
Bundle
Free standalone and in the $199 bundle

How it actually works

Exactly what it does — and when.

1Combine configured weighted signals into a 0–1 pressure score
2Map pressure to full, compressed, or emergency mode
3Track estimated spend, remaining budget, and overage
In practice · A long task approaches its context boundary

The host feeds several pressure signals into the pure function and receives compressed mode plus should-compact. It uses that result as one decision input, records its own token estimate, and performs the actual compaction outside the library.

This vs the alternative

Why it's clearly worth it.

This product
A hard-coded message-count limit
Signals
Weighted inputs
One proxy
Modes
Three configured states
Compact or do nothing
Budget
Estimate, spend, remaining, over
Manual arithmetic
Boundary
Caller-supplied estimates
Does not know provider billing automatically

The shift it creates

Without it
  • Context pressure is noticed after failure
  • Compaction triggers are implicit
  • Token estimates have no remaining-budget interface
With it
  • Combine several pressure signals into one inspectable score
  • Trigger full, compressed, or emergency behavior at configured thresholds
  • Track estimated token spend against a budget

Use it to…

Real ways people put CONTEXT-BUDGET — Pressure Meter + Token Budget to work.

Choose a context mode

Feed the current weighted signals into the pressure score and inspect the configured mode.

Trigger compaction

Use should-compact as one input to your host's context-management decision.

Track a token estimate

Record estimated spend and remaining budget around a bounded task.

What's inside

Weighted signals → one 0–1 pressure score
FULL / COMPRESSED / EMERGENCY modes + should-compact trigger
Token Budget: estimate, spend, remaining, over
Pure functions — no disk, no network
Free · zero-dep Node · MIT source

Who it's for

Long-running agent developers

need an explicit compaction signal

Prompt-budget maintainers

need spend and remaining values in code

Local library users

want pure functions with no disk or network access

Questions, answered

✓ Free · no email✓ Yours to own✓ Use on every project✓ Built to ship results

Ready to put CONTEXT-BUDGET — Pressure Meter + Token Budget to work?

Free download · no account needed · yours forever

CONTEXT-BUDGET — Pressure Meter + Token Budget