Skip to content

Stop paying the multimodal tax. Your AI agent keeps every image it has seen but only sends the ones it needs: lighter chats, no endless reconnecting, no starting over. Works with Codex, Claude Code, Cline, Gemini CLI, OpenCode, WorkBuddy and more. Install once, forget it.

docs(v0.10): one 7% cap for both platforms; note the mod fix

chipfighterb5a72bed006e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8b576d8..32a478c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ Earlier images come back after compaction and resume, with the same IDs, in Code
### Fixes
+- Since 0.9.0, Claude Code 2.1.309 refused to load the plugin's Claude mod, because it named environment variables through a variable. Claude sessions then did not go through the plugin at all: no placeholders, no Auto-select, even though the image tool still showed. The mod now names each variable directly.
- Claude Code 2.1.304 and later keep the last messages through a compaction. The plugin now links them the way Claude Code does, so it recognizes the compaction and puts the earlier images back; before, such a compaction could put none back.
- When Claude Desktop resumes a session into a new transcript, the plugin follows it back to the earlier transcripts, also across several resumes and forks. Images keep their IDs, feature lines and ratings. Before, IDs restarted in the new transcript, so earlier feature lines could attach to the wrong image; lines written that way are now matched back to the right image.
- Resumed and forked Claude sessions start with the previous session's checked, pinned and Auto-select settings.
@@ -24,7 +25,7 @@ Earlier images come back after compaction and resume, with the same IDs, in Code
- After updating, reopen Claude sessions that were open: their image tool still runs the earlier code and numbering until then.
- Earlier transcripts are read only up to the compaction, and their image data stays on disk until needed: for the longest real session tested (9 transcripts, 210 images), the engine uses about 60 MB more memory and the first index takes under 2 seconds.
-- Verified so far with 281 unit tests and read-only replays of real Codex and Claude sessions. The model self-tests and a live Claude Desktop compaction test are still to run.
+- Verified so far with 282 unit tests and read-only replays of real Codex and Claude sessions. The model self-tests and a live Claude Desktop compaction test are still to run.
## [0.9.1] - 2026-10-29
diff --git a/docs/spec.md b/docs/spec.md
index 3b2288e..6ea016b 100644
--- a/docs/spec.md
+++ b/docs/spec.md
@@ -347,7 +347,7 @@ v0.1 之前的阶段验收(阶段 0 的重建路线、代理路线 P2)都已
1. Claude:压缩当场和续接之后(包括多次续接、分叉),压缩前的图都放回在摘要后面,编号和续接前一样;老会话里按重排编号写下的特征行和评价,换算后落在对的图上。用户的真实会话只读回放验证。
2. Claude:续接和分叉出来的会话沿用上一个会话的勾选。
3. Codex:压缩之后,工具查看、生成的图带着编号、特征行和评价回到请求里,模型能靠清单拿对,要看原图时按编号取对。
-4. 压缩后放回的那一段用紧凑清单:130 张图的 Claude 会话多出的不超过请求的约 8%,33 张图的 Codex 任务不超过约 4%(原定 6% 和 3%,用户看了估算后放宽);往回读旧记录时,最长的真实会话引擎堆内存多不超过 80 MB,第一次建索引不超过 2 秒。
+4. 压缩后放回的那一段用紧凑清单:130 张图的 Claude 会话、33 张图的 Codex 任务,多出的都不超过请求的约 7%(原定 6% 和 3%;用户看了估算后放宽,准确度和信息别丢太多更要紧);往回读旧记录时,最长的真实会话引擎堆内存多不超过 80 MB,第一次建索引不超过 2 秒。
5. 写错的特征行能更正;被打断那一轮里还没有特征行的图,下一轮再发一次让模型补写。
6. 原有测试和自测不退化(gpt-6-sol,中英文);Claude 桌面版用 `/compact` 再续接实测一次。
diff --git a/docs/v0.10/plan.md b/docs/v0.10/plan.md
index d8e100a..ffa56eb 100644
--- a/docs/v0.10/plan.md
+++ b/docs/v0.10/plan.md
@@ -75,10 +75,10 @@
- 结果:通过。旧文件只留压缩点之前带 uuid 的记录,图片数据留在磁盘上、用到时再读:堆内存 83 → 145 MB(多 62 MB),第一次建索引 1.8 秒;每条请求重建约 10 毫秒,同一请求里再读走缓存,约 0.5 毫秒(现在是每次都建,3 次共约 6 毫秒)。
5. **Codex 放回的位置**:压缩项后面能不能插;插成开发者消息还是用户消息,模型才把它当真;连续两次请求里这一段逐字节相同,缓存接得上。用 app-server 的 `thread/compact/start` 做探针验证。
- 结果:未完成。按真实压缩记录重建的请求(本机回放)和单元测试里,放回的一段在压缩项后面(说明是开发者消息,原图在后面一条用户消息里),两次请求逐字节相同。探针(`spike/src/v10-compaction-selftest.ts`)没跑成:Codex 用量到了上限,2026-11-04 15:35 恢复。
-6. **token**:实测压缩后的请求,按 API 返回的用量算,不按估算。130 张图的 Claude 会话多出的不超过请求的约 8%(原定 6%,英文特征行不再截短后用户同意放宽,见第 8 节第 4 条),33 张图的 Codex 任务不超过约 4%(原定 3%,用户同意放宽,见第 8 节第 5 条)。
- - 结果:只有估算(按字数估的 token,不是 API 返回的用量)。Claude 那个 127 张的会话,放回的一段约 5.4–7.3 千 token(清单 4.4–5.8 千、说明 1.0–1.5 千),约占请求的 6%–8%,超过 6% 的部分来自第 2 节第 8 条(英文特征行不再截短)。Codex 那个 33 张的任务约 1.2–1.7 千(说明 0.24–0.34 千、清单 0.98–1.33 千),压缩后第一条真实请求是 44,893 token,约占 2.7%–3.7%,超过 3% 的部分主要是编号式的文件名(第 8 节第 5 条)。实测用量等桌面实测和自测。
+6. **token**:实测压缩后的请求,按 API 返回的用量算,不按估算。130 张图的 Claude 会话、33 张图的 Codex 任务,多出的都不超过请求的约 7%(原定 6% 和 3%;用户看了估算后放宽,准确度和信息别丢太多更要紧,见第 8 节)。
+ - 结果:只有估算(按字数估的 token,不是 API 返回的用量)。Claude 那个 127 张的会话,放回的一段约 5.4–7.3 千 token(清单 4.4–5.8 千、说明 1.0–1.5 千),约占请求的 6%–8%,上半段可能超过 7%,比原定 6% 多出的部分来自第 2 节第 8 条(英文特征行不再截短)。Codex 那个 33 张的任务约 1.2–1.7 千(说明 0.24–0.34 千、清单 0.98–1.33 千),压缩后第一条真实请求是 44,893 token,约占 2.7%–3.7%,其中编号式的文件名约 0.2–0.3 千(第 8 节第 5 条)。实测用量等桌面实测和自测。
7. **模型照样会取、取对**:改成紧凑写法、放回之后,Codex 自测(gpt-6-sol,推理强度 low),Claude 桌面测试会话(Haiku 5.5),中英文都测。
- - 结果:未完成。10 组自测(新的 v10-compaction 和 v08-features、v01-placeholder、v01-needs、v03-auto,各中英文)都因 Codex 用量上限(HTTP 429)没跑成,建的测试任务都已归档;Claude 桌面实测要用户在测试会话里手打 `/compact`。
+ - 结果:未完成。10 组自测(新的 v10-compaction 和 v08-features、v01-placeholder、v01-needs、v03-auto,各中英文)都因 Codex 用量上限(HTTP 429)没跑成,建的测试任务都已归档;Claude 桌面实测要用户在测试会话里手打 `/compact`。第一次桌面实测发现,v0.9.0 起 Claude Code 2.1.309 不加载插件的 mod(它用变量传环境变量的名字),Claude 会话的请求根本不经过插件;已修好,在修好的版本上重测。
## 4. 做法
@@ -129,5 +129,7 @@
1. 第 2 节第 7 条的补写:被打断那一轮的新图,下一轮再发一次,让模型补写特征行(多花一轮这几张图的 token)。
2. 第 2 节第 6 条:别处原位的占位不改短,这次只改压缩后放回的那一段。
3. 截图的规则:另议。
-4. 关卡 6 的 Claude 部分:英文特征行不再截短以后,估算是 6%–8%,超过原定的 6%。用户接受,上限改成约 8%:多出的约 0.15 万 token 换来 29 张图能互相分开。
-5. 关卡 6 的 Codex 部分:估算 2.7%–3.7%,超过原定的约 3%。多出的主要是 15 行里 `exec-<uuid>.png` 这样由一串编号组成的文件名(9 个不同的名字),约 0.17–0.34 千 token;压缩后保留的对话里这些名字一个都没再出现。用户选了上限放宽到约 4%,名字照留。另一个办法是清单里把这类名字写成“-”(约 2.3%–3.3%),没有采用。
+4. 关卡 6 的 Claude 部分:英文特征行不再截短以后,估算是 6%–8%,超过原定的 6%。用户接受:多出的约 0.15 万 token 换来 29 张图能互相分开。
+5. 关卡 6 的 Codex 部分:估算 2.7%–3.7%,超过原定的约 3%。多出的主要是 15 行里 `exec-<uuid>.png` 这样由一串编号组成的文件名(9 个不同的名字),约 0.17–0.34 千 token;压缩后保留的对话里这些名字一个都没再出现。用户选了名字照留;另一个办法是清单里把这类名字写成“-”(约 2.3%–3.3%),没有采用。
+
+随后用户补充(同一天):两边放回的一段占请求约 7% 以内都能接受,更要紧的是准确度和信息别丢太多。关卡 6 的上限照此定为约 7%。