When a long conversation compacts, the details vanish into a summary: the exact error, the command, the decision you made an hour ago. Afterimage shows what was dropped, lets you search it, and brings the original turns back, word for word.长对话一压缩,细节就消失在摘要里:完整的报错、那条命令、一小时前定下的决定。Afterimage 让你看到丢了什么、能搜到,还能把原文一字不差地找回来。
relation "users" already exists. Fixed the duplicate.失败了:relation "users" already exists,已修复重复的迁移。ERROR: relation "users" already existsThese requests are open in the official trackers. Neither app gives a way to see or restore what compaction dropped, yet both keep the original turns on your disk.这些请求在官方仓库里都还开着。两个应用都不能让你看到或找回被压缩掉的内容,可原文其实都还留在你的电脑上。
When it happened, tokens before and after, and a numbered list of the turns it summarized.什么时候发生、压缩前后多少 token,以及被总结掉的每一轮(带编号)。
Original messages, replies, errors and tool calls, searchable by a few words.原始提问、回复、报错和工具调用,几个关键词就能搜到。
Chosen turns come back into the conversation, so the model works from the real text, not the summary.选中的轮次回到当前对话,模型照着原文工作,而不是照着摘要猜。
Pins go to the compactor as must-keep notes and come back after every compaction.钉住的内容作为"必须保留"交给压缩,每次压缩后还会重新加回来。
You see how many turns were summarized; the model learns it can look them up instead of guessing.你会看到总结掉了几轮;模型也知道可以去查原文,而不是瞎猜。
Realized too late? /afterimage in a fresh session shows your most recent compacted conversation.事后才发现?在新会话输入 /afterimage,会显示你最近一次被压缩的会话。
Needs Node.js 18 or newer.需要 Node.js 18 或更新版本。
In a terminal.在终端里运行。
claude plugin marketplace add LucasYanzy/afterimage
For your user, in every project.按用户安装,所有项目通用。
claude plugin install afterimage@afterimage
Then type:然后输入:
/afterimage
Clone it somewhere you'll keep it.克隆到一个固定位置。
git clone https://github.com/LucasYanzy/afterimage.git
From the folder holding the clone.在克隆所在的文件夹运行。
codex plugin marketplace add "$PWD/afterimage"
Codex → Plugins → Afterimage → Install, then ask:Codex → Plugins → Afterimage → 安装,然后问:
What did compaction drop?压缩丢了什么?From the transcripts your app already writes: ~/.claude/projects for Claude Code, ~/.codex/sessions for Codex. Both keep messages from before a compaction. Afterimage only reads them.来自应用本来就会写的会话记录:Claude Code 在 ~/.claude/projects,Codex 在 ~/.codex/sessions。两者都保留了压缩前的消息,Afterimage 只读取,不修改。
No. No network requests, no model calls, no API keys. Restored text goes only into the conversation you're in.不会。不联网、不调用模型、不需要密钥。找回的原文只会放进你当前的对话。
Cards appear in the Claude desktop app in a session started after installing. Everything also works as plain text: /afterimage lists the dropped turns and /afterimage 3-5 restores them.卡片需要在安装之后新开的 Claude 桌面版会话里才会出现。所有功能也都能用纯文字完成:/afterimage 列出丢掉的轮次,/afterimage 3-5 就能找回。
Then its turns are gone. Afterimage can only bring back what the app kept on disk.那部分就没了。Afterimage 只能找回应用留在本地的内容。