Guide · Comment to DM · Claude Code

Set up Instagram comment-to-DM automation from Claude Code

Short answer: connect Instagram to Claude Code with Scorper, run scorper connect --dm once for the messaging permission, then say “add a DM automation to my next post, keyword GUIDE, send my link”. Commenters who type GUIDE get the link by DM. No ManyChat, no per-contact fees.

Updated 5 November 2026

Before you start

  • An Instagram Business or Creator account. Meta's messaging API does not work with personal accounts.
  • Claude Code with Node 18 or newer. (Codex and Cursor work identically; the Claude app uses a connector URL instead.)
  • A link to send: a PDF, a webinar page, a discount code page.

Step by step

  1. 1

    Install Scorper in Claude Code

    Claude Code chat, or a terminal
    npx scorper@latest init

    Sign in with the 6-digit code emailed to you. New accounts pick a plan and get 7 days free, card needed to start.

  2. 2

    Connect Instagram

    connect my instagram

    Approve in the browser. Make sure the browser is logged into the right Instagram first.

  3. 3

    Grant the messaging permission (once)

    Terminal
    scorper connect --dm

    Instagram needs one extra approval for DMs. This opens it. You do this once per account.

  4. 4

    Arm a post

    add a DM automation to my next post, keyword GUIDE, send my webinar link https://yourbrand.com/webinar
    Claude replies
    ⏺ Armed. The moment your next post goes live, commenters who say GUIDE get the link.
       Early comments are caught too.

    Prefer a specific post? “add it to my latest post” or paste the post link.

  5. 5

    Post, or let the next post trigger it

    post the video on my desktop called launch.mp4 to instagram, caption: comment GUIDE and I'll send you the free guide

    Claude reads the post back, you confirm, it goes live, and the automation starts watching comments.

  6. 6

    Manage it from the chat

    list my DM automations
    pause the GUIDE one
    delete it

    The dashboard's Auto-DM page shows the same list.

Variations that work

You wantSay
Post and arm in one go"post this and DM my PDF to everyone who comments GUIDE"
A button before the link"two-step: send a button first, then the link when they tap"
A different keyword per post"keyword LINK on this one"
Catch people who already commentedArm it on an existing post; early comments are caught
Run it from a cron jobUse Claude Code's claude -p with the same prompt

Troubleshooting

SymptomFix
"Instagram needs an extra permission"Run scorper connect --dm and approve.
DMs aren't arrivingConfirm the account is Business or Creator, then say "reconnect my instagram" and re-run scorper connect --dm.
Claude doesn't know the automation toolsRun scorper doctor and start a fresh Claude Code session.
Meta lets a professional account privately reply to someone who has just commented on its post. That is what this uses. It never messages people who did not interact.

Frequently asked questions

Can I arm an automation on a post I published from the dashboard or the Instagram app?
Yes. Say "add a DM automation to my latest post" or name the post. The automation attaches to the post regardless of how it was published.
What happens if two people comment the keyword at once?
Each commenter gets their own DM. The automation watches comments through Meta's webhooks and replies to each one.
Can I change the message later?
Delete the automation and arm a new one with the new text, or edit it on the dashboard's Auto-DM page. Both views show the same rules.
Does the keyword have to be an exact match?
Pick a distinctive word (GUIDE, PDF, LINK). Casual variations in casing are fine; a common word like "yes" will trigger on people who did not mean to ask.
Does this work from Codex, Cursor or the Claude app?
Yes. The same prompts work in Codex and Cursor after the one-line install, and in the Claude app through the connector URL.

Arm your next post in one sentence

npx scorper@latest initStart free for 7 days

7 days free on every plan. The AI-agent connection is on Max ($25/month) and Studio.