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.
Connecting an agent
Context Attachment Manager cuts the multimodal tax on any agent: earlier turns' images go out as short placeholders, and the model pulls back the one it needs by its id. The plugin has three layers:
- The core (
plugin/src/core) knows no platform. It decides what to leave out, numbers the images and keeps them for the fetch tool. - Request-format translators (
plugin/src/adapters/protocols) find the images in a request and put the core's decision into it. Four formats today: OpenAI Responses, OpenAI Chat Completions, Anthropic Messages, Gemini generateContent. - Platform adapters (
plugin/src/adapters/<name>) are thin: where the platform's requests go, how they name their session, how the user connects it.
The panel (pick images, pin, search) is only in Codex and Claude Desktop. Every other agent uses the core alone: auto-select is always on, and the model fetches an image with cam_view_image when it needs it.
Agents you can connect now
WorkBuddy, OpenCode, Gemini CLI, pi, DeepSeek Harness, Qwen Code, Cline, Kilo Code, goose and Cherry Studio. These adapters were written from each agent's code and docs and are not tested live yet. If one does not work for you, please open an issue with what you saw.
How to install, step by step (also for an AI doing it for you): INSTALL.md, Other agents. In short, from a clone of this repository:
cam detecttells which agent a shell runs in, from the variables each agent sets for its commands, and prints the next command.cam connect <agent> --applyregisters a route in the local engine, from a local address to where the agent's requests go now, and writes the agent's settings: that address, and the MCP server forcam_view_image. What each setting held before is recorded (the files are never copied: they may hold API keys).cam disconnect <agent>puts back what was there, except settings changed since.cam connect <agent>without--applyonly prints the steps.
DeepSeek Harness needs no route: plugin/src/adapters/dsh is a dsh bundle, installed with dsh plugin --profile <profile> add <folder>. It turns dsh's own image offload (@deepseek-ai/dsh-compaction-image-offload) off and does what it did, offloading the oldest images when a route refuses a request as over its image budget, and also offloads every earlier turn's images when a new turn starts. dsh shows an offloaded image as text with a read-only path, and the model reads it back from there.
Adding your agent
A pull request that adds an agent touches these places:
plugin/src/adapters/<name>/platform.ts: the agent's entry, aCorePlatform(plugin/src/core/platform.ts). WorkBuddy's adapter, in short:export const workbuddy: CorePlatform = { name: "workbuddy", title: "WorkBuddy", upstream: "https://www.workbuddy.cn/v2", sessionOf: (headers) => headerOf(headers, "x-conversation-id"), sideRequest: (headers) => headerOf(headers, "x-agent-type") === "auxiliary", detect: (env) => env.CODEBUDDY === "1" && /* WorkBuddy's own marks */ true, setup: ({ home, env }) => ({ current, fallback, edits }), // what cam connect --apply writes connect: ({ url, mcp }) => [/* the steps cam connect prints */], };plugin/src/platforms.ts: one line inCORE_PLATFORMS.Tests: in
spike/src/platforms.test.ts, a request as your agent sends it, rewritten as expected; inspike/src/connect.test.ts, whatdetectandsetupread and write. Runnode --testfrom the repository root.The "Works with" table at the bottom of
README.md(andREADME_CN.md,README_JA.mdif you can; we will fill them in otherwise): one row with a link, one line on what your agent is, and how far it is tested.
What the engine needs from an agent:
- A way to send its model requests through the engine. Usually a base URL setting;
cam connectregisters the route. The engine keeps every header except its own (x-cam-*), and the credentials stay in the agent's requests. - A request format the translators know. The engine tells it by the path:
/chat/completions,/responses,/messages,:generateContent,:streamGenerateContent. A new format is a new translator inplugin/src/adapters/protocols/<format>/and an entry inspike/src/contract.test.ts, which checks every translator the same way. - A session id, if it has one. Name the header in
sessionOf. An agent with extensions can addx-cam-sessionto each request instead (see the pi extension). Without either, sessions are told apart by their first prompt, which works but can merge two sessions that start with the same words. - A variable it sets for the shell commands it runs (
detect), socam detectand an AI installing the plugin pick your agent and no other. - Settings files
cam connect --applycan write (setup): where the base URL and the MCP servers go. Plain JSON orNAME=valuelines; withoutsetup, the steps are only printed. - An MCP server, so the model has
cam_view_image:node plugin/src/plugin-server.tswithCAM_HOST=<name>. It also keeps the engine running while the agent runs.
An agent that runs plugins inside its own process, like DeepSeek Harness, can do auto-select there instead of going through the engine. Keep its rule the same: when a new turn starts, earlier turns' images leave the request, and the model has a way to get one back.
The panel
The panel stays in Codex and Claude Desktop. Other agents get no panel by default. If you want one for your agent, open an issue first: the panel layer (plugin/src/panel) reads everything through the core, and an adapter that shows it also has to store the user's choices per session (see plugin/src/adapters/claude/panel-web.ts).