/instagram-ai-plugin:instagramfrom instagram-ai-plugin
Drives the user's own Instagram account from the terminal through the same private endpoints instagram.com's web client uses, authenticated with the user's browser session cookies (no Graph API app, no Apify). Signs in via Chrome or imported cookies, reads profiles, posts, reels, comments, hashtags and search, computes account metrics, and publishes photos, carousels, reels and stories, edits captions and replies to comments (it never deletes), always as a dry run until the user approves. This skill should be used when the user says "post this to Instagram", "upload a reel", "publish a carousel", "log in to Instagram", "import my Instagram cookies", "post a story", "edit the caption on", "am I logged in to Instagram", "show my recent posts", "get stats for this post", "get this profile's posts", "reply to that comment", or mentions an instagram.com URL, even without saying "Instagram skill".
Ships in instagram-ai-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Run every command from this skill directory:
cd <skill-dir> # the folder containing this SKILL.md
npx -y bun scripts/main.ts <command> [options] # add --json for a machine envelope
No install step: Bun runs the TypeScript directly and the scripts have zero npm dependencies.
ffmpeg is optional (PNG/WebP to JPEG conversion and reel cover frames).
post, edit-caption, comment and reply
print the exact requests and validation result and send nothing. Show the user the media,
caption and warnings, get an explicit yes for that post, then re-run the same command with
--confirm --account <username>. Approval for one post never covers the next one.
The dry run shows signedInAs: say which account the post will go to, and if it is not the
account the user means, stop and have them login --force as the right one. --account is
required with --confirm, and the write refuses if the session is another account.--confirm alone only once its
contract is verified-live (status lists them). Photos, carousels, reels, stories, comments and replies are verified
(reels through the "comet async" form instagram.com requires since 2026-11-12; verified 2026-11-13). Reel tags
(--tag) and the AI label (--ai-label) are verified too (2026-11-13). Collaborator invites
(--collab), the story AI label and edit-caption still need --experimental. Story mentions
(--mention) were tried live and did NOT take: tell the user to add the mention in the app. Tell the user the endpoint has not been proven on a real
account and may fail, and suggest a test account for the first try.rate_limited (HTTP 429), checkpoint, feedback_required
or not_logged_in, stop all Instagram calls and report the error's hint. Never retry in a
loop, never switch endpoints to get around it.pending check <id>, ask the user to look at the
profile, and resolve with pending resolve <id> --posted|--not-posted.
Only one publish runs at a time; a second one is refused while the first is running. A
crashed run's lock is ignored automatically. pending unlock only tidies up those files.status shows redacted lengths only.npx -y bun scripts/main.ts login # opens Chrome (dedicated profile); sign in, 2FA is fine
npx -y bun scripts/main.ts login --force # always re-open Chrome (--timeout <sec>, default 300)
npx -y bun scripts/main.ts import-cookies cookies.json # Cookie-Editor JSON, cookies.txt, or "Cookie:" header
npx -y bun scripts/main.ts whoami # confirms the session against Instagram
npx -y bun scripts/main.ts status # offline: saved cookies (redacted), pending publishes
npx -y bun scripts/main.ts logout # deletes cookies, caches and the Chrome profile (--keep-profile keeps it)
The session needs sessionid, csrftoken and ds_user_id for .instagram.com. sessionid
is HttpOnly, so login reads cookies over the Chrome DevTools protocol. The data directory
(%APPDATA%\instagram-ai, ~/Library/Application Support/instagram-ai, or
$XDG_DATA_HOME/instagram-ai) is locked to the current user before anything is written
(icacls on Windows, 0700/0600 elsewhere). If that fails, nothing is saved. INSTAGRAM_COOKIES
can carry a session for one process without touching disk.
npx -y bun scripts/main.ts profile [username] # default: own account
npx -y bun scripts/main.ts posts [username] --limit 30 # default: own account; newest first
npx -y bun scripts/main.ts media <url|shortcode|id>
npx -y bun scripts/main.ts comments <url|shortcode|id> --limit 50
npx -y bun scripts/main.ts hashtag <tag> --limit 24
npx -y bun scripts/main.ts search <query>
npx -y bun scripts/main.ts audit [username] --limit 30 --tz America/Bogota
npx -y bun scripts/main.ts swipe user1,user2,user3 --limit 24 --min 3
Every read reports via, meaning which endpoint answered. Reads try the REST endpoints first,
then a GraphQL persisted query whose doc_id is discovered from the live web bundles. The last
resort is the 12 posts embedded in the profile response. When via says "embedded, max 12",
tell the user the sample is small. Counters can be null when the owner hid like counts.
Reach, saves, shares and profile visits are Insights-only and never available here.
audit returns the metric set used by the instagram-audit skill. swipe scores each post
against its own account's median, and is used by instagram-research. Keep research small: at
most 12 accounts per run, and the CLI spaces requests at least 1.5 s apart.
# 1. Dry run: show this output to the user
npx -y bun scripts/main.ts post photo ./img.jpg --caption-file caption.txt --alt "Alt text"
npx -y bun scripts/main.ts post carousel ./1.jpg ./2.jpg ./3.mp4 --caption "..."
npx -y bun scripts/main.ts post reel ./reel.mp4 --caption "..." --cover ./cover.jpg # or --cover-at 1.5
npx -y bun scripts/main.ts post story ./story.jpg
# 2. After explicit approval of that exact post
npx -y bun scripts/main.ts post photo ./img.jpg --caption-file caption.txt --alt "Alt text" --confirm --account <username>
--experimental stays required until that write type is marked verified-live.
Options: --disable-comments, --hide-likes, --no-feed (reel only on the Reels tab),
--max-hashtags N (default 5, Instagram's current cap), --ignore-pending (only after the user
resolved pending publishes by looking at the profile).
Validation before anything is uploaded:
| Rule | Limit |
|---|---|
| Caption | 2,200 chars; 5 hashtags; 20 mentions; warning when the first line is over ~125 chars |
| Feed images | aspect 4:5 to 1.91:1; 8 MB; JPEG (other formats converted with ffmpeg) |
| Carousel | 2 to 20 items; mixed aspect ratios are cropped to the first (warning) |
| Reel | 3 s to 15 min; H.264/HEVC; 9:16 recommended (warning otherwise) |
| Story | photo or video (up to 60 s); 9:16 recommended |
Prefer a caption file (--caption-file) for anything with line breaks or quotes, to avoid shell
quoting problems on Windows. Lint captions first with the instagram-content skill's
caption-lint.ts.
npx -y bun scripts/main.ts edit-caption <ref> --caption-file new.txt [--confirm --account <username> --experimental]
npx -y bun scripts/main.ts comment <ref> --text "..." [--confirm --account <username>]
npx -y bun scripts/main.ts reply <ref> <commentId> --text "..." [--confirm --account <username>]
Every confirmed write appends a line (ids, urls, never cookies) to actions.jsonl in the data
directory. Use it to find what the CLI posted, or to finish a failed cleanup by hand.
| Kind | Meaning / action |
|---|---|
not_logged_in | Session expired: login --force or import-cookies |
checkpoint | Instagram wants a security check: user completes it in a browser, then login --force |
rate_limited | 429: stop for 15 to 30 min; do not retry |
feedback_required | Action blocked: stop writes for 24 h |
not_found / unexpected_response | Endpoint moved: run probe, then update scripts/endpoints.ts |
bad_request | Payload rejected: compare with the web client (see references) |
validation | Input problem; nothing was sent |
probe [--refresh-config] [--graphql] checks the main endpoints with a handful of GETs and
stops at the first 429. Run it only when diagnosing, not routinely.
references/endpoints.md: every endpoint, request contract and evidence status, how to
re-verify them from the live web client, and what to edit when Instagram changes something.scripts/endpoints.ts (the endpoint table), scripts/publish.ts (write contracts and
CONTRACTS status), scripts/graphql.ts (doc_id discovery).| Variable | Purpose |
|---|---|
INSTAGRAM_DATA_DIR, INSTAGRAM_COOKIE_PATH, INSTAGRAM_CHROME_PROFILE_DIR, INSTAGRAM_CHROME_PATH | Storage and browser locations |
INSTAGRAM_COOKIES | Session for one process, any supported format, never written to disk |
INSTAGRAM_APP_ID, INSTAGRAM_ASBD_ID, INSTAGRAM_USER_AGENT | Header overrides when Instagram rotates them |
INSTAGRAM_DOCID_<OperationName> | Pin a GraphQL doc_id |
INSTAGRAM_MIN_GAP_MS | Minimum gap between requests (default 1500) |
INSTAGRAM_MAX_HASHTAGS | Default hashtag cap (5) |
INSTAGRAM_FFMPEG_PATH | ffmpeg location |
INSTAGRAM_ALLOW_INSECURE_STORAGE=1 | Store the session even if the folder cannot be locked (not recommended) |
Bun auto-loads a .env file from the working directory, which could set any of these. Always run
from this skill directory (it ships no .env), or add --no-env-file after bun. Origin
overrides (INSTAGRAM_BASE_URL and friends) are ignored unless they are https on instagram.com.
references/endpoints.md (opens in a new tab)scripts/analytics.ts (opens in a new tab)scripts/auth.ts (opens in a new tab)scripts/client.ts (opens in a new tab)scripts/comet.ts (opens in a new tab)scripts/constants.ts (opens in a new tab)scripts/cookie-store.ts (opens in a new tab)scripts/endpoints.ts (opens in a new tab)scripts/graphql.ts (opens in a new tab)scripts/main.ts (opens in a new tab)scripts/media.ts (opens in a new tab)scripts/normalize.ts (opens in a new tab)scripts/paths.ts (opens in a new tab)scripts/pending.ts (opens in a new tab)scripts/publish.ts (opens in a new tab)scripts/read.ts (opens in a new tab)scripts/secure.ts (opens in a new tab)scripts/types.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub proyecto26/instagram-ai-plugin --plugin instagram-ai-plugin7 skills in this plugin
/instagram-adsPlans and evaluates paid campaigns that run on Instagram (Meta Ads with Instagram feed, Stories and Reels placements). It picks which organic posts to promote using real performance pulled through the user's web session, writes ad copy and creative briefs, sets up Andromeda-era campaign structure, and makes kill, keep and scale decisions from numbers the user pastes. This skill should be used when the user asks to "run Instagram ads", "boost this post", "which post should I promote", "write Instagram ad copy", "set up a Meta campaign for Instagram", "is my Instagram ad working", "when should I kill this ad", "creative testing for Reels ads", or mentions ROAS, CPA, CPM or partnership ads on Instagram./instagram-auditAudits an Instagram account from real data pulled with the user's own web session (no Apify, no Graph API app), covering profile conversion, format mix, cadence, best days and hours, caption length, hashtags, and outlier versus underperforming posts, with an honest note on what only Insights can show. This skill should be used when the user asks to "audit my Instagram", "why is my reach down", "which formats work best on my account", "best time to post", "which posts performed best", "review my Instagram profile", "score my bio", "analyze @someaccount", or "what's working on my Instagram", and whenever the user shares output from the plugin's `audit` command (saved audit JSON, "I already ran the audit") and wants it interpreted, even if they ask only "what should I post more of"./instagram-contentPlans and writes Instagram content (Reels scripts and hooks, carousels slide by slide, captions, Stories sequences, content pillars, weekly calendars, repurposing long-form into posts), lints it with bundled offline scorers, and hands approved posts to the instagram skill for publishing. This skill should be used when the user asks to "write a caption", "script a reel", "give me reel hooks", "make a carousel about", "plan my Instagram week", "content calendar for Instagram", "turn this blog post into Instagram posts", "give me post ideas", "what should I post this week", "make this sound less AI", or wants Instagram copy reviewed before posting./instagram-researchResearches other Instagram accounts and hashtags through the user's own web session (no Apify) to build a swipe file of outlier posts (posts beating their own account's median by 3x or more), extract the hook formulas and formats behind them, and turn that into content ideas. This skill should be used when the user asks to "research competitors on Instagram", "what's working in my niche", "find viral reels about X", "build a swipe file", "reverse engineer this account", "analyze these creators", "check the/instagram-video-breakdownReverse-engineers an Instagram reel or any short video so a similar, original one can be made - downloads the video through the user's own web session (or takes a local file), measures cuts, pacing and audio with ffmpeg, extracts per-shot frames and timelines, optionally transcribes speech with the user's local model, and produces a shot list, on-screen text timeline, script, asset list and a per-shot production plan (film it, ComfyUI, code render, screen recording, ffmpeg). This skill should be used when the user asks to "break down this reel", "analyze this Instagram video", "how was this reel made", "recreate this reel", "make a video like this one", "extract the script / shots / captions from this reel", "reverse engineer this video", "turn this reel into a template", or pastes an instagram.com/reel/ or /p/ link and asks what makes it work or how to make their own version. Not for posting, and not for downloading a video to re-upload it./instagram-video-remakeThis skill should be used when the user asks to "remake this reel with another person", "replace the woman/man in this video", "swap the person in a clip", "put me (or someone) in this video", "recreate this video with a different character", "extend / continue this shot", or wants a new video that keeps the performance, camera, scene and bystanders of an existing one while changing who appears. Runs MiniMax H3 character swap and shot continuation in a local ComfyUI, puts the result back over the original, joins the timeline and keeps the music continuous. Local and free, with no paid service, nothing published.