@lornatang/dsh-caveman 0.1.9 → 0.1.10

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-caveman/releases/download/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.9",
2
+ "version": "0.1.10",
3
3
  "binaries": {
4
4
  "linux-x64": {
5
5
  "name": "dsh-caveman-learn_linux_amd64",
6
- "sha256": "0bbc8d74cb5c1f7494fc6fed5582a1e0f0259200df490b4b866ce43ba555d889"
6
+ "sha256": "777dc6016207a25c7aa20c50b60140a81655e66795f239591a440838dcd7ff0c"
7
7
  },
8
8
  "linux-arm64": {
9
9
  "name": "dsh-caveman-learn_linux_arm64",
10
- "sha256": "b3ddb175c675023c6c091f26a1f992c545e03df0ccf46632a577e48db8ec1fa9"
10
+ "sha256": "b302c89852481fcf0da0450530079edfca87f63c4fa190948b184302bc831238"
11
11
  },
12
12
  "darwin-x64": {
13
13
  "name": "dsh-caveman-learn_darwin_amd64",
14
- "sha256": "8145380c71fe57e8829a856c808c887b271e6d004078ca989c23d997c61ffbab"
14
+ "sha256": "33b851d8defc27b5d5e20df3797c5e338ad5c730a2acab886388396e261433e7"
15
15
  },
16
16
  "darwin-arm64": {
17
17
  "name": "dsh-caveman-learn_darwin_arm64",
18
- "sha256": "03be0ecc7f9d4d0669edf1c79a5d3f20921e8d89d210fdadc99f0e2c16b1e7b4"
18
+ "sha256": "ab3a063099fcbc49401daa0ad615999fda2ebad56ea17a89a2fbbcc57f5b438d"
19
19
  },
20
20
  "win32-x64": {
21
21
  "name": "dsh-caveman-learn_win32_amd64",
22
- "sha256": "ce0b6834457c8f188c883b6c46892930b0fad63d85cf9f7033ddd53cc1fd5b4a"
22
+ "sha256": "315cbf8a19e5b2e9357c248cf4616daa7f82dcea4b30cfdcbb6795c886b3be1f"
23
23
  },
24
24
  "win32-arm64": {
25
25
  "name": "dsh-caveman-learn_win32_arm64",
26
- "sha256": "bceddc401c9711c6c67194dbf27e7a227100eb315397018affce9cd8ea0a2f5b"
26
+ "sha256": "4b693fcde17ceb0de7600a58fa51d935f585891c68aa7f9c0bfba10fc38574f1"
27
27
  }
28
28
  }
29
29
  }
@@ -1,383 +0,0 @@
1
- <div align="center">
2
-
3
- ## New: Caveman Code. Free.
4
-
5
- **The most efficient coding agent.** Same model, same work, smaller bill.
6
-
7
- <table>
8
- <tr>
9
- <td align="center"><h3>21% cheaper</h3>than Codex<br><sub>Terminal-Bench 4, per solved task</sub></td>
10
- <td align="center"><h3>14% cheaper</h3>than Claude Code<br><sub>Terminal-Bench 4, 97 vs 83 solved</sub></td>
11
- <td align="center"><h3>76% cheaper</h3>than Claude Code<br><sub>full workday, 4 connected apps</sub></td>
12
- </tr>
13
- </table>
14
-
15
- <sub>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">How we measured</a></sub>
16
-
17
- Every coding agent in one window. Free on the subscriptions and keys you already have.
18
-
19
- **[Download Caveman Code for Mac](https://caveman.so/download) · [Read the launch post](https://caveman.so/news/introducing-caveman-code)**
20
-
21
- ---
22
-
23
- <img src="docs/assets/caveman-logo-banner.png" alt="Caveman" width="720">
24
-
25
- # why many token when few do trick
26
-
27
- **Caveman make your AI agent say less and read less. Code stay exact. Brain still big.**
28
-
29
- <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>
30
- <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>
31
- <a href="./INSTALL.md"><img src="https://img.shields.io/badge/works_with-30%2B_agents-orange?style=flat-square" alt="30+ agents"></a>
32
- <a href="#license"><img src="https://img.shields.io/badge/license-Apache--2.0-green?style=flat-square" alt="License"></a>
33
-
34
- <table>
35
- <tr>
36
- <td align="center" width="25%"><h3>33.2% fewer</h3>input tokens, whole sessions<br><sub><a href="#read-less-332-fewer-input-tokens">54 Claude Code runs</a>, 18 of 18 answers right</sub></td>
37
- <td align="center" width="25%"><h3>54% cheaper</h3>with Auto, same score<br><sub><a href="#auto-54-cheaper-same-score">85 coding tasks</a> vs Opus 5.5 at xhigh, interim</sub></td>
38
- <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>
39
- <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>
40
- </tr>
41
- </table>
42
-
43
- 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>
44
- **#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)
45
-
46
- **[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-54-cheaper-same-score) · [Blocks](#blocks-code-mode-script-written-once) · [Commands](#commands) · [Caveman Cloud](#caveman-cloud)**
47
-
48
- </div>
49
-
50
- ---
51
-
52
- <table>
53
- <tr>
54
- <th width="50%">Normal agent · 63 tokens</th>
55
- <th width="50%"><img src="docs/assets/dancing-rock.svg" width="18" height="18" alt=""> Caveman agent · 20 tokens</th>
56
- </tr>
57
- <tr>
58
- <td valign="top">
59
-
60
- > 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.
61
-
62
- </td>
63
- <td valign="top">
64
-
65
- > New object ref each render, so React re-renders. Wrap the prop in `useMemo`.
66
-
67
- </td>
68
- </tr>
69
- </table>
70
-
71
- **Same fix. 63 token become 20. Brain still big.**
72
-
73
- Pick your club:
74
-
75
- | Skill | Same answer | Tokens |
76
- |---|---|---:|
77
- | `/caveman` | New object ref each render, so React re-renders. Wrap the prop in `useMemo`. | 20 |
78
- | `/ultracave` | Inline object prop, new ref, re-render. `useMemo`. | 14 |
79
- | `/megacave` | 新參照致重繪。`useMemo`。 | **13** |
80
-
81
- <sub>Token counts: tiktoken o200k.</sub>
82
-
83
- ## Install
84
-
85
- ```bash
86
- npx @caveman-ai/cli@latest
87
- ```
88
-
89
- One command. Mac, Linux, Windows. Caveman find your agents and your logins, show what it change. Press Enter. Done. Needs Node.js 22.13+.
90
-
91
- 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.
92
-
93
- <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>
94
-
95
- ## Six rocks, one install
96
-
97
- New in 4.0: caveman is six parts. All on after install. Each has its own switch.
98
-
99
- | Rock | What it does | Measured |
100
- |---|---|---|
101
- | **[Say less](#say-less-the-caveman-voice)** | Agent answers short. Code stays exact | 63 → 20 tokens, same fix |
102
- | **[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 |
103
- | **[Auto](#auto-54-cheaper-same-score)** · new | Picks the model and the effort for each ask | **54%** cheaper than Opus at xhigh, same score |
104
- | **[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 |
105
- | **[Waste fixes](#smaller-rocks)** | Finds where your tokens go and fixes it. New: keeps the prompt cache warm while you pause | Not measured yet |
106
- | **[Browse](#smaller-rocks)** | Web pages come back compressed | **129.8×** smaller page |
107
-
108
- `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)
109
-
110
- ## Proof
111
-
112
- Outside labs first. Ours come with each rock below. Nothing rounded up. Red rows stay red.
113
-
114
- | Who | Setup | Result |
115
- |---|---|---|
116
- | **[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×** |
117
- | **[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."* |
118
- | **[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 |
119
-
120
- 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*.
121
-
122
- ## Say less: the caveman voice
123
-
124
- **A voice, not broken grammar. Every reply follows the same structure.**
125
-
126
- | Rule | What it means |
127
- |---|---|
128
- | **Answer first** | `[thing] [action] [reason]. [next step].` No greeting, no "let me", no recap |
129
- | **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 |
130
- | **Meaning never dropped** | Articles can go. *not*, *never*, *no*, *only* never go. Numbers and units stay exact |
131
- | **Payload verbatim** | Code, commands, paths, and error messages untouched, character for character |
132
- | **No theater** | No "me think". No chatter between tool calls. If caveman phrasing isn't shorter, plain wins |
133
- | **Knows when to stop** | Security warnings, irreversible actions, and confused users get full sentences. Then grunt resumes |
134
- | **Your prompts stay yours** | Never rewritten. [Research say that backfire](#proof) |
135
-
136
- Ten dev questions on claude-opus-5-5:
137
-
138
- | Instruction | Output tokens |
139
- |---|---:|
140
- | None | 6,983 |
141
- | `Answer concisely.` | 4,334 |
142
- | `/caveman` | 4,119 |
143
- | `/ultracave` | **2,693** |
144
-
145
- "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)
146
-
147
- <!-- BENCHMARK-TABLE-START -->
148
- <!-- BENCHMARK-TABLE-END -->
149
-
150
- **Only want this rock?** The skill alone, no proxy:
151
-
152
- ```bash
153
- npx skills add JuliusBrussee/caveman -g
154
- ```
155
-
156
- <a href="https://skills.sh/JuliusBrussee/caveman"><img src="https://skills.sh/b/JuliusBrussee/caveman" alt="skills.sh"></a>
157
-
158
- Type `/caveman` (`$caveman` in Codex) if it doesn't start on its own. Say `stop caveman` to go back.
159
-
160
- <details>
161
- <summary><strong>Other ways in</strong>: Claude app and phone, Claude Code plugin, Gemini, every agent at once, Windows, uninstall</summary>
162
-
163
- <br>
164
-
165
- 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.
166
-
167
- ```bash
168
- # Claude Code plugin, auto-starts every interactive session, subagents too
169
- claude plugin marketplace add JuliusBrussee/caveman && claude plugin install caveman@caveman
170
-
171
- # Gemini CLI
172
- gemini extensions install https://github.com/JuliusBrussee/caveman
173
-
174
- # Every agent on your machine at once, plus the Claude Code statusline badge (Node.js 22.13+)
175
- curl -fsSL https://raw.githubusercontent.com/JuliusBrussee/caveman/v4.1.0/install.sh | bash
176
- ```
177
-
178
- Already inside Claude Code? Same rock, slash form. Type these where you talk to Claude:
179
-
180
- ```text
181
- /plugin marketplace add JuliusBrussee/caveman
182
- /plugin install caveman@caveman
183
- ```
184
-
185
- Windows, PowerShell 5.1+:
186
-
187
- ```powershell
188
- irm https://raw.githubusercontent.com/JuliusBrussee/caveman/v4.1.0/install.ps1 | iex
189
- ```
190
-
191
- 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:
192
- `npx --allow-git=root -y github:JuliusBrussee/caveman#v4.1.0`
193
-
194
- Changed your mind: `npx -y github:JuliusBrussee/caveman -- --uninstall` (on npm 12+, add `--allow-git=root` too)
195
-
196
- Only grabbed the skill? `npx skills remove JuliusBrussee/caveman -g` take it back out.
197
-
198
- Install broke? Open your agent in this repo and say *"Read CLAUDE.md and INSTALL.md, install caveman for me."* Agent fix own brain.
199
-
200
- </details>
201
-
202
- ## Read less: 33.2% fewer input tokens
203
-
204
- **The voice shrinks what the agent says. This shrinks what it reads. Same answers: 18 of 18 right.**
205
-
206
- | File type | The file, through caveman | File saved | Whole Claude Code session, 3 runs | Session saved |
207
- |---|---:|---:|---:|---:|
208
- | CSV | 28,041 → **314** | **98.9%** | 165,823 → 74,484 | **55.1%** |
209
- | Logs | 22,810 → **348** | **98.5%** | 148,807 → 74,068 | **50.2%** |
210
- | YAML | 20,447 → **178** | **99.1%** | 132,124 → 71,027 | **46.2%** |
211
- | Test output | 18,806 → **203** | **98.9%** | 150,377 → 108,514 | **27.8%** |
212
- | JSON | 18,837 → **281** | **98.5%** | 147,975 → 108,939 | **26.4%** |
213
- | HTML | 21,670 → 21,670 | none yet | 140,687 → 154,641 | 9.9% worse |
214
- | **All six** | 130,611 → 22,994 | 82.4% | **885,793 → 591,673** | **33.2%** |
215
-
216
- *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. [Method](./docs/WRAP-BENCHMARK.md#per-file-compression)
217
-
218
- Every original stays on your disk. The agent can pull it back any time.
219
-
220
- ## Auto: 54% cheaper, same score
221
-
222
- **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.**
223
-
224
- | Setup | Tasks solved | Cost per try | Median time |
225
- |---|---:|---:|---:|
226
- | Opus 5.5, xhigh effort, every ask | 44.3% | $7.83 | 35.2 min |
227
- | **Auto**, Claude models only | **43.7%** | **$3.59** | **15.9 min** |
228
- | **Auto**, plus OpenAI and open models | 42.9% | $3.47 | 16.7 min |
229
-
230
- 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)
231
-
232
- ```bash
233
- caveman login # free account. Auto shows up in the model picker
234
- caveman providers add openai # optional: give Auto more models, on your own key
235
- ```
236
-
237
- 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)
238
-
239
- ## Blocks: code mode, script written once
240
-
241
- **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.
242
-
243
- | Input | Raw | What agents type now | Block |
244
- |---|---:|---:|---:|
245
- | `go test -v ./...`, 326 tests | 10,561 | 397 · `\| tail -20` | **76** · `test-summary` |
246
- | 1.4 MB JSON file | 251,893 | 236 · their own heredoc | **227** · `json-peek` |
247
- | 366-line Go file | 3,111 | **250** · `grep -n` | 489 · `grep-defs` |
248
-
249
- 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)
250
-
251
- 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.
252
-
253
- ```bash
254
- caveman-blocks scan # what your agents retyped this month. Script text never leaves your machine
255
- caveman-blocks init # rules and block index into this repo's AGENTS.md
256
- ```
257
-
258
- 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)**
259
-
260
- ## Smaller rocks
261
-
262
- | Rock | What it does | Measured |
263
- |---|---|---|
264
- | `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 |
265
- | 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 |
266
- | `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) |
267
- | `/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) |
268
- | 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 |
269
-
270
- <p align="center">
271
- <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">
272
- </p>
273
-
274
- ## Commands
275
-
276
- In your terminal:
277
-
278
- ```bash
279
- caveman claude # start an agent on caveman: codex · gemini · opencode · aider · kilo · qwen · hermes · openclaw · pi
280
- caveman status # what is on, which agents it reaches, one next step
281
- caveman on browse # switch one rock on or off: output · input · waste-fixes · routing · scripts · browse
282
- caveman login # free account, turns on Auto
283
- caveman learn # where your tokens go
284
- caveman trial -- claude # A/B a real session on your own work
285
- caveman shrink -- pnpm test # compress noisy command output
286
- caveman convert --dry-run # pixel mode: skills the model reads as images
287
- caveman stats # your token history
288
- caveman doctor # one problem per line, with its fix
289
- ```
290
-
291
- In your agent:
292
-
293
- | Command | What it does |
294
- |---|---|
295
- | `/caveman` · `/ultracave` · `/megacave` | The voice, the grunt, the 文言文. `/caveman status` shows the mode, `/caveman off` stops it |
296
- | `/caveman-commit` | One-line Conventional Commit |
297
- | `/caveman-review` | One finding per line: `L42: 🔴 null deref. Guard it.` |
298
- | `/caveman-compress <file>` | Shrinks memory files and backs up the original |
299
- | `/caveman-stats` | Real token usage for this Claude Code session |
300
- | `/caveman-help` | Every mode and command on one screen |
301
- | `cavecrew` | Subagents that find, edit, and review code, then report back in caveman |
302
- | `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 |
303
- | `caveman-setup` · `caveman-discover` · `caveman-learn` · `caveman-manage` · `caveman-optimize` · `caveman-explore` · `caveman-evidence-review` | Drive the proxy from inside your agent |
304
-
305
- ## Caveman Cloud
306
-
307
- **Everything above is for the coding agent you use. Caveman Cloud is for the agents you build.**
308
-
309
- You ship an agent. Every run costs money. Is it good? Is it cheap? Which change made it worse? Cloud answers.
310
-
311
- | Cloud does | What you get |
312
- |---|---|
313
- | **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 |
314
- | **Evals** | Grades how good the answers are, on your own tasks, from your real traffic |
315
- | **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 |
316
- | **Proof** | Every number says if it is measured, inferred, or verified. A saving counts only after real traffic shows it |
317
-
318
- <p align="center">
319
- <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>
320
- </p>
321
-
322
- ## In the wild
323
-
324
- <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>
325
-
326
- **ThePrimeagen**: *"No way this actually works."* [Watch](https://www.youtube.com/watch?v=L29q2LRiMRc)
327
-
328
- **Adobe Research**: [CAVEWOMAN](https://arxiv.org/abs/2606.24083), arXiv, June 2026
329
-
330
- **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/)
331
-
332
- **Elastic**: [elastic-caveman](https://www.elastic.co/search-labs/blog/elastic-caveman-ai-token-reduction) on Elasticsearch Labs, April 2026
333
-
334
- **Hacker News**: [#1, 904 points](https://news.ycombinator.com/item?id=47647455)
335
-
336
- **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
337
-
338
- Started as a joke in April 2026. Now past 100,000 stars. Joke got serious. Voice did not.
339
-
340
- <br clear="right">
341
-
342
- [![Star History Chart](./docs/assets/star-history.png)](https://star-history.com/#JuliusBrussee/caveman&Date)
343
-
344
- ## Privacy
345
-
346
- - **The skill** runs on your machine and sends nothing. One exception: `/caveman-compress` sends the file you compress to your configured model provider.
347
- - **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`.
348
- - **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.
349
- - **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.
350
-
351
- The full list, and how to delete sent telemetry: [SECURITY.md](./SECURITY.md).
352
-
353
- ## License
354
-
355
- [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.
356
-
357
- ## Cite
358
-
359
- ```bibtex
360
- @software{brussee2026caveman,
361
- author = {Brussee, Julius},
362
- title = {Caveman: why many token when few do trick},
363
- year = {2026},
364
- url = {https://github.com/JuliusBrussee/caveman}
365
- }
366
- ```
367
-
368
- ---
369
-
370
- <div align="center">
371
-
372
- 🪨 **Caveman save you token. Star cost zero. Fair trade.**
373
-
374
- <sub>
375
- <a href="./docs/README.md">Docs</a> ·
376
- <a href="./INSTALL.md">Install matrix</a> ·
377
- <a href="./docs/HONEST-NUMBERS.md">Honest numbers</a> ·
378
- <a href="./CONTRIBUTING.md">Contributing</a> ·
379
- <a href="https://app.caveman.so/signup">Caveman Cloud</a> ·
380
- <a href="https://github.com/JuliusBrussee/caveman/issues">Issues</a>
381
- </sub>
382
-
383
- </div>