feat: hint Claude to read image files via Read tool#1
Open
clairewangjia wants to merge 1 commit intoLinekForge:mainfrom
Open
feat: hint Claude to read image files via Read tool#1clairewangjia wants to merge 1 commit intoLinekForge:mainfrom
clairewangjia wants to merge 1 commit intoLinekForge:mainfrom
Conversation
When a WeChat image is received, the extracted content now includes a prompt telling Claude to use its Read tool to view the image file. Previously, only the file path was passed as plain text, so Claude had no cue to actually look at the image content. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When users send images via WeChat, they are correctly downloaded, decrypted, and saved locally. However, the message passed to Claude Code via
notifications/claude/channelonly contains a plain text line like:Claude sees this as a file path string but has no cue to actually view the image. Since Claude Code's
Readtool supports reading image files (it's a multimodal LLM), adding a simple hint resolves the issue:This is consistent with how video frames are already listed with paths for Claude to read (lines 385-401 in media.ts).
Changes
media.ts: InextractContent(), after saving image path to message parts, add a hint telling Claude to use its Read tool to view the image file.Test plan
🤖 Generated with Claude Code