HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
twitter
the-algorithm
Scala2022–2026
twitter / the-algorithm

the-algorithm

Source code for the X Recommendation Algorithm

104Distinct people
116Mentions
0Explicit recommenders
74.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Source code for the X Recommendation Algorithm

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 11:56:56 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year116 dated mentions

Observed mentions: 2022-04-25 21:01:53 UTC to 2026-10-19 13:35:30 UTC.

0204060802022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 78 mentions; 14 submissions, 64 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 13 mentions; 1 submissions, 12 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 16 mentions; 3 submissions, 13 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC312
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC781464
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC13112
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC16313
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC615

What Hacker News says

116 sources
I browsed through it a bit and these are some details that raised questions or which I found interesting: There's multiple mentions of slop, for example: SlopsAuthorScoreFeature in HomeTweetTypePredicates. That means everyone gets a slop score between 0 and 1, which makes me wish that it was openly visible and that people with a high slop score would get a little piggy emoji next to their name. There's a CLIENT_TWEET_TAKE_SCREENSHOT action, which is likely used to keep track of when a (mobile, presumably) client takes a screenshot. I hadn't considered this before, but for a social media app where posts are often shared externally through screenshots, keeping track of this can give you another engagement metric. They have two types of NSFW filters: isNsfw and isSoftNsfw, but I couldn't figure out the distinction. Other metadata types inclu
Read the rest
de: isGore, isViolent, isSpam, isLowQuality, isOcr. In ContentFeatureAdapter there's a getTweetLengthType function which shows the range for each tweet type. This is used to set TWEET_LENGTH_TYPE elsewhere. I wonder if it would help your virality to switch up your tweet lengths to regularly put out tweets which hit every length category, or if it doesn't significantly affect your potential reach. There's a hardcoded list of top-level Grok topics [0]. Just mildly interesting to see what they consider to be top-level categories. Anime has achieved a significant cultural victory by getting separated into its own major category. The timeout values for different service request types varied a lot across the application, which makes me curious about how they settled on those numbers. This is a question I've pondered in the past but haven't gotten around to researching deeply. [0] https://github.com/twitter/the-algorithm/blob/c54bec0d4e029f...
In Source code for the X recommendation algorithm
The file in question is now here: https://github.com/twitter/the-algorithm/blob/main/home-mixe... author_is_elon, author_is_democrat, and author_is_republican are in fact gone. Now there is grok_politics_neutral, grok_politics_left, and grok_politics_right. This is in addition to a whole group of other categories, such as grok_category_sports and grok_category_music. All are based on annotations by Grok. Importantly, this file is not used for recommendations. Everything in this file is only used for "metrics tracking purposes to measure how often we serve posts with various attributes." This would also have applied to author_is_elon.
In Source code for the X recommendation algorithm

Showing the 15 most recent of 116 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.