δΈ­ζ–‡ Source Code β†—

The X Algorithm Handbook

Rules and playbooks distilled from X's official open-source recommendation algorithm (2025-09 update). Every number cites a source file. You can check it all yourself.

⚠️ About the data: This handbook is based on the official GitHub repos twitter/the-algorithm (latest commit c54bec0, 2025-09-03, "update for-you recommendations code") and twitter/the-algorithm-ml. In the 2025 code, the model weights are set remotely (the defaults in code are 0). The weight numbers quoted here come from the last table X made public (April 2023) β€” the official README still points to them. The open-source code may differ from what runs in production. Treat every number as a strong hint about scale, not an exact value.

What is this

X (Twitter) put its recommendation algorithm β€” the code that decides which posts you see β€” on GitHub. It even got a quiet update in September 2025. That means for the first time, questions like "how do I grow?" and "why is my reach dead?" have answers you can actually check.

This handbook pulls out every rule that matters for creators, organized as Rules β†’ Time β†’ Playbooks by situation, so you can look things up any time. It's written for people just starting out, small accounts, and people reviving old accounts.

The big picture: a post's journey

β‘  Gather ~50% from follows ~50% from strangers β‰ˆ1500 candidates β‘‘ Score A neural net predicts 15 kinds of reactions points Γ— probability β‘’ Adjust strangers Γ—0.75 same-author discount fatigue Γ—0.2 β‘£ Filter seen / duplicates NSFW / low quality β†’ your timeline Where candidates come from (inside β‘ ): Earlybird index follows Β· last 7 days UTEG like-spread "X liked" Β· 48 hours SimClusters 145k interest groups TwHIN embeddings similar content Communities / FRS separate pipelines
The four stages of the For You timeline. Each refresh scores about 1,500 candidate posts. Only a few dozen make it to your screen.

Scoring: the points table

The whole algorithm boils down to one simple idea. Think of it like a video game:

Post score = sum of (chance someone does an action Γ— points for that action)

The model guesses what each reader will do with your post. Each action is worth points (from the last table X made public):

What a reader doesPointsNotes
Replies to you β€” and you answer back+75The biggest prize in the whole game
Replies to your post+13.5Worth 27 likes
Visits your profile, then likes or replies+12Your pinned post matters
Opens your post and stays 2+ minutes+10–11Deep reading counts
Reposts it+1
Likes it+0.5The weakest positive signal
Taps "not interested" / mutes / blocksβˆ’74β‰ˆ erases 148 likes
Reports your postβˆ’369β‰ˆ erases 738 likes

Source: the-algorithm-ml/projects/home/recap/README.md; weights are read in home-mixer/.../param/HomeGlobalParams.scala (2025 version sets them remotely; defaults are 0, but the scale still holds)

New in the 2025 update

The September 2025 code added new things the model now predicts. That tells you what X is rewarding now:

Source: home-mixer/.../model/PredictedScoreFeature.scala (15 prediction heads), PhoenixPredictedScoreFeature.scala

βœ… The one-line takeaway
The game is not "get likes." The game is "start conversations with the right people." One conversation with the author = 150 likes. One "not interested" tap = losing 148 likes. Better to reach 100 right people than to bother 10,000 wrong ones.

Boosts & penalties (the multipliers)

After the model scores your post, a chain of multipliers gets applied:

MultiplierValueMeaning
Out-of-network discountΓ—0.75Non-followers see your post at 75% strength
Reply discountΓ—0.75Replies shared as content get 75% strength
Same-author discountΓ—1 β†’ Γ—0.625 β†’ Γ—0.4375…Your 2nd, 3rd post in one refresh decays by 0.75Γ—0.5^n+0.25, floor Γ—0.25. Spamming doesn't work
Feedback fatigueΓ—0.2 to startAfter someone taps "not interested" on you, your posts show to them at 20% strength. Recovers 0.2 every 35 days β€” full recovery takes 140 days
Grok "slop" decayΓ—(0–1)Content Grok flags as low-effort filler gets multiplied down
Live content boostdynamicOnly for followed authors with 1M+ followers. Not your problem yet

Source: home-mixer/.../scorer/RescoringFactorProvider.scala, DiversityDiscountProvider.scala, FeedbackFatigueScorer.scala (140 days / floor 0.2), GrokSlopScoreRescorer.scala, ScoredTweetsParam.scala (the 0.75 defaults)

Filters (instant removal, no discount)

Source: home-mixer/.../functional_component/filter/ (18 filters)

Where traffic comes from

About 50% of the For You feed comes from accounts people follow (the Earlybird index holds the last 7 days of posts). The other 50% comes from recommendations to strangers. Four doors lead to strangers:

DoorHow it worksWhat it means for small accounts
UTEG like-spreadSomeone likes your post β†’ their followers may see "X liked this." The interaction graph only keeps 24–48 hoursOne like from a real account with real followers beats 50 bot likes (bots have no followers β€” the chain breaks)
SimClusters~145k interest "neighborhoods." Your neighborhood is decided by who follows and likes you. Each liker's interests get added to your post's profile in real timeStay in one lane and your neighborhood label gets sharp. Random followers and like-swaps blur your label
SearchEvery public post enters the search indexDoesn't care about followers. Use words people actually search for β€” traffic is possible on day one
CommunitiesA separate pipeline sends posts straight to community membersReach a whole community with 0 followers. The most underrated door for new accounts

Source: README.md (the 50% split), src/scala/.../user_tweet_entity_graph/README.md (24–48h), simclusters_v2/README.md, ScoredTweetsRecommendationPipelineConfig.scala (9 candidate pipelines)

πŸ’‘ The fifth door β€” and it ignores followers too: replies
Your reply under any big post is visible to everyone reading that conversation. It's the only surface that completely ignores your follower count. Combine that with the +75 prize for author-engaged replies, and the reply section is a small account's main quest, not a side quest. Warning: spammy replies get folded into the hidden "low quality" section (see Limits). Quality wins, not volume.

Account trust (TweepCred)

Every account has a 0–100 trust score, computed with PageRank β€” the same idea Google used to rank web pages. Followers pass trust to you. The more trusted your followers are, the more they pass. The key rules:

RuleValueIn the code
Suspended accountbase score = 0if (isSuspended) 0
Verified accountbase score = 100 (max)if (isVerified) 100
Regular account ceilingbase score tops out at 55device weight 0.55 Γ— age weight Γ— 100
Account-age weightmaxes out at 30 daysif (age > 30) 1.0
Restricted accountbase score Γ—0.1score *= 0.1
Follow-ratio penalty (base)following > 500 AND following/followers > 0.6 β†’ exponential decayUserMass.scala
Follow-ratio penalty (PageRank)following > 2500 β†’ divided by up to 50Reputation.scala
Low-trust filterTweepCred < 40 gets filtered from follow recommendationsLowTweepCredFollowStore.scala

Source: src/scala/com/twitter/graph/batch/job/tweepcred/UserMass.scala, Reputation.scala

βœ… Myth busted: following people does not hurt you
The penalty needs two conditions at once: following more than 500 (base score) / 2,500 (PageRank) and a bad ratio. A new account with 0 followers following 300 accounts in its topic = zero penalty. The only thing to avoid is the follow-thousands-for-follow-backs game. Safe line: follow freely up to 500; past that, keep following ≀ 0.6 Γ— followers.

Limits & safety labels

"Shadowban" isn't magic β€” in the code it's specific labels with specific actions. Three levels:

LabelWhat triggers itResult
NotGraduatedNew account that hasn't "graduated"May not be shown to non-followers at all; replies folded
EngagementSpammerLike-swap groups, fake engagementDrop
DuplicateContentReposted / copied contentDrop
CopypastaSpamCopy-pasting viral postsDownrank / folded
UntrustedUrlSketchy links in repliesFolded into the abusive-quality section
HighToxicityScoreHigh score from the toxicity model (pToxicity)Downranked by per-language thresholds
NsfwHighPrecision etc.NSFW model hitsDrop / downrank

Source: visibilitylib/.../UserLabelRules.scala, DownrankingRules.scala, trust_and_safety_models/README.md

Negative feedback (block / mute / report / "not interested") is counted in 1-day / 7-day / 30-day windows β€” old mistakes fall out of the stats after 30 days (but feedback fatigue runs its own 140-day timer).

Source: representation-scorer/.../UserSignalServiceRecentEngagementsClient.scala

Behavior dictionary: what every action does

Every action has two sides: when you do it (it shapes your profile and relationships) and when you receive it (it changes your post's score). The repo root file RETREIVAL_SIGNALS.md lists all 18 signals and exactly which systems consume each one. Here they are, one by one.

Signal-flow abbreviations: USS=User Signal Service Β· SC=SimClusters neighborhoods Β· TwHIN=knowledge-graph embeddings Β· UTEG=like-spread graph Β· FRS=follow recommendations Β· LR=light ranker

πŸ“ Posting (original)

When you do itEnters your followers' in-network candidate pool (7-day shelf life); your 2nd+ post in one refresh decays from Γ—0.625; duplicate media gets cluster-deduped; Grok tags content quality
Key clocksFirst hour (buzz features halve every 30 min) β†’ 48 hours (like-spread window) β†’ 7 days (candidate pool) β†’ forever (search)
Playbook1–3 good posts a day; post when your readers are online; guard the first hour; silent after 48 hours = move on; never post in rapid bursts

πŸ’¬ Replying

When you do itVisible to everyone reading the conversation (the only surface that ignores follower count); distributed as content at Γ—0.75; charges the relationship edge between you two; spammy replies get folded into the low-quality section
When you receive it+13.5; answer that reply and it triggers the game's biggest prize: +75
Signal flowUSS Β· TwHIN Β· UTEG Β· FRS Β· LR
PlaybookA small account's main quest. 3–5 thoughtful replies a day; answer every comment under your own posts (each one is a +75 chance); quality over volume

❀️ Liking (and unliking)

When you do itFour effects: β‘  shapes your interest profile (decides what you see); β‘‘ may broadcast to your followers ("X liked", 48-hour window) β€” a like is a public endorsement; β‘’ your interest vector gets added to that post's profile in real time, helping it find its audience; β‘£ keeps funding the author's neighborhood label with a 100-day half-life
When you receive it+0.5 (weakest positive signal, but with hidden embedding and spread value); who likes you decides who your post gets shown to next
Signal flowLike: all six systems | Unlike: USS Β· SC (negative β€” withdraws the interest vote)
PlaybookLike deliberately inside your niche β€” it's the cheapest support you can give and a vote for your own profile; random likes pollute your label for a full batch cycle (~a week)

πŸ” Reposting & quoting

When you do itDistributes the content to your followers at full strength (no discount, same stage as originals); a quote also creates your own new post that can earn engagement; both count as repost signals shaping your profile
When you receive it+1 (quotes carry the same weight as reposts in Phoenix)
Signal flowUSS Β· TwHIN Β· UTEG Β· FRS Β· LR
PlaybookQuote beats plain repost: you gain a content surface and a conversation entry of your own. Reposting good niche content is a cheap way to stay daily-active and keep follower edges warm

πŸ”– Bookmarking

When you do itA private positive signal (USS only) β€” not public, doesn't spread, quietly trains your profile
When you receive itNew 2025 prediction head (BookmarkParam) with its own positive weight β€” "worth saving" is now rewarded on its own
Signal flowUSS
PlaybookDeliberately make save-worthy formats: checklists, tutorials, comparison tables, reference posts. Bookmark rate is one of the best new metrics to watch in analytics

πŸ“€ Sharing & screenshots

When you do itShares (including copy-link and off-platform shares) feed USS / FRS; a strong interest statement
When you receive itNew 2025 Share prediction head (Phoenix tracks 3 share actions); screenshots are their own prediction head too (ScreenshotParam) β€” getting screenshotted earns points
Signal flowUSS Β· FRS
PlaybookMake content people forward to group chats; self-contained, one-screen layouts are screenshot-friendly. "Worth sending to a friend" is the new banger standard

βž• Following

When you do itThe strongest profile vote there is: all six systems consume it, often as both feature and training label. Up to 500 follows is penalty-free; past that, keep following ≀ 0.6 Γ— followers
When you receive itPassive: trust inflow (PageRank) + a neighborhood vote + you become a "friend of a friend" to all their followers. Active: edge strength peaks at the follow moment β€” a 7-day trial that silently zeroes out without interaction
Signal flowUSS Β· SC Β· TwHIN Β· UTEG Β· FRS
PlaybookTreat your follow list as a "what's my niche" declaration form; when someone follows you, go reply to one of their posts β€” weld the edge shut while it's hot, much faster than waiting for their like

βž– Unfollowing

When you do itRecorded as a "recently unfollowed" signal (USS feature) that shapes what gets recommended to you; does not directly hurt your own trust score β€” pruning is safe
When you receive itYou lose that person's trust inflow and in-network eligibility; follow-then-unfollow games leave a data trail
Signal flowUSS
PlaybookPrune old follow-for-follow lists boldly (especially if you follow 2,500+); never play the follow/unfollow game

πŸ”‡ Muting & blocking

When you do itUSS / FRS features β€” the system stops recommending those accounts to you; cleaning your timeline = improving your own consumption profile. Use freely
When you receive itCounts into the negative-feedback group (the βˆ’74 tier), tracked in 1/7/30-day windows; pile up enough and account-level labels trigger
Signal flowUSS Β· FRS
PlaybookAvoid block-magnet behavior: @-spamming, promo comments under strangers' posts, showing up too often in the wrong people's feeds

πŸ‘Ž "Not interested"

When you do itTrains your own feed (USS feature); hits the author at the βˆ’74 tier
When you receive itβˆ’74 (β‰ˆ erases 148 likes) + 140 days of feedback fatigue from that user (your posts start at Γ—0.2 for them, recovering one step every 35 days)
Signal flowUSS
PlaybookThe most underrated liability in the system. Trend-jacking to the wrong crowd, clickbait, and hard selling are all net losses by the math β€” reach 100 right people, never bother 10,000 wrong ones

🚨 Reporting

When you do itUSS feature, trains your feed
When you receive itβˆ’369 (the heaviest penalty in the system, β‰ˆ erases 738 likes); high report rates trigger safety labels like HighPReportedTweetScore β†’ downrank / folding
Signal flowUSS
PlaybookThe red-line list: rage bait, rule-edge testing, mass DMs, sketchy links. One report costs more than one banger earns

πŸ‘€ Browsing (clicks / dwell / video / profile visits)

When you do itAll implicit signals quietly shaping your profile: detail-page clicks (USS/FRS, LR training labels), watching videos past a seconds/percentage bar (USS/SC, LR labels), notification opens and Notifications-tab clicks (USS/SC/TwHIN/FRS)
When you receive itOpen + stay 2 minutes +10–11; profile visit that converts +12; video watch time counted to the millisecond (VideoWatchTimeMsParam); dwell is its own prediction head
Signal flowUSS Β· SC Β· FRS Β· LR (varies by action)
PlaybookBuild "open it and stay" structure: a first-line hook, long posts that fold, images that carry detail; videos need β‰₯10 seconds to enter the quality-view system; make your profile worth the click β€” the pinned post is your +12 landing page

Sources for this section: RETREIVAL_SIGNALS.md (18 signals Γ— 6 systems matrix), PredictedScoreFeature.scala, PhoenixPredictedScoreFeature.scala, FeedbackFatigueScorer.scala, UTEG README

The seven clocks

The whole system runs on timers, like ovens in a kitchen. Hour-level clocks decide a post's fate. Day-level clocks decide relationships. Week-level clocks decide your label. Hundred-day clocks decide compound interest.

30 min post "buzz" score half-life 48 hours like-spread window (UTEG) 7 days friendship-strength half-life, daily update every 7 days neighborhood batch job (the "label maker") 30 days age weight caps; negative-signal window 100 days each like keeps paying your neighborhood 140 days "not interested" full recovery ⏱ Fast to slow: seven clocks running at once
Each clock maps to a decision: guard the first hour of a post, show up daily, stay on topic weekly, build reputation quarterly.
ClockValueWhat it means for youSource
Real-time engagement featureshalf-life 30 minutesThe first hour decides a post's fate. Stay and answer every commentTimelinesOnlineAggregationConfigBase.scala
UTEG interaction graph24–48 hoursNothing after 48 hours? Move on. Post the next oneUTEG README
RealGraph edge weightdaily decay Γ—0.955, half-life β‰ˆ 7 days; updates dailyGo quiet for a week and every relationship loses half its strength. A little every day beats a Sunday bingeInteractionGraphAggregationConfig.scala
Earlybird index7 daysHow long a post stays in the recommendation poolsearch README
SimClusters batch jobruns every 7 daysWhat you do this week becomes your label next week. Off-topic likes pollute your label for a full cycleInterestedInFromKnownFor.scala batchIncrement=Days(7)
Like-edge half-life100 daysEvery real like keeps funding your neighborhood label for 3+ months β€” compound interestProducerNormsAndCounts.scala
Feedback fatiguerecovers one step every 35 days, full at 140 daysAnnoying one reader costs you four monthsFeedbackFatigueScorer.scala

Playbook β‘  New account (days 0–30)

Your situation: you wear the NotGraduated "new kid" badge, your age weight isn't full, and the algorithm doesn't know who you are. The goal of the first 30 days is not followers. It's teaching the algorithm who you are, and earning a handful of real relationships.

Playbook β‘‘ Old account, 0 followers

Your situation: better than a new account β€” age weight full βœ“, no new-kid badge βœ“, clean record βœ“. But like a new account: no relationships, no neighborhood. Run the new-account playbook, skip the 30-day waiting period. Every clock starts today.

Playbook β‘’ Waking up a dormant account (followers, but years of silence)

Your situation: your structural assets survived (trust score, follower graph, age). Your behavioral assets are dead: the friendship strength between you and every follower has decayed to zero. To the algorithm, your followers are now strangers who happen to follow you. Your neighborhood label is blurry.

Playbook β‘£ Changing your niche

Your situation: your neighborhood label points at your old topic. Posting new-topic content right away β†’ it goes to old followers first β†’ "not interested" (βˆ’74) β†’ terrible start.

Playbook β‘€ Every post: the checklist

  1. Timing: post when your target readers are online
  2. Guard the first hour (30-minute half-life): answer every single comment β€” each answer is a +75 chance
  3. 48-hour review: if it's spreading, keep tending it; if it's silent, move on β€” the post keeps working through search (7-day pool + permanent search index)
  4. Never: post in rapid bursts (2nd post drops to Γ—0.625), bait clicks (βˆ’74 to start), buy fake engagement (broken chains = wasted money), repost duplicate media (cluster dedup filters it out)

FAQ

Q: What does one new follower actually give me? The chance they like my stuff again is low, right?

Passive benefits (work even if they never act): β‘  they pass trust to you continuously (PageRank); β‘‘ they cast a vote for which neighborhood you belong to; β‘’ you become a "friend of a friend" to all of their followers (a social-proof feature in ranking).

Active benefits (with an expiry date): at the moment of the follow, your friendship strength is at its peak β€” the first few days are when they're most likely to see you. Think of a follower as a 7-day trial subscription that silently cancels unless they interact. No interaction in the window β†’ the edge decays to zero in weeks β†’ they become a ghost follower.

The move: when someone follows you, go reply to one of their posts with something real. It's much faster than waiting for them to like you β€” and if they answer, that's a +75-class signal that welds the edge shut.

Q: Why do some million-follower accounts get no reach?

Followers aren't a bank balance β€” they're batteries that need recharging. Friendship strength halves every 7 days; years of silence zero it all out, leaving only passive benefits. The metric to watch is "how many familiar faces engage per post," not the follower count.

Q: Does buying followers or likes work?

At the code level it's useless and harmful: bots have no followers, so the like-spread chain breaks (you bought nothing); bot interest vectors are noise that blurs your neighborhood label; engineered engagement triggers the EngagementSpammer label = Drop.

Q: Am I shadowbanned?

Rule out the simple thing first: do your replies get any engagement? Yes β†’ you're not banned, your content's distribution is just low. Total silence for weeks (followers can see you, zero engagement) β†’ suspect a safety label; check the Limits section triggers and review your recent behavior (sketchy links, bulk actions, reports).

Q: Is Premium (verification) worth it?

For the base trust score, the code literally says if (isVerified) mass = 100, while unverified caps at 55. That's the part you can verify in the code; other perks (editing, long posts) are a separate question.

Q: How many posts per day?

The same-author discount (2nd post Γ—0.625) plus cluster dedup means: 1–3 good posts beat 10 filler posts. Spend the saved time in the reply sections (the +75 gold mine).

Source file index

TopicFile (path inside the repo)
Scoring formula & last public weightsthe-algorithm-ml/projects/home/recap/README.md
2025 dynamic weight paramshome-mixer/server/src/main/scala/com/twitter/home_mixer/param/HomeGlobalParams.scala
15 prediction headshome-mixer/.../model/PredictedScoreFeature.scala
Boosts / penaltieshome-mixer/.../scorer/RescoringFactorProvider.scala, DiversityDiscountProvider.scala
Feedback fatigue (140 days)home-mixer/.../scorer/FeedbackFatigueScorer.scala
Grok slop decayhome-mixer/.../scorer/GrokSlopScoreRescorer.scala
Trust: base scoresrc/scala/com/twitter/graph/batch/job/tweepcred/UserMass.scala
Trust: PageRank adjustmentsrc/scala/com/twitter/graph/batch/job/tweepcred/Reputation.scala
Safety labelsvisibilitylib/.../UserLabelRules.scala, DownrankingRules.scala
Edge decay (7 days)src/scala/com/twitter/interaction_graph/scio/agg_all/InteractionGraphAggregationConfig.scala
Weekly neighborhood batch jobsrc/scala/com/twitter/simclusters_v2/scalding/InterestedInFromKnownFor.scala
100-day like half-lifesrc/scala/com/twitter/simclusters_v2/scalding/ProducerNormsAndCounts.scala
Real-time aggregation (30 min)src/scala/com/twitter/timelines/prediction/common/aggregates/real_time/TimelinesOnlineAggregationConfigBase.scala
Retrieval signals master listRETREIVAL_SIGNALS.md (repo root)