# The X Algorithm Playbook

> **What this is:** A practical, no-BS guide to how X's feed actually ranks
> your posts — every claim tied line-by-line to the open-source code xAI
> released in 2026. Not folk wisdom. Not "growth hacks." The actual mechanics,
> plus what you can do about them.
>
> **Source:** `github.com/xai-org/[...]/algorithm` (Apache-2.0, 2026 release)
> **Read time:** ~15 minutes
> **Skill level:** none — if you post on X, this is for you.
> **Maintained by:** AlphaStack · alphastack.fun

---

## Why This Guide Exists

Every "X growth" thread you've ever read is someone guessing. They watch their
own posts, notice a pattern, and invent a rule to explain it. Sometimes they're
right. Usually they're describing a coincidence.

In 2026, xAI did something unusual: they open-sourced the actual ranking code.
Not a blog post *about* it — the real pipeline, the real model architecture, the
real filters. So we don't have to guess anymore. We can read it.

This guide is the result of going through that code line by line. Every claim
points to a specific file. When something is genuinely unknowable from the open
release (like exact weight values), this guide says so instead of pretending.

```
 ┌──────────────────────────────────────────────────────────────┐
 │                                                              │
 │   THE OLD WAY              →        THE NEW WAY              │
 │   ───────────                       ───────────              │
 │   "I think replies                  "ranking_scorer.rs       │
 │    are worth 30 likes"               line 83 shows the 4     │
 │                                      negatives subtract"     │
 │                                                              │
 │   Folklore                          Code                     │
 │                                                              │
 └──────────────────────────────────────────────────────────────┘
```

---

## TL;DR — The Five Things That Actually Matter

If you read nothing else, read this.

```
 ╔══════════════════════════════════════════════════════════════╗
 ║                                                              ║
 ║   1. THE MODEL NEVER READS YOUR TEXT                         ║
 ║      It runs on hashed IDs, your history, the surface        ║
 ║      you're on, and post age. "Magic word" advice is wrong.  ║
 ║      (recsys_model.py → RecsysBatch)                         ║
 ║                                                              ║
 ║   2. REACH HAS TWO DOORS                                     ║
 ║      In-network (your followers) and out-of-network          ║
 ║      (vector search across all of X). The second door is     ║
 ║      what gets new accounts seen.                            ║
 ║                                                              ║
 ║   3. RECENCY IS A HARD FILTER, NOT A PREFERENCE              ║
 ║      Past the age cutoff, your post is deleted from the      ║
 ║      pool BEFORE the model sees it. (age_filter.rs)          ║
 ║                                                              ║
 ║   4. FOUR NEGATIVE ACTIONS SUBTRACT HARD                     ║
 ║      not_interested, block, mute, report. Trigger them       ║
 ║      and your score is gutted. (ranking_scorer.rs:83)        ║
 ║                                                              ║
 ║   5. A HIGH SCORE ≠ DELIVERY                                 ║
 ║      Safety, dedupe, mutes, blocks, and diversity decay      ║
 ║      can all drop you AFTER scoring.                         ║
 ║                                                              ║
 ╚══════════════════════════════════════════════════════════════╝
```

Remember those five and you're already ahead of 99% of the growth-hack content
out there.

---

# Part 1: How a Post Actually Reaches a Feed

Per `phoenix/run_pipeline.py` and the candidate-pipeline crates, here's the full
journey from "you hit post" to "it shows up in someone's feed":

```
                         YOU HIT POST
                              │
                              ▼
              ┌───────────────────────────────┐
              │  1. COLLECT VIEWER SIGNALS    │
              │     interaction history,       │
              │     profile, surface           │
              └───────────────┬───────────────┘
                              │
                              ▼
              ┌───────────────────────────────┐
              │  2. RETRIEVE CANDIDATES        │
              │     from two sources ↓         │
              └───────────────┬───────────────┘
                              │
              ┌───────────────┴───────────────┐
              ▼                               ▼
   ┌────────────────────┐         ┌────────────────────┐
   │  THUNDER           │         │  PHOENIX           │
   │  (in-network)      │         │  (out-of-network)  │
   │                    │         │                    │
   │  Recent posts from │         │  Two-tower         │
   │  people you follow │         │  embedding model.  │
   │  Sub-ms in-memory  │         │  Your interests →  │
   │  lookups.          │         │  a vector → search │
   │                    │         │  ALL of X.         │
   └─────────┬──────────┘         └─────────┬──────────┘
             │                               │
             └───────────────┬───────────────┘
                              ▼
              ┌───────────────────────────────┐
              │  3. ATTACH grox LABELS         │
              │     spam prob, category,       │
              │     safety. (Runs offline —    │
              │     not per-request.)          │
              └───────────────┬───────────────┘
                              │
                              ▼
              ┌───────────────────────────────┐
              │  4. FILTER & CLEAN             │  ◀── happens
              │     age, dedupe, seen/bloom,   │      BEFORE
              │     mutes, blocks, muted       │      ranking
              │     keywords, low-quality      │
              └───────────────┬───────────────┘
                              │
                              ▼
              ┌───────────────────────────────┐
              │  5. RANK (the Grok model)      │
              │     predicts 19 probabilities  │
              │     per surviving candidate    │
              └───────────────┬───────────────┘
                              │
                              ▼
              ┌───────────────────────────────┐
              │  6. WEIGHTED SCORE             │
              │     prob × weight, negatives   │
              │     subtract. Diversity decay  │
              │     + OON factor apply here.   │
              └───────────────┬───────────────┘
                              │
                              ▼
              ┌───────────────────────────────┐
              │  7. SAFETY FILTER + TOP-N      │  ◀── happens
              │     drops spam/violence/gore   │      AFTER
              │     (vf_filter.rs)             │      ranking
              └───────────────┬───────────────┘
                              │
                              ▼
              ┌───────────────────────────────┐
              │  8. ADS BLENDED IN             │
              │     separate pipeline, spaced  │
              │     + brand-safety checked.    │
              │     NOT inside the ranker.     │
              └───────────────┬───────────────┘
                              │
                              ▼
                       THAT'S YOUR FEED
```

## Three things this diagram makes obvious

```
  ┌─────────────────────────────────────────────────────────────────┐
  │                                                                 │
  │  ✓ FILTERING HAPPENS BEFORE RANKING                             │
  │    If you're past the age cutoff, or the viewer muted a         │
  │    keyword in your post, the model never even scores you for    │
  │    them. No score can save a filtered post.                     │
  │                                                                 │
  │  ✓ SAFETY FILTERING HAPPENS AFTER RANKING                       │
  │    A high score is necessary but not sufficient. A safety       │
  │    flag drops you even with a perfect score. (vf_filter.rs)     │
  │                                                                 │
  │  ✓ ADS ARE NOT IN THE RANKER                                    │
  │    They're blended at the very end. "Competing with ads" is     │
  │    not a thing during ranking — ignore that worry entirely.     │
  │                                                                 │
  └─────────────────────────────────────────────────────────────────┘
```

---

# Part 2: The Two Doors of Reach

This is the single most important mental model in the guide. Understand this and
half of "why isn't my post doing well" answers itself.

```
                        YOUR POST
                            │
            ┌───────────────┴───────────────┐
            ▼                               ▼
 ┌─────────────────────┐         ┌─────────────────────┐
 │   DOOR 1            │         │   DOOR 2            │
 │   IN-NETWORK        │         │   OUT-OF-NETWORK    │
 │   (Thunder)         │         │   (Phoenix)         │
 ├─────────────────────┤         ├─────────────────────┤
 │                     │         │                     │
 │  WHO SEES IT:       │         │  WHO SEES IT:       │
 │  People who         │         │  People who DON'T   │
 │  follow you         │         │  follow you but     │
 │                     │         │  match your topic   │
 │                     │         │                     │
 │  HOW IT WORKS:      │         │  HOW IT WORKS:      │
 │  Fast lookup of     │         │  Your post → a      │
 │  recent posts from  │         │  vector. Searched   │
 │  your follows.      │         │  against the whole  │
 │  In-memory.         │         │  corpus by topic    │
 │                     │         │  similarity.        │
 │                     │         │                     │
 │  CARES WHO          │         │  DOESN'T CARE WHO   │
 │  FOLLOWS YOU?       │         │  FOLLOWS YOU?       │
 │  Yes — entirely.    │         │  Correct. Topic     │
 │                     │         │  match is all.      │
 │                     │         │                     │
 │  GOOD FOR:          │         │  GOOD FOR:          │
 │  Established        │         │  New accounts,      │
 │  accounts with a    │         │  breaking into a    │
 │  real audience.     │         │  niche, going       │
 │                     │         │  beyond your        │
 │                     │         │  followers.         │
 └─────────────────────┘         └─────────────────────┘
```

**Why this matters so much:** if you have 50 followers, Door 1 is nearly useless
to you. All your reach has to come through Door 2 — and Door 2 only opens if your
post is *clearly about a topic* the embedding model can match. This is why a
brand-new account with a sharp, consistent niche can get seen, while a
scattershot account with 5,000 followers stalls.

---

# Part 3: The 19 Actions the Model Predicts

This is the core of the new ranker. For every candidate post, the Grok-based
transformer predicts the probability you'll take each of 19 actions. Positives
add to the score; the four negatives subtract hard.

From `ranker/config.json` (`"num_actions": 19`) and `ranking_scorer.rs`:

```
 POSITIVE / NEUTRAL (these ADD to your score)
 ════════════════════════════════════════════════════════════════

   ENGAGEMENT          CLICKS              SHARING
   ──────────          ──────              ───────
   favorite (like)     click               share
   reply               profile_click       share_via_dm
   retweet (repost)    quoted_click        share_via_copy_link
   quote               photo_expand
                                           FOLLOW
   ATTENTION                               ──────
   ─────────                               follow_author
   vqv (video view)
   quoted_vqv
   dwell

 CONTINUOUS (real-valued, not yes/no — measures HOW MUCH)
 ════════════════════════════════════════════════════════════════
   dwell_time          actual seconds spent on the post
   click_dwell_time    seconds after clicking through

 NEGATIVE (these SUBTRACT — ranking_scorer.rs:83)
 ════════════════════════════════════════════════════════════════
   not_interested      block_author      mute_author      report

   Plus: not_dwelled (a scroll-past with no engagement) is its own
   penalty term.
```

```
 ┌─────────────────────────────────────────────────────────────────┐
 │  ⚠  THE ACTUAL WEIGHTS ARE NOT IN THE OPEN-SOURCE CODE           │
 │                                                                 │
 │  The numbers that turn these probabilities into a final score   │
 │  live in runtime feature-switch config, NOT in the OSS release. │
 │                                                                 │
 │  So when someone tells you "a reply is worth 30 likes" — that   │
 │  is a guess. The code only confirms the DIRECTION: positives    │
 │  add, the four negatives subtract. Anyone quoting exact         │
 │  multipliers is making them up.                                 │
 └─────────────────────────────────────────────────────────────────┘
```

---

# Part 4: What Actually Helps (The DOs)

Every one of these is tied to a real mechanic in the code — not a vibe.

### ✓ 1. Lead with a clear topic

> **The mechanic:** Out-of-network reach runs through Phoenix's two-tower model
> (`recsys_retrieval_model.py`). It matches posts to *interests*. On-topic first
> line = matchable. Generic vibes = invisible to Door 2.

**Do:** Open with a concrete subject — "the new X algorithm…", "ETF flows…".
**Don't:** Open with "so I was thinking…" or anything that anchors no topic.

### ✓ 2. Post while there's still time on the clock

> **The mechanic:** `age_filter.rs` removes posts past a max age BEFORE ranking.
> The model caps post-age at 4,800 minutes (~80 hours). Old posts aren't
> demoted — they're filtered out of existence.

**Do:** Aim to earn engagement in the first few hours.
**Don't:** Expect a post to "find its audience" over days. The pool ages out.

### ✓ 3. Ask a real question

> **The mechanic:** `reply`, `quote`, and `quoted_click` are all positive heads.
> A genuine question raises their probability.

**Do:** Ask something specific you'd actually debate.
**Don't:** Engagement-bait ("comment below!"). The model is calibrated against
that via `not_interested` / `report`.

### ✓ 4. Hook a meaningful dwell in the first 1–2 lines

> **The mechanic:** `dwell` and `dwell_time` are *continuous* — they measure how
> long, not just whether. A strong opening = longer dwell = higher score.

**Do:** Front-load the most concrete or surprising thing you've got.
**Don't:** Bury the lede behind "hey everyone, just wanted to share…".

### ✓ 5. Pick a coherent identity

> **The mechanic:** Phoenix is collaborative — it learns whose engagement
> predicts what. When your engagers cluster around a topic, your author
> embedding sharpens, helping BOTH doors.

**Do:** Be recognizably about something. Niches compound.
**Don't:** Whiplash between unrelated topics. It blurs your embedding.

### ✓ 6. Earn the click on media

> **The mechanic:** `quoted_click`, `photo_expand`, `vqv`, `click_dwell_time`
> are all positive heads. Visible payoff beats a clickbait tease.

**Do:** Make images legible at a glance; make the first 2s of video count.
**Don't:** Post text-wall images or thumbnails that hide the payoff.

### ✓ 7. Reply to and quote adjacent topics

> **The mechanic:** Your engagement history (`history_*_hashes` in
> `recsys_model.py`) shapes your embedding. Engaging in a niche makes you a
> better Door-2 candidate for that niche.

**Do:** Reply substantively to 3–5 posts/day in your lane.
**Don't:** Spray replies onto unrelated trending posts.

### ✓ 8. Treat video as its own medium

> **The mechanic:** `vqv` and `quoted_vqv` are separate heads with their own
> probabilities. Native video has a different positive path than text.

**Do:** Native upload, captions, watchable on mute.
**Don't:** Link out to YouTube — you lose the `vqv` signal AND links suppress
out-of-network reach (see next section).

---

# Part 5: What Hurts (The DON'Ts)

### ✗ 1. Engagement-bait

> The most direct hit there is. "RT if", "like if", "tag a friend" correlate
> with `not_interested` and `report` — both subtract hard (`ranking_scorer.rs:83`).

### ✗ 2. Links in the body (when you care about reach)

> There's no "links bad" weight in the code. But links suppress on-platform
> engagement (lower dwell, fewer replies, no `vqv`), which suppresses every
> positive head indirectly. **Put the link in a reply instead.**

### ✗ 3. Reposting the same idea repeatedly

> Two mechanisms gang up on you:
> - `previously_seen_posts_filter.rs` (bloom filter) — already-seen posts are
>   cut before scoring.
> - Author-diversity decay (`ranking_scorer.rs:186-217`) — repeat posts from the
>   same author get multiplied down by `(1 - floor) × decay^position + floor`.
>   Geometric decay by rank.
>
> Your 4th post of the day on the same theme is actively dampened — even to
> people who'd otherwise see it.

### ✗ 4. Being muteable

> `muted_keyword_filter.rs` checks your post against each viewer's muted-keyword
> list. If they muted "crypto" and you said "crypto", you're cut for them —
> score irrelevant.

### ✗ 5. Being reportable / mass-blocked

> `author_socialgraph_filter.rs` drops you for anyone who muted or blocked you.
> Sustained `block_author` / `mute_author` predictions drag your score broadly.
> A rage-bait post can buy one viral spike and a permanent author-level penalty.

### ✗ 6. Leaning on hashtags / @mentions for reach

> No hashtag-boost or mention-boost exists in the code. They don't help. More
> than ~3 @mentions reads as spammy to humans, which lowers dwell.

### ✗ 7. Stale content

> `age_filter.rs` cuts old posts; freshness caps and decays past ~80 hours.
> There is no slow-burn discoverability mechanism in the code. None.

### ✗ 8. Expecting topic-based punishment

> The ranker is **text-blind** — it can't punish a topic, only behavior on one.
> What looks like topic-suppression is almost always `vf_filter.rs` dropping
> safety-flagged content.

---

# Part 6: "Shadowban" — What the Code Actually Says

There is **no single shadowban switch** in the open-source code. What people
call a shadowban is several independent mechanisms stacking up:

```
 ┌─────────────────────────────────────────────────────────────────┐
 │                                                                 │
 │   "I GOT SHADOWBANNED" USUALLY MEANS ONE OF THESE:              │
 │                                                                 │
 │   ┌─────────────────────────────────────────────────────────┐  │
 │   │  BEFORE SCORING (pre-filters drop you)                  │  │
 │   │  • Post aged out (age_filter.rs)                        │  │
 │   │  • Already seen / duplicate (bloom filter)              │  │
 │   │  • Viewer muted a keyword in your post                  │  │
 │   │  • Viewer blocked/muted you                             │  │
 │   └─────────────────────────────────────────────────────────┘  │
 │                                                                 │
 │   ┌─────────────────────────────────────────────────────────┐  │
 │   │  AFTER SCORING (post-filters drop you)                  │  │
 │   │  • Safety flag — hard binary drop (vf_filter.rs)        │  │
 │   └─────────────────────────────────────────────────────────┘  │
 │                                                                 │
 │   ┌─────────────────────────────────────────────────────────┐  │
 │   │  SCORE DAMPENERS                                        │  │
 │   │  • Author-diversity decay (repeated posts)              │  │
 │   │  • OON factor (out-of-network scaled down)              │  │
 │   │  • Predicted negatives (not_interested/report/etc.)     │  │
 │   └─────────────────────────────────────────────────────────┘  │
 │                                                                 │
 └─────────────────────────────────────────────────────────────────┘
```

So when someone says they got shadowbanned, what almost always actually happened
is one or more of: they tripped a safety label, got blocked/muted by a chunk of
their engaged audience, went stale before earning early engagement, or repeated
themselves into author-diversity decay.

---

# Part 7: Playbooks for Specific Situations

## You're a new account (< 1,000 followers)

```
  STRATEGY: Lean entirely on Door 2 (out-of-network).
  ════════════════════════════════════════════════════════
  Thunder won't help — you don't have a follower lane yet.
  Phoenix retrieval is your whole game.

  ✓ Pick a clear topic and STAY on it (embedding clarity)
  ✓ Engage with established accounts in your niche
  ✓ Reply with substance, never "great post!"
  ✓ One concrete topic per post, every post
```

## You have an audience but growth has plateaued

```
  LIKELY CAUSE: Author-diversity decay or a drifted audience.
  ════════════════════════════════════════════════════════
  ✓ Reduce posting frequency on the SAME theme
    (3 thoughtful posts > 10 variations)
  ✓ Audit who's actually engaging — has your niche drifted?
  ✓ Cut the bottom 20% of your follows — your following set
    also shapes who Phoenix thinks you are
```

## You want ONE post to go big

```
  ✓ First line: on-topic and concrete
  ✓ One real question or genuine hot take
  ✓ One media item that pays off at a glance
  ✓ No links in the body
  ✓ Reply to your own thread within the first hour to seed
    early engagement (resets nothing, but feeds the signal)
```

## You want sustained reach over months

```
  ✓ Pick a topic you can stay with for 6+ months
  ✓ Post 1–3× a day, varied angles
  ✓ Be quote-postable: leave a clear thing to add to
  ✓ Treat replies as content, not as comments
```

---

# Part 8: Myths Busted With Code

| The Claim | What the Code Actually Says |
|-----------|------------------------------|
| "Likes are dead." | `favorite` is one of the 19 positive heads. It still counts. Its *weight* isn't in the OSS, so nobody can say it's "lightest." |
| "Replies are 30× a like." | Relative weights aren't in the open code. Direction (replies are positive) is true; the multiplier is folklore. |
| "Hashtags boost reach." | No hashtag-boost mechanism exists. Excess hashtags read as spammy → lower dwell. |
| "The algorithm reads my words." | The ranker is text-blind (`RecsysBatch`). Your text is only read by the muted-keyword filter and offline `grox` labels. |
| "Post at 9am ET Tuesday." | No time-of-day signal in the model inputs. Freshness matters (`age_filter.rs`); "best time" is just when your audience is online. |
| "Linking out gets you banned." | No anti-link weight. Links suppress on-platform engagement (which suppresses everything) and unsafe domains can trip safety filters. |
| "Quote-tweet yourself as a hack." | Author-diversity decay explicitly dampens repeat-author posts by rank. It's the *opposite* of a hack. |
| "There's a secret blue-check boost." | Not in the open-source code. Whether production-only config does anything is unknowable from this release. |

---

# Part 9: What's Genuinely Unknowable

Being honest about the limits of this guide:

```
  ✗ The actual weight values (favorite vs reply vs follow_author)
    — fetched at runtime from feature switches, not in the OSS.

  ✗ The exact age-filter threshold (MAX_POST_AGE is a config param).

  ✗ The exact out-of-network scaling factor (OonWeightFactor, runtime).

  ✗ Anything xAI changes after this release. The 2026 drop is a snapshot.
```

This guide sticks to the **mechanisms** that are structurally in the code — not
the exact magnitudes that aren't.

---

# The Fridge Magnet (One-Page Summary)

```
 ╔══════════════════════════════════════════════════════════════╗
 ║                                                              ║
 ║   ✓ DO                          ✗ DON'T                      ║
 ║   ────                          ───────                      ║
 ║   Lead with a topic             Engagement-bait phrasing     ║
 ║   Post fresh                    Links in the body            ║
 ║   Ask a real question           Repost the same idea         ║
 ║   Hook the first two lines      Words your audience muted     ║
 ║   Stay in a niche               Posts that earn blocks        ║
 ║   Earn the click on media       Hashtag / mention spam        ║
 ║   Reply substantively           Stale content                ║
 ║   Native video > linked         Topic-whiplash                ║
 ║                                                              ║
 ║   AND REMEMBER:                                              ║
 ║   • The model never reads your text                          ║
 ║   • Two doors: in-network + out-of-network                   ║
 ║   • Recency is a hard filter                                 ║
 ║   • A high score ≠ guaranteed delivery                       ║
 ║                                                              ║
 ╚══════════════════════════════════════════════════════════════╝
```

---

# Appendix A: How to Verify Any Claim Yourself

Every claim above is tied to a file in xAI's open release (Apache-2.0, 2026) at
`github.com/xai-org/[...]/algorithm`. The most useful files:

```
  recsys_model.py              What the ranker takes as input
                               (proves the text-blind claim)

  phoenix/grok.py              The transformer architecture (Grok-based)
                               + candidate-isolation attention mask

  ranking_scorer.rs            How 19 head probabilities → one score;
                               author-diversity decay + OON factor

  age_filter.rs                The recency hard-cut
  previously_seen_posts_       Dedupe / bloom filter
    filter.rs
  author_socialgraph_          Block/mute viewer drops
    filter.rs
  muted_keyword_filter.rs      Per-viewer keyword muting
  vf_filter.rs                 Post-ranking safety drop

  phoenix/run_pipeline.py      The unified entry point
```

---

# Appendix B: Score Your Own Posts

Want to run a draft post against the real model before you publish it?

**→ x.alphastack.fun**

It runs the open-source Phoenix mini checkpoint plus a calibrated content judge
and gives you:

- A letter grade
- The 19 predicted actions
- One concrete rewrite

Same caveats as this guide — directional, not exact, because the runtime weights
aren't public. But it'll catch the obvious problems (stale framing, buried lede,
engagement-bait, off-topic openers) before they cost you reach.

---

# AlphaStack Resources

```
  Channel ............ youtube.com/@alphastack
  All guides ......... alphastack.fun
  Score a post ....... x.alphastack.fun
  Follow on X ........ @alphastack1
```

---

*Built by AlphaStack · alphastack.fun · Backed line-by-line by xAI's 2026
open-source algorithm release. If a claim isn't in the code, it isn't in this
guide.*