savetokens.tips

Token-saving techniques for AI coding agents

A characterized reference for saving tokens when working with Claude Code and Codex. Measured figures come from logged raw-versus-filtered token deltas. Estimated figures carry no counterfactual and are marked as such.

Doc: 
ST-0001
Rev: 
A
Snapshot: 
2026-07-18
Scope: 
global
Characterized by: 
github.com/ryanportfolio

Characterization data: snapshot 2026-07-18, global scope, values subject to revision. Figures are a dated sample from rtk gain. No other numbers are invented.

[M] measured, production tested, real counterfactual [E] estimated, guaranteed by design, no counterfactual [S] vendor specification, not measured here, no counterfactual · not characterized
1

Features

2

Absolute Maximum Ratings

ParameterValueUnit
Context window, working budget[S]~200,0001
S, vendor spec, no counterfactual
tokens
Single command output, before filtering·tokens
Sustained context occupancy·%
  1. Vendor specification, not measured here, no counterfactual. A nominal ceiling for planning, never a characterized figure.

Note: stresses beyond these limits cause context to be dropped, not summarized. Sustained operation near maximum reduces answer quality.

3

Electrical Characteristics

Conditions unless otherwise noted: rtk gain, snapshot 2026-07-18, global scope, raw output tokens versus RTK-filtered output tokens. Min and Max are shown only where a distribution exists.

Part No Parameter Min Typ Max Unit Test conditions
RTK-READ-01 Tokens saved, rtk read · [M]24.91 · % n=571, 8.9M saved
RTK-DIFF-01 Tokens saved, rtk git diff · [M]99.21,3 · % n=3, 5.6M saved, one large diff
RTK-LOG-01 Tokens saved, rtk git log --all -p · [M]100.01,3 · % n=1, 2.0M saved, single observation
RTK-GREP-01 Tokens saved, rtk grep · [M]23.01 · % n=1199, 448.6K saved
RTK-VITEST-01 Tokens saved, rtk vitest run · [M]92.51 · % n=38, 208.4K saved
RTK-PULL-01 Tokens saved, rtk git pull · [M]92.31 · % n=73, 38.9K saved
RTK-TERSE-01 Prose reduction, terse prompting · [E]~752 · % no counterfactual, design target only
STK-TOTAL All proxied commands · [M]83.51 · % n=92,695 commands, 18.4M saved
  1. Production tested. Raw output token count versus RTK-filtered output token count, logged per command by rtk gain.
  2. Guaranteed by design, characterization only, not production tested.
  3. Single observation, not a distribution. Treat the value as one sample, not a stable average.
4

Typical Performance Characteristics

Saved percent plotted against command frequency, from the 2026-07-18 snapshot. Measured points carry the accent and a solid mark whose size grows with sample count. The estimate renders as a dashed reference line and never carries the accent.

0 25 50 75 100 1 10 100 1000 COMMAND COUNT, LOG SCALE (n) SAVED PERCENT read, n=571 diff, n=3 log, n=1 grep, n=1199 vitest, n=38 pull, n=73 [E] ~75, design target, no measured frequency [E] ~75, design target
[M] measured point, production tested; marker size grows with sample count n - - [E] estimated reference line, design target, holds no command-count position
5

Application Information

5.1 RTK-DIFF-01, route git diff through the RTK proxy

Functional block diagram of one proxied command. Raw diff enters, RTK filters it, a compact diff summary leaves. The delta is the characterized parameter.

git diff
raw output
rtk git diff
filter
filtered
summary
 delta  [M]99.2%1,2 saved
[M]99.2%1,2
Tokens saved, one large diff
[M]5.6M1,2
Absolute tokens saved
M, rtk gain, 2026-07-18, global, n=3

A full git diff of a large change can send millions of characters to the model, most of which the agent never reads line by line. Routing the command through RTK returns a filtered summary that preserves the decision content: which files changed, the shape of the change, and the parts that need review.

In one measured large diff the filtered output used 99.2 percent fewer tokens than the raw diff, a saving of 5.6 million tokens. The delta is pooled across three runs and treated as one sample, not a stable average, so read it as a strong signal rather than a guaranteed rate. Use rtk git diff whenever a diff is large enough that you would scroll past most of it anyway.

Handle estimates with care. Values marked [E] are design targets, not measured, and are not guaranteed across sessions.

  1. Production tested. Raw output token count versus RTK-filtered output token count, logged per command by rtk gain.
  2. Single observation, not a distribution. Treat the value as one sample, not a stable average.

One application note is characterized in full above. The remaining characterized parts follow the same note structure.

6

Ordering Information

Part NoTechniqueStatus
RTK-DIFF-01 Route git diff through the RTK proxy Active
RTK-READ-01 Route file reads through the RTK proxy Active
RTK-TERSE-01 Terse prompting prose style Active, estimated only
STK-CATFULL-00 Paste whole files into the prompt by hand Not recommended for new designs

Part-number decoder: RTK-DIFF-01 reads as tool RTK, characterized command git diff, revision 01. STK-prefixed parts are site-level techniques not bound to one command. All listed techniques apply to both Claude Code and Codex. The table shows a subset of ordered parts; STK-CATFULL-00 appears for status only and is not characterized in Section 3.

§

Revision History

RevDateChange
A2026-07-18First characterization run from rtk gain, global scope. Values subject to revision as sample counts grow.
··Reserved. The next characterization run appends here when the live rtk gain feed lands.

Note: characterization ages. Every figure is a dated snapshot; re-measure as sample counts grow, and prefer a newer revision over a stale one.