> Quick Definition, Claude Code LinkedIn loops: A scheduled Claude Code prompt that reads your content calendar, a comment export you saved, and a snapshot of your own profile on a fixed cadence, daily or weekly, then writes draft posts, draft replies, and change alerts to a file. You review and publish in LinkedIn yourself. It is the difference between "I will post when I remember" and "a draft is waiting at 7 a.m."
LinkedIn CPC averages $9.13 for B2B (LinkedIn Marketing Solutions research), which is why organic still has to carry the compounding work. A SERP audit for "claude code linkedin" returns personal posts and tool roundups, no published /loop workflow, and no compliance framework. The tooling exists. The pattern does not. This article is /loop content specifically for LinkedIn: four named organic loops, a ToS-boundary decision tree, real .loop files, and cron schedules.
If you read the hub article on Claude Code Loop Engineering for Modern GTM you already know the ESG Framework (Enable → Schedule → Govern) and the 5 GTM Loop Archetypes. Every loop below is a Generate, Nurture, or Monitor archetype applied to Claude Code LinkedIn. The discipline transfers; the configurations do not. The goal is cost-bounded automation you can ship without learning to code, four loops, four cron entries, one shared persona file, and a hard stop at LinkedIn's Terms of Service.
TL;DR
- The LinkedIn Loop Compliance Frame (ToS-boundary decision tree) + 4 organic loops is the original framework in this article. Draft-then-human-post is the default. Official exports and official APIs are in bounds. Browser bots, scrapers, mass DMs, and connection spam are out.
- A four-loop Claude Code LinkedIn stack costs under $3/month in tokens for a founder or a small agency book of one to three personal brands. The expensive failure is not the API bill. It is a restricted account.
- Claude Code /loop does not log into LinkedIn for you. It reads files you already have, calendar CSVs, pasted comments, Analytics downloads, Campaign Manager exports, and writes drafts. You paste the approved text into LinkedIn.
- LinkedIn automation is not illegal. ToS-violating bots still get accounts banned. The decision tree below is the part the SERP omits.
The Claude
Code LinkedIn automation dilemma (reach vs. risk)
Claude Code LinkedIn automation is a reach-versus-risk problem, not a "can the model write a post" problem. Organic distribution still compounds cheaper than a $9.13 CPC, and a scheduled draft loop will out-publish a founder who waits for Friday inspiration. The same schedule, pointed at the LinkedIn UI through a browser bot, is how people lose the account that holds their pipeline.
The two sides do not fail the same way. Under-posting costs you impressions you can earn back next month. A ToS ban costs you the URL, the message requests, and the warm graph you spent years building. That is why this article treats Claude Code LinkedIn as a drafting and monitoring layer, not as a puppet for your profile.
Reach is real: a three-post week with a reply sitting in draft within an hour of each comment will beat an irregular burst of five posts and radio silence. Risk is also real. LinkedIn's Professional Community Policies and User Agreement restrict fake engagement, spam, and unauthorized automated access. "LinkedIn automation illegal" is the query people type; the accurate answer is that automation is not a crime in itself, and a ToS-violating bot is still a ban waiting to happen.
The usable rule: if the loop never authenticates to LinkedIn, never clicks the UI, and never sends a message or invitation, you are on the cheap side of the dilemma. If it does any of those, you have left Claude Code LinkedIn loop engineering and entered account roulette.
Playing by Claude Code LinkedIn rules: compliant automation principles
Compliant Claude Code LinkedIn automation has three principles: draft, do not dispatch; read files you are allowed to have; keep a human in the publish path. Everything else in this article is an application of those three.
Official paths are narrow on purpose. LinkedIn documents a Marketing API for ads, Campaign Manager exports, native Analytics downloads, and a restricted Community Management API for approved partners. There is no "drive my profile like a person" API for growth teams. Claude Code scheduled tasks can sit on top of the files those official paths produce. They cannot invent a login.
The persona file is how you stop a loop from "helpfully" reaching for a scraper when a comment file is missing. Without it, each run re-derives the rules. With it, every Claude Code LinkedIn loop starts from the same sentence: draft only, files only, human publishes.
The Claude Code LinkedIn ToS-boundary decision tree
The ToS-boundary decision tree is the load-bearing piece of the LinkedIn Loop Compliance Frame (ToS-boundary decision tree) + 4 organic loops. You run a proposed action through it before you write a cron line. If the action needs LinkedIn credentials, a headless browser, or anyone else's profile data, it is a never. If it writes a markdown draft from a file you exported or pasted, it is an allow.
# CLAUDE.md (excerpt)
You are the LinkedIn drafting agent for this workspace.
Your job: draft posts, draft replies, and flag profile drift, never publish.
Your data lives in data/linkedin/, calendar CSV, comment pastes,
Analytics exports, Campaign Manager CSVs, profile snapshots you saved.
Output: data/linkedin/drafts/YYYY-MM-DD-*.md.
Rules:
- Never log into LinkedIn, never call unofficial endpoints, never scrape.
- Never send DMs, connection requests, or InMail.
- Never like, react, follow, or invite on anyone's behalf.
- If an input file is missing or stale, alert and exit.
- Mark every draft UNPUBLISHED until a human posts it.The table is the tree in operational form. Keep it next to the crontab. If a new idea does not map to a row, it is not a loop yet.
| Proposed action | Allowed data source | Verdict |
|---|---|---|
| Draft an organic post | Your calendar + posts you already saved | Allow — human publishes |
| Draft a reply | Comment text you exported, pasted, or received via official partner API | Allow — human publishes |
| Weekly performance brief | LinkedIn Analytics CSV you downloaded | Allow |
| Ads bid or creative note | Marketing API or Campaign Manager export | Allow — separate Ads path |
| Sales Navigator talking points | Notes you typed after using Sales Navigator yourself | Allow — research, not scrape |
| Mass DMs / InMail blasts | Any | Never |
| Connection spam / auto-invite | Any | Never |
| Scrape profiles, search, or Sales Navigator | Any | Never |
| Auto-like, poll-bait, engagement pods | Any | Never |
| Browser bot that clicks the LinkedIn UI | Any | Never |
Read the table as a filter, not as a menu of growth hacks. Allow rows are Generate, Nurture, and Monitor loops that stop at a file. Never rows are how accounts get restricted. Sales Navigator belongs on the Allow side only as a human research tool: you sit in the product, you type notes, Claude Code LinkedIn drafts angles for a conversation you will have. Scraping Sales Navigator is a Never.
Loop #1: Content calendar + draft generation
The content calendar loop is the first Claude Code LinkedIn loop most teams should ship. It is a Generate archetype, three times a week is enough for a personal brand, and it never posts. It reads a calendar CSV you maintain (date, pillar, hook, CTA, status), reads a small archive of your last posts so the voice does not drift, and writes a draft with a headline, body, and suggested first comment.
The loop exists because blank-page mornings are where calendars die. A founder who has already decided Tuesday is "customer story" and Thursday is "point of view" still loses the week when the draft is not sitting there at 7 a.m. Claude Code LinkedIn does not fix strategy. It removes the empty editor. Feed it a calendar that names the pillar and CTA, plus a voice file of your actual posts. Twelve prior posts plus one calendar row is enough for an on-voice native draft. Without those files you get sludge, and you will stop opening the folder.
# .loops/linkedin-content-calendar.md
Every Monday, Wednesday, Friday at 07:00:
1. Read data/linkedin/calendar.csv (date, pillar, hook, cta, status).
2. Read data/linkedin/voice/recent-posts.md (last 12 posts you saved).
3. Pick the next row with status=planned and date=today or next working day.
4. Draft one native post (150-250 words) matching voice.
5. Mark UNPUBLISHED. Save to data/linkedin/drafts/YYYY-MM-DD-post.md.
6. Set that calendar row to status=drafted.
7. If calendar.csv is missing or has no planned row, post "no draft today" and exit.# crontab
0 7 * * 1,3,5 cd /path/to/repo && claude code /loop .loops/linkedin-content-calendar.mdToken cost stays small because the inputs are files you already curate. Twelve prior posts plus a calendar row is roughly 6,000 input tokens and 2,500 output tokens per run, about $0.06 per draft, or under $1/month at three drafts a week. The human step is the actual work: you edit two lines, paste into LinkedIn, and hit post. That is Claude Code LinkedIn used as a writer with a clock, not as a ghost account.
Loop #2: Engagement monitoring (comments → draft replies)
The engagement loop is a Nurture archetype. It turns comments on your posts into draft replies within a working day, which is the difference between a thread that compounds and a post that dies after the first hour. It does not watch the LinkedIn feed, does not scrape comment widgets, and does not send the reply.
Input is a file you are allowed to have: LinkedIn notification emails saved into data/linkedin/comments/, a paste of comments you copied from your own post, or an official Community Management API payload if you are on that partner program. Claude Code LinkedIn classifies each comment, question, compliment, qualified lead, spam, and writes a reply draft plus a one-line reason. You post the replies that still sound like you. A generic "thanks" prompt produces a folder nobody opens. A classification prompt produces a queue. The loop should refuse to draft a reply that asks for a follow, a DM, or a like, that is engagement baiting with extra steps.
# .loops/linkedin-engagement-replies.md
Every weekday at 11:00 and 16:00:
1. Read new files in data/linkedin/comments/ (your export or paste only).
2. Skip any file older than 48 hours; flag it stale.
3. For each comment: classify as question, compliment, lead, or spam.
4. Draft a reply for question, compliment, and lead. Skip spam.
5. Never include a "follow me", "drop a like", or "DM me for the template" line.
6. Save drafts to data/linkedin/drafts/YYYY-MM-DD-replies.md marked UNPUBLISHED.
7. If the comments folder is empty, post "no new comments" and exit.# crontab
0 11,16 * * 1-5 cd /path/to/repo && claude code /loop .loops/linkedin-engagement-replies.mdCadence is twice on weekdays because comment half-life on LinkedIn is short. The loop still does not need to live inside LinkedIn. You batch-paste comments when you check the app, or you drop notification emails into the folder. Claude Code LinkedIn does the sorting. You do the sending. That split is the whole compliance story for engagement.
Loop #3: Content curation (articles → share + commentary)
The curation loop is a Syndicate archetype with a Generate finish. It does not scrape LinkedIn's feed for "what's performing." You maintain a reading list, RSS items, newsletter roundups, URLs you dropped into data/linkedin/reading-list.md after you actually read them, and the loop drafts a share post with your commentary attached. You publish the ones that add a point, not the ones that restate the headline.
Curation is how operators stay visible on weeks when they have no original story. The failure mode is becoming a retweet bot with a LinkedIn login. Claude Code LinkedIn should require an 80, 150 word take that disagrees, specifies, or adds a number from your own work. If the loop cannot find a take, it should skip the URL rather than invent enthusiasm. You comment on pieces you opened as a reader. You do not dump a competitor's post body into the prompt from a scraped DOM. A URL plus your notes is enough.
# .loops/linkedin-curation.md
Every Tuesday and Thursday at 08:00:
1. Read data/linkedin/reading-list.md (url, title, your_notes, status).
2. Take the next row with status=queued that has non-empty your_notes.
3. Draft an 80-150 word share post that adds a take, not a summary.
4. Include the URL. Do not paste scraped article body.
5. Save to data/linkedin/drafts/YYYY-MM-DD-curation.md marked UNPUBLISHED.
6. Set the row to status=drafted.
7. If no queued row with notes exists, exit with "nothing to curate".# crontab
0 8 * * 2,4 cd /path/to/repo && claude code /loop .loops/linkedin-curation.mdTwo days a week is the ceiling for most personal brands; daily curation crowds out Loop #1. Token use is moderate when notes are short, about 8,000 input tokens and 1,500 output tokens per run, roughly $0.40/month. The value is editorial: Claude Code LinkedIn forces the notes field to exist, which is the difference between sharing because the algorithm might like it and sharing because you had something to say.
Loop #4: Profile optimization monitor
The profile loop is a Monitor archetype on a monthly cadence. It diffs a snapshot of your profile text, headline, about, featured, CTA, against last month's snapshot, and writes a change log plus two or three improvement notes. It does not open LinkedIn. It does not look at anyone else's profile. You paste your own headline and about into data/linkedin/profile/current.md once a month, or you save the PDF LinkedIn lets you download of your own profile.
Profile drift is quiet. A headline that still names last year's offer, an About section with a dead CTA, a Featured slot pointing at a 404, none of those show up in post analytics. Claude Code LinkedIn catching a stale CTA on the first of the month is worth more than another draft post that week, because the profile is the landing page every impression can click. Keep the notes small: one headline variant, one About opening sentence, one Featured swap. A monthly loop that proposes a full rewrite will be ignored.
# .loops/linkedin-profile-monitor.md
On the 1st of each month at 09:00:
1. Read data/linkedin/profile/current.md (headline, about, featured, cta, your paste).
2. Read data/linkedin/profile/previous.md (last month's snapshot).
3. Diff fields. Classify: unchanged, copy-edit, broken-cta, offer-drift.
4. Propose at most three edits. Do not rewrite the whole About by default.
5. Save the brief to data/linkedin/drafts/YYYY-MM-profile.md marked UNPUBLISHED.
6. Copy current.md over previous.md after the brief is written.
7. If current.md is missing, alert and exit. Do not fetch a profile.# crontab
0 9 1 * * cd /path/to/repo && claude code /loop .loops/linkedin-profile-monitor.mdMonthly is the right cadence because profile copy does not decay daily. Token cost is a few cents a month. Treat it as hygiene, the same way the Claude Code SEO freshness audit treats stale pages: detect, brief, wait for a human.
What NOT to automate
Do not automate mass DMs, connection spam, scraping, or engagement baiting. Those four are the Never column of the decision tree, and they are the reason most "LinkedIn automation" products get people banned. Claude Code LinkedIn does not get a special exemption because the drafts are well written.
Mass DMs and InMail blasts are not a loop. They are spam with a better model. Connection spam, auto-invites, invite-then-pitch sequences, scraped search-result lists, is the same category. This article will not tell you how to build either. If your outbound motion is email, use a channel with a legal and product path for sending, and read Claude Code workflows for marketing agencies for how teams keep a human approval gate in the middle.
Scraping LinkedIn, profiles, search, Sales Navigator, comments you do not own, anything behind the logged-in DOM, is a ToS violation and a practical ban risk. Can Claude Code scrape LinkedIn? It should not, and this playbook does not. Sales Navigator stays a human-in-the-loop research product: you run the searches, you write notes, the loop drafts talking points. It does not log into Sales Navigator for you.
Engagement baiting is the softer ban. "Comment 'GUIDE' and I'll DM you," like-pods, auto-reactors, and follow-for-follow scripts train the graph to treat you as junk. Loop #2 is explicitly forbidden from drafting those lines. If a vendor promises "set and forget engagement," that is not Claude Code LinkedIn. That is someone else's bot wearing your face.
Claude Code LinkedIn Analytics reporting loop
The analytics loop is a weekly Monitor on top of a file LinkedIn already lets you download. Creator and Company Page analytics CSVs are official exports. Claude Code LinkedIn reads this week's file, diffs it against last week, and writes a short performance brief: which posts moved impressions or reactions, which drafts from Loop #1 actually shipped, and one recommendation for next week's calendar. It does not scrape the analytics UI.
Weekly matches how LinkedIn reporting is used in a GTM meeting. Daily overfits noise. Monthly forgets the post you should have repeated three weeks ago. The brief should be one page.
# .loops/linkedin-analytics-report.md
Every Monday at 09:30:
1. Read data/linkedin/analytics/YYYY-MM-DD.csv (official LinkedIn download).
2. Diff against last week's CSV if present.
3. Summarize top 3 posts by impressions and by reactions.
4. Note calendar rows still stuck in drafted (not posted).
5. Recommend one pillar to repeat and one to pause next week.
6. Save to data/linkedin/drafts/YYYY-MM-DD-analytics.md.
7. If the CSV is missing or older than 8 days, flag stale and exit.# crontab
30 9 * * 1 cd /path/to/repo && claude code /loop .loops/linkedin-analytics-report.mdThis loop is how you close the ESG loop: Enable the files, Schedule the four organic loops, Govern with a weekly number. Without it, Claude Code LinkedIn is a content factory with no feedback. With it, next week's calendar row is an Optimize step, not a guess.
The compliance checklist: staying within LinkedIn ToS
Stay inside LinkedIn ToS by treating every loop as a writer with a clock, not as a logged-in user. The checklist below is the operational version of the LinkedIn Loop Compliance Frame (ToS-boundary decision tree) + 4 organic loops. If you cannot tick every box, do not turn the cron on.
- Draft-then-human-post for every organic artifact. No loop publishes.
- Inputs are files you exported, pasted, or received through an official API. No scraping.
- No mass DMs, no connection spam, no auto-invite, no InMail blast.
- No engagement bait, like-pods, or auto-reactors.
- No headless browser against linkedin.com.
- Stale or missing files cause an exit, not a "helpful" fetch.
- Ads work, if you do it, is a separate path.
LinkedIn Ads automation via Claude Code is that separate path. It is API-official. You pull Campaign Manager exports or Marketing API objects, spend, CPC, CTR, creative IDs, and the loop drafts budget, bid, or creative notes for a human to apply in Campaign Manager or through the same official API. It is not a browser bot clicking Ads Manager, and it is not one of the four organic loops. Keep Ads files in data/linkedin/ads/ so an organic draft run cannot see them and "optimize" a campaign by accident.
Sales Navigator stays human-in-the-loop research, not a scrape target. You use Sales Navigator as LinkedIn sold it. After a research block, you paste account notes into data/linkedin/research/. Claude Code LinkedIn can turn those notes into conversation angles for a call or a connection you will send yourself. It cannot enumerate SN results, enrich emails from SN, or auto-sequence the people you viewed.
The token table below is a worked example for one personal brand running the four organic loops plus the weekly analytics brief. Numbers assume current Claude per-token prices and the cadences in this article. Compute your own line items before you ship; the point is that the figure is knowable, and that it is not the number that should scare you.
| Loop | Cadence | Input tokens | Output tokens | Cost per run | Monthly cost |
|---|---|---|---|---|---|
| Content calendar | 3×/week | 6,000 | 2,500 | $0.06 | $0.72 |
| Engagement replies | 10×/week | 4,000 | 1,200 | $0.03 | $0.90 |
| Curation | 2×/week | 8,000 | 1,500 | $0.05 | $0.40 |
| Profile monitor | Monthly | 3,000 | 1,000 | $0.02 | $0.02 |
| Analytics report | Weekly | 5,000 | 2,000 | $0.04 | $0.16 |
| Total | — | — | — | — | ~$2.20/month |
Daily-ish loops dominate cost, and even then the stack is a few dollars. Engagement is the largest line because it runs ten times a week, not because each run is heavy. If you need to cut, drop the afternoon engagement pass before you drop the calendar. Compared with a $9.13 CPC, a month of Claude Code LinkedIn drafts is less than a single paid click, which is only a good deal if the account is still alive to collect the organic return.
The second table is the cheat sheet you keep next to the decision tree. Every cron line should map to one row. If an alert fires that does not map, you have either a threshold problem or a loop you never documented.
| Claude Code LinkedIn loop | Archetype | Alert / output | Failure mode to guard |
|---|---|---|---|
| Content calendar | Generate | Draft post waiting | Empty calendar, voice file missing |
| Engagement replies | Nurture | Draft replies waiting | Stale comment paste, baiting language |
| Curation | Syndicate | Draft share waiting | Reading list with no notes |
| Profile monitor | Monitor | Three-edit brief | Missing self-snapshot, temptation to fetch |
| Analytics report | Monitor / Optimize | Weekly one-pager | Stale CSV, overfitting one viral post |
Tape that next to the ToS table. An alert that does not map is a governance failure, not a model failure. Addy Osmani's loop engineering note is about making the repeating unit explicit in software; this is the GTM version of the same idea, with a ban-risk constraint the original essay did not have to carry.
Where This Goes Next
The asset you carry out of this article is the LinkedIn Loop Compliance Frame (ToS-boundary decision tree) + 4 organic loops. Four named loops, four cadences, one weekly analytics brief, one shared CLAUDE.md, and a Never column you do not negotiate. Once those loops run for a month without a missing-file incident and without a draft that tries to DM strangers, adding a second personal brand is copy-the-folder work.
The discipline that compounds is ESG applied to organic social: Enable the persona and the allowed file paths once, Schedule the loops at cadences that match how LinkedIn actually decays, and Govern with stale-file exits and a human publish step. That is the same pattern as the rest of this cluster, with a harder legal edge.
Metaflow is built for this motion. The platform ships marketing agents that hold your positioning, ICP, and approved voice as durable context, and pause for approval before anything ships, which is the same boundary the ESG Framework enforces on raw Claude Code. Skills and workflows encode the decision tree so a run cannot "helpfully" reach for a scraper when a comment file is empty. If you want to skip the CLI plumbing and start from a loop that already knows your stack, that is the layer Metaflow adds on top. For the broader Claude Code marketing skills ecosystem, see the Claude Marketing Skills Ultimate Guide; for how agencies deploy approval-gated workflows, see Best Claude Code Workflows for Marketing Agencies.
Frequently Asked Questions
Is LinkedIn automation illegal? No. LinkedIn automation is not illegal in the sense people mean when they type the query. Using software to draft posts, summarize an Analytics CSV, or reason over Campaign Manager exports is ordinary work. What gets accounts banned is violating LinkedIn's User Agreement and Professional Community Policies, scraping, unauthorized bots that click the UI, mass DMs, connection spam, fake engagement. Claude Code LinkedIn as specified here stays on the allowed side by never logging in and never sending. ToS can still ban you if you ignore that boundary.
Can Claude Code scrape LinkedIn? No. Do not. Scraping profiles, search, comments you do not own, or Sales Navigator is a ToS violation and a practical way to lose the account. Claude Code can read files you exported or pasted. It should not fetch linkedin.com behind a session cookie. If a tutorial shows a scraper pointed at LinkedIn, it is not this playbook.
Can Claude control my LinkedIn? Not in any setup you should run. Claude Code LinkedIn writes drafts to disk. You paste approved text into LinkedIn. Metaflow agents use the same rule: durable context and a pause for approval before anything leaves the draft folder. There is no "Claude drives my profile" mode in this article, and there should not be one in your crontab.
Is Claude Code safe for LinkedIn outreach? It is safe as a research-and-draft layer with a human sending the message. It is not safe as a mass-outreach bot. Do not auto-send DMs, InMail, or connection requests. Sales Navigator research stays in your hands; the loop drafts talking points from your notes. Metaflow's approval-gated workflows exist for this exact failure mode, the model can be fast, and the send still waits for you.
Sources
- LinkedIn, Professional Community Policies, ToS-adjacent community rules this playbook treats as binding
- Claude Code official docs on scheduled tasks,
/loopcommand reference - Addy Osmani, Loop Engineering, origin of the loop engineering concept
- Metaflow, Claude Code Loop Engineering for Modern GTM, hub article for this cluster
- Metaflow, Claude Marketing Skills Ultimate Guide, broader Claude Code marketing skills ecosystem
- Metaflow, Best Claude Code Workflows for Marketing Agencies, agency deployment and approval gates
- Metaflow, Claude Code Loop for SEO, related Monitor/Optimize loop pattern




