You can make five Instagram carousels on Sunday and still post none of them by Wednesday. The design is done; the daily upload is what slips.
This is a content-scheduling recipe, not an agent framework tutorial: a local scheduled task in Claude Desktop plus PublishPort’s Instagram command. The photos and captions already exist.
Who this fits: an account with photos and captions waiting. You get a scheduled task that posts one carousel a day, skips anything already logged, refuses to retry after an uncertain failure, and stops itself when a run is late. It does not supply the photos or the ideas.
Before you start: this is a local setup. The computer must be awake at the time you pick, with Claude Desktop and the PublishPort app running; if it sleeps, the post waits. If you only want the task rules, skip to Step 2 and copy the prompt. The install is what makes it run.
Pick a time you are at the computer. The 9 am default is arbitrary. If 6 pm is when you sit down, change the 9 in the recipe sentence to 6, set the trigger to 6 pm, and change the 2 pm cutoff in the task prompt to 8 pm. The queue does not expire; a folder can wait a day.
The routine it replaces:
- Sunday, 20 minutes: five folders, three to five images each, one
caption.mdeach. - Monday, 9:00: the task publishes the oldest folder, checks the link, moves the folder to
posted/, and writes a line tolog.md. - Tuesday, 9:00: the next folder. When the queue is empty, the task says so and stops.
After the first week, log.md has five lines like this:
2026-11-09 | 2026-11-09-mon | 4 images | https://www.instagram.com/p/...
The first run takes 15 to 20 minutes once the two apps are installed: five to sign in, five to pick the first photos, and the rest watching the upload.
If the computer is asleep at the scheduled time, the run is skipped. Claude Code can catch up later, but the task stops after its late cutoff rather than publish a morning post at the wrong time. A “good morning” post that goes out at 9:40 is worse than no post; the same rule applies to any local scheduled task.
What the Instagram command can do
Checked against the PublishPort command set (publishport-opencli 1.0.48): the command cannot schedule on Instagram itself, so the local task is the schedule, and a folder waits in queue/ if the task does not run. It has no dry run either, so read the caption before you approve the first post. It also does not crop, so export the images in one carousel at the same aspect ratio.
Step 0: Get two things ready
1. Claude Desktop, with the Code tab and Scheduled. Download it from claude.com/download and sign in. This recipe uses a local scheduled task because your images live on your computer. Per Anthropic’s docs, local tasks run while the app is open and the computer is awake, and a run is skipped if the machine sleeps through it.
2. PublishPort, connected to Instagram. Install it from the download page and connect Instagram under Platform accounts (walkthrough). Publishing uses that signed-in session, so there is no Meta developer app or API key. The app must be running when the task fires.
Step 1: Make the folder and run it once
Create a folder called ig-queue, and inside it:
ig-queue/
queue/
01-first-carousel/
01.jpg
02.jpg
03.jpg
caption.md
Put three to five images in the first folder and write caption.md as plain text. The command accepts 1 to 10 images, in .jpg, .jpeg, .png or .webp. If the photos are on your phone, put ig-queue in iCloud Drive or Dropbox, add the images from the phone’s Files app, and wait for them to sync before the run. AirDrop works too. Write the caption the way you would type it in the Instagram app: plain text, first line as the hook, hashtags at the end, under 2,200 characters.
The command needs Node.js 18 or newer. Ask Claude to run node -v; if it is missing or older, install the LTS release from nodejs.org and ask it to check again.
Open Claude Code in the ig-queue folder and paste this:
Read https://www.publishport.app/skill.md and follow it to set up PublishPort for me, then check that Instagram is connected. In this folder, create queue/, posted/ and log.md if they do not exist. I will put one subfolder per post in queue/, each holding 1 to 10 images and a caption.md. Publish the oldest subfolder as an Instagram post (a carousel when there are several images) using the caption in caption.md; if the caption is missing, stop and tell me. Show me the caption and the image count first, then publish it, give me the link, move the folder to posted/ and add a line to log.md. After that, help me create a local Claude Code Desktop scheduled task that publishes the next folder every morning at 9.
The skill file is a short public instruction sheet. It tells the AI how to install itself, ask you for one authorization click, check which accounts are connected, publish, and confirm the post exists. Every AI you authorize is listed on your account page, where you can revoke it at any time.
On the first run, Claude installs the skill and starts the login. You get an authorization link and a confirmation code: open the link, sign in or create a PublishPort account, check that the code matches, and click Authorize. The link lasts 10 minutes; ask for a new one if it expires.
Once the account is connected, it checks that Instagram is signed in, creates posted/ and log.md, reads the first folder, and shows you the caption and the number of images. Edit the caption in the chat if you want, then tell it to publish. The upload follows; it gives you the link, moves the folder into posted/, and adds a line to log.md.
Claude Code asks permission before running commands. Approve them while you are watching; step 2 makes those approvals stick for the scheduled task. If it offers to install the publishing command globally, say yes: the scheduled run then starts without waiting for a download.
Open the link and look at the post. Check three things: the images are in the order you named them, the first image has the crop you expected, and the line breaks in the caption survived. If the crop is wrong, fix the source images before the next run. If the order is wrong, rename the files and put the folder back in queue/.
Step 2: Create the daily task
The recipe already asked Claude to create the task. Open Scheduled in the Code tab’s sidebar and look for a local task on ig-queue at the time you picked.
If it is not there, or you would rather build it yourself, click Scheduled (or Routines in an older build), then New task (or New routine), and choose Set up manually if that menu appears. Turn on Only on this computer, pick the ig-queue folder, and set the trigger to Daily at the time you picked. The official walkthrough covers the other dialog shapes, including the Local / Cloud menu and the full-page form.
Paste this as the task instructions:
This is a pre-approved daily Instagram publishing task. Publish without asking me to confirm, but only as these rules allow.
1. Look in queue/ for subfolders. Sort them by name and skip any folder whose name already appears in log.md. If there are none, stop and tell me the queue is empty. If log.md already has a post line dated today, stop: one post per day.
2. Take the first remaining folder. Stop and tell me if any of these is true: it has no images or a file is not .jpg, .jpeg, .png or .webp; caption.md is missing or empty; the caption is longer than 2,200 characters; it is after 2 pm. Do not truncate the caption, convert files or publish a partial post.
3. Run publishport guide instagram (use npx -y publishport@latest if the command is not installed) and use the post command it shows. Pass the images in filename order and the caption as the content. Give the upload a generous timeout.
4. Verify the post with the returned link or by checking my profile's latest posts. Do not report success without a link or a visible post.
5. Move the folder to posted/ only after the post is confirmed. Append one line to log.md: date, folder name, image count, link.
6. If the command fails or times out, do NOT run it again. Check my profile's latest posts first. Retry once only if the post is not there. If it is there, treat it as success and log the link. If you still cannot confirm, leave the folder in queue/ and write the error at the top of log.md.
7. Finish with a two-line summary: what was posted, what is next.
The rule that matters most: a failed publish command may still have posted. Before you retry, open your profile and check; the task prompt above encodes that as rule 6. It is the one rule worth copying even if you never use the rest of this setup.
Then click Run now once and watch the session. The first time a command needs permission, choose Always allow. Anthropic’s docs note that later runs of that task then approve the same tools without stalling; you can review or revoke those approvals on the task’s detail page.
When you click Run now after the first carousel, the task will stop: either the queue is empty, or today’s post line is already in log.md. That is the one-post-a-day guard working. It will take the next folder on the next scheduled day.
Step 3: Keep the queue full
The task only posts what is in queue/. A week of folders takes about 20 minutes: five folders named 2026-11-09-mon through 2026-11-13-fri, each with three to five images in one shape, named 01, 02, 03, and a caption.md written by the same rules as Step 1. Leave them in queue/; the task takes one per morning.
If writing five captions is the part that stalls you, add a notes.md to each folder with three bullets about the post and ask Claude to draft the caption from those notes in your voice. Give it two or three captions you have actually written as examples, and edit what it produces. The points come from you.
If you only want the automation, stop after Step 2. The task will post whenever you add a folder.
A folder with one image publishes a single post; a separate reels/ queue with .mp4 files can use the Instagram reel command, covered in the short-video recipe.
If something does not run
| Symptom | What to do |
|---|---|
| Nothing was posted at the scheduled time | The computer was asleep, or Claude Desktop was not running. Open the task’s History; skipped runs show why. If the machine sleeps, turn on Keep computer awake under Settings > Desktop app or Settings > This computer > System. A catch-up run may fire later, which is why the prompt has a late cutoff. If Scheduled is missing from the Code tab, update Claude Desktop; local tasks need 1.1.5368 or later. |
| No device online, or Instagram signed out | Start the PublishPort app, sign in again under Platform accounts, and run the task again. |
| The folder is rejected | The caption is over 2,200 characters or empty, or an image is not .jpg, .jpeg, .png or .webp. Fix the folder and run the task again; do not let the AI truncate or convert silently. |
| The command failed or timed out | Do not rerun it blindly. Open your Instagram profile and check the latest posts first. A failed command may still have published. Retry once only if the post is not there. |
| The task stalls on a permission prompt | Open the run from History, answer the prompt, and choose Always allow. |
| The carousel order is wrong | The command follows the filenames. Delete the wrong post in Instagram, rename the images 01, 02, 03 in the order you want, move the folder back from posted/ to queue/, and run the task again. |
Start with three folders this Sunday; the first line in log.md should appear on Monday morning.
