Context Attachment Manager 為 Codex desktop 和 Claude Desktop 的 Code tab 管理長對話圖片歷史
I built an image-history manager for long Codex and Claude conversations
作者開發 MIT 授權的本地插件 Context Attachment Manager,供 Codex desktop 和 Claude Desktop 的 Code tab 按需省略歷史圖片,並讓模型按 ID 取回原圖。
I was iterating on images with GPT in one long Codex task when the conversation started repeatedly reconnecting. In that task, requests carrying the accumulated image history had grown to about 44 MB.
Starting a new conversation reduced the baggage, but separated me from the references, previous edits, and feedback I wanted to keep using.
That led to Context Attachment Manager, an MIT-licensed local plugin for image-heavy conversations in Codex desktop and Claude Desktop's Code tab.
GitHub repository · Install instructions
Keep the conversation; retrieve images when needed
With Auto-select enabled, images from earlier turns can be left out of later requests. When the model needs to inspect an earlier image, it can fetch that image back by its ID.
For a character reference or another image that should always remain visible, pin it to send every turn. If you prefer to decide yourself, turn off Auto-select and use the panel's checkboxes.
The aim is to keep working in the same conversation while reducing repeated image transfers. It does not require moving the conversation to another service.
Find an image by what you remember
The panel supports searching visual descriptions and your own feedback. Instead of remembering a filename, search for something like "rainy night" or "best face", then open the original.
The model records short image features and user feedback as retrieval cues. Those cues can survive conversation compaction, helping it locate the corresponding image later. They are not a substitute for looking at the original when a question depends on fine visual details.
A measured example, with a narrow claim
In one 15-image test in the project, the next request body dropped from 24.9 MB to 212 KB.
That is a result from that particular scenario. It is not a promise for every conversation, a token-cost measurement, or proof that every reconnect has the same cause. The effect depends on the images retained and the images fetched back during the turn.
The panel estimates request size so the change is visible before sending.
How the local plugin works
A loopback-only engine sits between the client and its configured model endpoint. It replaces unneeded historical image payloads with numbered placeholders and forwards the request. An MCP tool lets the model retrieve an original image when necessary.
The panel handles search, previews, pinning, and manual selection. Original conversation records and image files remain read-only. The plugin does not send an extra copy of the conversation to a separate cloud service; normal model requests still go to the configured provider.
Version 0.9.0 binds each route to both the client platform and its original upstream. Compatible custom endpoints can use image management too. They must support the client's API format, image inputs, and tool calls: the plugin does not translate between Responses and Anthropic Messages.
Current scope
- Codex desktop and local sessions in Claude Desktop's Code tab. Ordinary Claude Chat is outside the integration.
- Windows, macOS, and Linux. Windows is the primary manual-testing platform; three-platform CI covers unit tests and installation, startup, upgrade, and uninstall checks.
- English and Simplified Chinese interfaces.
- MIT licensed, written in TypeScript/Node.
Live third-party gateway model calls have not been tested by the maintainer. The plugin also does not shrink the original history files or repair unrelated networking, local rendering, or model-capacity problems.
Try it, report a problem, or contribute
You can ask Codex, or Claude in Claude Desktop's Code tab, to install the plugin by following INSTALL.md. After installation, restart Codex or start a new Claude Code session.
In Codex, open Context Assets in the task's side panel. In Claude Desktop Code, the panel opens once the conversation has images, and /cam opens it again.
I'm looking for feedback from people who repeatedly edit images, compare visual references, or accumulate screenshots during a long task. Reports from real desktop workflows on macOS/Linux and compatible custom endpoints would be particularly useful.
Please include the client version, platform, and reproducible steps when reporting a problem. PRs are welcome.
Disclosure: this article was drafted and published with an AI agent, using the project's existing documentation, implementation, and recorded test results.
來源:DEV Community · dev.to
