X updated its For You page algorithm - Here's what works now
Plus: How I went through the 20000+ lines of code of X's For You algorithm
Hi there,
X, formerly Twitter, the social network owned by Elon Musk, just updated its For You page algorithm and I went through the 20000+ lines of code to analyze it and create this article, so you can understand what actually works now when posting to X.
I mean, maybe I didn’t actually go through all those 20000+ lines myself… there’s a chance I shortened it with AI 😇
The X For You page algorithm is now open-source here: https://github.com/xai-org/x-algorithm, so I started by cloning the repo to my computer.
You can do the same with this command:
git clone https://github.com/xai-org/x-algorithm.gitThen, move into the downloaded directory with this command:
cd x-algorithmAnd execute Claude Code:
claudeYou should then see a window similar to this one:
I told Claude what the directory contained and asked it to analyze the entire codebase.
What Actually Works in X’s New For You Algorithm
Optimize for the full action surface, not just likes.
Every time you post, the algorithm gives your content a score. Positive engagement (likes, replies, reposts, bookmarks, time spent) increases that score. Negative engagement (hides, blocks, “not interested”, quick scrolls) decreases it.
The algorithm applies decaying scores to subsequent posts from the same account per feed request, meaning every extra post you make gets shown to fewer people. This should significantly reduce spam on the For You feed.
The algorithm also has specific logic designed to detect if a post has banger potential, and actively penalizes low-quality, generic, or AI-generated content.
You’ll now see more content from people you actually follow (in-network). Their posts get a higher score, so the algorithm is pushing more of what comes from your network.
The combination of reduced dwell time and lower click-through to X’s own content makes external links a well-established penalty.
NSFW, violence, gore, and toxicity will not help your content stand out. In fact, the algorithm actively penalizes this type of content.
Quality beats follower count. Small accounts can now achieve massive reach, as long as they create content that keeps people engaged for a long time.
Undisclosed ads will get almost zero reach.
Microniches are the big winners. If you stay consistent in a specific microniche and deliver high-value content, you can grow extremely fast. Avoid mixing too many different topics. Focus is heavily rewarded now.
Start making videos. X is now clearly becoming a video-first platform. Add captions/subtitles, because a huge portion of people watch videos on X with the sound off. Good captions will dramatically increase the time people spend watching and boost your reach.
Engagement velocity in the first 30-60 minutes is critical.
Below is Claude Code’s output.
Claude Code’s output
General Architecture — 8-step pipeline (Home Mixer)
Query Hydration → Candidate Sources → Candidate Hydration → Filtering
→ Scoring → Selection → Post-Selection Filtering → Feed Response
Scoring System — Phoenix model
Grok-based transformer that predicts the probability of 19 simultaneous actions. Final score = weighted sum:
Score = Σ (weight_i × P(action_i))
Positive actions (by weight order):
Negative actions:
Candidate Sources
Hydrators — factors that boost score
has_media = true — image or video present
VQV_WEIGHT — video longer than MIN_VIDEO_DURATION_MS and actually watched
engagement_counts — fav_count, reply_count, repost_count, quote_count
author_followers_count — accounts with more followers get more visibility
mutual_follow_jaccard — author followed by people you follow
language_code — feature passed to the model (no explicit filter)
Filters (pre and post scoring)
Final Selection
TopKScoreSelector: sorts by score, selects top 25–50
BlenderSelector: interleaves ads (minimum 5 organic posts between ads, default gap of 3)
Author Diversity Decay
Penalty for the same author appearing repeatedly in the feed:
multiplier = (1 - FLOOR) × DECAY^position + FLOOR
DECAY ≈ 0.6–0.9 → the 2nd post from the same author is worth ~60% of the original score
FLOOR ≈ 0.2–0.4 → never drops below this minimum
On language/location (from the specific search)
language_code exists on both posts and users
country_code and ip_location are also captured
No explicit filter or penalty for language mismatch — it is a feature passed to the model
The model learns language preferences implicitly from engagement history
No references to any specific locale in the scoring code
Identified numeric values
Examples
Now that we have all this information, I asked Claude Code to create an HTML file with some examples of posts that could went viral based in the new algorithm. Below is the result.
Open questions (maximise replies)
Hot takes and strong opinions (generate debate)
Educational threads (maximise dwell time and follows)
Posts with media (activate has_media + VQV_WEIGHT)
"Send this to someone" (maximise SHARE_VIA_DM_WEIGHT)
Surprising data (maximise reposts and quotes)
Polls (generate clicks and direct engagement)
Conclusion
In this article I used Claude Code to analyze X’s new For You page algorithm.
And yes… I did have that moment of doubt: should I have used Grok instead, since the code is from xAI?
In the end, I figured using an external tool might actually make the analysis more impartial 😁
Anyway, don’t take everything in this post as absolute truth. It was analyzed with AI, and as we all know, AI can make mistakes.
I went through the Claude Code analysis and shared several examples that you can use as inspiration for your own posts.
You can also use Claude Code (or any other AI tool) to help you create posts that are more likely to perform well under the new algorithm.
That said, in my opinion, it’s crucial not to lose your authenticity. I personally prefer to stay authentic rather than purely chasing the algorithm - but that doesn’t mean we shouldn’t study it, learn from it, and adapt our content accordingly.
Now go post on X and good luck! I hope one of your posts goes viral 🔥
See you soon,
Nelson









