Write viral tweets powered by X's actual algorithm signals + AI
Free & open source Chrome extension that scores your tweets against 19 ranking signals from X's Grok-powered algorithm and generates optimized variations using Claude AI.
Install • Features • How It Works • Algorithm • Contributing
Most people chase likes. The X algorithm doesn't care about likes.
A single reply where the author responds back is worth 75x more than a like. A bookmark is worth 50x. An external link in your tweet kills 30-50% of your reach.
TweetRocket is built on these insights, extracted from X's open-sourced algorithm. It scores your tweets against the signals that actually matter and uses Claude AI to rewrite them for maximum algorithmic reach.
| Mode | What it does |
|---|---|
| Write | Enter a topic or idea. Get 3 algorithm-optimized tweet variations. |
| Rewrite | Paste an existing tweet. Get 3 improved versions that score higher. |
| Reply | Paste someone's tweet. Get 3 high-signal replies (75x algorithm weight). |
Every tweet gets scored 0-100 as you type, broken down into four components:
- Hook (0-25) - First-line impact, pattern matching, scroll-stopping power
- Length (0-20) - Optimal range is 100-220 characters
- Engagement (0-25) - Questions, CTAs, bookmark triggers, specificity
- Readability (0-20) - Line breaks, formatting, scannability
Penalties are applied for external links (-25), excessive hashtags, ALL CAPS, and too many @mentions.
- 6 tones - Engaging, Bold, Educational, Witty, Inspirational, Spicy
- Generation history - Last 50 generations saved locally
- Popup & Sidebar - Use as a quick popup or pin to the side of your browser
- Privacy-first - Your API key stays in your browser. Nothing is sent to any server except Anthropic's API.
Engagement weights from X's ranking algorithm (relative to Like = 1x):
Reply + Author responds ██████████████████████████████████████ 75x
Bookmark █████████████████████████ 50x
Share via DM ████████████████████ 40x
Copy link share ██████████████████ 35x
Quote tweet ████████████████ 30x
Repost ██████████ 20x
Follow after seeing ████████ 15x
Profile click █████ 10x
Like █ 1x
External links ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -50%
- First 30 minutes decide everything. Early engagement velocity determines whether your post reaches the For You feed at all.
- External links kill reach. 30-50% reduction. Put links in your first reply instead.
- Stay in your niche. SimClusters enforce topical consistency. Drifting = near-zero distribution.
- Author diversity decay. Each additional post in the same feed refresh gets ~halved. Quality > quantity.
- Positive > negative. Grok reads sentiment. Constructive content gets wider distribution.
- Clone or download this repo
- Go to
chrome://extensionsin Chrome - Enable Developer mode (top right toggle)
- Click Load unpacked and select the
extension/folder - Click the TweetRocket icon in your toolbar
- Open Settings (gear icon) and paste your Anthropic API key
That's it. Start writing.
There's also a Next.js web version if you prefer a full-page editor:
npm install
cp .env.example .env # add your ANTHROPIC_API_KEY
npm run dev # http://localhost:3000- You provide your own Anthropic API key - costs ~$0.003 per generation (~3 tweets). Your key is stored locally and only sent to Anthropic.
- Client-side scoring - The algorithm scoring runs entirely in your browser. No server needed.
- AI generation - When you click Generate, your input is sent to Claude Sonnet 4.5 along with a detailed system prompt encoding X's algorithm weights, rules, and optimization strategies.
- You get back 3 variations - Each with a score, hook analysis, algorithm notes, and actionable improvement tips.
extension/ Chrome extension (standalone, no build step)
├── manifest.json Manifest V3
├── app.html Popup & sidebar UI
├── app.css Dark theme
├── app.js App logic, generation, rendering
├── algorithm.js Scoring algorithm + system prompt
├── background.js Service worker (popup/sidebar switching)
└── icons/ 16, 48, 128px icons
src/ Next.js web app
├── app/
│ ├── page.tsx Landing page
│ ├── write/ Full-page editor
│ └── api/generate/ Server-side generation endpoint
└── lib/
└── algorithm.ts Scoring algorithm (TypeScript version)
The Chrome extension is fully self-contained - no build step, no dependencies, no server. It talks directly to the Anthropic API from your browser.
| Component | Technology |
|---|---|
| Extension | Vanilla JS, Chrome Manifest V3 |
| Web app | Next.js 16, React 19, TypeScript, Tailwind CSS 4 |
| AI model | Claude Sonnet 4.5 (claude-sonnet-4-5-20250929) |
| Scoring | Custom heuristic algorithm (client-side) |
| Icons | Generated with pure Node.js (no dependencies) |
Contributions welcome. Some ideas:
- More scoring signals - The heuristic algorithm can always be improved
- Thread support - Multi-tweet thread generation
- Firefox port - Adapt manifest for Firefox
- Analytics - Track score improvements over time
- i18n - Support for non-English tweets
To contribute:
- Fork the repo
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes
- Push and open a Pull Request
Free for personal and non-commercial use. Commercial use requires a license. See LICENSE for details.
Want to use TweetRocket commercially or collaborate? Reach out at github.com/onwp.
- Algorithm data from xai-org/x-algorithm (Jan 2026 open-source release)
- AI powered by Anthropic Claude