Add a 1200×630 Open Graph image — Claude Code
Missing or undersized og:image is why LinkedIn and Slack previews look empty. 1200×630 PNG/JPEG is the spec every social platform expects.
Fixing this in Claude Code
Anthropic's official terminal coding agent
Claude Code can grep the whole codebase first, plan the change, then edit every affected file. Paste the prompt below into your Claude Code chat and the fix rolls out across the project in one pass.
Using a different tool? Pick your stack:
The prompt for Claude Code
Copy and paste this into your Claude Code chat exactly as-is.
Run Claude Code in the project root and make these exact changes, scanning the whole codebase first: Add an Open Graph image 1. Create a 1200x630px image for social sharing. 2. Add <meta property="og:image" content="https://yoursite.com/og-image.png"> to <head>. 3. Host the image on your own domain, not an external CDN.
Why this matters
Social and chat previews are often the first impression. A well-designed OG image lifts link CTR by 30-80% on social. No image = no preview card = scrolled past.
Dynamic OG images (Next.js ImageResponse, Vercel OG) can generate per-page cards automatically from page data — high impact, low maintenance.
How to use this prompt in Claude Code
- 1. Open your Claude Code project.
- 2. Copy the prompt above with the copy button.
- 3. Paste into the Claude Code chat and send.
- 4. Review the diff, accept the changes, redeploy.
- 5. Verify the fix using the checklist below.
Common mistakes to avoid
- error_outlineUsing a square logo as og:image — LinkedIn and Slack crop it.
- error_outlineServing the image from a fragile URL (e.g., behind auth).
- error_outlineForgetting the absolute URL — relative URLs break many scrapers.
- error_outlineText in OG image too small to read at preview size.
How to verify the fix worked
- check_circlehttps://www.opengraph.xyz/ shows the image.
- check_circlePaste URL into LinkedIn/Slack/WhatsApp — preview renders.
- check_circleTwitter Card Validator passes with summary_large_image.
Frequently asked questions
Dynamic or static OG images?expand_more
JPEG or PNG?expand_more
Want all 34 prompts tailored to your Claude Code site?
Pantra scans your site in 10 seconds, detects the stack, and generates the exact prompts that apply — only the ones you actually need.
Scan my siteRelated Claude Code prompts
Add Open Graph + Twitter Card tags — Claude Code
Prompt to add og:title, og:description, og:image, and Twitter Card meta so links look right when shared on Slack, LinkedIn, WhatsApp, Twitter.
TechnicalAdd a high-resolution favicon — Claude Code
Stack-specific prompt to add a favicon that shows up correctly in browser tabs and Google search results.
ImagesConvert images to WebP or AVIF — Claude Code
Prompt to convert JPEG/PNG to WebP or AVIF — 30-50% smaller at the same quality. Helps LCP and CLS.
ImagesAdd alt text to all images at once — Claude Code
Prompt to walk every <img> tag and add descriptive alt attributes in bulk — fast alternative to one-by-one fixing.