xAI open-sourced the code behind X's For You feed. Most of what I saw online about it came from the README or from people quoting each other, so I cloned the repo and read the code itself: the Rust that builds your feed, the JAX that trains the model, and the config file X syncs from production.
This is what I found, read at commit b220448 from 3 November 2026. Every number below is from the code, with the file it lives in.
The repo. 2,352 files of Rust, JAX and Scala, with a commit almost every weekday.
Before the numbers, here's the whole path a feed takes. Every time you open For You, this runs from left to right:
One feed request, start to finish. Most of this post is about the green and amber boxes.
How a post gets scored
Every post you could see gets one score:
score = sum of (weight × the chance you'll take that action)
Enter fullscreen mode
Exit fullscreen mode
The model predicts the chance you'll like, reply, repost, share, mute, report and about 20 other actions.…