dlgod7/image-context-cascade — explained in plain English
Analysis updated 2026-05-18
Stop an AI coding agent session from growing huge or crashing after many pasted screenshots.
Rescue an existing bloated Claude Code or Codex session file to make it small again.
Automatically archive old images at the end of a Claude Code session via a hook.
Restore a specific archived image later by its hash if the agent needs to see it again.
| dlgod7/image-context-cascade | alamops/agetor | aza-ali/blendpixel.com | |
|---|---|---|---|
| Stars | 12 | 12 | 12 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | hard | easy |
| Complexity | 3/5 | 4/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Behavior and automation level depend on which coding agent host you use (Pi, Claude Code, Codex, or generic).
image-context-cascade solves a specific problem that shows up when using AI coding agents like Claude Code or Codex: every screenshot you paste into a conversation gets resent in full, as base64 text, on every single request after that, even many turns later. In one measured session, screenshots ate over 86 percent of the context window, and requests can grow so large the session simply breaks with an error. This tool fixes the problem before a request ever leaves your machine, by downgrading older images to small, stable placeholders while keeping the images from the current turn intact. It sorts images into three tiers: hot images from the current turn are sent as is, warm images from recent history can get optional thumbnails, and cold images from older history become tiny placeholders that can be restored later by their hash if needed. Nothing is ever permanently deleted, only archived, and only images are touched, so the actual text of a conversation stays unchanged. Measured results show a single 1.3 megabyte image shrinking to 315 characters, and in one real session, downgrading four historical images cut input tokens from over 91,000 down to under 2,000. A full 50 megabyte session was reduced to about 2 megabytes with one command. Setup differs slightly by which coding agent you use. Some agents with the right hooks get this handled automatically on every request, Claude Code archives images automatically when a session ends, Codex needs the agent to propose the action for approval, and any other agent can use a manual command line tool on its session file. The project has no runtime dependencies and works with Anthropic, OpenAI Chat, and OpenAI Responses style request formats. Known limits include that it only handles images and not general text, it only recognizes exact byte-identical images rather than resized copies, and images referenced only by remote URL rather than embedded data are not processed. The README does not state a license.
A middleware tool that shrinks AI coding agent sessions by turning old pasted screenshots into small, restorable placeholders before each request is sent.
Mainly TypeScript. The stack also includes TypeScript, Node.js, Claude Code.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.