How the X algorithm works in 2026, read straight from the code

Most advice about the X algorithm (formerly Twitter) is secondhand. Links kill your reach. Premium guarantees views. One report wipes out hundreds of likes. These claims spread fast, and they're hard to check, even though X publishes the code that builds the For You feed.
This guide goes to the source. It reads the public code in the official repository and explains it in marketing terms: what each action is worth, which signals sink a post, how long a post stays in play, and which popular beliefs don't hold up.
Two rules apply throughout. Every claim names the file it comes from. And when the code doesn't prove something, you'll see it flagged plainly as an inference. Let's start with what was actually published.
What did X publish about its algorithm, and how current is it?
X keeps the xai-org/x-algorithm repository on GitHub, with the code that picks and orders posts for the For You feed. This article is based on the version published on November 4, 2026. Specifically, it's commit b508926 of the repository. The weights live in home-mixer/params/param.rs, which says it was last synced with X's configuration on November 3, 2026.
Keep three caveats in mind:
- This is code published on a date, not a live view of production. X runs A/B tests and can change values for groups of users. The repository itself records weight changes in July and August 2026.
- Not everything is public. The README notes that some anti-spam rules and the prompts behind the AI classifiers weren't released.
- The repository disagrees with itself in places.
vm-ranker/params.rscarries different default values fromparam.rs(a like is 0.5 there instead of 0.66, for example). The README saysparam.rsis synced automatically with the primary production values, so this article usesparam.rs. Treating the other file as fallback values is our inference.
For context, Twitter's 2023 open-source release (the twitter/the-algorithm-ml repository) weighted a reply at 13.5, a like at 0.5 and a report at −369. The 2026 numbers are different, and so is the logic.
How does the For You feed choose posts?
The feed is built in four stages: gather candidates, drop what can't be shown, score each post, then adjust the order so the feed doesn't get repetitive. This runs every time someone opens or refreshes the feed.
- Candidates. Posts from accounts you follow, plus posts from outside your network that the model thinks may interest you.
- Filters. Out go posts older than 48 hours, posts from accounts you've blocked or muted, posts with words you've muted, replies and reposts from accounts you don't follow, and duplicate branches of the same conversation (only the highest-scoring one stays). The README's filter table lists them all.
- Scoring. A model predicts how likely you are to take each action on the post (like, reply, share, report and so on) and combines those predictions into a single score.
- Final adjustments. The system tones down several posts in a row from the same author, discounts posts from outside your network, and gives small authors with fresh posts a nudge.
How does X score each post?
A post's score is the sum of each action's weight multiplied by the predicted chance you'll take that action: score = Σ (weight × probability). It isn't a count of likes, and it isn't the same for everyone. The same post gets a different score for each reader.
Here's a hypothetical example, just to show the math. Say the model predicts a 10% chance you'll like a post and a 1% chance you'll copy its link. The like contributes 0.66 × 0.10 = 0.066. The copied link contributes 20 × 0.01 = 0.2. A rare action with a high weight can outweigh a common one.
That's also why "one report cancels 468 likes" is wrong. The math (234 divided by 0.5) treats weights as if they were counts. The comment next to the weights in param.rs says otherwise. Weights multiply probabilities. The baseline chance of a report is more than 1,000 times lower than that of a like. And mass reporting has limited effect, because predictions are personalized and only actions on posts that X served on Home count.
Which actions count most in the X algorithm?
Copying a post's link carries the highest positive weight (20). Next come replying, quoting and sending by direct message (5 each), following the author (4) and sharing (2). A like is worth 0.66. All values below come from home-mixer/params/param.rs.
| Predicted action | Weight | What it means for you |
|---|---|---|
| Copy the post's link | 20 | People save it or take it somewhere else |
| Reply | 5 (20 in some cases, see the next section) | The post sparks real conversation |
| Quote | 5 | The post becomes the starting point for another |
| Send by direct message | 5 | Someone thinks a specific person should see it |
| Follow the author from the post | 4 | The post convinces someone to keep up with you |
| Share by other means | 2 | Other ways of sharing |
| Repost | 1 | A plain repost |
| Like | 0.66 | The most common action, with a low weight |
| Time spent after clicking into the post | 0.4 | They clicked and kept reading |
| Click the post | 0.3 | Opening the conversation or detail view |
| Open a link | 0.2 | A click on the post's link |
| Pause on the post / expand a photo / click a quoted post | 0.05 each | Light attention signals |
| Open a video | 0.02 | A light signal |
| Profile click, video view, "analyze with Grok" | 0 | Not part of the score right now |
The takeaway: likes are the weakest positive signal, and the heavy weights reward usefulness and conversation, such as saving the link, sending it to someone, replying and quoting. A zero weight doesn't make an action pointless. It just doesn't add to the feed score in this version.
What is the mutual-follow boost?
When you and an author follow each other, the weight on your reply to that author's original post rises from 5 to 20. The parameter is BidirectionalFollowReplyWeightBoost, set to 15 and added on top of the reply weight.
Here's the detail most people get wrong. The boost is not a general bonus for "replies between mutual followers." According to BIDIRECTIONAL_BOOST_CHANGE.md, it applies only when the candidate post is original, meaning it isn't a reply or a repost, and the author is someone the reader follows who follows them back. In effect, the system puts much more value on the chance that this reader will start a conversation on that post.
The same document lays out the timeline:
| Date (2026) | What happened |
|---|---|
| July 10 | A/B test with values of 5, 10, 15 and 20 |
| July 13 | Broad launch at 20 |
| July 24 | Lowered to 15, after feedback during the World Cup |
It also shows that a similar boost for reading time was tested and not shipped (it sits at 0).
What this suggests for your strategy is our inference: active mutual relationships, with people who actually talk to you, are worth more than a large, silent audience. The code doesn't show that mass follow-backs help, because a mutual follower who never replies still has a low predicted chance of replying.
Which negative signals sink a post?
Reporting (−234), muting the author (−58.8), "not interested" (−52.272) and blocking the author (−31.2) are the heaviest negative signals. There's also a light one for scrolling past without pausing (−0.02).
| Predicted action | Weight |
|---|---|
| Report the post | −234 |
| Mute the author | −58.8 |
| "Not interested in this post" | −52.272 |
| Block the author | −31.2 |
| Scroll past without pausing | −0.02 |
Remember the earlier rule: these weights multiply probabilities. A post doesn't lose reach because it "got a report." It loses ground when the model predicts that this particular reader has a real chance of reporting, muting or saying they're not interested.
For most brands, mute and "not interested" matter more than reports. They're the typical reaction to repetitive or off-topic posts.
How long does a post stay in play, and why does posting in bursts backfire?
A post can appear in For You for up to 48 hours. Within each feed build, a second post from the same author keeps 62.5% of its score, a third keeps 43.75%, and so on down to a floor of 25%.
The 48-hour limit is set in home-mixer/params/config.rs (MAX_POST_AGE = 48 * 60 * 60) and enforced by the age filter. After that, the post is out of the running for recommendations.
The same-author reduction works like this, based on xai-value-model/scoring.rs and the values in vm-ranker/params.rs (a decay of 0.5 and a floor of 0.25):
| Position among the same author's posts | Score multiplier |
|---|---|
| 1st | 100% |
| 2nd | 62.5% |
| 3rd | 43.75% |
| 4th | 34.4% |
| 5th onward | falling to the 25% floor |
Two reading notes:
- It applies per feed build, not per day or per session. The reduction hits posts from the same author competing for space in a single feed refresh.
- The values are code defaults. That production uses exactly 0.5 and 0.25 is our inference, since those numbers aren't in the file synced with production.
Two more adjustments round out the picture:
- Out-of-network discount. Posts from outside the reader's network have their score multiplied by 0.75 (
OonWeightFactorinvm-ranker/params.rs). The README says the discount also applies to replies and reposts that arrive through accounts the reader follows. - Small-author nudge. An original post can be promoted if it meets three conditions:
- it's up to 2 hours old;
- it has fewer than 200 views on Home;
- its author has up to 50,000 followers.
The limits are in param.rs (ColdStartImpressionThreshold, ColdStartMaxPostAgeSecs, ColdStartFollowerCap). author_cold_start.rs promotes one such candidate per feed build. Note that the 200 views are the post's, not the account's.
One myth about new accounts deserves a correction. The NewUserMinEngagementFilter doesn't require minimum engagement from new authors. It looks at the account age of the person reading the feed (under 30 minutes). In this version it's switched off (EnableNewUserMinEngagementFilter = false).
Premium, links and Grok: what's myth and what's in the code?
None of the three gains or loses points directly in the For You weights. All three show up elsewhere in the system, though, and that's where the nuance lives.
| Common claim | What the code shows | What the code doesn't show |
|---|---|---|
| "Premium boosts reach" | No Premium or verified weight in the feed score. But the account reputation calculation (user-cred-v2) gives a starting point only to Premium and verified accounts | How much that reputation changes reach |
| "Links kill reach" | No negative weight for links. Opening a link adds 0.2. A "has a link" signal (has_url) is sent to the final reranker | What the reranker does with that signal |
| "Grok judges whether your writing is good" | The "analyze with Grok" weight is 0. But AI models do read posts for spam, low-quality content and reply ranking | Any "good writing" bonus in the feed score |
Does X Premium increase reach?
The ranking code has no Premium weight. X does, however, compute a reputation score for each account, a kind of PageRank, in the user-cred-v2 module. In UserCredV2App.scala, the starting point for that calculation goes only to Premium or verified accounts, and engagement signals are blended in afterward. That reputation feeds anti-spam rules: high-reputation accounts can skip some checks.
That this translates into more reach is our inference. The code shows the mechanism, not the size of the effect. The spam rules also exempt accounts with the gray (government) checkmark, not regular Premium accounts.
Do links hurt reach on X?
The public code shows no direct penalty. Opening a link has a positive weight (+0.2). There are two nuances:
- A "has a link" signal goes to the final reranker.
has_url, defined inhome-mixer/models/content_features.rs, is passed along. The code doesn't show whether it counts for, against, or not at all. - Bad links have their own rules. The anti-spam rules handle low-quality links and links from bad sources.
The idea that a link "takes people off the app and cuts reading time" is a hypothesis, not something the code proves.
Does Grok read my posts?
It does, though not to give your writing a quality score in the feed. According to the README, a classifier system called grox runs when a post is published and checks for spam, adult content and violence. In the grox files:
- one classifier uses a Grok model to score replies from 0 to 3;
- another, built on the Gemma model, computes a "slop" score for generic, low-quality content.
The abuse-enforcement-service rules apply visibility labels to posts and accounts flagged as "llm_slop" (for 30 and 7 days, respectively). That Gemma's slop score is exactly what triggers those labels is our inference.
The safe conclusion: mass-produced generic text is more likely to get flagged, and the code shows no bonus for "well-written" text.
What should you do with what the code shows?
Write posts that start conversations and are worth saving or forwarding, space them out, post when your audience is active, and avoid anything that triggers "not interested." The checklist below ties each habit to a signal in the code. Items marked as inferences are our reading.
- [ ] Make posts worth saving or sending to someone: lists, data, how-tos, references. Weights of 20 (copy link) and 5 (direct message).
- [ ] End with a real question you'll answer. Reply and quote are each weighted 5. Replying back keeps the conversation going; that it helps the post is our inference.
- [ ] Build active mutual relationships. Your original posts are worth more to people you follow back (reply weight of 20).
- [ ] Favor original posts over reposts when you want reach within your network. The mutual-follow boost only applies to original posts.
- [ ] Space out your posts. Bursts compete with each other in the same feed refresh (2nd post at 62.5%, 3rd at 43.75%).
- [ ] Post when your audience is usually active. The small-author nudge only covers the first 2 hours, and posts leave For You after 48 hours. The code doesn't define a "best time"; the right time depends on your audience (our inference).
- [ ] Stay on topic. Mute (−58.8) and "not interested" (−52.272) weigh far more than a like.
- [ ] Avoid generic text at volume. There are "slop" classifiers with visibility labels.
- [ ] Use links when they help the reader. There's no direct penalty in the public code, and the effect of the
has_urlsignal isn't visible. - [ ] Don't buy into a formula. Scores are per-reader predictions, and X can change the weights at any time.
If you post the same topic across several networks, rewrite it for X instead of copying it over. The guide on how to cross-post on social media walks through how.
How can PostRite help?
PostRite schedules and publishes posts to X using your own API key. It respects your account's character limit and lets you space posts out on a calendar and in a queue. It doesn't change the algorithm, but it helps you put the pacing and formatting above into practice.
First, a requirement: X requires you to use your own API key. According to the X integration docs, you create an app in the X developer portal with read and write permissions, then enter its four OAuth 1.0a credentials in PostRite. X bills API usage to your developer account. If your API plan runs out of credits, PostRite marks the failed post as "payment required" (HTTP 402).

X options appear in the editor once the account is selected: who can reply and the first comment.
Once the account is connected, the docs list:
- The right character limit. It's 280 characters, or 25,000 if the account has an X subscription (Basic, Premium or Premium+).
- The count is weighted the way X does it: every link counts as 23 and every emoji as 2.
- A post going to several accounts can use 25,000 only if all of them are subscribed.
- Media: up to 4 images, or 1 video of up to 2 minutes 20 seconds, per post.
- First comment: published automatically as a reply right after the post, up to 280 characters. It's the usual place for a link or hashtags if you'd rather keep the main post clean.
- Who can reply: everyone, only accounts you follow, or only accounts you mention.
- Different copy per network: the same post can have one version for X and another for LinkedIn.
- Multiple X accounts, within your plan's limits.

The queue lists what goes out next, in order.
For pacing, scheduling gives you three views:
- a calendar (month, week, day and agenda);
- a queue;
- a list.
Everything runs in your organization's time zone. You can reschedule by dragging a post on the calendar, and schedule or cancel several posts at once. That makes it easy to space posts out instead of publishing in bursts. Teams also get templates and an approval workflow.
One limit, to set expectations: PostRite doesn't currently show per-post metrics for X, and it doesn't offer automatic replies or direct messages on X. To pick posting times, rely on what you already know about your audience. Plans and what each includes are on the pricing page.
Frequently asked questions
Is the GitHub code the same as what runs on X?
Largely, but not necessarily identical. The README says the values in param.rs are synced automatically with production, and the last recorded sync is November 3, 2026. A/B tests can change values for groups of users, and some anti-spam rules and AI prompts weren't published.
Does one report cancel out 468 likes?
No. Weights multiply the predicted probability of each action for each reader, and the baseline chance of a report is more than 1,000 times lower than that of a like. The comment in param.rs corrects this math itself.
Does X Premium increase reach?
There's no Premium weight in the feed score. Premium and verified accounts get a starting point in the reputation calculation used by anti-spam rules, but the code doesn't show how much that changes reach. The verifiable benefit is the 25,000-character limit.
Do links hurt reach on X?
The public code has no negative weight for links, and opening a link adds 0.2. A "has a link" signal goes to the final reranker with no visible effect, and spam or low-quality links fall under their own rules.
Does Grok read my posts?
AI models, including Grok and Gemma, read posts to detect spam and low-quality content ("slop") and to score replies. The "analyze with Grok" weight in the feed score is 0, and the code shows no bonus for good writing.
How long does a post show up in For You?
Up to 48 hours. Authors with up to 50,000 followers can get a nudge in the first 2 hours if the post has fewer than 200 views on Home.
Conclusion
The X code doesn't hand you a formula, but it settles a lot. Likes are the weakest signal. Saving the link, sending it by message and replying count far more. Mutes and "not interested" are expensive, and every post gets a 48-hour window. The code also shows where the gray areas are, such as Premium, links and AI.
The best strategy is still to publish useful things, at a steady pace, for people who talk back. And to revisit these numbers now and then, because the code changes.
If you want to plan that pace on X and your other networks from one calendar, PostRite offers a 14-day free trial, no credit card required, so you can connect your X account with your own API key and line up next week's posts. Less guesswork. More method.