Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/hex/claude-image-generation/generate-imagegit clone --depth 1 https://github.com/hex/claude-image-generationWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/hex/claude-image-generation/generate-image)<a href="https://agentmods.dev/commands/hex/claude-image-generation/generate-image"><img src="https://agentmods.dev/badge/commands/hex/claude-image-generation/generate-image.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00014 | $0.00806 |
| Opus 5 | $0.00007 | $0.00403 |
| Sonnet 5 | $0.00003 | $0.00161 |
| Haiku 4.5 | $0.00001 | $0.00081 |
Grade A, and why
generate-image scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Generate or edit an image based on the user's request.
Process
-
Parse the arguments:
- The main text is the image prompt
- If
--editis present, the next argument is the path to an input image for editing - Determine mode: "edit" if --edit flag is present, otherwise "generate"
-
Ask the user which provider to use with AskUserQuestion:
- Gemini (gemini-3-pro-image-preview): Premium quality, professional asset production, up to 14 reference images
- OpenAI (gpt-image-2): Best for text rendering and transparent backgrounds
- xAI (grok-imagine-image-pro): Premium tier, higher quality, flat per-image pricing
- All in parallel: Generate with all available providers and pick the best result
-
Ask the user where to save the output with AskUserQuestion:
- Current directory (e.g.,
./generated-image.png) - Custom path (let them type)
- Current directory (e.g.,
-
Execute the generation using tasks for progress tracking:
If single provider selected: a. Create a task with TaskCreate:
- subject: "Generate image with "
- activeForm: "Generating image with ..." b. Mark it in_progress with TaskUpdate c. Run the script via Bash:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/<provider>.sh" \ --mode <generate|edit> \ --prompt "<prompt>" \ --output "<output-path>" \ [--input-image "<input-path>"]d. Mark the task completed (or note the error if it failed)
If multiple providers selected: a. Create one task tracking the whole parallel run with TaskCreate:
- subject: "Generate image with all providers in parallel"
- activeForm: "Generating with Gemini, OpenAI, and xAI..."
b. Mark it in_progress with TaskUpdate.
c. Run
scripts/run-all.shin a single Bash call — it opens the streaming pane, forks all providers in parallel, captures their stdio under$DISPLAY_PANE_DIR/logs/, and closes the pane when every provider has returned:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/run-all.sh" \ --mode <generate|edit> \ --prompt "<prompt>" \ --output-base "<base>" \ [--input-image "<input-path>"]Each provider produces
<base>-gemini.png,<base>-openai.png,<base>-xai.png. To run a subset, pass--providers gemini,openai. To pass per-provider tuning, use--gemini-extra "...",--openai-extra "...",--xai-extra "...". d. Mark the task completed when run-all.sh exits. Its exit status reports whether any provider failed; per-provider error details are in$DISPLAY_PANE_DIR/logs/<provider>.errand shown inline in the streaming pane as a red error banner. -
After generation completes, confirm the output path(s) to the user. If multiple were generated, let the user know all files are available so they can compare.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 72 lines · 14 tokens per session scan A 4f77b188fa86
generate-image is a command published in the GitHub repository hex/claude-image-generation (8 stars, last pushed 14d ago), licensed MIT. It adds 14 tokens to every session and 806 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
media
Understand an audio / video / image file — Antigravity (agy/Gemini) transcribes and analyzes it, returning a timestamped digest while the full transcript goes to a file.
watch-video
Watch and analyze a video file or YouTube URL — extracts frames and audio for understanding.
media
Ask a question about an AUDIO, VIDEO or IMAGE file (or a YouTube/remote URL) with Antigravity (agy / Gemini 3.x multimodal). Beyond transcription — "what decisions were made in this meeting?", "what happens at 2:30 in the video?", "what's the tone of this voice note?". Claude Code can't see/hear media; agy can.
transcribe
Transcribe and summarize an AUDIO or VIDEO file (or a YouTube/remote URL) with Antigravity (agy / Gemini 3.x multimodal) — something Claude can't do natively. Voice notes, meetings, calls, screencasts. Faithful transcript + summary; timestamps for video/URLs. Saves to docs/agy/transcripts/.
video
WATCH a video and return a structured VISUAL breakdown (not just a transcript) with Antigravity (agy / Gemini 3.x, natively multimodal in video). Scene-by-scene segments with timestamps, on-screen text/OCR (slides, charts, UI, captions), key visual events, and a summary. For screencasts, tutorials, presentations…
gemini-imagegen
Generate or edit an image via a Gemini (agy) session — Gemini's generateimage tool does what Claude cannot.