How the X algorithm works: a plain guide

The short answer
The X algorithm is a pipeline that runs each time someone opens the For You feed: it gathers candidate posts, filters out the ineligible ones, predicts how the viewer would react to each, adjusts the scores, applies visibility rules and mixes in ads. X publishes the code, but not every rule or live setting.
Key takeaways
- There is no single X algorithm. The For You feed is rebuilt for each viewer in stages: gather, filter, score, adjust, check visibility and blend.
- The scoring model predicts the chance that the viewer will like, reply, share, click, mute or report, then multiplies each chance by a weight. Weights do not multiply raw counts.
- People who do not follow you can only reach your post through two out of network sources, and visibility filtering can still drop it before it is shown.
- In the files and pages we read there is no link penalty, no posting frequency rule and no best hour. Some rules are withheld, so that is not proof they do not exist.
- Treat every algorithm tip as a claim and ask which file or Help Center page it comes from.
You are trying to work out why one post travels and another sits still. The first thing to know about the X algorithm is that no single formula decides it. A pipeline runs every time someone opens the For You feed, and X has published the code for it.
This guide walks that pipeline in order: where posts come from, what gets removed, how what is left is scored, what changes the score afterwards and what decides whether a post can be shown at all. Every claim is labelled as something the code shows, something X says, or our own reading, so you can tell which is which.
How does the X algorithm work in one picture
Each time you open For You, X builds the feed again from scratch. The code describes six stages: gather candidate posts, filter, score, adjust, check visibility, then blend in ads and other items. X's Help Center describes the same shape in plainer words.
It says X finds content inside and outside your network, ranks it with a neural network trained on your interactions, and filters harmful, abusive or spammy content before showing it. It also says the system distils roughly 500 million posts a day down to a handful of top posts for your feed.
- Gather. Three sources supply candidate posts: one for accounts you follow, two for accounts you do not.
- Filter. Posts that cannot or should not be shown to this viewer are removed before any scoring.
- Score. A model predicts how likely the viewer is to act on each post, and weights turn those chances into one number.
- Adjust. Rules change the score for variety, for accounts the viewer does not follow and for new authors.
- Check. The top posts go through visibility filtering, which answers allow, notice, interstitial or drop.
- Blend. Ads, Who to Follow and prompts are mixed in with the posts.
3
candidate sources
x-algorithm README, Candidate Sources
19
filters before scoring
x-algorithm README, filter table
48 hours
oldest post that stays in the pool
x-algorithm README, age filter
3
visibility answers
x-algorithm README, Visibility Filtering
What does X publish, and what can't the code tell you
X publishes the code that builds the For You feed at github.com/xai-org/x-algorithm, under an Apache 2.0 licence. The README says "our aim is for the public to be able to understand how posts are distributed on X". That makes it the best primary source there is, and it is still not the whole picture.
An older release exists. X first published recommendation code in March 2023, in an earlier repository that showed parts of the system. Write ups from that time describe that version, not the one in this guide.
X's engineering account announced the release, saying the new algorithm is powered by the same transformer architecture as xAI's Grok model. The Phoenix README adds that earlier releases shipped a sample model, while the current release ships the production code. An article about an older release may describe something that no longer runs. For the accounts X suggests rather than the posts, see how Who to follow chooses accounts.
| Label in this guide | What it means |
|---|---|
| Code shows | Something you can read in the repository or its README, with the file named |
| X says | Something on an X Help Center page or from an X account |
| Our reading | What we make of it. It can be wrong |
| Unknown | Not published, so nobody outside X can say |

| What the code can tell you | What it cannot tell you |
|---|---|
| The stages and the order they run in | The chance the model gives your post, for any one viewer |
| Default weights, with a sync stamp of 8 October 2026 | Which values are live for you today, since tests run on small slices of traffic |
| The filters, by name and by purpose | The files X withholds: model prompts for its classifiers and some rules |
| Which actions the model predicts | Why one post did better than another |
For You or Following: which feed is your post competing in
The two feeds work differently. According to the Help Center, Following shows posts only from accounts you follow, newest first. For You mixes accounts and Topics you follow with recommended posts and ranks them for you.
| For You | Following |
|---|---|
| Posts from accounts and Topics you follow, plus recommended posts | Posts only from accounts you follow |
| Ranked by a neural network trained on your interactions | Newest first, per the Help Center |
| Shaped by the accounts and Topics you follow, and by your interactions | Set only by which accounts you follow |
The code ships separate servers for the three: for_you_server.rs, following_feed_server.rs and ranked_following_feed_server.rs. The Help Center page we could read describes Following as newest first. If your app shows a sort option next to Following, check which one is selected before you draw conclusions about reach.
In a newest first feed, timing is plain arithmetic: an older post sinks as newer ones arrive. We cover that in our guide to the best time to post on X. The rest of this guide is about For You.
Where do the posts in a For You feed come from
Three sources run at the same time, and each one returns candidate posts. Before they run, X loads context about the viewer: recent engagements (the main input to the model), the follow list, blocks and mutes, muted keywords, posts already seen and followed topics.
In network
Thunder
Holds recent posts in memory as they are published and returns those from accounts the viewer follows.
Out of network
Phoenix retrieval
Turns the viewer and each post into vectors, then returns the posts nearest the viewer.
Out of network
SimClusters
Groups accounts and posts by who engages with what, then finds candidates through those groups.
Our reading: a post reaches people who do not follow you only through the two out of network sources. Both are driven by what the viewer, and people who engage like them, have engaged with. Follower count is not one of the sources. For what the weights mean for replies, reposts and likes in particular, see our guide to X engagement signals.
Which posts are filtered out before ranking
The README lists 19 filters that run before any scoring. Most are housekeeping. Here are the ones that matter most to a person writing posts, in plain words.
| Filter, in plain words | What it means for you |
|---|---|
| The same post from more than one source | A post found twice is shown once |
| Posts older than 48 hours | After two days a post leaves the For You candidate pool |
| The viewer's own posts | You do not meet your own posts in For You |
| Posts already seen or already served | A viewer who has seen your post is not shown it again |
| Posts matching muted keywords | A muted word hides the post for that viewer |
| Posts from blocked or muted accounts | A block or a mute takes you out of that viewer's feed |
| Subscriber only posts the viewer cannot access | Locked posts are not shown to people without access |
| Reposts and replies from accounts the viewer does not follow | Out of network, original posts are what travel (the README adds conditions) |
| Repeated reposts of the same post | One repost of a post is enough |
| For new accounts, out of network posts below an engagement threshold | A brand new account's posts need some engagement before they travel to non followers |
| A configured percentage of posts, chosen the same way each time | Looks like a holdout for testing (our reading) |
The 48 hour limit is an age cap on candidates. It is one of the few hard numbers about time in the whole pipeline, and we come back to it when we look at the claim that some hours are magic.
How does X score the posts that are left
A transformer model called Phoenix reads the viewer's recent engagement history and each candidate post, and predicts the chance of many actions at once. Then a scorer combines those chances with weights: final score equals the sum of weight times chance, action by action.
The model predicts five groups of actions, according to the README.
| Group | Actions it predicts a chance for |
|---|---|
| Engagement | Like, reply, repost, quote, share, share by message, share by copying the link |
| Clicks | The post, the profile, a link, a photo expanding, a video opening, the quoted post |
| Attention | Video quality view, dwell, dwell time, click dwell time, active seconds |
| Author | Following the author |
| Negative | Not interested, mute author, block author, report, not dwelled |
The weights live in a parameter file whose header says it is mirrored from configuration defaults, last synced 8 October 2026. These are the defaults, not a promise about what is live. X re-syncs the file often: by 13 October 2026 a like was 0.66 and not interested minus 52.272.
| Action | Default weight |
|---|---|
| Like | 0.5 |
| Repost | 1.0 |
| Share | 2.0 |
| Follow the author | 4.0 |
| Reply | 5.0 |
| Quote | 5.0 |
| Share by message | 5.0 |
| Share by copying the link | 20.0 |
| Open a link | 0.2 |
| Dwell | 0.05 |
| Not interested | minus 47.52 |
| Block the author | minus 31.2 |
| Mute the author | minus 58.8 |
| Report | minus 234.0 |
Read it as chance times weight
A heavy weight on a rare action can add as much as a light weight on a common one. The walk above shows it with made up chances.
Read it as count times weight
Your likes are not multiplied by 0.5 and then cancelled by a report. The model scores the chance of each action for each viewer.
Two things follow, and they are our reading. A post has no single score, because the chances depend on who is looking. And the table is a map of what the model is asked to care about, not a recipe, because the README says live values come from a configuration system and are tested on a small share of traffic.
What changes the score after ranking
After scoring, a few adjustments reshape the list. The README describes three, and the docs folder describes a fourth.
README
Author diversity
Each post after an author's first is multiplied by a decaying factor, down to a floor. In one scorer file we read, this setting was written as off, so the code alone cannot say whether it applies today.
README
Out of network discount
Posts from accounts the viewer does not follow are multiplied by a factor below 1. So are replies and reposts from accounts the viewer does follow.
README
New author boost
Posts from authors whose impressions are below a threshold are lifted toward a target position.
Docs folder
Mutual follow boost
Original posts from people you follow and who follow you back get extra weight on the predicted chance that you reply.
A separate reranking service also trades a little score for less similarity between neighbours in the list, using a determinantal point process over the posts' embeddings. In plain words, it avoids stacking near twins side by side.
The new author boost, in numbers
The default settings in the parameter file say a post qualifies when all of these hold:
- the author has no more than 50,000 followers
- the post has fewer than 200 impressions
- the post is no more than 7,200 seconds (2 hours) old
- the post is an original post, not a reply or repost
The settings name target slots 15 and 16, which we read as the places in the ranked list where an eligible post is lifted to. The code also checks which experiment group the viewer and the author belong to, so it may apply to only part of your audience.
The fourth adjustment is the best documented change in the repository. The docs folder uses it as a worked example of how a change gets published.
10 July 2026
Test begins
Random users get a boost value of 5, 10, 15 or 20. Most users have 0.
13 July 2026
Broad launch
After positive early results, a value of 20 goes out widely while testing of other values continues.
24 July 2026
Lowered to 15
The notes say people were not seeing as much discussion as they wanted, with many posts coming from accounts they did not follow during the World Cup.
Our reading: a value that went from a test to a broad launch to a lower number in two weeks is a reminder that these numbers are tuned by people, often on feedback. Do not build a posting plan on a number that is likely to change next month.
Who decides whether a post can be shown at all
Visibility filtering does. After the top posts are selected, the scorer's order stops mattering for any post that visibility filtering drops. The README puts it in one line: "Ranking decides the order. Visibility filtering decides whether a post can be shown at all."
For each post and viewer, visibility filtering gives one of four answers:
- Allow: show the post normally.
- Notice: show the post with a notice attached to it.
- Interstitial: show it behind a gate the viewer can tap through, for example for adult or graphic media.
- Drop: do not show it.
"The first rule that answers drop ends the evaluation," says the README. A further set of rules applies only to recommendations from accounts the viewer does not follow, and those rules can only drop. Spam caught at high recall is the README's example.
The rules registry groups the Home timeline rules into things like author state (suspended, deactivated or protected accounts), the viewer's blocks and mutes, safety labels, spam, legal takedowns and sensitive media. X's Help Center adds that it restricts the reach of posts that violate its policies, for example by excluding them from search, trends and recommended notifications, or by limiting discoverability to the author's profile.
A Community Note is a different thing: contributors write and rate it. If one appears on your post, read our guide to X Community Notes.
What gets mixed in after ranking
The ranked posts are one source for the final feed. The README says the others add ads, Who to Follow, prompts and push to home items. A blender interleaves them, the default ads blender reorders posts so that ads sit next to them, and Who to Follow and prompts go at fixed positions.
- Ranked posts come from the pipeline above.
- Ads are placed by the blender.
- Who to Follow and prompts sit at fixed slots.
Our reading: a post's place in someone's feed is not a clean read of its rank. Ads and fixed slots sit around it, so two posts with similar scores can look further apart on the screen than they were in the ranking.
What else lives in the repository
The repository is bigger than the feed. Most of it is the machinery that labels posts and accounts, which is what visibility filtering reads.

Two label systems are worth knowing by name:
- Grox holds classifiers for categories such as spam, adult content and violent media.
- Agatha labels accounts from how many blocks, reports and spam reports they receive relative to favorites.
Our reading: the second one is why audience fit matters more than a big number. An account that collects blocks and reports for every like it earns can pick up a label, and labels feed the visibility rules. Three narrower questions have their own guides: how X ranks replies under a post, why posts reach the wrong audience and whether editing a post hurts its reach.
The README is open about what it leaves out: the model prompts used by the Grox classifiers and some rules, to reduce the risk that people use them to game the system.
Which X algorithm myths does the code support
Most algorithm advice is a claim about a rule. Here are common claims and what the primary sources show. "Not found" means not found in the files and pages we read, and because some rules are withheld, that is not proof of absence.
| The claim | What the sources show | How sure |
|---|---|---|
| Links get your post buried | In the weights we read, opening a link has a small positive weight, 0.2. We found no rule that lowers a post for containing a link | Not found |
| Posting too often hurts you | No posting frequency rule found. The nearest thing is author diversity, which one file we read had switched off | Unclear |
| There is a magic hour | The only time rules we found are the 48 hour age filter and the 2 hour window of the new author boost. Nothing names an hour of the day | Not found |
| A shadowban hides your account | The documented mechanism is visibility filtering with labels, and Under the Hood shows the labels on your account | Check your labels |
| Premium or a badge boosts every post | The weights list actions, not account types. The only subscription rule we found hides subscriber only posts from people without access | Not found |
| One report cancels hundreds of likes | The README calls that conclusion incorrect | Contradicted |
If you want the neighbouring facts, our guides cover when to post, what the badges mean and how automation rules work.
What does this mean for the posts you write
None of this is a recipe, and nothing here promises reach. But the pipeline does give you better questions to ask of a draft. Everything in this list is our reading of the sources above.
Questions to ask of a draft
- Who is the one reader who would reply to this, and what would they say?
- Would someone send it to a friend or copy its link? Those actions carry some of the highest default weights.
- Does the first line give a reason to stay? The model predicts dwell, and our guide to X hooks shows how to write that line.
- Could the wrong reader mute, block or report it? The biggest weights in the table are the negative ones.
- Is it an original post? Out of network, reposts and replies are filtered.
We are moving weekend bread pickup from 9am to 8am. If you could only take one loaf home, which one: seeded rye or plain sourdough?
Do not read this as a licence to bait. The negative weights are the largest in the table, and a post that earns mutes and blocks pays for it with every viewer who reacts that way.
To check your own results, calculate your engagement rate post by post. Kairo Post's analytics shows which topics and hours work for your own account, which is a better guide than a general tip.
How to keep up as the algorithm changes
The code, the weights and the filters all change. The only reliable habit is to check the source rather than the summary.
Open the README and the docs folder
Look for dated change notes. The bidirectional follow notes are the model of what a published change looks like.
Read the sync stamp
The weights file header says when it was last mirrored from configuration. If the date is old, the numbers may be too.
Open Under the Hood for your account
Check whether any visibility labels apply to you before you blame the ranking.
Ask where every tip comes from
If it cannot point to a file or a Help Center page, treat it as speculation and test it on your own posts.
Your plan for this week
- Open the README once and find the six stages in it.
- Open Under the Hood and note any labels on your account.
- Rewrite the first line of your next post so the right reader has a reason to stay.
- Compare your last 10 posts by engagement rate, and write down what the top two have in common.
In the product
How Kairo Post does this
Everything above works by hand. Kairo Post does the same work for you, with your approval before anything goes out.
Questions people ask
Is the X algorithm open source?
Does the X algorithm use Grok?
Is the Following feed in order of time?
Do replies count for more than likes?
How can I see whether X limited my posts?
How often does the X algorithm change?
Does the time I post matter for the X algorithm?
Sources
Every rule, limit and figure in this post was checked against these on the date shown.
- x-algorithm README, xai-org on GitHub
github.com · checked
- Phoenix README, xai-org on GitHub
github.com · checked
- Home Mixer parameters (param.rs), xai-org on GitHub
github.com · checked
- Bidirectional follow boost change notes, xai-org on GitHub
github.com · checked
- New author scorer (author_cold_start.rs), xai-org on GitHub
github.com · checked
- Visibility filtering rules registry, xai-org on GitHub
github.com · checked
- For You Home Timeline Recommendations, X Help Center
help.x.com · checked
- About your For you timeline on X, X Help Center
help.x.com · checked
- Our approach to recommendations, X Help Center
help.x.com · checked
- Engineering on X, announcement of the open source release
x.com · checked
Written by
