-
Notifications
You must be signed in to change notification settings - Fork 1
Token Forecast
The context gauge tells you where you are now. The forecast tells you where you will be soon, so you can compact on your terms instead of getting trimmed mid-thought.
slipstream tracks the per-step token delta across the recent window of tool calls. It takes the rolling mean of how many tokens each step has added to the context, smooths it with an exponentially weighted average (heavier weight on the most recent steps), and projects forward:
steps_remaining = (warnPct * targetTokens - actualTokens) / mean_tokens_per_step
Where targetTokens and warnPct come from .claude/slipstream/budget.json and actualTokens is the live reading (true in Claude Code from the session transcript, estimated elsewhere). The forecaster floors negative or near-zero results, caps the upper bound at 99, and refuses to display a number when the recent window has fewer than three steps (the variance is too high to be useful).
The statusline gains a forecast segment next to the budget level:
cp | ctx 47%* (~12 steps) | mem 4 | obs 37 | skill scoped-read
In the dashboard the same number sits on the budget gauge, and the gauge shades amber once the forecast drops below ten.
It means: at the current pace of context growth, you have about twelve more tool calls before you cross the warn threshold (the amber line on the gauge, default 70 %). It is a rolling estimate, not a hard guarantee. If you start pulling in big files the number shrinks fast; if you switch to sp_symbol and sp_lines it grows.
The tilde is deliberate. The forecast is a hint to act early, not a deadline. Common reactions when it dips below ten:
- Run
/slipstream:rememberto checkpoint the decision in progress. - Switch to scoped reads exclusively.
- Trigger a compaction on purpose so the PreCompact digest captures the session shape you want, instead of whatever Claude Code chooses to trim.
SarmaLinux . sarmalinux.com . Repository
Start here
Install paths
v0.6.0 features
- Map watcher
- Token forecast
- Replay export
- Configurable redaction
- Drift detection
- Per-skill opt %
- CI mode
- Lessons
Headline features
- MCP tools
- Observation memory & search
- Cross-IDE support
- Lossless compaction
- Memory recall
- Live agent dashboard
- Statusline
- Output style
- Subagents
Token efficiency
Skills
Internals
- Architecture
- Memory system
- Hooks
- Mind map and status
- Configuration and tuning
- Data formats
- Performance and benchmarks
- Design decisions
- Security model
- Testing strategy
Reference
SarmaLinux . sarmalinux.com