-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
447 lines (431 loc) · 20.1 KB
/
Copy pathindex.html
File metadata and controls
447 lines (431 loc) · 20.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>tokenwar — five token-saving tools, run as one stack (5-in-1)</title>
<meta name="description" content="Five token-saving tools, run as one stack: caveman, RTK, context-mode, claude-mem, ponytail. Built for Claude Code first; several work across agents (Codex, Gemini, Cursor), with Codex/Gemini usage tracked natively. Each compresses a different buffer — response, tool stdout, heavy data, memory, and the code itself — zero overlap, savings stack. 5-in-1. RTK saved $214 in API-equivalent Opus 4.8 tokens." />
<style>
:root {
--bg: #0b0d12;
--panel: #131722;
--ink: #e6e8ee;
--muted: #8a93a6;
--accent: #7c9eff;
--green: #22c55e;
--amber: #fbbf24;
--rtk: #38bdf8;
--ctx: #4ade80;
--mem: #c084fc;
--cave: #fbbf24;
--pony: #f472b6;
--border: rgba(255, 255, 255, 0.08);
--radius: 14px;
--shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
--font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;
--font-sans: -apple-system, BlinkMacSystemFont, "Inter", Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
body {
margin: 0; padding: 0;
font-family: var(--font-sans);
background: var(--bg);
color: var(--ink);
line-height: 1.55;
min-height: 100vh;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 48px 24px 96px; }
header { text-align: center; margin-bottom: 56px; }
h1 {
font-size: clamp(2rem, 5vw, 3.4rem);
margin: 0 0 12px;
letter-spacing: -0.02em;
background: linear-gradient(120deg, #7c9eff, #c084fc 50%, #fbbf24);
-webkit-background-clip: text; background-clip: text;
color: transparent;
}
.tag { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0 auto; }
.badges {
display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
margin-top: 24px; font-family: var(--font-mono); font-size: 0.92rem;
}
.badge {
padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
background: var(--panel);
}
.badge.ctx { color: var(--ctx); border-color: rgba(74, 222, 128, 0.35); }
.badge.mem { color: var(--mem); border-color: rgba(192, 132, 252, 0.35); }
.badge.rtk { color: var(--rtk); border-color: rgba(56, 189, 248, 0.35); }
.badge.cave { color: var(--cave); border-color: rgba(251, 191, 36, 0.35); }
.badge.pony { color: var(--pony); border-color: rgba(244, 114, 182, 0.35); }
section { margin: 56px 0; }
h2 {
font-size: 1.45rem; margin: 0 0 18px;
display: flex; align-items: center; gap: 10px;
}
h2::before {
content: ""; width: 6px; height: 22px; border-radius: 3px;
background: linear-gradient(180deg, var(--accent), transparent);
}
.panel {
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 28px;
box-shadow: var(--shadow);
}
/* === Buffer diagram === */
.diagram {
display: grid;
grid-template-columns: 1fr;
gap: 28px;
}
.flow {
display: grid;
grid-template-columns: 140px 1fr 140px;
gap: 16px;
align-items: center;
}
.node {
background: #1c2030;
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 14px 16px;
text-align: center;
font-family: var(--font-mono);
font-size: 0.95rem;
}
.arrow {
position: relative;
height: 56px;
display: flex;
align-items: center;
justify-content: center;
font-family: var(--font-mono);
font-size: 0.85rem;
color: var(--ink);
}
.arrow::before {
content: ""; position: absolute; left: 8%; right: 8%; top: 50%;
height: 2px; background: linear-gradient(90deg, transparent, currentColor, transparent);
opacity: 0.4;
}
.arrow .pill {
position: relative; z-index: 2;
padding: 6px 14px; border-radius: 999px;
background: var(--bg); border: 1px solid currentColor;
}
.arrow.cave .pill { color: var(--cave); }
.arrow.rtk .pill { color: var(--rtk); }
.arrow.ctx .pill { color: var(--ctx); }
.arrow.mem .pill { color: var(--mem); }
.arrow.pony .pill { color: var(--pony); }
/* === card grid === */
.cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
gap: 16px;
}
.card {
background: var(--panel);
border-radius: var(--radius);
padding: 22px;
border: 1px solid var(--border);
border-top: 3px solid currentColor;
}
.card.ctx { color: var(--ctx); }
.card.mem { color: var(--mem); }
.card.rtk { color: var(--rtk); }
.card.cave { color: var(--cave); }
.card.pony { color: var(--pony); }
.card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--ink); font-size: 0.93rem; }
.card .buffer {
font-family: var(--font-mono);
font-size: 0.78rem;
color: var(--muted);
margin-top: 8px;
}
/* === Proof table === */
table {
width: 100%; border-collapse: collapse;
font-size: 0.93rem;
}
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
td code {
background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 4px;
font-family: var(--font-mono); font-size: 0.85em;
}
.check { color: var(--green); font-weight: 600; }
footer {
color: var(--muted);
font-size: 0.85rem; margin-top: 80px;
font-family: var(--font-mono);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
/* === Credits block === */
.credits {
background: linear-gradient(135deg, rgba(124, 158, 255, 0.07), rgba(192, 132, 252, 0.05));
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 32px 36px;
margin-top: 56px;
}
.credits-head {
display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px;
padding-bottom: 18px;
border-bottom: 1px dashed var(--border);
margin-bottom: 22px;
}
.credits-kicker {
font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
color: var(--muted); font-weight: 600;
}
.credits-brand {
font-size: 1.15rem; color: var(--ink); font-weight: 600;
font-family: var(--font-sans);
}
.credits-brand a { color: var(--ink); }
.credits-brand a:hover { color: var(--accent); }
.credits-tagline {
color: var(--muted); font-size: 0.9rem; margin-left: auto;
}
.credits-section-title {
color: var(--ink); font-size: 0.92rem;
margin: 0 0 14px; font-family: var(--font-sans); font-weight: 600;
}
.contrib-list {
list-style: none; padding: 0; margin: 0;
display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 24px;
}
.contrib-list li {
display: flex; align-items: center; gap: 10px;
padding: 8px 0;
}
.contrib-mark {
font-family: var(--font-mono); font-weight: 700;
min-width: 1.2em; text-align: center;
}
.contrib-mark.done { color: var(--green); }
.contrib-mark.soon { color: var(--cave); }
.contrib-name {
font-family: var(--font-mono); font-weight: 600; color: var(--ink);
min-width: 110px;
}
.contrib-role { color: var(--muted); font-size: 0.85rem; }
.credits-foot {
margin-top: 22px; padding-top: 18px;
border-top: 1px dashed var(--border);
display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
align-items: center;
}
.credits-foot em {
color: var(--accent); font-style: normal; font-family: var(--font-sans);
}
@media (max-width: 640px) {
.credits { padding: 24px 22px; }
.credits-tagline { margin-left: 0; }
}
@media (max-width: 640px) {
.flow { grid-template-columns: 1fr; }
.arrow { height: 36px; }
}
</style>
</head>
<body>
<div class="wrap">
<header>
<h1>tokenwar</h1>
<p class="tag">Five tools, five buffers, zero overlap. None is the star — the genius is running all five at once. <strong>5-in-1.</strong></p>
<div class="badges">
<span class="badge ctx">[ctx 1.0.162]</span>
<span class="badge mem">[mem 13.6.0]</span>
<span class="badge rtk">[rtk 42.8M]</span>
<span class="badge cave">[caveman 25d22f8]</span>
<span class="badge pony">[ponytail on]</span>
</div>
</header>
<section>
<img src="docs/tokenwar-stack.png" alt="tokenwar — 1 project → 5 buffers, all compressed. The savings stack." style="width:100%;height:auto;display:block;border-radius:12px;margin:0 0 8px;">
</section>
<section>
<h2>5 layers, 5 responsibilities</h2>
<div class="cards">
<div class="card cave">
<h3>caveman</h3>
<p>Compresses what the model says to the user. Drops articles, filler, hedging — keeps technical substance exact.</p>
<p style="margin-top:8px"><strong style="color:var(--cave)">Why:</strong> the model's prose is tokens too — a 5-line answer beats three paragraphs, every turn.</p>
<div class="buffer">buffer: LLM → USER</div>
</div>
<div class="card rtk">
<h3>RTK</h3>
<p>Rewrites shell commands at the hook level. Compressed stdout enters the model context instead of raw output.</p>
<p style="margin-top:8px"><strong style="color:var(--rtk)">Why:</strong> tool output is the heaviest, most frequent buffer — the firehose is where the tokens actually are. Biggest measured saver.</p>
<div class="buffer">buffer: SHELL → LLM</div>
</div>
<div class="card ctx">
<h3>context-mode</h3>
<p>Offloads heavy ops (HTTP, large files, MCP) into a sandbox. Only the answer enters context. FTS5 indexes everything.</p>
<p style="margin-top:8px"><strong style="color:var(--ctx)">Why:</strong> one large read can blow the whole window — some payloads should be processed, never read.</p>
<div class="buffer">buffer: LLM ⇄ SANDBOX</div>
</div>
<div class="card mem">
<h3>claude-mem</h3>
<p>Persists session knowledge across <code>/clear</code> and restarts. Recallable next session — no re-explaining.</p>
<p style="margin-top:8px"><strong style="color:var(--mem)">Why:</strong> the most expensive tokens are the ones you'd otherwise pay twice, re-priming every session.</p>
<div class="buffer">buffer: cross-session store</div>
</div>
<div class="card pony">
<h3>ponytail</h3>
<p>The lazy-senior-dev ruleset. A YAGNI ladder — stdlib before custom, native before dependency, one line before fifty — so the model writes the <em>smallest correct</em> code, not an over-engineered one.</p>
<p style="margin-top:8px"><strong style="color:var(--pony)">Why:</strong> the cheapest code to maintain is the code never written — it saves at generation <em>and</em> on every future read.</p>
<div class="buffer">buffer: LLM → CODE (recurs on read)</div>
</div>
</div>
<div class="panel" style="margin-top:22px">
<h3 style="margin:0 0 10px;font-size:1.12rem">The genius isn't one tool — it's all five at once</h3>
<p style="margin:0 0 12px;font-size:0.95rem">
None of these is the headliner. Each owns a buffer the others physically can't reach:
<span style="color:var(--rtk)">RTK</span> the tool firehose,
<span style="color:var(--ctx)">context-mode</span> the heavy-data sandbox,
<span style="color:var(--mem)">claude-mem</span> the cross-session memory,
<span style="color:var(--cave)">caveman</span> the response,
<span style="color:var(--pony)">ponytail</span> the code on disk.
One's a Rust hook, one's an MCP sandbox, one's a memory store, one's a response filter, one's a ruleset — different shapes, different lanes, which is exactly why they stack.
</p>
<p style="margin:0 0 12px;font-size:0.95rem">
Run <em>one</em> and you compress one buffer. Run <strong>all five</strong> and nothing in the loop is left uncompressed — input, output, heavy data, memory, and the artifact itself.
<strong>That's the 5-in-1.</strong>
</p>
<p style="margin:10px 0 0;font-size:0.82rem;color:var(--muted)">
Honest accounting: RTK / context-mode / claude-mem report real telemetry; caveman and ponytail are presence-only (a style nudge and a prompt include — no metered buffer), so they show <code style="color:var(--pony)">on</code>, never a fabricated number. Measure ponytail by A/B-ing <code>/ponytail</code> on vs off. Ruleset: <a href="https://github.com/DietrichGebert/ponytail" style="color:var(--pony)">DietrichGebert/ponytail</a>.
</p>
</div>
</section>
<section>
<h2>Why complementary, not conflicting</h2>
<div class="panel">
<table>
<thead>
<tr><th>Rule</th><th>What tokenwar <code>check.sh</code> verifies</th><th>Verdict</th></tr>
</thead>
<tbody>
<tr>
<td><code>R1</code></td>
<td>Single <code>PreToolUse</code> Bash hook (RTK only — no double-rewrite)</td>
<td class="check">PASS ✓</td>
</tr>
<tr>
<td><code>R2</code></td>
<td><code>claude-mem</code> writes <code>~/.claude-mem</code>, <code>context-mode</code> writes <code>~/.claude/projects/<slug>/memory</code> — disjoint sinks</td>
<td class="check">PASS ✓</td>
</tr>
<tr>
<td><code>R3</code></td>
<td>RTK targets tool stdout; caveman targets LLM output — disjoint buffers</td>
<td class="check">PASS ✓</td>
</tr>
<tr>
<td><code>R4</code></td>
<td>All 4 tools installed at compatible versions</td>
<td class="check">PASS ✓</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h2>Quick start</h2>
<div class="panel">
<p style="margin:0 0 12px;font-family:var(--font-mono);font-size:0.92rem;color:var(--muted)">Inside Claude Code:</p>
<div style="display:flex;flex-direction:column;gap:8px;font-family:var(--font-mono);font-size:0.92rem">
<div><code style="color:var(--accent)">/tokenwar status</code> <span style="color:var(--muted)">— health of the 5 tools</span></div>
<div><code style="color:var(--accent)">/tokenwar upgrade</code> <span style="color:var(--muted)">— bump each to latest</span></div>
<div><code style="color:var(--accent)">/tokenwar gain</code> <span style="color:var(--muted)">— token savings + monthly $ value</span></div>
<div><code style="color:var(--accent)">/tokenwar doctor</code> <span style="color:var(--muted)">— full pipeline: status → check → gain</span></div>
</div>
<p style="margin:16px 0 0;font-family:var(--font-mono);font-size:0.82rem;color:var(--muted)">
Statusline: <code style="color:var(--ink)">[ctx 1.0.162] [mem 13.6.0] [rtk 42.8M] [caveman 25d22f8] [ponytail on]</code>
</p>
</div>
</section>
<section>
<h2>/tokenwar gain — real savings, real $</h2>
<div class="panel">
<p style="margin:0 0 18px;font-size:0.93rem">
Each tool is read from its <strong>own native telemetry</strong>—never fabricated.
RTK alone saved <strong>$214.36</strong> in API-equivalent Claude Opus 4.8 tokens (input-side, Mar–Jun 2026).
</p>
<div style="font-family:var(--font-mono);font-size:0.88rem;line-height:1.7;overflow-x:auto">
<div style="color:var(--muted)"> tool saved note</div>
<div style="color:var(--muted)"> ─────────────────────────────────────────────────────────────</div>
<div><span style="color:var(--rtk)"> RTK</span> 42.8M 16635 commands (72.0%)</div>
<div><span style="color:var(--ctx)"> context-mode</span> 4.9M 12660 entries indexed</div>
<div><span style="color:var(--mem)"> claude-mem</span> 2.8M ~est: 55K obs + 15K summaries · 31 projects</div>
<div><span style="color:var(--muted)"> caveman</span> N/A style-only hook — no measurable buffer</div>
<div><span style="color:var(--pony)"> ponytail</span> N/A generation axis — A/B /ponytail on vs off to measure</div>
<div style="color:var(--muted)"> ─────────────────────────────────────────────────────────────</div>
<div> <strong>TOTAL</strong> 50.6M summed across tools with telemetry</div>
<div style="margin-top:16px;color:var(--muted)">Monthly value — API-equivalent $ saved (RTK)</div>
<div style="color:var(--muted)"> month saved claude $ codex $</div>
<div> 2026-03 18.4M $92.00 $23.00</div>
<div> 2026-04 23.9M $119.50 $29.88</div>
<div> 2026-05 552.9K $2.76 $0.69</div>
<div> 2026-06 19.0K $0.10 $0.02</div>
</div>
<p style="margin:14px 0 0;font-size:0.82rem;color:var(--muted)">
Savings are input-side (context offload). Valued at Claude Opus 4.8 $5/M + Codex $1.25/M input list prices.
Codex placeholder — edit <code>gain.sh</code> constants to match openai.com/pricing.
</p>
</div>
</section>
<footer>
<section class="credits" aria-label="Credits">
<div class="credits-head">
<span class="credits-kicker">Powered by</span>
<span class="credits-brand">
<a href="https://studio.oratelecom.net">Ora Studio</a>
<span style="color: var(--muted); font-weight: 400; margin: 0 6px;">·</span>
Ora Telecom
</span>
<span class="credits-tagline">Token economics, productized.</span>
</div>
<h3 class="credits-section-title">Our open-source footprint on the stack</h3>
<ul class="contrib-list">
<li>
<span class="contrib-mark done" aria-label="contributor">✓</span>
<span class="contrib-name">RTK</span>
<span class="contrib-role">upstream contributor</span>
</li>
<li>
<span class="contrib-mark done" aria-label="contributor">✓</span>
<span class="contrib-name">context-mode</span>
<span class="contrib-role">upstream contributor</span>
</li>
<li>
<span class="contrib-mark done" aria-label="contributor">✓</span>
<span class="contrib-name">claude-mem</span>
<span class="contrib-role">upstream contributor</span>
</li>
<li>
<span class="contrib-mark soon" aria-label="coming soon">✦</span>
<span class="contrib-name">caveman</span>
<span class="contrib-role">Ora maintenance landing soon</span>
</li>
<li>
<span class="contrib-mark soon" aria-label="adopted">✦</span>
<span class="contrib-name">ponytail</span>
<span class="contrib-role">adopted — DietrichGebert/ponytail</span>
</li>
</ul>
<div class="credits-foot">
<span><em>tokenwar</em> · MIT · <a href="https://github.com/oratelecom/tokenwar">github.com/oratelecom/tokenwar</a></span>
<span>Built with caveman 🦴</span>
</div>
</section>
</footer>
</div>
</body>
</html>