GuideUpdated May 2026

X algorithm explained: what the code actually says

X has open-sourced its ranking algorithm twice. Most algorithm advice is speculation. This isn't. It's what the code actually reveals about what gets posts seen.

How we got here: the open-source timeline

March 31, 2023

twitter/the-algorithm released

Elon Musk fulfilled a promise to open-source the recommendation algorithm. The release at github.com/twitter/the-algorithm exposed the ranking pipeline, including reply weights, the Tweepcred system, and how the For You feed blends in-network and out-of-network content. Caused significant coverage when developers found the explicit multiplier for verified accounts.

github.com/twitter/the-algorithm
January 2026

xai-org/x-algorithm released

xAI released a new version of the ranking algorithm powered by Grok models. The new system uses ML-based ranking rather than the rules-based approach in the original release. Grok is used for content understanding, toxicity detection, and engagement prediction. Available at github.com/xai-org/x-algorithm.

github.com/xai-org/x-algorithm
March 2026

Link penalty introduced

A significant update to the ranking pipeline that added a distribution penalty for posts containing external links. xAI engineers confirmed this was intentional. The platform wants to keep users on X. Posts that link out now receive reduced For You distribution.

May 15, 2026

Largest algorithm update

The biggest update to xai-org/x-algorithm since launch, covering 187 files. Included improvements to engagement prediction models, adjustments to the Premium multiplier, and updates to the TweepCred scoring system. The update focused heavily on reducing low-quality engagement farming.

github.com/xai-org/x-algorithm

The single most important thing the code reveals

Replies are worth roughly 150x more than likes in the ranking model. Not 2x. Not 10x. One hundred and fifty times.

This is why posts that generate discussion outperform posts that generate approval. A tweet with 8 replies and 40 likes will rank higher than a tweet with 400 likes and 2 replies. The platform is built for conversation, and the algorithm weights accordingly.

The implication: write posts that provoke a response, not just agreement.

Ranking signals: what the algorithm measures

Engagement velocity (first 30-60 min)

Critical

How fast a post accumulates engagement right after posting is the strongest early signal. The algorithm uses this window to decide whether to amplify. A post that gets 50 replies in 30 minutes will see dramatically more distribution than one that gets 50 replies spread over 6 hours.

Reply weight (approx. 150x likes)

Very High

Replies are by far the most valuable engagement type in the ranking model. The exact multiplier has changed across versions but replies consistently outweigh likes by a factor of roughly 100-150x. A post with 10 replies outperforms a post with 1,000 likes in the ranking model.

Retweets and Quote Tweets

High

Both signal that the content is worth sharing to a new audience. Quote tweets carry slightly more weight because they require a new piece of content creation, signaling stronger endorsement than a plain retweet.

Bookmarks

High

Bookmarks were added as a ranking signal after the 2023 open-source release. They signal 'I want to come back to this,' which the algorithm interprets as high-value content even without public engagement numbers.

Premium account multiplier

Moderate

X Premium and Premium+ subscribers receive a distribution multiplier in the For You feed. This is hardcoded in the ranking pipeline. Premium+ gets a larger boost. For accounts with the same content quality, the subscriber gets more reach.

TweepCred score

Moderate

Account-level credibility score based on account age, follower quality, engagement history, and policy record. Not shown to users but affects how generously the algorithm distributes your posts. New accounts start lower; accounts with good history over time build it.

External links

Negative (since Mar 2026)

Starting with the March 2026 update, posts containing outbound links are penalized in For You distribution. The update was acknowledged by X engineers. The recommendation from most power users: put the link in a reply to your own post, not the original tweet.

Profile interaction history

Moderate

The algorithm personalizes based on whether you've previously engaged with an account. If someone has replied to, liked, or bookmarked your posts before, they're more likely to see future posts from you. Consistent posting builds this signal over time.

What changed from the 2023 algorithm to the 2026 version

twitter/the-algorithm (2023)

  • +Rules-based ranking pipeline with explicit weight tables
  • +Tweepcred as a static account quality score
  • +In-network and out-of-network feed blending
  • +Verified account multiplier (controversial on release)
  • +Engagement weights: reply 27.0, like 0.5, retweet 1.0 (approximate)

xai-org/x-algorithm (2026)

  • +ML-based ranking using Grok for content understanding
  • +Dynamic TweepCred that updates based on recent behavior
  • +Grok-powered toxicity detection and content quality scoring
  • +Link penalty introduced March 2026 for off-platform links
  • +May 2026 update: 187-file overhaul targeting engagement farming

What this means for how you post

Post when you can respond immediately

The first 30-60 minutes determine whether the algorithm amplifies your post. If you post and then go offline, you miss the engagement window. Post when you can monitor and reply to comments in real time. Replies to your replies generate additional engagement that compounds the initial signal.

Write for reply, not just agreement

Likes are almost worthless in the ranking model. Ask a question that people feel compelled to answer. State something slightly provocative that people want to push back on. End with a prompt: 'What's yours?', 'Have you seen this?', 'Drop yours below.' The goal is the first 10 replies, not 100 likes.

Put links in replies, not posts

Since March 2026, external links in a post body significantly reduce For You distribution. The workaround is standard now: post the observation or hook as the main tweet, then reply to yourself with the link. The original tweet gets full distribution; the reply with the link serves people who want to go deeper.

Get bookmarks, not just likes

Bookmarks are a high-weight signal and they're private. People bookmark posts they want to return to: tutorials, frameworks, resources, genuinely useful observations. Creating 'bookmark-worthy' content (specific, actionable, worth saving) performs better in the algorithm than content that generates passing agreement.

Frequently asked

Is the X algorithm actually open source?+

Yes, twice. Twitter first released the ranking algorithm as open source on March 31, 2023 at github.com/twitter/the-algorithm. xAI then released a new Grok-powered version in January 2026 at github.com/xai-org/x-algorithm, with a major update on May 15, 2026 covering 187 files. Both repos are publicly readable.

What does the X algorithm reward most?+

Engagement velocity in the first 30-60 minutes matters most. Replies are weighted roughly 150x more than likes. Bookmarks and retweets also score high. External links were penalized starting in March 2026 — the algorithm now significantly reduces distribution for posts that send users off-platform.

Does being a Twitter Blue / Premium subscriber boost reach?+

Yes. The algorithm explicitly applies a multiplier for Premium accounts in the For You feed ranking. The multiplier varies but is documented in the open-source code. Premium+ gets a larger boost than Premium. This is a direct ranking factor, not just a benefit for the subscriber.

What is TweepCred and does it matter?+

TweepCred is an account-level credibility score used internally by X. It's influenced by factors like account age, history of policy violations, quality of followers, and engagement patterns. Accounts with higher TweepCred get better distribution. It's not directly visible to users but affects how the algorithm treats your posts.

Do links hurt reach on X?+

Since the March 2026 algorithm update, yes. Posts containing external links receive significantly reduced distribution in the For You feed. The penalty applies to the tweet itself. Workarounds include putting the link in a reply to your own tweet, or using an image with the URL embedded rather than a plain hyperlink.

Primary sources

Write posts that earn replies

Replies are the highest-value signal in the ranking model. Bangers Only generates 4 variations of your idea. Pick the one that makes people respond.

Generate your next post