Is the X (Twitter) algorithm open source?
Yes. X publishes its For You recommendation code at github.com/xai-org/x-algorithm, including the ranking weights in home-mixer/params/param.rs. Some safety rules and model prompts are not published.
Blog · 11 min read · Algorithm
X open-sourced its For You ranker. We read the code: copy-link shares weigh 20, replies 5, likes 0.66, bookmarks 0 — and one mute costs more than a pile of likes. Here is what that means for what you post.
By Andry Dina · Published · Updated

Most advice about the "Twitter algorithm" is guesswork. In 2026 it doesn't have to be: X publishes its For You recommendation code at github.com/xai-org/x-algorithm, including the weights it uses to rank posts. This guide is written from that code (commit 07d159b, October 23, 2026), not from rumor threads.

In one sentence: for every viewer, a model predicts how likely they are to take each action on your post, multiplies each prediction by a fixed weight, and adds it up. Your job as a writer is to make the heavy positive actions likely and the negative ones unlikely.
The pipeline has a few clear stages. Knowing them tells you which levers are real.
These are the default values in home-mixer/params/param.rs. X's own comment in that file is worth repeating: the weights multiply predicted probabilities, not raw counts, and they partly compensate for how rare each action is. A report is far rarer than a like, so its weight is larger — "one report cancels 468 likes" is a misreading.
| Predicted action | Weight | What it means for you |
|---|---|---|
| Share by copying the link | 20 | The heaviest positive action. Write the post people paste as the answer to a question. |
| Reply | 5 (+15 from a mutual follower, on original posts) | Ask what only a practitioner can answer. Original posts only — replies and reposts can't earn the boost. |
| Quote | 5 | Leave room for someone to add their own line on top. |
| Share via DM | 5 | Make something worth sending to one named person. |
| Follow the author | 4 | Prove there is more where this came from. |
| Share (other) | 2 | |
| Repost | 1 | Don't design for reposts. |
| Like | 0.66 | Raised from 0.5 in October 2026 — still a weak lever. |
| Click / open link / dwell | 0.3 / 0.2 / small | Links are not penalized, but they barely help. |
| Bookmark, profile click | 0 | Predicted, not weighted. Never ask people to save. |
| Not interested / mute / block / report | −52.3 / −58.8 / −31.2 / −234 | The real risk. One annoyed reader costs more than many likes earn. |
Write a reference, not a mood. The heaviest positive action is someone copying your post's link — usually to paste it as the answer to a question. Copy-ready prompts, templates, checklists, honest comparisons and data cuts get shared this way.
Write originals your peers have to answer. A reply from someone who follows you back, on an original post, carries 5 + 15. A specific question ("What retry delay did you actually ship?") earns that; "Thoughts?" doesn't.
Stop chasing likes, reposts and bookmarks. They are weak or zero in the formula. A post with fewer likes but more shares and real replies ranks higher.
Avoid the negatives above everything. Ragebait, engagement bait ("like if you agree", "comment YES") and AI filler raise the odds of mutes and "not interested" — and a post whose total score is negative is pushed below every positive one.
Some outcomes are not a weight at all — they remove the post. X's enforcement rules map AI slop at the account level (llm_slop_user) and post level (llm_slop_post), gibberish and fast-reply spam to labels that remove posts from out-of-network recommendations. Your followers can still see them; strangers won't.
Two structural limits matter for scheduling: posts older than 48 hours are never shown in For You, and each extra post from the same author in a feed refresh is discounted. Space your posts instead of stacking them.
X gives new and small authors a chance. An original post from an account with 50,000 followers or fewer, under two hours old and with fewer than 200 home impressions, can be lifted to around position 16 of a viewer's feed. The pick favors posts with a good like rate per view so far.
Practically: if you are small, your fresh originals get a real test. Make the first line earn the stop, and be around to reply in those first two hours.
Many 2026 blog posts still quote the 2023 open-source release: reply 13.5, "author replies to a reply" 75, good profile click 12, report −369. Those numbers belong to an older model. The current ranker is Phoenix, with the weights in the table above. Profile clicks now weigh 0, and copy-link sharing — absent from the 2023 list — is the heaviest positive weight.
Grok is not the ranker. Grok is xAI's language model; X uses separate models for recommendation. Grok's real advantage for writers is that it can search live X posts.
Myth: bookmarks are a top signal. Reality: they are predicted but carry no weight.
Myth: links kill reach. Reality: opening a link is a small positive (0.2). A post whose value is behind the link still earns few shares — put the value in the post.
Myth: the first 30 minutes decide everything. Reality: there is no such rule in the code. Posts stay eligible for 48 hours; small accounts get an early lift in their first two hours.
Myth: X Premium boosts For You ranking. Reality: there is no Premium or verification boost in the ranking code.
Myth: hashtags help discovery. Reality: they carry no weight; the model reads the post itself.
Before you post, run five checks. They map directly to the weights.
ViralGrok reads its weights from the same open-source file, drafts with Grok from live X conversations, and scores every draft against those weights before you publish. The free viral tweet checker runs the same checks with no account. A score is an estimate from your text, not X's internal prediction — it raises the odds, it doesn't guarantee reach.
Latest Grok · Live X research · 20 free credits · No credit card
Start freeYes. X publishes its For You recommendation code at github.com/xai-org/x-algorithm, including the ranking weights in home-mixer/params/param.rs. Some safety rules and model prompts are not published.
For each viewer, a model called Phoenix predicts how likely they are to reply, share, like, follow, mute or report your post. Each prediction is multiplied by a fixed weight and added up; the highest totals rank first.
Sharing a post by copying its link (weight 20), then replies, quotes and DM shares (5 each, with +15 when a mutual follower replies to an original post) and follows (4). Likes weigh 0.66 and bookmarks 0.
No. Bookmarks are predicted by the model but have no weight in the ranking formula. Posts worth bookmarking tend to be shared too — and shares do count.
Not in the ranking code: opening a link is a small positive weight (0.2). But a post that sends the value elsewhere earns fewer shares and replies, so keep the value in the post and add the link in a reply if needed.
There is no Premium or verification boost in the For You ranking code. Premium lets you post longer content, which can help when the topic needs depth.
The like weight moved from 0.5 to 0.66 in October 2026, the mutual-reply boost was set to +15 in July, and AI-slop labels now remove posts and accounts from out-of-network recommendations. The 2023 weights (reply 13.5, author reply 75) no longer apply.
No. Grok is xAI's language model. The For You feed is ranked by a separate recommendation model (Phoenix). Grok is useful to writers because it can search live X posts.
Grounded in X's open-source ranking code, with a template you can copy the same day. See what's inside