How the X algorithm works in 2026, read from its source code
Updated October 2, 2026 · 6 min read
X published the code that builds the For You feed. In short: it predicts, for each person, how likely they are to reply, share, like or mute your post, multiplies each prediction by a weight, and ranks by the total. A reply is worth 10 likes, a reply between people who follow each other is worth 40, and a post older than 48 hours is out of the feed for good.
Where the code comes from
In 2026 X open-sourced the system that ranks the For You timeline (the xai-org/x-algorithm repository). It replaces the 2023 release: names you may have read about, like Tweepcred, Real Graph or the "heavy ranker", are gone. The ranking is now done by Phoenix, a transformer model, inside a service called home-mixer.
One caveat before any number: the weights below are the defaults written in the code. X runs experiments and can change them for some users, so read them as orders of magnitude, not as exact truth. X also publishes the changes it makes, like the July 2026 change that boosted replies between mutual follows.
Step 1: finding candidate posts
Every time you open the app, home-mixer gathers a few thousand candidate posts from two places at once:
- In-network: recent posts from the accounts you follow (a service called Thunder).
- Out-of-network: posts from accounts you don't follow, found by Phoenix retrieval, which matches your recent engagement history against what each post is about and who wrote it, and by SimClusters, communities of people who engage with the same things.
Step 2: the filters, including the 48-hour window
Before any scoring, candidates are filtered out. The one that matters most for creators: posts older than 48 hours are dropped. After two days, your post can't appear in anyone's For You feed, however good it is. A reply is a post too, so the same window applies to the conversations under your posts.
The other filters remove posts you've already seen, posts from accounts you blocked or muted, posts containing your muted keywords, and replies or reposts from accounts outside your network.
Step 3: predicting what each person will do
Phoenix reads the viewer's recent engagement sequence and predicts, for each candidate post, the probability of about twenty actions: like, reply, repost, quote, share, follow the author, but also mute, block, report or "not interested". The score of the post is the sum of each probability multiplied by its weight.
This is the key idea: the algorithm doesn't count the likes your post already has. It estimates what this particular person is likely to do with it. The same post gets a different score for every viewer.
The weights: what each action is worth
These are the default weights in home-mixer/params/param.rs. A higher number means the action counts more when Phoenix predicts it.
| Action | Weight | What it means |
|---|---|---|
| Share via copy link | 20 | The strongest positive signal: people copy the link to paste it elsewhere. |
| Reply, between mutual follows | 5 + 15 | A reply is boosted when the viewer and the author follow each other. |
| Reply | 5 | Ten times a like. |
| Quote | 5 | Same as a reply. |
| Share via DM | 5 | Sending your post to someone. |
| Follow the author | 4 | The post made them follow you. |
| Share (other) | 2 | |
| Repost | 1 | Worth two likes. |
| Like | 0.5 | One of the weakest signals. |
| Open the post | 0.4 | |
| Open a link | 0.2 | |
| Profile click | 0 | Not counted at all. |
| Report | −234 | The heaviest weight in the model. |
| Mute the author | −58.8 | |
| Not interested | −43.2 | |
| Block the author | −31.2 |
How to read these weights correctly
A weight multiplies a predicted probability, not a count. "One report cancels 468 likes" is a misreading that the code's own comments warn against. Negative actions are rare, so they need large weights to matter at all.
What it does mean: if your post looks like the kind of post people mute or mark "not interested", every viewer similar to them sees it scored down. And if it looks like something people reply to or send to a friend, it climbs. Likes barely move it.
Step 4: the adjustments after scoring
- Out-of-network discount: a post from an account the viewer doesn't follow is scored down compared with the same post from an account they follow. Your post has to land with your own followers first to travel further.
- Cold-start boost for small accounts: authors with fewer than 1,000 followers and little reach yet can get a fresh post (under 48 hours) lifted toward positions 15 to 16 of the feed. It is experiment-gated, but it means posting regularly while small is rewarded.
- Diversity: the final ranking uses a model designed to keep the feed varied, so several near-identical posts compete with each other instead of all showing.
Step 5: visibility filtering
Last, safety labels can remove a post or put it behind a warning: spam, inauthentic behavior, adult content, low-quality accounts. Some of these rules only apply to people who don't follow you. A flagged account can still reach its followers but loses discovery, which is why it can feel like a "shadowban".
What the code doesn't show
Some popular beliefs have nothing behind them in the code:
- No length penalty: nothing scores a post down for being long.
- No explicit link penalty in the score. Opening a link is weighted low (0.2) and posts know whether they contain a link, but the real cost of a link post is that it gets fewer replies and quotes.
- Hashtags have no ranking effect. In the feed code they're only used to match muted keywords.
- Bookmarks feed the viewer's history, but have no direct weight in the score.
- Engagement from people you send a direct link to doesn't count for ranking. Only engagement from the Home timeline does, so engagement pods and group chats don't help, and coordinated behavior is what the inauthentic-behavior models look for.
What this means for your posts
Write to start conversations, not to collect likes. Reply to the replies you get while the post is still under 48 hours old, especially to people who follow you back. Make posts people want to send to someone. Stay in your topic so retrieval matches you with the right people. The next guides turn this into practice: 12 tips to grow on X and the mistakes that kill your reach.
Questions
Is the X algorithm really open source?
Yes. X published the code of the For You feed in 2026 (xai-org/x-algorithm on GitHub): the candidate sources, the filters, the Phoenix ranking model and the default weights. Production can override some values through experiments.
How long does a post stay in the For You feed?
48 hours at most. Older posts are filtered out before ranking. Replies are posts too, so the same window applies to them.
Are likes useful on X?
Barely, for reach. A like weighs 0.5, a reply 5, a reply between mutual follows 20, and sharing a link 20. Likes still tell Phoenix what the viewer enjoys, but they won't carry a post.
Do links reduce reach on X?
The ranking code has no explicit link penalty. Link posts tend to get fewer replies and quotes, which are what the score rewards. Put the value in the post, and the link in a reply if you need one.
Do hashtags help on X?
No. In the feed code, hashtags are only used to match muted keywords. They have no effect on ranking.