DEV Community

The Ultimate Guide to Getting Recommended by Twitter's Algorithm (Legacy Code)

Based on Twitter's Open-Source Recommendation Algorithm

A comprehensive, data-driven guide to maximizing your reach on Twitter/X


Table of Contents

  1. How Twitter's Algorithm Works
  2. The Ranking Signals That Matter
  3. Engagement Types & Their Weights
  4. Content Strategy for Maximum Reach
  5. What Kills Your Reach
  6. Advanced Growth Tactics
  7. Timing & Recency Factors
  8. The SimClusters Community Effect

How Twitter's Algorithm Works

Twitter's recommendation system uses a multi-stage pipeline to surface content:

Stage 1: Candidate Retrieval

The algorithm pulls tweets from multiple sources:

  • In-Network: Tweets from people you follow
  • Out-of-Network: Tweets from people you don't follow (the "For You" feed)
  • SimClusters: Community-based recommendations using sparse embeddings
  • Real Graph: Predicted user-to-user interaction likelihood
  • UTEG (User-Tweet-Entity-Graph): "Liked by people you follow" recommendations

Stage 2: Ranking

Tweets are scored using a Heavy Ranker (neural network) that predicts multiple engagement types:

  • Favorites (Likes)
  • Retweets
  • Replies
  • Video views
  • Profile clicks
  • Bookmarks
  • Shares
  • Negative signals (reports, blocks, "not interested")

Stage 3: Filtering & Heuristics

Final adjustments based on:

  • Content quality filters
  • Diversity (author, topic)
  • Feedback fatigue
  • NSFW/spam/violence detection

The Ranking Signals That Matter

Based on the algorithm's source code, here are the predicted engagement scores that determine your tweet's ranking:

Positive Engagement Signals (Ranked by Training Weight)

Signal Training Weight What It Means
Reply 9.0x Highest value - sparks conversation
Favorite (Like) 1.0x Base engagement metric
Retweet 1.0x Amplification signal
Profile Click 1.0x Interest in the author
Good Click (detail expand) 0.3x User clicked to read more
Video Playback 50% 0.01-0.6x Video watched to 50%
Photo Expand 0.03x Image engagement
Link Click 0.1x External link engagement

Additional High-Value Signals

  • Bookmark: Strong save-for-later intent
  • Share: Direct message or external share
  • Dwell Time: How long users spend viewing your tweet
  • Good Profile Click: Clicking profile after engaging with tweet
  • Reply Engaged by Author: When the original author replies back (high value!)
  • Video Watch Time: Total time spent watching videos

Negative Signals (Hurt Your Reach)

These have negative weights and will suppress your content:

Signal Impact What Triggers It
Report -20,000 max penalty User reports your tweet
Block Severe User blocks you after seeing tweet
Mute Severe User mutes you
"Not Interested" Strong negative User clicks "Not interested in this tweet"
"Show Less Often" Moderate negative User wants to see less of this content
Unfollow Strong negative User unfollows after seeing tweet

Engagement Types & Their Weights

The Reply Multiplier (9x Weight!)

Replies are 9x more valuable than likes in the algorithm's training data. This is THE most important signal.

How to optimize for replies:

  1. Ask questions - End tweets with thought-provoking questions
  2. Hot takes - Controversial (but not offensive) opinions spark debate
  3. Fill-in-the-blank - "The best ___ is ___"
  4. Polls - Built-in reply mechanism
  5. Incomplete thoughts - "The 3 rules of X: 1) ... 2) ... 3) ..." (people will ask for more)
  6. Reply to your own tweets - Start conversations in your own thread

Example formats that drive replies:

❌ "Just launched my new product!"
✅ "What's the #1 feature you look for in [product category]?"

❌ "Here's my opinion on X"
✅ "Unpopular opinion: X is better than Y. Change my mind."

❌ "I learned something today"
✅ "I just discovered [surprising fact]. Did you know this?"
Enter fullscreen mode Exit fullscreen mode

The Retweet Signal (1x Weight)

Retweets amplify your reach exponentially through the network graph.

How to optimize for retweets:

  1. Valuable insights - "Here's what I learned after [big number]"
  2. Tweetstorms/threads - People RT the first tweet
  3. Quotable one-liners - Make it easy to share
  4. Contrarian takes - People RT to show agreement/disagreement
  5. Data & statistics - "X% of people don't know..."
  6. Actionable tips - "Do this, not that"

The Like Signal (1x Weight - Baseline)

Likes are the baseline metric but least impactful per engagement.

Strategy: Don't optimize for likes alone - they're a vanity metric. Focus on replies and retweets.

Video Engagement (0.01-0.6x Weight)

Video has special treatment with multiple signals:

  • 50% playback: User watched at least half
  • Quality view: Watched with sound/fullscreen
  • Watch time: Total seconds watched

Video optimization:

  1. Hook in first 3 seconds - Algorithm tracks drop-off
  2. Optimal length: 30-90 seconds (long enough to show quality, short enough to finish)
  3. Captions/text overlay - Many watch without sound
  4. Native video - Upload directly to Twitter, don't link to YouTube
  5. Vertical or square - Better mobile experience

Content Strategy for Maximum Reach

The Golden Formula

Based on the algorithm's scoring mechanism, the ideal tweet has:

  1. High reply probability (9x multiplier)
  2. Moderate retweet probability (1x multiplier)
  3. Strong engagement from your community (SimClusters boost)
  4. Recency (tweets decay with time)
  5. No negative signals (spam, NSFW, low quality)

Content Types Ranked by Algorithmic Performance

🏆 S-Tier (Highest Reach)

  1. Question threads - Ask + provide value in thread
  2. Contrarian insights - "Everyone says X, but actually Y"
  3. Data-driven threads - "I analyzed [big number] and found..."
  4. Actionable how-to's - Step-by-step guides
  5. Personal stories with lessons - Vulnerability + value

🥇 A-Tier (Strong Reach)

  1. Curated lists - "10 tools that..."
  2. Before/after transformations - Visual proof
  3. Industry insights - "Here's what's really happening in [industry]"
  4. Myth-busting - "The truth about X"
  5. Short-form video tutorials - 30-60 seconds

🥈 B-Tier (Moderate Reach)

  1. Quotes with commentary - Add your take
  2. News reactions - Timely commentary
  3. Memes (relevant to niche) - Community-specific humor
  4. Polls - Easy engagement but lower quality signal
  5. Celebrations/milestones - "Just hit X followers"

🥉 C-Tier (Low Reach)

  1. Plain announcements - "Check out my new..."
  2. Generic motivational quotes - Oversaturated
  3. Selfies without context - Unless you're already famous
  4. Vague-posting - "Big news coming..."
  5. Pure promotional content - "Buy my product"

What Kills Your Reach

The algorithm has multiple filter stages that can suppress or remove your content:

Content Quality Filters

1. Spam Detection (GrokSpamFilter)

Triggers:

  • Repetitive content
  • Excessive hashtags (>2 is risky)
  • Suspicious link patterns
  • Copy-paste replies
  • Automated behavior patterns

How to avoid:

  • Vary your content
  • Use 1-2 relevant hashtags max
  • Write unique replies
  • Space out similar tweets

2. NSFW/Adult Content (GrokNsfwFilter)

Triggers:

  • Adult content
  • Suggestive imagery
  • Certain keywords

Impact: Filtered from most users' feeds, severely limited reach

3. Violence/Gore Filters (GrokGoreFilter, GrokViolentFilter)

Triggers:

  • Graphic content
  • Violence
  • Disturbing imagery

Impact: Immediate suppression

4. Low Quality Signals

What the algorithm considers "low quality":

  • Low text quality - Poor grammar, excessive caps, spam-like
  • Low engagement rate - Consistently getting few interactions
  • High negative feedback - Reports, blocks, "not interested" clicks
  • Duplicate content - Reposting same/similar tweets

5. Feedback Fatigue Filter

If users have clicked "Show less often" on:

  • Your account
  • Accounts you retweet
  • Topics you tweet about

Your tweets will be suppressed for those users for a time period.

The "Slop" Filter (Low-Quality Author Filter)

The algorithm has a specific filter for low-quality authors called "SlopFilter":

You're flagged as "slop" if:

  • You have few followers (threshold varies)
  • Your content gets low engagement
  • You're a new account with low signal

Impact: Your out-of-network reach is severely limited

How to escape:

  1. Build engaged followers (not just follower count)
  2. Get consistent engagement on tweets
  3. Avoid negative signals
  4. Engage authentically with your niche

Social Context Requirements

For out-of-network tweets (people who don't follow you), the algorithm requires "social proof":

Your tweet needs at least ONE of:

  1. Liked by someone the viewer follows (strongest signal)
  2. Followed by someone the viewer follows
  3. Related to a topic the viewer follows
  4. From a verified account (in some cases)
  5. Part of a trending conversation

Without social proof, your tweet won't appear in "For You" feeds.


Advanced Growth Tactics

1. The SimClusters Strategy

What are SimClusters?
Twitter groups users into overlapping "communities" based on:

  • Who they follow
  • What they engage with
  • Shared interests

How to leverage this:

  1. Identify your cluster - What niche/community are you in?

    • Tech Twitter
    • Crypto Twitter
    • Fitness Twitter
    • Writing Twitter
    • etc.
  2. Engage with cluster leaders - Reply to big accounts in your niche

    • Quality replies, not spam
    • Add value to the conversation
    • Do this consistently
  3. Create cluster-specific content - Use terminology, references, and topics your cluster cares about

  4. Cross-cluster bridging - Occasionally tweet about adjacent topics to expand reach

    • Example: Tech + Business, Fitness + Mental Health

Why this works: The algorithm uses SimClusters embeddings to find similar users. If you're strongly embedded in a cluster, you'll be recommended to others in that cluster.

2. The Reply-Guy Growth Hack

Strategy: Become known in your niche by adding value in replies.

How to do it right:

  1. Find rising tweets - Reply to tweets with <100 likes but growing fast
  2. Add substantial value - Don't just say "Great point!"
  3. Be early - First 10 replies get most visibility
  4. Quote tweet with addition - Add your perspective and QT
  5. Thread off popular tweets - "Adding to this..." then provide more value

Why this works:

  • Replies have 9x weight in the algorithm
  • You appear in the thread of popular tweets
  • You get associated with that SimCluster
  • The original author might engage back (huge boost)

3. The Thread Mastery Formula

Threads get special algorithmic treatment:

  • First tweet gets boosted if thread performs well
  • Each reply in thread can be discovered independently
  • Threads signal "high effort content"

Optimal thread structure:

  1. Hook tweet (first tweet) - Make it retweetable standalone
  2. Promise value - "Here's what I learned..."
  3. Deliver in 5-10 tweets - Not too long
  4. One idea per tweet - Easy to digest
  5. End with CTA - "If you found this valuable, RT the first tweet"

Thread template:

Tweet 1: [Surprising claim or question]
Tweet 2: "Here's why this matters:"
Tweet 3-7: [Numbered insights]
Tweet 8: [Conclusion]
Tweet 9: "Found this helpful? RT the first tweet to share"
Enter fullscreen mode Exit fullscreen mode

4. The Engagement Pod Alternative (Legitimate)

Don't: Join engagement pods (algorithm detects this)

Do: Build a genuine engagement group

  1. Find 5-10 people in your niche at similar follower count
  2. Create a group chat (off Twitter)
  3. Share your best content (not everything)
  4. Genuinely engage if it's valuable
  5. No obligation - only engage if you actually like it

Why this works: Early engagement (first 30 min) signals quality to the algorithm.

5. The Timing Optimization

When to post (based on real-time aggregates in the algorithm):

The algorithm uses time decay with half-lives:

  • 30 minutes for real-time trending
  • 48 hours for extended reach
  • Tweets older than 48 hours rarely get recommended

Optimal posting times:

  1. When your audience is active - Check your analytics
  2. Weekday mornings - 6-9 AM in your audience's timezone
  3. Lunch hours - 12-1 PM
  4. Evening - 6-8 PM

Posting frequency:

  • Minimum: 1 quality tweet per day
  • Optimal: 3-5 tweets per day
  • Maximum: 10-15 (beyond this, you risk spam signals)

Space out tweets: Don't post all at once. Spread throughout the day.

6. The Video Advantage

Video tweets get preferential treatment:

  • Separate video ranking pipeline
  • Multiple engagement signals (views, watch time, quality views)
  • Higher weight in "For You" feed

Video best practices:

  1. First 3 seconds are critical - Hook immediately
  2. 30-90 second sweet spot - Long enough for "quality view" signal
  3. Vertical format - 9:16 for mobile
  4. Captions always - 85% watch without sound
  5. Native upload - Don't link to YouTube
  6. Thumbnail matters - First frame should be compelling

Video content ideas:

  • Quick tutorials
  • Before/after demonstrations
  • "Day in the life" snippets
  • Reaction videos with commentary
  • Screen recordings with voiceover

7. The Profile Optimization

Your profile affects recommendations:

The algorithm considers:

  • Follower count (but engagement rate matters more)
  • Follower quality (real vs. bots)
  • Bio keywords (for topic clustering)
  • Verification status (slight boost)
  • Account age (newer accounts have limited reach)

Optimize your profile:

  1. Clear niche - Make it obvious what you tweet about
  2. Keywords in bio - Help the algorithm categorize you
  3. Pinned tweet - Your best performing tweet
  4. Consistent posting - Gaps hurt your reach
  5. Profile picture - Professional, recognizable

Timing & Recency Factors

How Tweet Age Affects Reach

The algorithm uses exponential time decay:

Half-life periods:

  • 30 minutes: Real-time trending topics
  • 2 hours: Peak engagement window
  • 24 hours: Standard recommendation window
  • 48 hours: Maximum age for most recommendations

What this means:

  • Your tweet's reach decays by 50% every 30 minutes for trending
  • After 48 hours, tweets rarely appear in "For You" feeds
  • Evergreen content needs to be re-shared

The First 30 Minutes Are Critical

Why:

  • Algorithm samples early engagement to predict future performance
  • Early engagement triggers broader distribution
  • First 30 min determines if you go viral

Maximize first 30 minutes:

  1. Post when your audience is online - Check analytics
  2. Engage with early replies - Boost the conversation
  3. Don't delete and repost - Resets the clock and looks suspicious
  4. Have a "notification squad" - People who have your notifications on

Real-Time Aggregates

The algorithm tracks engagement in real-time with different time windows:

30-minute window:

  • Trending detection
  • Viral content identification
  • Breaking news

48-hour window:

  • Standard recommendations
  • User preference learning
  • Community engagement patterns

Strategy: Create time-sensitive content to leverage real-time signals:

  • Breaking news commentary
  • Live event reactions
  • Trending topic participation

The SimClusters Community Effect

Understanding SimClusters

SimClusters is Twitter's secret weapon for recommendations.

How it works:

  1. Twitter identifies 145,000 communities (clusters)
  2. Each user belongs to multiple overlapping clusters
  3. Each tweet is embedded into relevant clusters
  4. Algorithm recommends tweets from your clusters

Example clusters:

  • "AI/ML researchers"
  • "Indie hackers"
  • "Fitness enthusiasts"
  • "Crypto traders"
  • "YA book readers"

How to Dominate Your SimCluster

1. Cluster Identification

Find your cluster by analyzing:

  • Who follows you
  • Who you engage with
  • What topics you tweet about
  • Who retweets you

Tools:

  • Look at your followers' bios
  • Check who appears in your "For You" feed
  • Analyze your top performing tweets

2. Cluster Penetration

Become known in your cluster:

  1. Engage with cluster leaders

    • Reply with valuable insights
    • Quote tweet with additions
    • Collaborate on threads
  2. Use cluster language

    • Industry jargon
    • Inside jokes
    • Common references
  3. Solve cluster problems

    • Address pain points
    • Share solutions
    • Provide resources

3. Cross-Cluster Expansion

Grow beyond one cluster:

  1. Identify adjacent clusters

    • Example: "Developers" → "Startup founders"
    • Example: "Fitness" → "Mental health"
  2. Bridge content

    • Tweet about overlapping interests
    • Collaborate with people in adjacent clusters
    • Use hashtags from both clusters
  3. Gradual expansion

    • Don't dilute your main cluster
    • 80% core content, 20% adjacent topics

The Network Effect

How tweets spread through SimClusters:

  1. You tweet → Algorithm embeds it in your clusters
  2. Cluster members engage → Tweet gets boosted in that cluster
  3. High engagement → Tweet spreads to adjacent clusters
  4. Cross-cluster engagement → Tweet goes viral

Maximize network effect:

  • Create content that appeals to your entire cluster
  • Encourage engagement from cluster leaders
  • Time tweets when cluster is most active

Practical Action Plan

Week 1: Foundation

  • [ ] Audit your last 50 tweets - which got most replies?
  • [ ] Identify your SimCluster(s)
  • [ ] Optimize your profile for your niche
  • [ ] Find 10 accounts in your cluster to engage with
  • [ ] Create a content calendar

Week 2: Engagement Focus

  • [ ] Post 1 question tweet per day
  • [ ] Reply to 10 tweets in your niche daily (add value)
  • [ ] Create your first thread (5-7 tweets)
  • [ ] Track which tweets get replies vs. just likes
  • [ ] Engage with everyone who replies to you

Week 3: Content Optimization

  • [ ] Test different content formats (thread, video, poll)
  • [ ] Post at 3 different times, track performance
  • [ ] Create 1 piece of video content
  • [ ] Analyze your top tweet - what made it work?
  • [ ] Double down on what's working

Week 4: Scale

  • [ ] Increase posting to 3-5 tweets per day
  • [ ] Build relationships with 5 people in your niche
  • [ ] Create a "greatest hits" thread of your best content
  • [ ] Experiment with cross-cluster content
  • [ ] Set up analytics tracking

Daily Habits for Growth

  1. Morning (15 min): Reply to 5 tweets in your niche
  2. Midday (10 min): Post your main tweet of the day
  3. Afternoon (10 min): Engage with replies to your tweets
  4. Evening (15 min): Reply to 5 more tweets, post a second tweet
  5. Before bed (5 min): Check analytics, plan tomorrow's content

Key Takeaways

The Algorithm Rewards:

Replies (9x weight - most important!)
Conversations (back-and-forth engagement)
Retweets (amplification signal)
Video engagement (watch time, completion rate)
Recency (first 30 minutes critical)
Community relevance (SimClusters matching)
Consistent quality (avoid negative signals)

The Algorithm Punishes:

Spam behavior (repetitive, automated)
Low quality content (poor grammar, clickbait)
Negative feedback (reports, blocks, "not interested")
No social proof (for out-of-network reach)
NSFW/violent content (filtered heavily)
Engagement bait (detected and suppressed)
Inconsistent posting (algorithm favors active accounts)

The Golden Rules:

  1. Optimize for replies, not likes - Ask questions, spark conversations
  2. Provide value first - Help your community before promoting
  3. Be consistent - Post daily, engage daily
  4. Know your cluster - Dominate your niche before expanding
  5. Quality over quantity - One great tweet > ten mediocre ones
  6. Engage authentically - Build real relationships
  7. Track and iterate - Double down on what works

Final Thoughts

Twitter's algorithm is not your enemy - it's a tool. The algorithm wants to:

  • Show users content they'll engage with
  • Keep people on the platform longer
  • Surface quality conversations

Your goal aligns with the algorithm's goal: Create content people genuinely want to engage with.

The accounts that grow fastest aren't gaming the system - they're providing so much value that the algorithm can't help but recommend them.

Focus on:

  • Solving problems for your community
  • Starting meaningful conversations
  • Building genuine relationships
  • Creating content worth sharing

Do this consistently, and the algorithm will reward you.


Resources & Tools

Analytics:

  • Twitter Analytics (native)
  • Tweet Hunter
  • Typefully
  • Hypefury

Content Creation:

  • Thread scheduling: Typefully, Hypefury
  • Video editing: CapCut, Descript
  • Graphics: Canva, Figma

Research:

  • Find trending topics: Twitter Trends, Google Trends
  • Analyze competitors: Tweet Hunter, Followerwonk
  • Track mentions: TweetDeck, Hootsuite

Based on Twitter's open-source algorithm:

GitHub logo twitter / the-algorithm

Source code for the X Recommendation Algorithm

X's Recommendation Algorithm

X's Recommendation Algorithm is a set of services and jobs that are responsible for serving feeds of posts and other content across all X product surfaces (e.g. For You Timeline, Search, Explore, Notifications). For an introduction to how the algorithm works, please refer to our engineering blog.

Architecture

Product surfaces at X are built on a shared set of data, models, and software frameworks. The shared components included in this repository are listed below:





































Type Component Description
Data tweetypie Core service that handles the reading and writing of post data.
unified-user-actions Real-time stream of user actions on X.
user-signal-service Centralized platform to retrieve explicit (e.g. likes, replies) and implicit (e.g. profile visits, tweet clicks) user signals.
Model SimClusters Community detection and sparse embeddings into those communities.
TwHIN Dense knowledge graph embeddings for Users and Posts.
trust-and-safety-models Models for detecting NSFW or abusive content.
real-graph Model to






If you found this guide valuable, share it with someone who's trying to grow on Twitter. The algorithm rewards valuable content - and this guide is designed to be exactly that. 🚀

P.S. Check Vexrail's Newsletter to learn more about Monetization / Advertising in AI chat apps

Top comments (0)