Guide
How the X algorithm ranks posts, from its open-source code
X publishes the code that ranks the For You feed. This guide quotes what it says about replies, links, small accounts and mutual follows, with the file and the lines for each, and says what the code cannot tell you about your own account.
Updated
In short: Xโs open-source ranking code (xai-org/x-algorithm) ranks a post for each viewer by the reactions it predicts, each with a weight: a likely reply at 5.0, a likely link open at 0.2. In For You, a reply reaches only people who already follow its author; an original post from an account with 1,000 followers or fewer can get a cold-start lift in its first 48 hours; and on an original post, a likely reply counts for more when the viewer and the author follow each other. The code gives weights, not results: what works on your account is something only your own posts can show.
What the code weighs
For each viewer, the ranking code predicts how likely each reaction to a post is, and multiplies each prediction by its own weight. The weights sit in one file of parameters, home-mixer/params/param.rs. Two of them, as the file writes them:
- a reply: 5.0;
- opening a link: 0.2.
The file itself warns against reading these as exchange rates: they multiply predicted probabilities, not counts, so a reply is not worth a fixed number of link opens. What the weights do say is that a post people are likely to reply to is valued well above one they are likely to leave through a link. The file has no constant that takes points away from a post for carrying a link: opening one is simply weighted low. That is why some writers put the link in the first reply instead of the main post.
Three rules in the code
Read at commit 4c5cfe8f on 27 Sep 2026. Each links to the lines it comes from.
- For You drops a reply for anyone who does not follow its author, so in that feed your replies can only reach people who already follow you. home-mixer/filters/oon_retweet_reply_filter.rs, lines 13โ18
- An account with 1,000 followers or fewer can get a cold-start lift in For You for an original post under 48 hours old with fewer than 1,000 Home impressions. Replies and reposts are not eligible. home-mixer/scorers/author_cold_start.rs, lines 176โ181 and 294โ316
- When the viewer and the author follow each other, ๐ adds 15 to the weight of a likely reply in the score. Only original posts get this; replies and reposts do not. xai-value-model/inputs.rs, lines 19โ21; the 15 is set in home-mixer/params/param.rs, lines 297โ302
What Xโs help pages add
- Hashtags: Xโs help page recommends no more than 2 per post.
- Engagement exchange: Xโs authenticity policy prohibits coordinating to trade likes, reposts or follows, such as follow for follow, and lists restricting reach among the ways it enforces that.
What the code cannot tell you
The repository is not guaranteed to match what X runs in production, and it can change after the day it was read, which is why the commit and the date are printed above. More to the point, a weight is not a result. It says how the ranking values a reaction, not which of your hooks, formats, topics or posting times get those reactions from the people who follow you.
Only your own posts can show that, and only if they are compared fairly: each post against the median of the 20 posts you published nearest it in time, so follower growth does not decide the result, and a pattern trusted only once it holds at least 5 posts and beats what 500 random draws of your own posts produce. The method, with a worked example.
Writing posts with this in mind
Crux turns your GitHub commits, merged pull requests and releases into X drafts in your voice, and checks each draft in code before you post it. A link in the main post is flagged with the link and reply weights beside it, a question that invites replies is noted with the reply weight, and the draft is scored against your own posts. Crux then reads how each post does and reports what works for your account once a finding beats a test against chance.
Without an account, the free reach linter runs the link, hashtag and engagement bait checks on any post, in your browser. Related: the seven kinds of hook, and how to test yours.