Skip to content

feat: hint Claude to read image files via Read tool#1

Open
clairewangjia wants to merge 1 commit intoLinekForge:mainfrom
clairewangjia:feat/image-read-hint
Open

feat: hint Claude to read image files via Read tool#1
clairewangjia wants to merge 1 commit intoLinekForge:mainfrom
clairewangjia:feat/image-read-hint

Conversation

@clairewangjia
Copy link
Copy Markdown

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/channel only contains a plain text line like:

[图片] 已保存到 /path/to/img_xxx.jpg

Claude sees this as a file path string but has no cue to actually view the image. Since Claude Code's Read tool supports reading image files (it's a multimodal LLM), adding a simple hint resolves the issue:

[图片] 已保存到 /path/to/img_xxx.jpg
请用 Read 工具查看该图片文件来了解图片内容。

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: In extractContent(), after saving image path to message parts, add a hint telling Claude to use its Read tool to view the image file.

Test plan

  • Send an image via WeChat to Claude Code session
  • Verify Claude reads the image file and describes its content correctly
  • Verify no regression for text messages, voice, video, file handling

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant