Reverse-engineering X's open-sourced For You algorithm — and turning the findings into x-copilot, a working growth toolkit that runs inside Claude Code with no API keys.
| Piece | What it is |
|---|---|
ALGORITHM-DECODED.md |
The dossier: a file-cited mechanical teardown of how X retrieves, ranks, filters, and serves posts — scoring formula, the 19 engagement heads, filters, the Grok content-judging pipeline, in-network vs viral paths — plus the growth playbook derived from it |
x-algorithm/ |
Clone of xai-org/x-algorithm @ 0bfc279 (May 15, 2026 release, Apache-2.0) — the source of every claim |
.claude/skills/x-copilot/ |
x-copilot — the toolkit built from the dossier (see its README) |
web/ |
x-copilot web — the skill as a FastAPI + OpenRouter web app (Score/Enhance/Compose/Plan/Track/Analyze UI); keyless mock mode included (README) |
WEB-PORT.md |
The port's architecture blueprint |
- X's ranker never reads your post. It's collaborative filtering over hashed post/author/user IDs + engagement history. Your author embedding (who engages with you) is the asset; content quality enters through a separate Grok LLM pipeline (quality score, slop score, topic tags).
- Follower growth is in the objective.
P(follow_author)andP(profile_click)are scored heads; five negative heads (not-interested/ mute/block/report/not-dwelled) punish bait catastrophically. - ~80-hour relevance window, author-diversity decay against bursting, and hard per-viewer gates (muted keywords, seen-post bloom filters, one-post-per-conversation dedup).
- Replies under large accounts are LLM-scored 0–3 — a new account's main distribution channel; a 0 earns spam labels.
- Unscored posts default to MediumRisk brand safety — traction triggers the Grok scoring that unlocks full distribution status.
Thirteen modes covering the full loop — compose / score / enhance / thread / reply / radar / reangle / profile / coldstart / plan / analyze / track / eval — where Claude plays the LLM judges (via calibrated rubrics mimicking X's Grok classifiers and 19 prediction heads) and stdlib-Python scripts own everything that must be reproducible (linting, weighted scoring, scheduling, analytics, campaign tracking, prediction-vs-reality calibration). Includes a plug-in-ready read-only X API module (works keyless via CSV export or mock mode) and an eval harness that validated the pipeline: 100% quality-tier ordering across 3 independent blind judges, Spearman ≥ 0.96.
# use it here: start a Claude Code session in this repo
/x-copilot compose a post about <your idea>
# or install it anywhere / share it
cp -r .claude/skills/x-copilot ~/.claude/skills/Requires only Claude Code (any subscription) + Python 3.
Everything mechanical is cited to source files in the dossier. X redacted
the tuning values (params module), so x-copilot's weights are documented
priors (2023 public release ratios adapted to the 2026 head structure) and
all scores are relative units. The toolkit is deliberately read-only /
human-posts-only: the decode itself shows that spam, pods, and fake
engagement are mechanically self-defeating on today's X.