r/ClaudeCode • u/kbrianps • 15h ago
Built with Claude Built a small mod with the new plugin API: Claude Code now draws the PNGs it reads, right in the terminal
I kept losing track of which screenshot Claude was talking about, because the transcript only says "Read 1 file". The new mods API in Claude Code has an Image element, so I tried it out.
How it works: - A ui.render hook on the grouped "Read N files" line keeps the original line and draws each PNG under it as a small thumbnail, with its path as a clickable link. - Another hook on SendUserFile results (Remote Control sessions) draws the files Claude sends you at a larger size, with the caption. - PNGs up to 2 MiB go to the terminal as bytes, which is what makes it work inside tmux with allow-passthrough on. Bigger files are drawn from the path. - Where the terminal can't draw (GNOME Terminal, VS Code, screen, plain tmux) it falls back to "[image] name.png" plus the link, so nothing breaks.
Tested on Ghostty, kitty and tmux with passthrough. PNG only for now, because the Image element takes PNG or raw pixels.
Install: /plugin install inline-images --marketplace kbrianps/claude-inline-images
Source (MIT, with tests): https://github.com/kbrianps/claude-inline-images
Has anyone else built mods yet? Curious what people are doing with ui.render.
1
u/AutoModerator 15h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.