What a single paste actually costs your context window
Real measured numbers instead of estimates: four actual files, a disclosed tokenizer, and a cross-check against a second model family.
Rather than estimating the impact of pasting code and terminal outputs into an AI prompt, we measured four real-world files directly. Using a disclosed tokenizer and a cross-check with a second model family, these measurements reveal the exact cost of common clipboard pastes in both tokens and dollars.
Method
- Tokenizer:
tiktokenwitho200k_base(GPT-4o/5 family). - Anthropic publishes no local tokenizer, so this is a reliable approximation rather than a Claude measurement.
- Cross-check with
cl100k_base: deviation of 6.5 percent for the log, 9.7 percent for source code. - Reference window: 200,000 tokens.
- The path inserted by CtxVault (
/Users/name/CtxVault/2026-08-05-143012-clipboard.txt) costs 19 tokens.
What we measured
| Sample | Characters | Tokens when pasted | vs. a 19-token path | Share of a 200k window | Pastes until the window is full |
|---|---|---|---|---|---|
Terminal log, 400 lines (git log --stat) |
16,609 | 5,646 | 297x | 2.8 % | 35 |
| Swift source file, 2,348 lines | 169,223 | 40,324 | 2,122x | 20.2 % | 4 |
package-lock.json, first 800 lines |
30,890 | 11,178 | 588x | 5.6 % | 17 |
CLI output, 193 lines (git help -a) |
12,005 | 2,169 | 114x | 1.1 % | 92 |
Characters per token
Our measurements showed 2.94 characters per token for terminal logs, compared to 4.20 characters per token for source code. Logs are more expensive because hashes, paths, and numbers are rarely merged, and that is precisely the material you copy in a terminal.
What it costs in money
Below are the calculated costs based strictly on pure input tokens without caching:
| Sample | Sonnet (3 $/M) | Opus (5 $/M) |
|---|---|---|
| Terminal log, 400 lines | $0.0169 | $0.0282 |
| Swift source file, 2,348 lines | $0.1210 | $0.2016 |
package-lock.json, 800 lines |
$0.0335 | $0.0559 |
Individually these costs are fractions of a cent or a few cents per paste. The key factor is that the same text is re-sent in every subsequent request of the same session — four pasted source files and the window is full, after which compaction begins.
What this means
- A 2,348-line source file costs 20 percent of your context window. The path to that same file costs 0.01 percent.
- Four pastes like that and the window is full — not after four hours of work, after four Cmd+V.
- Logs are the most expensive kind of text you can paste: 2.94 characters per token versus 4.20 for source code.
CtxVault automatically turns large clipboard pastes into local text files before they hit your terminal, giving your AI CLI a 19-token file path to read on demand instead of a window-filling wall of text.