Skip to main content
command CX Codex

viral-tweet — Claude Code command: what it does, how to install

viral-tweet converts rough draft thoughts into high-engagement posts tailored to the recommendation system of X.

MIT ★ 2,707 updated 2026-03-05

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/viral-tweet.md
Open on GitHub

What viral-tweet does

The command breaks down a draft idea to identify friction points. It models the feed algorithm to lift probabilities of replies, reposts, and dwell time while avoiding spam flags like links in the opening tweet.

You receive an analysis and three rewrites. One version builds a seven-word hook, another provokes replies, and the third targets reposts to reinforce reader identity. The agent also recommends media choices and follow-up timing.

No external API keys are needed. It runs entirely inside the markdown prompt definition.

What it helps with

  • rebuild a raw thought around a punchy opening hook
  • strip out hashtags and links that lower initial post reach
  • generate distinct rewrites focused on replies or reposts
  • determine if an idea warrants a thread or media attachment

Example prompts for the agent

  • /viral-tweet We rebuilt our database engine from scratch in Rust
  • /viral-tweet Why early stage founders spend too much time on design
  • /viral-tweet

How to install viral-tweet

Manually: put the files in place

.claude/commands/viral-tweet.md

Call it with /viral-tweet. For all projects use ~/.claude/commands/

Questions about viral-tweet

How to install viral-tweet in Claude Code?

Save the command definition file to .claude/commands/viral-tweet.md. The /viral-tweet command will then be available directly in Claude Code.

What does the viral-tweet command do?

It evaluates an initial tweet draft and produces three targeted rewrites: one hook-focused, one reply-maximizing, and one repost-oriented, plus posting advice.

What negative signals does viral-tweet help avoid?

The prompt avoids engagement bait, links in the initial post, and excessive hashtag usage. These patterns reduce negative signals like mutes, blocks, or report actions.

Source text

viral-tweet.md · MIT
---
description: Transform a raw tweet idea into an optimized viral post for X
argument-hint: <tweet idea or topic>
---

# Viral Tweet Optimizer

You are a viral tweet optimization agent. Transform the provided tweet idea into something optimized for maximum engagement on X's algorithm.

## Input

The user's tweet idea: $ARGUMENTS

If no argument provided, ask the user for their tweet idea or topic.

## How the X Algorithm Works

The For You feed is powered by a Grok-based transformer that predicts engagement probabilities for each tweet. Maximize the weighted score:

**Final Score = Σ (weight × P(action))**

**Positive signals (higher weights):**
- P(like) — immediate resonance
- P(reply) — conversation triggers
- P(repost) — share-worthy content
- P(quote) — content worth adding to
- P(click) — curiosity hooks
- P(dwell) — stops the scroll
- P(share) — off-platform worthy
- P(follow_author) — "I need more of this"

**Negative signals (hurt your score):**
- P(not_interested) — boring, irrelevant
- P(block_author) — annoying, spammy
- P(mute_author) — too much, too often
- P(report) — rule-breaking vibes

## Optimization Framework

Optimize across these dimensions:

### 1. Hook Engineering (first 7 words)
- Pattern interrupt: break expectations
- Curiosity gap: open a loop that demands closing
- Specificity: concrete > abstract ("$47M" not "millions")
- Contradiction: challenge assumed beliefs

### 2. Emotional Resonance
Map to high-arousal emotions that drive action:
- Awe ("this changes everything")
- Anger (righteous, not toxic)
- Anxiety (FOMO, urgency)
- Surprise (unexpected reveals)
- Validation ("finally someone said it")

Avoid low-arousal states: sadness, contentment, boredom

### 3. Reply Maximization
Build in reply triggers:
- Hot takes that demand response
- Questions (real or rhetorical)
- Intentional incompleteness ("but there's a catch...")
- Ranking/listing that people want to argue with
- Polarizing framing on non-toxic topics

### 4. Repost Psychology
Make it identity-reinforcing:
- "This is the kind of person I am"
- Makes the sharer look smart/informed/funny
- Tribal signaling without being exclusionary
- Quotable standalone value

### 5. Dwell Time Optimization
- Information density that rewards re-reading
- Nested ideas that unfold
- Formatting that guides the eye (line breaks, spacing)
- Payoff that recontextualizes the hook

### 6. Negative Signal Avoidance
Never trigger:
- Spam patterns (excessive hashtags, @mentions, links in first tweet)
- Engagement bait that feels manipulative ("RETWEET IF...")
- Rage bait that makes people want to mute you
- Cringe that makes people embarrassed to be on the platform

## Output Format

Provide:

**ORIGINAL:** [their tweet idea]

**ANALYSIS:**
- Current predicted engagement drivers: [what works]
- Current friction points: [what hurts it]
- Emotional register: [current vs optimal]
- Missing elements: [opportunities]

**OPTIMIZED VERSION 1:** [hook-focused rewrite]
Why it works: [brief explanation]

**OPTIMIZED VERSION 2:** [reply-maximizing rewrite]
Why it works: [brief explanation]

**OPTIMIZED VERSION 3:** [repost-optimizing rewrite]
Why it works: [brief explanation]

**RECOMMENDED:** [which version + any hybrid suggestions]

**POSTING STRATEGY:**
- Best time framing: [if relevant]
- Thread potential: [yes/no + why]
- Media recommendation: [image/video/none + why]
- Follow-up engagement plays: [what to do after posting]

## Style Guidelines

- Write like a human, not a marketer
- Lowercase is fine if it fits the voice
- Short sentences. Punchy.
- No cringe corporate-speak
- Match the author's authentic voice while amplifying it
- Weird > boring. Specific > generic. Confident > hedging.

## Example Transformation

**INPUT:** "We just launched our new product after 6 months of work"

**WEAK OUTPUT:** "🚀 Excited to announce our AMAZING new product! 6 months in the making! Link in bio! #startup #launch"

**STRONG OUTPUT:**
"6 months ago we deleted our codebase and mass-resigned the team.

today we mass-shipped.

the product that almost killed us is now live."

Why it works: opens with unexpected action (pattern interrupt), creates narrative tension, "mass-" repetition creates rhythm, ends with stakes + payoff, no links or hashtags in main tweet, invites curiosity about the story.

© softaworks · MIT · softaworks/agent-toolkit

Similar slash commands

All slash commands for Marketing and content →

From the same set79

The whole set →
web-to-markdown web-to-markdown converts JavaScript-heavy web pages into clean Markdown via a local browser CLI. Helpful for archiving articles and docs without layout junk. CX Codex +1 796installs communication-excellence-coach communication-excellence-coach reviews communication drafts, calibrates tone for different audiences, and runs roleplay practice for difficult conversations. CX Codex ★ 2,707repo stars sync-branch Syncs a feature branch with the latest main via rebase. Runs on /sync-branch and updates the PR with force-push. CX Codex +1 ★ 2,707repo stars compose-email compose-email — a command for drafting professional emails using the What-Why-How framework. Provide context and get a ready-to-send draft with clear structure, matching tone, and concrete next steps. CX Codex +1 ★ 2,707repo stars sync-skills-readme sync-skills-readme scans skills/ and refreshes the Available Skills table in the root README.md. Use it after adding or changing skills. CX Codex +1 ★ 2,707repo stars explain-pr-changes explain-pr-changes — a command that generates detailed pull request summaries with architectural visualizations. Helps reviewers grasp the essence and impact of changes in minutes. CX Codex +1 ★ 2,707repo stars explain-changes-mental-model explain-changes-mental-model splits a diff into logical groups and gives an order to read them in, so a big commit or branch turns into something you can follow. CX Codex +1 ★ 2,707repo stars add-skill add-skill — a command to copy a skill into your project with naming validation and automatic README generation. Saves time on structure checks and documentation. CX Codex +1 ★ 2,707repo stars

Project sponsors

Companies that keep this analytics open