Cross-agent quota pacing and model-tier routing for agent apps.
TokenSave helps you avoid both sides of the reset-window problem: running out of usage too early, or leaving useful capacity unused. It keeps account usage quota separate from the current session context window, asks for fresh data instead of reusing stale screenshots, and recommends low / medium / high model tiers based on task risk.
- Divides remaining usage across days until reset.
- Shows the remaining-percentage floor where balanced work should stop today.
- Keeps a configurable reserve, defaulting to 15%.
- Interprets context-window pressure separately from account quota.
- Routes work to low, medium, high, or specialist tiers.
- Uses compact multiple-choice questions when fresh data or work-division preferences are missing.
- Can parse Codex local session JSONL token-count events when available.
Build the Codex skill package:
node scripts/build-codex-skill.mjsThen copy dist/codex-skill/tokensave into your Codex skills folder.
On Windows:
xcopy /E /I /Y dist\codex-skill\tokensave %USERPROFILE%\.codex\skills\tokensaveOn macOS/Linux:
mkdir -p ~/.codex/skills
cp -R dist/codex-skill/tokensave ~/.codex/skills/tokensaveUse it in Codex with:
$tokensaveCopy the Claude skill package into your personal or project skill directory:
mkdir -p ~/.claude/skills
cp -R packages/claude-code/skills/tokensave ~/.claude/skills/tokensaveUse it in Claude Code with:
/tokensaveFor current Claude Code values, run /usage first. Use /context when TokenSave needs current context-window pressure. Then reply with only what is missing, for example:
weekly=82%, reset=aug 2
weekly=82%, context=20%, tasks: fix testsCopy the Cursor rule into a project:
mkdir -p .cursor/rules
cp packages/cursor/tokensave.mdc .cursor/rules/tokensave.mdcInvoke it by asking Cursor about usage pacing, model routing, or TokenSave.
Copy the Windsurf rule into a project:
mkdir -p .windsurf/rules
cp packages/windsurf/tokensave.md .windsurf/rules/tokensave.mdInvoke it by asking Cascade about TokenSave, quota pacing, or model routing.
Use packages/chatgpt/TOKENSAVE_CUSTOM_INSTRUCTIONS.md or packages/generic/TOKENSAVE_PROMPT.md as reusable prompt instructions.
node scripts/tokensave.mjs questions
node scripts/tokensave.mjs auto
node scripts/tokensave.mjs today --current-remaining 94 --context-used 28 --reset 2026-08-05
node scripts/tokensave.mjs route "debug auth refresh race condition"
node scripts/tokensave.mjs codex-sessionsTokenSave does not require account credentials. It works from visible percentages, user-provided values, local client-state files, local Codex session logs when you choose to scan them, and Claude Code /usage or /context output supplied by the user.
Do not commit .tokensave/, local logs, screenshots, or generated usage ledgers. This repository's .gitignore excludes local TokenSave state by default.
Run:
node scripts/smoke-test.mjsThe smoke suite validates pacing, routing, stale-data refusal, reset-day handling, Codex session parsing, and package validation.
The project is named TokenSave because it is short, memorable, and matches how users describe the pain: saving limited agent usage. The exact purpose is broader than saving tokens, so the subtitle is the precise positioning: cross-agent quota pacing and model-tier routing.