X Algorithm: What Open Code Shows About Post Ranking

The X algorithm is a recommendation system that selects, evaluates and orders posts for a user's feed. It is used to assemble the personalized For You feed from posts by followed accounts, recommendations outside subscriptions, media, replies and service modules. In real scenarios, it is important to separate three things: what is published in open code, what can be checked in your own analytics and what remains internal platform logic.
The most useful source for verification is the xai-org/x-algorithm repository, which describes the For You feed code, the Phoenix scoring model, visibility filters and the Under the Hood tool. If a team manages several brand or client profiles, it is worth setting up separate processes for managing multiple X accounts from the start, because algorithmic signals mix with session, device and behavioral pattern risks.
This article does not promise a formula for "hacking the X algorithm". It explains how posts are ranked on X according to public materials, why open code for the X algorithm is not the same as a full production map and how to test X recommendations without myths about shadow bans. For stable checks of logins, cookies and sessions, it is useful to separately review X Web Login.
Which parts of the X algorithm are open
Open code shows the core logic for selecting, evaluating and filtering posts in the For You feed, but it does not reveal the full internal infrastructure of X. The xai-org/x-algorithm repository describes how the system combines in-network content from accounts a user follows, out-of-network content selected by machine learning, visibility filters and ranking through the Phoenix transformer model. This is already more than the public 2023 description, but it is still not a full production copy.
In 2023, Twitter opened the old twitter/the-algorithm repository, which included services such as Home Mixer, Product Mixer, search-index, UTEG, SimClusters, RealGraph, Tweepcred and visibility filters. That code helps explain the architectural lineage, but for the 2026 topic the new xAI repository is the main source. It directly describes the For You feed, core ranking, filters, scoring parameters and the pilot Under the Hood tool.
Technical code analysis does not replace work profile hygiene. If a team tests new, purchased or transferred accounts, set up a separate process for buying X Twitter accounts so environment changes are not mixed with conclusions about the algorithm.
The open part makes it possible to confirm these components:
- candidate pipeline for initial post selection
- home-mixer as the feed assembly layer
- Phoenix model for predicting user actions
- RankingScorer for combining predictions into a final score
- visibility filtering for show, interstitial or drop decisions
- Under the Hood tool for viewing visibility-impacting labels
It is equally important that the repository itself clearly marks the limits of transparency. Some Grox prompts, certain botmaker rules and fragments that could help bypass platform rules are not published. So open code for the X algorithm provides a technical frame, but it does not let you precisely derive the cause of every reach drop.
How the system selects candidate posts
The system first decides which posts enter the candidate shortlist at all and only then ranks them for a specific user. This is the key difference: a weak feed result may mean not a low final score, but that the post did not pass the selection stage or was filtered out before scoring.
In the older Twitter architecture, documentation described selection from in-network and out-of-network sources, as well as the use of search-index, tweet-mixer, UTEG and the follow recommendations service. In the new X repository, the logic is presented through candidate-pipeline, Thunder, SimClusters and the Phoenix selection mechanism. The practical conclusion is the same: the X recommendation system does not start from one huge list of all posts, but collects candidates from several sources.
A typical post path looks like this:
- entering a candidate source through follows, interactions, topical similarity or model retrieval
- technical hydration, where the system loads text, author, media and metadata
- passing pre-scoring filters that remove duplicates, old posts, already viewed posts, muted keywords or unavailable content
- receiving predicted action probabilities in Phoenix
- passing post-selection filters and mixing with service modules
For an author, this means that post ranking on X is not reduced to likes. In practice, this should be read like this: before final scoring, a post passes selection and filtering, so the result can be affected by audience relevance, context and repeat display of already viewed content.

Post age should be considered separately. In the README of the new repository, pre-scoring filters include AgeFilter, which removes posts older than 48 hours in the relevant For You context. This does not mean that old posts are invisible everywhere: they can be seen in a profile, in the Following timeline or through search. But for the recommendation surface, freshness remains a technical barrier.
Which signals may affect ranking
Open code shows not "magic points for a like", but a prediction system. Phoenix predicts probabilities of specific actions for a specific viewer, and RankingScorer multiplies these predictions by weights and sums the result. This clarification matters because a weight does not multiply a raw count of likes, reposts or reports.
The public README lists groups of predicted actions: engagement, clicks, attention, author and negative. These are names of groups and events in the open code.
Positive or neutral signals include favorite, reply, repost, quote, share and follow author.
The model also predicts clicks and attention signals, including profile click, link click, photo expand, video open, dwell, dwell time and active seconds.
Negative signals include not interested, mute author, block author, report and not dwelled.
| Signal group | What can be seen in open code | Practical takeaway |
|---|---|---|
| interactions | prediction of the probability of a like, reply, repost, quote or share | evaluate the quality of discussion, not only the sum of reactions |
| clicks | prediction of clicks on the post, profile, link, photo, video or quoted post | make content clear before the click, without bait and vague context |
| attention | dwell, dwell time, video quality view, active seconds | look at retention and completion, especially for video and long threads |
| author | prediction of following the author | consistency of the profile topic may matter more than a single viral post |
| negative | not interested, mute author, block author, report, not dwelled | sharp audience reactions can reduce the chance of display more strongly than public metrics show |
After scoring, adjustments are applied. The documentation mentions Author Diversity, Out-of-Network Discount and New-Author Boost. The first mechanism prevents one author from taking too many positions in the feed. The second lowers the weight of some content outside subscriptions, replies or reposts. The third may raise posts by authors with a low volume of impressions to a target position.
These mechanisms explain well why identical posts do not work the same for different accounts. The X algorithm personalizes the prediction for the viewer, rather than evaluating a post in a vacuum. So the same publication can receive different predictions for different audience segments depending on their behavior.
What cannot be determined from open code
Open code does not justify the conclusion that every reach drop is a shadow ban. It shows part of the recommendation logic, but does not reveal all production experiments, private safety rules, full training data, manual moderation decisions or the context of a specific account.
Competing reviews often turn scoring weights into simple tips: "a reply weighs this much", "a report cancels this many likes", "post only during quiet hours". That is a risky simplification. The README of the new repository directly explains that weights scale predicted probabilities of actions by a specific user, not raw reaction counts.
These things cannot be determined precisely:
- the current weight of each signal for all X traffic if some values come from configurations or experiments
- the reason for one post's reach drop without access to your own visibility labels, analytics and control group
- all Grox and botmaker rules if they are intentionally unpublished
- the full impact of manual or legal restrictions on a specific account
- a universal posting-time formula that works equally well for all niches
The correct approach is to phrase conclusions by evidence level. "The code confirms that dwell time is a predicted action" can be supported by open code. The claim "Long posts always rank better" is a hypothesis that needs your data. The conclusion "The account is shadow banned" should not be made without visibility labels, stable impression history and a check of behavior changes.

This approach is useful for editorial teams, SMM teams and traffic arbitrage teams. It reduces the number of chaotic changes: instead of rewriting the whole content strategy after one failed post, the team checks whether the format, topic, timing, audience, account infrastructure or visibility status changed.
How to test hypotheses without shadow ban myths
Hypothesis testing should start with a change log, not with a ready-made conclusion. If reach drops, record exactly what changed: post format, publishing frequency, login device, IP, cookies, topic, share of replies, language, media or operator behavior.
The simplest team process looks like this:
- record the baseline metric for each account over the last 30 days
- separate organic metrics into impressions, engagement rate, reply rate, indirect retention indicators, dwell proxies and profile visits
- mark all login environment changes, including device, browser profile, proxy, cookies and time zone
- change only one parameter during a test period
- compare the result with a control account or a similar content segment
- check the Under the Hood JSON if the account has access to the pilot tool
- postpone the conclusion if there is less data than several publishing cycles
For X, this is especially important because visibility labels and ranking score describe different system layers. A label can limit visibility regardless of how well a post is predicted for a specific audience. And a low score may simply be the result of weak relevance or quick scrolling, with no hidden restriction at all.
In a practical table, hypotheses should be separated like this:
| Symptom | Stronger check | Weaker interpretation |
|---|---|---|
| impressions of all posts dropped sharply | Under the Hood labels, login history, IP or device change | "the algorithm does not like the account" |
| one post received no impressions | comparison of topic, timing, first reaction, media and duplication | "this format is dead" |
| views grew without reactions | analysis of dwell, clicks and first-screen structure | "likes no longer work" |
| many replies but few new impressions | share of negative reactions, reply quality, mute or report risks | "replies always boost" |
Do not test the algorithm through mass identical actions. Coordinated likes, identical replies, synchronized publications from several profiles and sharp activity spikes may create not a relevance signal, but a behavioral pattern for anti-spam systems. It is better to test content variables on small groups and keep a clean log.
How teams with multiple X accounts should organize checks
Team work with X requires separating two tasks: content analytics and technical session hygiene. If five accounts are managed from one browser, shared cookies and unstable IPs, the team will have a harder time determining what exactly affected impressions: content, audience behavior or the technical footprint.
For cleaner testing, keep separate context for each account:
- separate browser profile with its own cookies and local storage
- separate proxy or stable network route for the account's geography
- log of logins, password changes, cookie imports and device transitions
- separate operator roles so manual work and automation are not mixed
- control publications that do not change at the same time as the technical environment
Check User Agent, language, time zone and basic browser parameters separately. If these signals jump between logins, first review User Agent and browser privacy, and only then draw conclusions about algorithmic ranking.

This approach does not guarantee reach and does not cancel X rules, but it removes noise from analytics. If all accounts in one group drop after a proxy change, that is a technical signal. If only one post format drops, that is a content signal. If Under the Hood shows a visibility-impacting label, that is a separate level of analysis.
How Afina Helps Isolate X Accounts
In Afina, each work account can be managed in an isolated profile with its own fingerprint, cookies, storage, history, per-account variables and profile-level proxy. This helps the team avoid mixing sessions and read test results more accurately.
If automation is added to the process, do not mix it with manual actions without logs. Afina supports a local API, profile launch, work with cookies, proxies and scenarios, but the scenarios themselves should comply with platform rules and healthy activity limits. This material is provided for informational and educational purposes only.
The takeaway is simple: the X algorithm should be read as a system of predictions, filters and context, not as a table of "how many points one action gives". Open code provides a basis for sober hypotheses, and clean account infrastructure helps test those hypotheses without unnecessary technical noise.
DownloadFAQ — Frequently Asked Questions
What is the X algorithm?
The X algorithm is a recommendation system that selects, filters and ranks posts for a user's feed. It accounts for content, viewer behavior, the author and visibility rules.
Is the X algorithm really open source?
Yes, part of the For You feed code is published in an open xAI repository. At the same time, some rules, prompts and internal protection mechanisms are not disclosed.
How are posts ranked on X?
X predicts the probability of different user actions and combines these predictions into a final score. After that, the system applies filters, adjustments and feed mixing.
Can you know the exact weight of every signal?
Not fully. Open code shows some weights and formulas, but production experiments, configurations and private rules can change the result.
Does low reach mean a shadow ban?
No, low reach alone does not prove a shadow ban. You need to check labels, impression history, behavior changes, technical environment and content quality.
What is Under the Hood on X?
Under the Hood is a pilot transparency tool that shows aggregated visibility-impacting labels for an account or posts. It does not replace full analytics, but helps check visibility restrictions.
Do replies and dwell time affect X recommendations?
Yes, open code shows that replies, clicks, dwell and dwell time are included among predicted actions. But what matters is not the raw number of actions, but the predicted probability for a specific viewer.
Does Afina help change the X algorithm?
No, Afina does not change the X algorithm or guarantee reach. It helps separate profiles, cookies and proxies so a team can test its own hypotheses more cleanly.
