Skip to content

Images not passed to Claude CLI - only path reference in text #4

@steipete

Description

@steipete

Bug Description

When an image is sent via WhatsApp, warelay correctly downloads it to ~/.warelay/media/inbound/<uuid> but only passes a text reference to Claude CLI like:

[media attached: /Users/steipete/.warelay/media/inbound/69e31733-e657-4417-bc73-a65d8a538665 (image/jpeg)]

Claude CLI cannot actually read images from a path reference in text - it needs the image passed via the --images flag or some other mechanism.

Current Behavior

  1. Image arrives via WhatsApp
  2. warelay saves it to ~/.warelay/media/inbound/<uuid>
  3. warelay prepends [media attached: <path>] to the prompt text
  4. Claude CLI receives this as plain text and cannot see the actual image
  5. Claude may hallucinate a description based on context

Expected Behavior

Images should be passed to Claude CLI via --images <path> flag so Claude can actually see and analyze them.

Relevant Code

In src/auto-reply/reply.ts:207-220:

const mediaNote = ctx.MediaPath?.length
  ? `[media attached: ${ctx.MediaPath}${ctx.MediaType ? ` (${ctx.MediaType})` : ""}...]`
  : undefined;

Suggested Fix

When invoking Claude CLI and MediaPath is set for an image type, add --images <MediaPath> to the argv:

if (isClaudeInvocation && ctx.MediaPath && ctx.MediaType?.startsWith('image/')) {
  argv.push('--images', ctx.MediaPath);
}

Environment

  • warelay version: 1.2.0
  • macOS
  • Claude CLI invocation via command mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions