@lornatang/dsh-caveman 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,82 +1,82 @@
1
- import { createHash, randomBytes } from 'node:crypto'
2
- import { createReadStream } from 'node:fs'
3
- import { chmod, mkdir, open, readFile, rename, rm } from 'node:fs/promises'
4
- import { homedir } from 'node:os'
5
- import { join } from 'node:path'
6
-
7
- const MAX_BINARY_BYTES = 120 * 1024 * 1024
8
- const manifestUrl = new URL('./learn-checksums.json', import.meta.url)
9
- const packageUrl = new URL('../package.json', import.meta.url)
10
-
11
- async function fileDigest(path) {
12
- try {
13
- const hash = createHash('sha256')
14
- for await (const chunk of createReadStream(path)) hash.update(chunk)
15
- return hash.digest('hex')
16
- } catch (error) {
17
- if (error?.code === 'ENOENT') return undefined
18
- throw error
19
- }
20
- }
21
-
22
- /** Download and verify the executable once for the current platform and version. */
23
- export async function resolveLearnBinary(options = {}) {
24
- const { env = process.env, platform = process.platform, arch = process.arch } = options
25
- if (env.DSH_CAVEMAN_LEARN_BINARY) return env.DSH_CAVEMAN_LEARN_BINARY
26
- const manifest = options.manifest ?? JSON.parse(await readFile(manifestUrl, 'utf8'))
27
- const version = JSON.parse(await readFile(packageUrl, 'utf8')).version
28
- if (manifest.version !== version || !/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u.test(version)) throw new Error('Invalid analyzer version manifest')
29
- const os = { linux: 'linux', darwin: 'darwin', win32: 'win32' }[platform]
30
- const cpu = { x64: 'amd64', arm64: 'arm64' }[arch]
31
- const entry = manifest.binaries?.[`${platform}-${arch}`]
32
- const expectedName = os && cpu ? `dsh-caveman-learn_${os}_${cpu}` : undefined
33
- if (!expectedName || entry?.name !== expectedName || !/^[a-f0-9]{64}$/u.test(entry.sha256 ?? '')) {
34
- throw new Error(`No verified analyzer is available for ${platform}/${arch}`)
35
- }
36
- const directory = join(options.cacheRoot ?? join(homedir(), '.dsh', 'cache', 'dsh-caveman', 'learn'), version)
37
- const target = join(directory, `${expectedName}${platform === 'win32' ? '.exe' : ''}`)
38
- if (await fileDigest(target) === entry.sha256) return target
39
- await mkdir(directory, { recursive: true, mode: 0o700 })
40
- const temporary = join(directory, `.${expectedName}.${randomBytes(12).toString('hex')}.tmp`)
41
- let handle
42
- let dispatcher
43
- try {
44
- const url = `https://github.com/Lornatang/dsh-plugin/releases/download/dsh-caveman-v${version}/${expectedName}`
45
- let fetcher = options.fetcher ?? fetch
46
- if (!options.fetcher && (env.https_proxy || env.HTTPS_PROXY || env.http_proxy || env.HTTP_PROXY)) {
47
- const { EnvHttpProxyAgent, fetch: proxyFetch } = await import('undici')
48
- dispatcher = new EnvHttpProxyAgent({
49
- httpProxy: env.http_proxy ?? env.HTTP_PROXY ?? '',
50
- httpsProxy: env.https_proxy ?? env.HTTPS_PROXY ?? '',
51
- noProxy: env.no_proxy ?? env.NO_PROXY ?? '',
52
- })
53
- fetcher = (input, init) => proxyFetch(input, { ...init, dispatcher })
54
- }
55
- const response = await fetcher(url, { signal: AbortSignal.timeout(120_000) })
56
- if (!response.ok || !response.body) throw new Error(`Analyzer download failed (HTTP ${response.status})`)
57
- const advertised = Number(response.headers.get('content-length'))
58
- if (advertised > MAX_BINARY_BYTES) throw new Error('Analyzer download exceeds the size limit')
59
- handle = await open(temporary, 'wx', 0o700)
60
- const hash = createHash('sha256')
61
- let size = 0
62
- for await (const chunk of response.body) {
63
- size += chunk.length
64
- if (size > MAX_BINARY_BYTES) throw new Error('Analyzer download exceeds the size limit')
65
- hash.update(chunk)
66
- await handle.writeFile(chunk)
67
- }
68
- await handle.close()
69
- handle = undefined
70
- if (hash.digest('hex') !== entry.sha256) throw new Error('Analyzer checksum mismatch')
71
- await chmod(temporary, 0o700)
72
- try { await rename(temporary, target) } catch (error) {
73
- // Another invocation may have finished the same verified download.
74
- if (await fileDigest(target) !== entry.sha256) throw error
75
- }
76
- return target
77
- } finally {
78
- await handle?.close().catch(() => {})
79
- await rm(temporary, { force: true }).catch(() => {})
80
- await dispatcher?.destroy().catch(() => {})
81
- }
82
- }
1
+ import { createHash, randomBytes } from 'node:crypto'
2
+ import { createReadStream } from 'node:fs'
3
+ import { chmod, mkdir, open, readFile, rename, rm } from 'node:fs/promises'
4
+ import { homedir } from 'node:os'
5
+ import { join } from 'node:path'
6
+
7
+ const MAX_BINARY_BYTES = 120 * 1024 * 1024
8
+ const manifestUrl = new URL('./learn-checksums.json', import.meta.url)
9
+ const packageUrl = new URL('../package.json', import.meta.url)
10
+
11
+ async function fileDigest(path) {
12
+ try {
13
+ const hash = createHash('sha256')
14
+ for await (const chunk of createReadStream(path)) hash.update(chunk)
15
+ return hash.digest('hex')
16
+ } catch (error) {
17
+ if (error?.code === 'ENOENT') return undefined
18
+ throw error
19
+ }
20
+ }
21
+
22
+ /** Download and verify the executable once for the current platform and version. */
23
+ export async function resolveLearnBinary(options = {}) {
24
+ const { env = process.env, platform = process.platform, arch = process.arch } = options
25
+ if (env.DSH_CAVEMAN_LEARN_BINARY) return env.DSH_CAVEMAN_LEARN_BINARY
26
+ const manifest = options.manifest ?? JSON.parse(await readFile(manifestUrl, 'utf8'))
27
+ const version = JSON.parse(await readFile(packageUrl, 'utf8')).version
28
+ if (manifest.version !== version || !/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u.test(version)) throw new Error('Invalid analyzer version manifest')
29
+ const os = { linux: 'linux', darwin: 'darwin', win32: 'win32' }[platform]
30
+ const cpu = { x64: 'amd64', arm64: 'arm64' }[arch]
31
+ const entry = manifest.binaries?.[`${platform}-${arch}`]
32
+ const expectedName = os && cpu ? `dsh-caveman-learn_${os}_${cpu}` : undefined
33
+ if (!expectedName || entry?.name !== expectedName || !/^[a-f0-9]{64}$/u.test(entry.sha256 ?? '')) {
34
+ throw new Error(`No verified analyzer is available for ${platform}/${arch}`)
35
+ }
36
+ const directory = join(options.cacheRoot ?? join(homedir(), '.dsh', 'cache', 'dsh-caveman', 'learn'), version)
37
+ const target = join(directory, `${expectedName}${platform === 'win32' ? '.exe' : ''}`)
38
+ if (await fileDigest(target) === entry.sha256) return target
39
+ await mkdir(directory, { recursive: true, mode: 0o700 })
40
+ const temporary = join(directory, `.${expectedName}.${randomBytes(12).toString('hex')}.tmp`)
41
+ let handle
42
+ let dispatcher
43
+ try {
44
+ const url = `https://github.com/Lornatang/dsh-plugin/releases/download/dsh-caveman-v${version}/${expectedName}`
45
+ let fetcher = options.fetcher ?? fetch
46
+ if (!options.fetcher && (env.https_proxy || env.HTTPS_PROXY || env.http_proxy || env.HTTP_PROXY)) {
47
+ const { EnvHttpProxyAgent, fetch: proxyFetch } = await import('undici')
48
+ dispatcher = new EnvHttpProxyAgent({
49
+ httpProxy: env.http_proxy ?? env.HTTP_PROXY ?? '',
50
+ httpsProxy: env.https_proxy ?? env.HTTPS_PROXY ?? '',
51
+ noProxy: env.no_proxy ?? env.NO_PROXY ?? '',
52
+ })
53
+ fetcher = (input, init) => proxyFetch(input, { ...init, dispatcher })
54
+ }
55
+ const response = await fetcher(url, { signal: AbortSignal.timeout(120_000) })
56
+ if (!response.ok || !response.body) throw new Error(`Analyzer download failed (HTTP ${response.status})`)
57
+ const advertised = Number(response.headers.get('content-length'))
58
+ if (advertised > MAX_BINARY_BYTES) throw new Error('Analyzer download exceeds the size limit')
59
+ handle = await open(temporary, 'wx', 0o700)
60
+ const hash = createHash('sha256')
61
+ let size = 0
62
+ for await (const chunk of response.body) {
63
+ size += chunk.length
64
+ if (size > MAX_BINARY_BYTES) throw new Error('Analyzer download exceeds the size limit')
65
+ hash.update(chunk)
66
+ await handle.writeFile(chunk)
67
+ }
68
+ await handle.close()
69
+ handle = undefined
70
+ if (hash.digest('hex') !== entry.sha256) throw new Error('Analyzer checksum mismatch')
71
+ await chmod(temporary, 0o700)
72
+ try { await rename(temporary, target) } catch (error) {
73
+ // Another invocation may have finished the same verified download.
74
+ if (await fileDigest(target) !== entry.sha256) throw error
75
+ }
76
+ return target
77
+ } finally {
78
+ await handle?.close().catch(() => {})
79
+ await rm(temporary, { force: true }).catch(() => {})
80
+ await dispatcher?.destroy().catch(() => {})
81
+ }
82
+ }
@@ -1,29 +1,29 @@
1
1
  {
2
- "version": "0.1.10",
2
+ "version": "0.1.12",
3
3
  "binaries": {
4
4
  "linux-x64": {
5
5
  "name": "dsh-caveman-learn_linux_amd64",
6
- "sha256": "777dc6016207a25c7aa20c50b60140a81655e66795f239591a440838dcd7ff0c"
6
+ "sha256": "4f73e771ac59e218ac7ec5f3648e79e472d565e5f3621755b5a1cf28b18bb0e1"
7
7
  },
8
8
  "linux-arm64": {
9
9
  "name": "dsh-caveman-learn_linux_arm64",
10
- "sha256": "b302c89852481fcf0da0450530079edfca87f63c4fa190948b184302bc831238"
10
+ "sha256": "c29a8cc49fff51b23352e687bb3974398ee6d2835b84fd31e290c9e3f0852f22"
11
11
  },
12
12
  "darwin-x64": {
13
13
  "name": "dsh-caveman-learn_darwin_amd64",
14
- "sha256": "33b851d8defc27b5d5e20df3797c5e338ad5c730a2acab886388396e261433e7"
14
+ "sha256": "e460f3fe253eb76b85064e857f748dcb718d96ec59ea93a31d90d540e7326175"
15
15
  },
16
16
  "darwin-arm64": {
17
17
  "name": "dsh-caveman-learn_darwin_arm64",
18
- "sha256": "ab3a063099fcbc49401daa0ad615999fda2ebad56ea17a89a2fbbcc57f5b438d"
18
+ "sha256": "c8f21233f3f4a66322ee961a4f75aa03315e65b17ba3f9b4ae44fffe19805131"
19
19
  },
20
20
  "win32-x64": {
21
21
  "name": "dsh-caveman-learn_win32_amd64",
22
- "sha256": "315cbf8a19e5b2e9357c248cf4616daa7f82dcea4b30cfdcbb6795c886b3be1f"
22
+ "sha256": "e5ea9938bedbdf3fd4dbae9717da2d643a4acb3802cdfcb116b878ea47e885b1"
23
23
  },
24
24
  "win32-arm64": {
25
25
  "name": "dsh-caveman-learn_win32_arm64",
26
- "sha256": "4b693fcde17ceb0de7600a58fa51d935f585891c68aa7f9c0bfba10fc38574f1"
26
+ "sha256": "c5d43c0dcf011490a1fe6aaf1239a9d90f959949ce34be9f971933c073b3c64d"
27
27
  }
28
28
  }
29
29
  }
@@ -0,0 +1,382 @@
1
+ <div align="center">
2
+
3
+ ## New: Caveman Code. Free.
4
+
5
+ **21% less than Codex per solved task on Terminal-Bench 4.** Same model on both sides.
6
+
7
+ <table>
8
+ <tr>
9
+ <td align="center"><h3>21% cheaper</h3>than Codex<br><sub>Terminal-Bench 4, per solved task, GPT-6.1 Sol: $1.21 vs $1.52, 90 of 192 runs solved both</sub></td>
10
+ <td align="center"><h3>Level</h3>with Claude Code within noise<br><sub>Terminal-Bench 4, Opus 5.5: 97 of 180 runs solved vs 83 of 177; $5.19 vs $6.04 per solved task, 95% interval 0.70x to 1.02x</sub></td>
11
+ </tr>
12
+ </table>
13
+
14
+ <sub>Measured build, benchmark settings on, not the shipped app: the app ships the same harness with three benchmark-only settings turned off. Same model on both sides: GPT-6.1 Sol against Codex, Opus 5.5 against Claude Code. Our own runs, November 2026, at list prices. <a href="https://caveman.so/code#benchmarks">How we measured</a></sub>
15
+
16
+ Every coding agent in one window. Free on the subscriptions and keys you already have.
17
+
18
+ **[Download Caveman Code for Mac](https://caveman.so/download) · [Read the launch post](https://caveman.so/news/introducing-caveman-code)**
19
+
20
+ ---
21
+
22
+ <img src="docs/assets/caveman-logo-banner.png" alt="Caveman" width="720">
23
+
24
+ # why many token when few do trick
25
+
26
+ **Caveman make your AI agent say less and read less. Code stay exact. Brain still big.**
27
+
28
+ <a href="https://github.com/JuliusBrussee/caveman/stargazers"><img src="https://img.shields.io/github/stars/JuliusBrussee/caveman?style=flat-square&color=F0A63C&label=stars" alt="GitHub stars"></a>
29
+ <a href="https://www.npmjs.com/package/@caveman-ai/cli"><img src="https://img.shields.io/npm/dm/@caveman-ai/cli?style=flat-square&color=F0A63C&label=cli%20downloads" alt="npm downloads"></a>
30
+ <a href="./INSTALL.md"><img src="https://img.shields.io/badge/works_with-30%2B_agents-orange?style=flat-square" alt="30+ agents"></a>
31
+ <a href="#license"><img src="https://img.shields.io/badge/license-Apache--2.0-green?style=flat-square" alt="License"></a>
32
+
33
+ <table>
34
+ <tr>
35
+ <td align="center" width="25%"><h3>33.2% fewer</h3>input tokens, whole sessions<br><sub><a href="#read-less-332-fewer-input-tokens">6 synthetic large-tool-output tasks, 18 pairs</a>, Aug 2026 engine, 18 of 18 answers right</sub></td>
36
+ <td align="center" width="25%"><h3>0.46×</h3>the cost of Opus at xhigh, with Auto<br><sub><a href="#auto-046x-the-cost-of-opus-at-xhigh-interim">85 coding tasks</a>, interim, score gap ±7 points, unresolved</sub></td>
37
+ <td align="center" width="25%"><h3>397 → 76</h3>tokens for one test run<br><sub><a href="#blocks-code-mode-script-written-once">Blocks</a> vs <code>| tail -20</code></sub></td>
38
+ <td align="center" width="25%"><h3>1.4 to 2.4× cheaper</h3>with caveman-style output<br><sub><a href="https://arxiv.org/abs/2606.24083">Adobe Research</a>, eight models</sub></td>
39
+ </tr>
40
+ </table>
41
+
42
+ Cited by **[Adobe Research](https://arxiv.org/abs/2606.24083)** · A/B tested by **[JetBrains](https://blog.jetbrains.com/ai/2026/07/speak-to-ai-agents-like-cavemen-tosave-tokens/)** · Remade for Elasticsearch on **[Elasticsearch Labs](https://www.elastic.co/search-labs/blog/elastic-caveman-ai-token-reduction)**<br>
43
+ **#1** on [Hacker News](https://news.ycombinator.com/item?id=47647455) · **#1** on GitHub Trending · *"No way this actually works."* [ThePrimeagen](https://www.youtube.com/watch?v=L29q2LRiMRc)
44
+
45
+ **[Install](#install) · [Six rocks](#six-rocks-one-install) · [Proof](#proof) · [Say less](#say-less-the-caveman-voice) · [Read less](#read-less-332-fewer-input-tokens) · [Auto](#auto-046x-the-cost-of-opus-at-xhigh-interim) · [Blocks](#blocks-code-mode-script-written-once) · [Commands](#commands) · [Caveman Cloud](#caveman-cloud)**
46
+
47
+ </div>
48
+
49
+ ---
50
+
51
+ <table>
52
+ <tr>
53
+ <th width="50%">Normal agent · 63 tokens</th>
54
+ <th width="50%"><img src="docs/assets/dancing-rock.svg" width="18" height="18" alt=""> Caveman agent · 20 tokens</th>
55
+ </tr>
56
+ <tr>
57
+ <td valign="top">
58
+
59
+ > The reason your React component is re-rendering is likely because you're creating a new object reference on each render cycle. When you pass an inline object as a prop, React's shallow comparison sees it as a different object every time, which triggers a re-render. I'd recommend using useMemo to memoize the object.
60
+
61
+ </td>
62
+ <td valign="top">
63
+
64
+ > New object ref each render, so React re-renders. Wrap the prop in `useMemo`.
65
+
66
+ </td>
67
+ </tr>
68
+ </table>
69
+
70
+ **Same fix. 63 token become 20. Brain still big.**
71
+
72
+ Pick your club:
73
+
74
+ | Skill | Same answer | Tokens |
75
+ |---|---|---:|
76
+ | `/caveman` | New object ref each render, so React re-renders. Wrap the prop in `useMemo`. | 20 |
77
+ | `/ultracave` | Inline object prop, new ref, re-render. `useMemo`. | 14 |
78
+ | `/megacave` | 新參照致重繪。`useMemo`。 | 13 |
79
+
80
+ <sub>Token counts: tiktoken o200k.</sub>
81
+
82
+ ## Install
83
+
84
+ ```bash
85
+ npx @caveman-ai/cli@latest
86
+ ```
87
+
88
+ One command. Mac, Linux, Windows. Caveman find your agents and your logins, show what it change. Press Enter. Done. Needs Node.js 22.13+.
89
+
90
+ After that, plain `claude` stays caveman'd. So do Codex, Gemini CLI, OpenCode, and [30+ more](./INSTALL.md). It runs on your machine, with your keys and your Claude Pro/Max login. One rock. That it.
91
+
92
+ <sub>Had caveman before 4.0? Say <code>@latest</code>, or the old copy on your machine wins. Already set up? <code>caveman setup</code> opens the screen again. Only want shorter answers? <a href="#say-less-the-caveman-voice">Get just the skill</a>.</sub>
93
+
94
+ ## Six rocks, one install
95
+
96
+ New in 4.0: caveman is six parts. All on after install. Each has its own switch.
97
+
98
+ | Rock | What it does | Measured |
99
+ |---|---|---|
100
+ | **[Say less](#say-less-the-caveman-voice)** | Agent answers short. Code stays exact | 3% shorter than "Answer concisely." (ultracave 35%), n=10 |
101
+ | **[Read less](#read-less-332-fewer-input-tokens)** | Logs, JSON, CSV, test output shrink before the model reads them | **33.2%** fewer input tokens per session (6 synthetic large-tool-output tasks, 18 pairs, Aug 2026 engine) |
102
+ | **[Auto](#auto-046x-the-cost-of-opus-at-xhigh-interim)** · new | Picks the model and the effort for each ask | 0.46× the cost of Opus at xhigh in an interim run (85 tasks); quality gap unresolved |
103
+ | **[Blocks](#blocks-code-mode-script-written-once)** · new | Code mode: agent keeps the scripts it writes and runs them again | **397 → 76** tokens for one test run |
104
+ | **[Waste fixes](#smaller-rocks)** | Finds where your tokens go and fixes it. New: keeps the prompt cache warm while you pause | Not measured yet |
105
+ | **[Browse](#smaller-rocks)** | Web pages come back compressed | 14.9% smaller full page than Playwright; 121 vs 15,704 tokens with a query, on one 200-row table |
106
+
107
+ `caveman status` shows what is on. `caveman off browse` turns one off. Only Auto needs an account, and it is free. [4.0.0 release notes](https://github.com/JuliusBrussee/caveman/releases/tag/v4.0.0)
108
+
109
+ ## Proof
110
+
111
+ Outside labs first. Ours come with each rock below. Nothing rounded up. Red rows stay red.
112
+
113
+ | Who | Setup | Result |
114
+ |---|---|---|
115
+ | **[Adobe Research](https://arxiv.org/abs/2606.24083)**, CAVEWOMAN paper (cites this repo) | Caveman-style output, eight models, five datasets | **Cost cut 1.4 to 2.4× per model, up to 3×** |
116
+ | **[Elastic](https://www.elastic.co/search-labs/blog/elastic-caveman-ai-token-reduction)**, Elasticsearch Labs | Caveman mode remade for Elasticsearch, eight live MCP scenarios | **63.6% fewer response tokens.** *"Zero information loss."* |
117
+ | **[JetBrains](https://blog.jetbrains.com/ai/2026/07/speak-to-ai-agents-like-cavemen-tosave-tokens/)** | 86 real coding tasks, paired A/B | **No measurable quality loss** (p = 0.82). 8.5% fewer output tokens |
118
+
119
+ Two findings shaped caveman. Adobe: cavemanning *your* prompt makes answers worse, so caveman never touches your prompt. JetBrains: agent sessions are mostly code and tool calls, which the voice leaves alone. So caveman grew rocks that shrink what the agent *reads* and what it *runs on*.
120
+
121
+ ## Say less: the caveman voice
122
+
123
+ **A voice, not broken grammar. Every reply follows the same structure.**
124
+
125
+ | Rule | What it means |
126
+ |---|---|
127
+ | **Answer first** | `[thing] [action] [reason]. [next step].` No greeting, no "let me", no recap |
128
+ | **One idea per sentence** | Built on [ASD-STE100](https://www.asd-ste100.org/), the controlled English of aircraft maintenance manuals: 20 words max, active voice, one term per thing |
129
+ | **Meaning never dropped** | Articles can go. *not*, *never*, *no*, *only* never go. Numbers and units stay exact |
130
+ | **Payload verbatim** | Code, commands, paths, and error messages untouched, character for character |
131
+ | **No theater** | No "me think". No chatter between tool calls. If caveman phrasing isn't shorter, plain wins |
132
+ | **Knows when to stop** | Security warnings, irreversible actions, and confused users get full sentences. Then grunt resumes |
133
+ | **Your prompts stay yours** | Never rewritten. [Research say that backfire](#proof) |
134
+
135
+ Example run, n=10, not a claim. Ten dev questions on claude-opus-5-5:
136
+
137
+ | Instruction | Output tokens |
138
+ |---|---:|
139
+ | None | 6,983 |
140
+ | `Answer concisely.` | 4,334 |
141
+ | `/caveman` | 4,119 |
142
+ | `/ultracave` | **2,693** |
143
+
144
+ "Be concise" is the real baseline; new models already know it. On top of it, `/caveman` cuts 3% more at the median and `/ultracave` 35% more. Measured on the 3.1.0 rules, not yet re-run. The rules cost about 1,160 tokens of input, and if you pay per request (GitHub Copilot), shorter answers save nothing. [Harness](./evals/README.md) · [Every case where caveman loses](./docs/HONEST-NUMBERS.md)
145
+
146
+ <!-- BENCHMARK-TABLE-START -->
147
+ <!-- BENCHMARK-TABLE-END -->
148
+
149
+ **Only want this rock?** The skill alone, no proxy:
150
+
151
+ ```bash
152
+ npx skills add JuliusBrussee/caveman -g
153
+ ```
154
+
155
+ <a href="https://skills.sh/JuliusBrussee/caveman"><img src="https://skills.sh/b/JuliusBrussee/caveman" alt="skills.sh"></a>
156
+
157
+ Type `/caveman` (`$caveman` in Codex) if it doesn't start on its own. Say `stop caveman` to go back.
158
+
159
+ <details>
160
+ <summary><strong>Other ways in</strong>: Claude app and phone, Claude Code plugin, Gemini, every agent at once, Windows, uninstall</summary>
161
+
162
+ <br>
163
+
164
+ Claude on the web, the phone app, or Cowork? No terminal. Add caveman to your Claude account once, in Customize > Plugins: [steps](./INSTALL.md#claude-apps-claudeai-desktop-mobile-cowork). Not tested end to end yet.
165
+
166
+ ```bash
167
+ # Claude Code plugin, auto-starts every interactive session, subagents too
168
+ claude plugin marketplace add JuliusBrussee/caveman && claude plugin install caveman@caveman
169
+
170
+ # Gemini CLI
171
+ gemini extensions install https://github.com/JuliusBrussee/caveman
172
+
173
+ # Every agent on your machine at once, plus the Claude Code statusline badge (Node.js 22.13+)
174
+ curl -fsSL https://raw.githubusercontent.com/JuliusBrussee/caveman/v4.2.0/install.sh | bash
175
+ ```
176
+
177
+ Already inside Claude Code? Same rock, slash form. Type these where you talk to Claude:
178
+
179
+ ```text
180
+ /plugin marketplace add JuliusBrussee/caveman
181
+ /plugin install caveman@caveman
182
+ ```
183
+
184
+ Windows, PowerShell 5.1+:
185
+
186
+ ```powershell
187
+ irm https://raw.githubusercontent.com/JuliusBrussee/caveman/v4.2.0/install.ps1 | iex
188
+ ```
189
+
190
+ On npm 12 or newer, new npm block git install. One-liners above handle it themselves from v3.2.0 on. Old one-liner pinned to v3.1.0 or older still fail there: use one above, or this:
191
+ `npx --allow-git=root -y github:JuliusBrussee/caveman#v4.2.0`
192
+
193
+ Changed your mind: `npx -y github:JuliusBrussee/caveman -- --uninstall` (on npm 12+, add `--allow-git=root` too)
194
+
195
+ Only grabbed the skill? `npx skills remove JuliusBrussee/caveman -g` take it back out.
196
+
197
+ Install broke? Open your agent in this repo and say *"Read INSTALL.md, install caveman for me."* Agent fix own brain.
198
+
199
+ </details>
200
+
201
+ ## Read less: 33.2% fewer input tokens
202
+
203
+ **The voice shrinks what the agent says. This shrinks what it reads. Same answers: 18 of 18 right.** 6 synthetic large-tool-output tasks, 18 pairs, Aug 2026 engine.
204
+
205
+ | File type | The file, through caveman | File saved | Whole Claude Code session, 3 runs | Session saved |
206
+ |---|---:|---:|---:|---:|
207
+ | CSV | 28,041 → **314** | **98.9%** | 165,823 → 74,484 | **55.1%** |
208
+ | Logs | 22,810 → **348** | **98.5%** | 148,807 → 74,068 | **50.2%** |
209
+ | YAML | 20,447 → **178** | **99.1%** | 132,124 → 71,027 | **46.2%** |
210
+ | Test output | 18,806 → **203** | **98.9%** | 150,377 → 108,514 | **27.8%** |
211
+ | JSON | 18,837 → **281** | **98.5%** | 147,975 → 108,939 | **26.4%** |
212
+ | HTML | 21,670 → 21,670 | none yet | 140,687 → 154,641 | 9.9% worse |
213
+ | **All six** | 130,611 → 22,994 | 82.4% | **885,793 → 591,673** | **33.2%** |
214
+
215
+ *The file* is each test file through today's compressor alone. *The session* is the whole agent run, which also carries the system prompt and tools, so it moves less. Honest part: the session run is from August 2026 on an older engine, HTML has no compressor yet so it lost, and each test file hides one record in 61 to 72 KB of noise. Yours will vary. Headroom on the same suite: 15 of 18 right, 6.7% fewer tokens (interval crosses zero; harness not public). [Method](./docs/WRAP-BENCHMARK.md#per-file-compression)
216
+
217
+ Every original stays on your disk. The agent can pull it back any time.
218
+
219
+ ## Auto: 0.46x the cost of Opus at xhigh (interim)
220
+
221
+ **New model in your agent's picker. Pick Auto and caveman chooses the model and the effort for each ask. Hard ask, big brain. Easy ask, save rocks.**
222
+
223
+ | Setup | Tasks solved | Cost per try | Median time |
224
+ |---|---:|---:|---:|
225
+ | Opus 5.5, xhigh effort, every ask | 44.3% | $7.83 | 35.2 min |
226
+ | **Auto**, Claude models only | **43.7%** | **$3.59** | **15.9 min** |
227
+ | **Auto**, plus OpenAI and open models | 42.9% | $3.47 | 16.7 min |
228
+
229
+ Auto costs 0.46× what Opus 5.5 at xhigh costs. That is 54% saved, in under half the time. 85 real coding tasks from SWE-Interact and SWE-Together, one try each. Honest part: the run is half done, the 0.5-point score gap is too small to tell apart at this size (±7), and most of the saving is Auto lowering effort on easy asks. Already on Opus at medium? Expect less; not measured yet. [Full table and limits](./docs/AUTO-BENCHMARK.md)
230
+
231
+ ```bash
232
+ caveman login # free account. Auto shows up in the model picker
233
+ caveman providers add openai # optional: give Auto more models, on your own key
234
+ ```
235
+
236
+ Works in Claude Code, OpenCode, and Codex on a ChatGPT login, with API keys, Claude Pro/Max, or ChatGPT. Any other model you pick runs as picked. Not signed in: no Auto, nothing sent. [What Auto sends](#privacy)
237
+
238
+ ## Blocks: code mode, script written once
239
+
240
+ **skills.sh for code mode.** Code mode is the agent writing a script instead of making tool call after tool call ([Cloudflare](https://blog.cloudflare.com/code-mode/), [Anthropic](https://www.anthropic.com/engineering/code-execution-with-mcp)). Problem: agent write same script every session, throw it away, write it again. Blocks keep it in your repo, check it every pull request, hand it back.
241
+
242
+ | Input | Raw | What agents type now | Block |
243
+ |---|---:|---:|---:|
244
+ | `go test -v ./...`, 326 tests | 10,561 | 397 · `\| tail -20` | **76** · `test-summary` |
245
+ | 1.4 MB JSON file | 251,893 | 236 · their own heredoc | **227** · `json-peek` |
246
+ | 366-line Go file | 3,111 | **250** · `grep -n` | 489 · `grep-defs` |
247
+
248
+ Tokens the agent reads back. In one week, agents on one machine wrote the same script [394 times](https://github.com/caveman-ai/blocks#one-script-written-394-times-in-a-week). [Purdue](https://arxiv.org/abs/2609.30725) measured the habit at up to 9.57% of task cost. `grep-defs` loses to a bare grep; row stays. [Method](https://github.com/caveman-ai/blocks#blocks-against-what-agents-type-now)
249
+
250
+ Comes with caveman. Eight blocks ready: `json-peek` · `jsonl-stats` · `test-summary` · `first-error` · `wait-for` · `grep-defs` · `http-json` · `replace-in-file`. When the agent starts typing a script a block already covers, it gets one line: use the block. Never denies or rewrites a command.
251
+
252
+ ```bash
253
+ caveman-blocks scan # what your agents retyped this month. Script text never leaves your machine
254
+ caveman-blocks init # rules and block index into this repo's AGENTS.md
255
+ ```
256
+
257
+ Pre-release (v0.1.0-rc.5). Python only, no sandbox yet. Own repo, own stars: **[caveman-ai/blocks](https://github.com/caveman-ai/blocks)**
258
+
259
+ ## Smaller rocks
260
+
261
+ | Rock | What it does | Measured |
262
+ |---|---|---|
263
+ | `caveman learn` | Ranks where your tokens go, from agent history already on disk. `caveman learn implement` applies fixes one diff at a time, only on your yes | Not yet |
264
+ | Warm cache · new | Step away and the provider forgets your session, so the next ask pays full price. Caveman keeps Anthropic's prompt cache warm while you pause, only when your own history says you come back in time. Every warm is listed in `caveman stats` | Not yet |
265
+ | `caveman browse <url>` | A compressed web page for the agent | **121 tokens instead of 15,704** for a Playwright snapshot of a 200-row table. Tiny forms lose 2.3×. [Bench](./browse/BENCHMARK.md) |
266
+ | `/caveman-compress <file>` | Shrinks memory files like `CLAUDE.md`, keeps a backup | **4,138 tokens instead of 6,198** across five files, 22.8% to 49.1% each, every heading, code block, and path intact. [Bench](./skills/caveman-compress/README.md#benchmarks) |
267
+ | Middleware | Same shrinking inside the Vercel AI SDK, LangChain, OpenAI, or Anthropic call you already make. [TypeScript](./packages/middleware/typescript/README.md) · [Python](./packages/middleware/python/README.md) · [Every framework](https://docs.caveman.so/caveman/middleware) · [One container for the team](docs/technical/deploy.md) | Not yet |
268
+
269
+ <p align="center">
270
+ <img src="docs/assets/learn-report.png" alt="Caveman Learn report: a summary and savings cards on the left; the biggest places tokens go, with one fix opened, and a chart of how full sessions get on the right" width="900">
271
+ </p>
272
+
273
+ ## Commands
274
+
275
+ In your terminal:
276
+
277
+ ```bash
278
+ caveman claude # start an agent on caveman: codex · gemini · opencode · aider · kilo · qwen · hermes · openclaw · pi
279
+ caveman status # what is on, which agents it reaches, one next step
280
+ caveman on browse # switch one rock on or off: output · input · waste-fixes · routing · scripts · browse
281
+ caveman login # free account, turns on Auto
282
+ caveman learn # where your tokens go
283
+ caveman trial -- claude # A/B a real session on your own work
284
+ caveman shrink -- pnpm test # compress noisy command output
285
+ caveman convert --dry-run # pixel mode: skills the model reads as images
286
+ caveman stats # your token history
287
+ caveman doctor # one problem per line, with its fix
288
+ ```
289
+
290
+ In your agent:
291
+
292
+ | Command | What it does |
293
+ |---|---|
294
+ | `/caveman` · `/ultracave` · `/megacave` | The voice, the grunt, the 文言文. `/caveman status` shows the mode, `/caveman off` stops it |
295
+ | `/caveman-commit` | One-line Conventional Commit |
296
+ | `/caveman-review` | One finding per line: `L42: 🔴 null deref. Guard it.` |
297
+ | `/caveman-compress <file>` | Shrinks memory files and backs up the original |
298
+ | `/caveman-stats` | Real token usage for this Claude Code session |
299
+ | `/caveman-help` | Every mode and command on one screen |
300
+ | `cavecrew` | Subagents that find, edit, and review code, then report back in caveman |
301
+ | `investigate-first` · `lean-build` · `surgical-patch` · `safe-refactor` · `migration` · `verify-and-stop` | Work patterns that write less code. Your agent picks them up when a task fits |
302
+ | `caveman-setup` · `caveman-discover` · `caveman-learn` · `caveman-manage` · `caveman-optimize` · `caveman-explore` · `caveman-evidence-review` | Drive the proxy from inside your agent |
303
+
304
+ ## Caveman Cloud
305
+
306
+ **Everything above is for the coding agent you use. Caveman Cloud is for the agents you build.**
307
+
308
+ You ship an agent. Every run costs money. Is it good? Is it cheap? Which change made it worse? Cloud answers.
309
+
310
+ | Cloud does | What you get |
311
+ |---|---|
312
+ | **Observability** | Every run traced to the work and what it cost. Sets itself up from your repo, your keys, and the logs or OpenTelemetry you already have |
313
+ | **Evals** | Grades how good the answers are, on your own tasks, from your real traffic |
314
+ | **Autopilot** | Proposes a cheaper change, tests it on your recorded work, ships only when the evals say answers are still as good. You approve the pull request |
315
+ | **Proof** | Every number says if it is measured, inferred, or verified. A saving counts only after real traffic shows it |
316
+
317
+ <p align="center">
318
+ <a href="https://app.caveman.so/signup"><b>Sign up free</b></a> &nbsp;·&nbsp; <a href="https://caveman.so/demo">Try the demo</a> &nbsp;·&nbsp; <a href="https://cal.com/caveman/chat">Book a call</a> &nbsp;·&nbsp; <a href="https://docs.caveman.so">Docs</a>
319
+ </p>
320
+
321
+ ## In the wild
322
+
323
+ <a href="https://www.youtube.com/watch?v=L29q2LRiMRc"><img src="https://img.youtube.com/vi/L29q2LRiMRc/hqdefault.jpg" alt="ThePrimeagen reacts to Caveman: No way this actually works" width="340" align="right"></a>
324
+
325
+ **ThePrimeagen**: *"No way this actually works."* [Watch](https://www.youtube.com/watch?v=L29q2LRiMRc)
326
+
327
+ **Adobe Research**: [CAVEWOMAN](https://arxiv.org/abs/2606.24083), arXiv, June 2026
328
+
329
+ **JetBrains**: *"It is fun, and it costs you nothing measurable in quality."* [Read](https://blog.jetbrains.com/ai/2026/07/speak-to-ai-agents-like-cavemen-tosave-tokens/)
330
+
331
+ **Elastic**: [elastic-caveman](https://www.elastic.co/search-labs/blog/elastic-caveman-ai-token-reduction) on Elasticsearch Labs, April 2026
332
+
333
+ **Hacker News**: [#1, 904 points](https://news.ycombinator.com/item?id=47647455)
334
+
335
+ **GitHub Trending** #1 overall, July 2026 · **[Trendshift](https://trendshift.io/repositories/25391)** #1 repo of the day, April 2026 · **[Product Hunt](https://www.producthunt.com/products/caveman)** #8 of the day
336
+
337
+ Started as a joke in April 2026. Now past 100,000 stars. Joke got serious. Voice did not.
338
+
339
+ <br clear="right">
340
+
341
+ [![Star History Chart](./docs/assets/star-history.png)](https://star-history.com/#JuliusBrussee/caveman&Date)
342
+
343
+ ## Privacy
344
+
345
+ - **The skill** runs on your machine and sends nothing. One exception: `/caveman-compress` sends the file you compress to your configured model provider.
346
+ - **The CLI** sends usage stats by default: commands run, token counts, caveman-blocks commands and usage counts, a random install ID, OS, and IP. Never your prompts, code, file paths, or scripts you wrote. One person maintains this for free, and those stats show what to build next. Off for good, Blocks included: `caveman telemetry off` or `DO_NOT_TRACK=1`.
347
+ - **Auto**, only once you sign in and pick it: each ask sends Caveman Cloud your latest ask (with whatever your agent attaches to it, such as CLAUDE.md, memory or @-mentioned files), the one before it, and the end of the agent's last reply, plus each request's tool names, effort, a few agent headers, and the previous request's token counts. On the Free plan Caveman may keep it to improve routing. `caveman off routing` stops it.
348
+ - **Where requests go:** from your machine to your provider, or to another provider you added with `caveman providers add`, on your own key. Only a request routed to a Caveman Cloud model passes through Caveman Cloud, whole (system prompt, tool results, code), on your Caveman project's stored key, billed to that project. `caveman providers cloud off` stops that.
349
+
350
+ The full list, and how to delete sent telemetry: [SECURITY.md](./SECURITY.md).
351
+
352
+ ## License
353
+
354
+ [Apache-2.0](./LICENSE), whole repo. Read it, fork it, ship it, host it. Free like mammoth on open plain. Older releases and third-party notices: [LICENSING.md](./LICENSING.md). "Caveman" and the rock logo are trademarks of Julius Brussee.
355
+
356
+ ## Cite
357
+
358
+ ```bibtex
359
+ @software{brussee2026caveman,
360
+ author = {Brussee, Julius},
361
+ title = {Caveman: why many token when few do trick},
362
+ year = {2026},
363
+ url = {https://github.com/JuliusBrussee/caveman}
364
+ }
365
+ ```
366
+
367
+ ---
368
+
369
+ <div align="center">
370
+
371
+ 🪨 **Caveman save you token. Star cost zero. Fair trade.**
372
+
373
+ <sub>
374
+ <a href="./docs/README.md">Docs</a> ·
375
+ <a href="./INSTALL.md">Install matrix</a> ·
376
+ <a href="./docs/HONEST-NUMBERS.md">Honest numbers</a> ·
377
+ <a href="./CONTRIBUTING.md">Contributing</a> ·
378
+ <a href="https://app.caveman.so/signup">Caveman Cloud</a> ·
379
+ <a href="https://github.com/JuliusBrussee/caveman/issues">Issues</a>
380
+ </sub>
381
+
382
+ </div>