Concept: Token Saver Skill

Token Saver Skill is an automated execution skill designed by nate-b-jones for terminal-based AI coding agents such as claude-code and codex. It automates context hygiene and token optimization rules directly within active workflows.


Core Capabilities & Workflow Integration

While manual context hygiene (editing prompts, starting clean threads) is highly effective, operators often forget or resist breaking long threads. The Token Saver skill installs via a single command into codex or claude-code and enforces efficiency rules automatically:

  • Pre-Execution File Scans: Pre-searches large source files locally before opening or passing them to the model context.
  • Passage Selection: Extracts and forwards only relevant passages rather than multi-thousand-line source files.
  • Code Execution Offload: Executes deterministic tasks (math, data transformation, string parsing) as local code rather than burning LLM reasoning tokens.
  • State Delta Tracking: Saves accepted artifact versions and constructs subsequent requests strictly from the previous result plus specified changes.
  • Length Bounds & Retry Suppression: Restricts output generation to specified word/bullet limits and terminates unhelpful retry loops.
  • Model Routing Assistance: Recommends the lowest-tier (“dumbest”) model capable of completing the task to minimize token expenditure.

Advanced Harness Optimization

The skill assists operators with advanced rules that are difficult to manage manually:

  • Tool Load Discipline: Mitigates tool definition bloat (where connecting multiple MCP tool servers like GitHub, Slack, Sentry, and Grafana loads ~55,000 tokens of schema definitions before execution).
  • Context Compaction & Editing: Integrates with Anthropic context editing and OpenAI compaction to strip stale thinking blocks and historical tool execution logs during extended debugging sessions.

Position in the Token Optimization Hierarchy

  1. Level 1: Manual habits (editing errors in-place, thread clearing, artifact carriage).
  2. Level 2: Token Saver Skill (agent-side automation during active chat execution).
  3. Level 3: ringer (local intermediary proxy intercepting calls before request envelopes leave the machine and checking open-brain-stack).

References