Spaces

How to connect Claude Code to your Instagram DMs and comments

For a small brand that sells through Instagram, a launch day is two inboxes at once. The comments fill up with "price?" and "do you ship to Ireland?", and the DMs fill up with the longer questions. Answering both by hand while you are also packing orders is hard. Claude Code runs in a terminal on your computer and can keep listening for new comments and messages, so it can draft an answer within moments. With Spaces connected, it can reply from your own Instagram account. This guide covers the setup, a worked launch day at a candle maker, how to treat comments differently from DMs, and the Instagram limits Spaces keeps it inside.

What you need

  • Claude Code installed and signed in on your computer.
  • A Spaces account. The Free plan starts when you connect a chat account, with no card needed.
  • The Instagram account your customers message, with two-step verification turned on.
  • A folder with a short notes file: products, prices, shipping, and the things you never want said in public.
  • If you want Claude Code to keep listening on busy days, a computer that stays on and awake.

Step 1: connect your Instagram account to Spaces

You sign in to Instagram through a secure link and approve the connection. Your account stays yours, and you keep using it on your phone as normal.

Once it is connected, the account shows in your Spaces dashboard. Connecting does not send anything. It only means Spaces can read and send on that account when an AI agent you have added asks it to.

Turn on two-step verification in Instagram before you connect: it helps the sign-in go through. Business and Creator accounts can also connect through Meta’s own business sign-in, on its own or next to the usual sign-in. Spaces then uses it for everything it can do and keeps the usual sign-in for outreach. Read the note at the top of this page too, because Instagram restricts automation on accounts.

Step 2: add Spaces to Claude Code

  1. Run the command below once. Add --scope user to use Spaces in every project.
  2. In Claude Code, type /mcp, pick spaces and sign in to Spaces in the browser.
  3. Approve the access Spaces asks for. No key is pasted anywhere.
claude mcp add --transport http spaces https://api.spacesos.com/mcp

To check it worked: Run claude mcp list. Spaces shows as connected, and /mcp lists its tools.

Prefer an API key? Add it as a header instead of signing in.

claude mcp add --transport http spaces https://api.spacesos.com/mcp --header "Authorization: Bearer spc_live_…"

You sign in on Spaces' own page during this step, so Claude Code never sees your Instagram login or your Spaces password. If Spaces does not show up:

  • Check the address is exactly https://api.spacesos.com/mcp, with nothing added at the end.
  • Run the sign-in step again, in case the first sign-in in the browser did not finish.
  • Restart Claude Code so it reads the new settings.
  • If it still does not appear, the Claude Code MCP docs have the current steps, and our Claude Code setup page has ours.

Step 3: try it

Open a terminal in the folder with your notes file, start Claude Code and ask in plain words. Start with requests that only read:

  • List my Spaces accounts and tell me which one is Instagram.
  • Show me today's Instagram DMs and message requests that have no reply.
  • List the comments on my latest post and group them by question.
  • Draft replies to the shipping questions using notes.md, and show me before sending.

Start with a question that only reads, like the first one. It shows you that Claude Code can see your Instagram messages before you let it send anything. Then try a draft, read it carefully, and only then let it send.

Good to know

Claude Code can keep running without you starting each conversation, which suits the busy hours after a post goes up. It can also reply while you are not looking, so start with drafts and keep Claude Code's own tool approvals on until you trust what it writes.

Comments are public and DMs are private. Treat them differently. A short public reply that answers the question for everyone is fine; anything about an order, a complaint or a personal detail belongs in a DM or with you.

A Spaces routine can also reply to a keyword in a comment and, on Instagram, message the commenter. A routine is not an AI. It sends text you wrote in advance, and it runs on Spaces even when your computer is off.

What Claude Code can do on Instagram through Spaces

  • Read your DMs and message requests, and reply in the conversation.
  • List your posts, read their comments and replies, and reply under a comment.
  • Send the person who commented a private reply as a direct message, when Instagram allows it.
  • React to messages and comments, and delete a comment your own account wrote.
  • Hear about new messages and comments as they arrive, through wait_for_events.

Hiding a comment is not available, so if a comment needs to go, do it yourself in the Instagram app. Posting is possible within tight limits, but most owners keep their own posts in their own hands.

A worked example: launch day at a candle maker

Here is how the first hours after a launch post might go for a one-person candle brand. Claude Code is running in a terminal with tool approvals on. Names and details are examples.

WhoMessage
Comment on the launch postprice?? 😍
Claude Code, in the terminalThree comments ask the price of the new fig candle. The notes say £24 and that prices can go in public. Draft public reply: "Thank you! The fig candle is £24, and it is in the shop now." Reply under each?
Owner, in the terminalReply under the first one only, and send the other two a private reply with the shop link.
Claude Code, in the terminalDone. One public reply, and two private replies sent as DMs: "Hi! The fig candle is £24. Here is the link to the shop: [link]."
Customer, in a DMDo you ship to Ireland? And is the wax vegan?
Claude Code, in the terminalDraft from the notes: "Hi Niamh, yes, we ship to Ireland, and the cost shows at checkout. Our wax is a soy and coconut blend with no animal products." Send it?
Owner, in the terminalSend.

One public reply answers the question for everyone who scrolls past, and private replies to the rest keep the comments from filling up with the same answer. Spaces paces the replies, so nothing goes out in a burst. Replies to DMs from people who wrote in: no daily limit, at least 15 seconds apart.

Comments or DMs: which reply goes where

What was askedWhere to answerWhy
Price of something in the postOne public reply, then private repliesEveryone sees the answer once; the rest get a link
Shipping countries, sizes, materialsPublic reply or DMUseful to everyone, nothing personal
Anything about an orderDM, or leave for youOrder details are private
A complaint in the commentsLeave for youA person should answer in public
Rude or spam commentsNo replyDeal with them in the Instagram app
"Collab?" from another accountLeave for youYou decide who you work with

Notes for Claude Code

Keep customer facts in your Spaces business brief, which every agent reads, and keep the working rules in a notes file in Claude Code's folder. An example:

# notes.md: Instagram for Ember & Fig Candles
Read the Spaces business brief before every reply.
Listen with wait_for_events for new messages and new comments. Never check in a loop.
Comments: answer one price question in public, then send private replies to the rest.
Never write in public about orders, refunds, delivery problems or allergies. Leave those for me.
DMs: draft every reply and show me first, unless it is shipping, price or materials from the brief.
Tone: warm and short. One emoji at most, only if they used one.
Never: promise a restock date or a delivery date. Never ask for card details in a DM.

Listening on a busy day

Ask it to call wait_for_events, which waits until something new arrives and returns it at once, then to call it again with the next_cursor it was given. Checking the chat list over and over looks like a bot to the platforms, and wait_for_events does not touch the platform at all. New DMs arrive as message.received and new comments as comment.received, so one call covers both.

Reading your own conversations is paced by Spaces rather than capped, which means Claude Code can read as much as it needs, a little at a time. If Spaces says to wait a few seconds before reading again, that is Spaces' own pacing, not a block from Instagram. Tell Claude Code to wait and carry on.

Instagram limits that shape the day

  • Comments: up to 10 an hour and 100 a day, shared with likes, follows, posts and new conversations.
  • Posts: part of the shared 10 an hour and 100 a day with likes, comments, follows and new chats.
  • Replies to people who wrote in: no daily limit, at least 15 seconds apart.
  • If Instagram pushes back on an action, that request is refused with a retry time. Reading conversations and other actions keep working
  • Instagram only lets you message someone who has not replied inside its messaging window, so replies in existing chats work best.

On a launch day the comment limit is the one you are most likely to meet, which is another reason to answer one comment in public and move the rest to private replies.

Drafts first

Ask your AI agent to hold replies as drafts, and nothing goes out until you approve it. Claude Code turns this on for you with set_approvals, either for every message or only for posts. You then ask it to list what is waiting, and approve or reject each one. Many owners keep public comment replies held for good, and let DMs about shipping and prices go out once the drafts are reliably right.

If something goes wrong in the middle of a busy day, pause all sending in Spaces under Settings, then Pause everything. Reading keeps working while it is paused.

What if...

  • Instagram asks you to confirm it is you? Do it yourself in the Instagram app. Claude Code never types your passwords or codes.
  • Someone comments with an order problem? Ask Claude Code to leave it for you, and reply personally, ideally moving it to a DM.
  • The same question comes in a hundred times? Answer it once in public and pin that comment yourself in the app, or put the answer in your caption next time.
  • Your computer is off overnight? Claude Code stops with it. A Spaces routine can send a set reply to a keyword comment while you sleep.

Common mistakes to avoid

  • Replying publicly to every identical comment. It fills your comments and uses up the comment limit fast.
  • Letting Claude Code answer complaints in public. Keep those for a person.
  • Connecting without two-step verification, so the sign-in fails at the worst moment.
  • Checking for new comments in a loop instead of using wait_for_events.
  • Following or liking lots of accounts to "boost" a launch. Those actions share the same small allowance and are what Instagram restricts.

Summing up

With Spaces, Claude Code can keep up with your Instagram DMs and comments on the days you need it most. Add it with one command, keep facts in the business brief and rules in a notes file, answer one comment in public and the rest in private, hold replies as drafts until you trust them, and let Spaces keep the account inside Instagram's limits.

How Spaces keeps your account safe

Whatever you ask, Spaces keeps your Instagram account inside safe limits: at least 15 seconds between messages, up to 150 a day, and 100 new conversations a day at most, with a gentler start for a newly connected account. If your AI tries to go faster, Spaces holds the message and says when it can try again.

New conversations warm up over the first weeks after you connect:

Since connectingNew chats an hourNew chats a day
First 3 days222
Rest of week 1440
Week 2660
Weeks 3 and 4885
After that10100

Instagram only lets you message someone who has not replied inside its messaging window, so replies in existing chats work best.

These are Spaces' own limits. They lower the risk of a restriction, but they cannot remove it, because Instagram makes its own decisions about accounts. Read the note at the top of this page before you connect.

Pricing

Free to start, then $9 per connected account a month

FAQ

Can Claude Code reply to Instagram comments as well as DMs?

Yes. Through Spaces it can read comments on your posts, reply under them and send the commenter a private reply as a DM when Instagram allows it. Comment replies have their own limits, so answer one in public and the rest in private.

Can Claude Code hide rude comments?

No. Hiding a comment is not available through Spaces. Hide or delete it yourself in the Instagram app, and ask Claude Code to leave those comments alone.

Does it work with message requests?

Yes. Messages from people who do not follow you arrive as message requests, and Claude Code can read and reply to them like any other DM. Our guide to message requests explains how Instagram sorts them.

Do I need a Business or Creator account?

No, the usual sign-in works with your own account. Business and Creator accounts can also connect through Meta's own business sign-in, which Spaces then uses for what it covers.

Will Claude Code keep replying while my laptop is shut?

No. Claude Code stops when the computer sleeps. A Spaces routine runs on Spaces itself and can send a set reply to a keyword comment while you are away. A routine is not an AI.

What if Instagram pushes back on the account?

If Instagram pushes back on an action, that request is refused with a retry time. Reading conversations and other actions keep working. Tell Claude Code to wait for the time Spaces gives rather than try again.

Can Claude Code post for me?

It can, within Instagram's limits in Spaces (part of the shared 10 an hour and 100 a day with likes, comments, follows and new chats). Most owners prefer to post themselves and use Claude Code for the replies that follow.

Does Claude Code see my Instagram password?

No. You sign in to Instagram on Spaces' secure link, and Claude Code signs in to Spaces. Neither your Instagram login nor your Spaces password goes into Claude Code.

Related

More articles

InstagramInstagram story replies and mentions: how to answer them11 Nov 2026 · 11 min readInstagramRestrict, block or mute on Instagram: which should a business use?11 Nov 2026 · 8 min readInstagramRunning more than one Instagram account for your business11 Nov 2026 · 8 min read