SkillOpen

last30days (Our Codex skills) (6965)

Research what people actually say about any topic in the last 30 days. Pulls posts and engagement from Reddit, X, YouTube, TikTok, Hacker News, Polymarket, GitHub, and the web.

Front matter
name: last30days
version: "3.0.1"
description: "Research what people actually say about any topic in the last 30 days. Pulls posts and engagement from Reddit, X, YouTube, TikTok, Hacker News, Polymarket, GitHub, and the web."
argument-hint: 'last30days nvidia earnings reaction | last30days AI video tools | last30days what users want in react'
allowed-tools: Bash, Read, Write, AskUserQuestion, WebSearch
homepage: https://github.com/mvanhorn/last30days-skill
repository: https://github.com/mvanhorn/last30days-skill
author: mvanhorn
license: MIT
user-invocable: true
metadata:
  openclaw:
    emoji: "📰"
    requires:
      env:
        - SCRAPECREATORS_API_KEY
      optionalEnv:
        - OPENAI_API_KEY
        - XAI_API_KEY
        - OPENROUTER_API_KEY
        - PARALLEL_API_KEY
        - BRAVE_API_KEY
        - APIFY_API_TOKEN
        - AUTH_TOKEN
        - CT0
        - BSKY_HANDLE
        - BSKY_APP_PASSWORD
        - TRUTHSOCIAL_TOKEN
      bins:
        - node
        - python3
    primaryEnv: SCRAPECREATORS_API_KEY
    files:
      - "scripts/*"
    homepage: https://github.com/mvanhorn/last30days-skill
    tags:
      - research
      - deep-research
      - reddit
      - x
      - twitter
      - youtube
      - tiktok
      - instagram
      - hackernews
      - polymarket
      - bluesky
      - truthsocial
      - trends
      - recency
      - news
      - citations
      - multi-source
      - social-media
      - analysis
      - web-search
      - ai-skill
      - clawhub

last30days v3.0.1: Research Any Topic from the Last 30 Days

Permissions overview: Reads public web/platform data and optionally saves research briefings to ~/Documents/Last30Days/. X/Twitter search uses optional user-provided tokens (AUTH_TOKEN/CT0 env vars). Bluesky search uses optional app password (BSKY_HANDLE/BSKY_APP_PASSWORD env vars - create at bsky.app/settings/app-passwords). All credential usage and data writes are documented in the [Security & Permissions](#security--permissions) section.

Research ANY topic across Reddit, X, YouTube, and other sources. Surface what people are actually discussing, recommending, betting on, and debating right now.

Runtime Preflight

Before running any last30days.py command in this skill, resolve a Python 3.12+ interpreter once and keep it in LAST30DAYS_PYTHON:

for py in python3.14 python3.13 python3.12 python3; do
  command -v "$py" >/dev/null 2>&1 || continue
  "$py" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 12) else 1)' || continue
  LAST30DAYS_PYTHON="$py"
  break
done

if [ -z "${LAST30DAYS_PYTHON:-}" ]; then
  echo "ERROR: last30days v3 requires Python 3.12+. Install python3.12 or python3.13 and rerun." >&2
  exit 1
fi

Step 0: First-Run Setup Wizard

CRITICAL: ALWAYS execute Step 0 BEFORE Step 1, even if the user provided a topic. If the user typed /last30days Mercer Island, you MUST check for FIRST_RUN and present the wizard BEFORE running research. The topic "Mercer Island" is preserved — research runs immediately after the wizard completes. Do NOT skip the wizard because a topic was provided. The wizard takes 10 seconds and only runs once ever.

To detect first run: check if ~/.config/last30days/.env exists. If it does NOT exist, this is a first run. Do NOT run any Bash commands or show any command output to detect this — just check the file existence silently. If the file exists and contains SETUP_COMPLETE=true, skip this section silently and proceed to Step 1. Do NOT say "Setup is complete" or any other status message — just move on. The user doesn't need to be told setup is done every time they run the skill.

When first run is detected, detect your platform first:

If you do NOT have WebSearch capability (OpenClaw, Codex, raw CLI): Run the OpenClaw setup flow below. If you DO have WebSearch (Claude Code): Run the standard setup flow below.


OpenClaw / Non-WebSearch Setup Flow

Run environment detection first:

"${LAST30DAYS_PYTHON}" "${SKILL_ROOT}/scripts/last30days.py" setup --openclaw

Read the JSON output. It tells you what's already configured. Display a status summary:

👋 Welcome to /last30days!

Detected:
{✅ or ❌} yt-dlp (YouTube search)
{✅ or ❌} X/Twitter ({method} configured)
{✅ or ❌} ScrapeCreators (TikTok, Instagram, Reddit backup)
{✅ or ❌} Web search ({backend} configured)

Then for each missing item, offer setup in priority order:

  1. ScrapeCreators (if not configured): "ScrapeCreators adds TikTok and Instagram search (plus a Reddit backup if public Reddit gets rate-limited). 10,000 free calls, no credit card. (No referrals, no kickbacks - we don't get a cut.)"
  • Option A: "ScrapeCreators via GitHub (recommended)" -- Check if gh CLI was detected in the environment detection output above. If gh IS detected: description should say "Registers directly via GitHub CLI in ~2 seconds - no browser needed". Before running the command, display: "Registering via GitHub CLI..." If gh is NOT detected: description should say "Copies a one-time code to your clipboard and opens GitHub to authorize". Before running the command, display: "I'll copy a one-time code to your clipboard and open GitHub. When GitHub asks for a device code, just paste (Cmd+V / Ctrl+V)." Then run "${LAST30DAYS_PYTHON}" "${SKILL_ROOT}/scripts/last30days.py" setup --github, parse JSON output. Tries PAT first (if gh is installed), falls back to device flow which copies a one-time code to your clipboard and opens your browser. If status is success, write SCRAPECREATORS_API_KEY={api_key} to .env.
  • Option B: "I have a key" -- accept paste, write to .env
  • Option C: "Skip for now"
  1. X/Twitter (if not configured): "X search finds tweets and conversations. To unlock X: add FROM_BROWSER=auto (reads browser cookies, free), XAI_API_KEY (no browser access, api.x.ai), or AUTH_TOKEN+CT0 (manual cookies)."
  • Option A: "I have an xAI API key" (recommended for servers -- persistent, no expiry). Write XAI_API_KEY to .env.
  • Option B: "I have AUTH_TOKEN + CT0 from my browser" -- accept both, write to .env
  • Option C: "Skip for now"
  1. YouTube (if yt-dlp not found): "YouTube search needs yt-dlp. Run: pip install yt-dlp"
  1. Web search (if no Brave/Exa/Serper key): "A web search key enables smarter results. Brave Search is free for 2,000 queries/month at brave.com/search/api"

After setup, write SETUP_COMPLETE=true to .env and proceed to research.

Skip to "END OF FIRST-RUN WIZARD" below after completing the OpenClaw flow.


Claude Code Setup Flow (Standard)

You MUST follow these steps IN ORDER. Do NOT skip ahead to the topic picker or research. The sequence is: (1) welcome text -> (2) setup modal -> (3) run setup if chosen -> (4) optional ScrapeCreators modal -> (5) topic picker. You MUST start at step 1.

Step 1: Display the following welcome text ONCE as a normal message (not blockquoted). Then IMMEDIATELY call AskUserQuestion - do NOT repeat any of the welcome text inside the AskUserQuestion call.

Welcome to /last30days!

I research any topic across Reddit, X, YouTube, and other sources - synthesizing what people are actually saying right now.

Auto setup gives you 5 core sources for free in 30 seconds:

  • X/Twitter - reads your x.com browser cookies to authenticate (not saved to disk). Chrome on macOS will prompt for Keychain access.
  • Reddit with comments - public JSON, no API key needed
  • YouTube search + transcripts - installs yt-dlp (open source, 190K+ GitHub stars)
  • Hacker News + Polymarket + GitHub (if gh CLI installed) - always on, zero config

Want TikTok and Instagram too? ScrapeCreators adds those (10,000 free calls, scrapecreators.com). No kickbacks, no affiliation.

Then call AskUserQuestion with ONLY this question and these options - no additional text:

Question: "How would you like to set up?" Options:

  • "Auto setup (~30 seconds) - scans browser cookies for X + installs yt-dlp for YouTube"
  • "Manual setup - show me what to configure"
  • "Skip for now - Reddit (with comments), HN, Polymarket, GitHub (if gh installed), Web"

If the user picks 1 (Auto setup):

Before running the setup command, get cookie consent:

Check if BROWSER_CONSENT=true already exists in ~/.config/last30days/.env. If it does, skip the consent prompt and run setup directly.

If BROWSER_CONSENT=true is NOT present, call AskUserQuestion: Question: "Auto setup will scan your browser for x.com cookies to authenticate X search. Cookies are read live, not saved to disk. Chrome on macOS will prompt for Keychain access. OK to proceed?" Options:

  • "Yes, scan my cookies for X" - Run setup as normal. Append BROWSER_CONSENT=true to .env after setup completes.
  • "Skip X, just set up YouTube" - Run setup with YouTube only (install yt-dlp). Do not scan cookies.
  • "I have an xAI API key instead" - Ask them to paste it, write XAI_API_KEY to .env. Then install yt-dlp.

Run the setup subcommand:

cd {SKILL_DIR} && "${LAST30DAYS_PYTHON}" scripts/last30days.py setup

Show the user the results (what cookies were found, whether yt-dlp was installed).

Then show the optional ScrapeCreators offer (plain text, then modal):

Want TikTok and Instagram too? ScrapeCreators adds those platforms - 10,000 free calls, no credit card. It also serves as a Reddit backup if public Reddit ever gets rate-limited.

Before showing the ScrapeCreators modal, check for gh CLI: Run which gh via Bash silently. Store the result as gh_available (true if found, false if not).

Call AskUserQuestion: Question: "Want to add TikTok, Instagram, and Reddit backup via ScrapeCreators? (We don't get a cut.)" Options:

  • "ScrapeCreators via GitHub (fastest, recommended)" - If gh_available: description should say "Registers directly via GitHub CLI in ~2 seconds - no browser needed". If NOT gh_available: description should say "Copies a one-time code to your clipboard and opens GitHub to authorize". After the user selects this option: If gh_available, display "Registering via GitHub CLI..." before running the command. If NOT gh_available, display "I'll copy a one-time code to your clipboard and open GitHub. When GitHub asks for a device code, just paste (Cmd+V on Mac, Ctrl+V on Windows/Linux)." Then run cd {SKILL_DIR} && "${LAST30DAYS_PYTHON}" scripts/last30days.py setup --github via Bash with a 5-minute timeout. This tries PAT auth first (if gh CLI is installed, zero browser needed), then falls back to GitHub device flow which copies a one-time code to your clipboard and opens GitHub in your browser. Parse the JSON stdout. If status is success, write SCRAPECREATORS_API_KEY={api_key} to ~/.config/last30days/.env. If method is pat, show: "You're in! Registered via GitHub CLI - zero browser needed. 10,000 free calls. TikTok, Instagram, and Reddit backup are now active." If method is device and clipboard_ok is true, show: "You're in! (The authorization code was copied to your clipboard automatically.) 10,000 free calls. TikTok, Instagram, and Reddit backup are now active." If method is device and clipboard_ok is false, show: "You're in! 10,000 free calls. TikTok, Instagram, and Reddit backup are now active." If status is timeout or error, show: "GitHub auth didn't complete. No worries - you can sign up at scrapecreators.com instead or try again later." Then offer the web signup option.
  • "Open scrapecreators.com (Google sign-in)" - run open https://scrapecreators.com via Bash to open in the user's browser. Then ask them to paste the API key they get. When they paste it, write SCRAPECREATORS_API_KEY={key} to ~/.config/last30days/.env
  • "I have a key" - accept the key, write to .env
  • "Skip for now" - proceed without ScrapeCreators

After SC key is saved (not if skipped), show the TikTok/Instagram opt-in:

Your ScrapeCreators key powers TikTok, Instagram, Threads, Pinterest, and YouTube comments. Want those on for every research run? (Each additional source uses a ScrapeCreators call per search.)

Call AskUserQuestion: Question: "Which ScrapeCreators sources do you want on?" Options:

  • "TikTok + Instagram (recommended)" - append INCLUDE_SOURCES=tiktok,instagram to ~/.config/last30days/.env. Confirm: "TikTok and Instagram are on, plus Reddit backup if public Reddit has issues. You can add threads, pinterest, youtube_comments, tiktok_comments to INCLUDE_SOURCES anytime."
  • "Everything - TikTok, Instagram, Threads, Pinterest, YouTube + TikTok comments" - append INCLUDE_SOURCES=tiktok,instagram,threads,pinterest,youtube_comments,tiktok_comments to ~/.config/last30days/.env. Confirm: "All ScrapeCreators sources are on."
  • "Just the basics - let's run our first search" - don't write the flag. Confirm: "Got it. ScrapeCreators will serve as Reddit backup. You can add sources to INCLUDE_SOURCES in your .env anytime."

After TikTok/Instagram opt-in (or SC skip), show the first research topic modal:

Call AskUserQuestion: Question: "What do you want to research first?" Options:

  • "Claude Code vs Codex" - tech comparison
  • "Sam Altman" - person in the news
  • "Warriors Basketball" - sports
  • "AI Legal Prompting Techniques" - niche/professional
  • "Type my own topic"

If user picks an example, run research with that topic. If they pick "Type my own", ask them what they want to research. If the user originally provided a topic with the command (e.g., /last30days Mercer Island), skip this modal and use their topic directly.

END OF FIRST-RUN WIZARD. Everything above in Step 0 ONLY runs on first run. If SETUP_COMPLETE=true exists in .env, skip ALL of Step 0 — no welcome, no setup, no ScrapeCreators modal, no topic picker. Go directly to Step 1 (Parse User Intent). The topic picker is ONLY for first-time users who haven't run /last30days before.

If the user picks 2 (Manual setup): Show them this guide (present as plain text, not blockquoted):

The magic of /last30days is Reddit comments + X posts together - and both are free. Here's how to unlock each source.

Add these to ~/.config/last30days/.env:

X/Twitter (pick one - this is the most important):

  • FROM_BROWSER=auto - free. Reads your x.com login cookies at search time to authenticate. Cookies are read live each run, not saved to disk. Chrome on macOS will prompt for Keychain access the first time. Firefox and Safari don't.
  • XAI_API_KEY=xxx - no browser access needed. Get a key at api.x.ai. Best for servers or if you don't want cookie scanning.
  • AUTH_TOKEN=xxx + CT0=xxx - paste your X cookies manually (x.com -> F12 -> Application -> Cookies)

Reddit (free, works out of the box):

  • Public JSON gives you threads + top comments with upvote counts. No setup required.
  • SCRAPECREATORS_API_KEY=xxx - optional backup source if public Reddit gets rate-limited.
  • OPENAI_API_KEY=xxx - optional fallback if public Reddit search has trouble finding threads.

YouTube (free, open source):

  • Run brew install yt-dlp - free, open source, 190K+ GitHub stars. Enables YouTube search and transcripts.

Bonus: TikTok, Instagram, Threads, Pinterest, YouTube comments (ScrapeCreators):

  • SCRAPECREATORS_API_KEY=xxx - 10,000 free calls at scrapecreators.com.
  • After adding your key, set INCLUDE_SOURCES=tiktok,instagram to turn on the most popular ones. Add threads, pinterest, youtube_comments, tiktok_comments for more.

GitHub Issues/PRs (free, no key needed):

  • If you have the gh CLI installed (brew install gh), GitHub search is automatic. No API key required.

Perplexity Sonar Pro (AI-synthesized research via OpenRouter):

  • OPENROUTER_API_KEY=xxx - adds AI-synthesized research with citations as an additive source alongside Reddit/X/YouTube. Returns structured narratives with specific dates, names, and numbers that social sources miss. ~$0.02/run.
  • After adding your key, set INCLUDE_SOURCES=perplexity (or append to existing, e.g. INCLUDE_SOURCES=tiktok,instagram,perplexity).
  • Use --deep-research flag for exhaustive 50+ citation reports (~$0.90/query) on topics that need serious investigation.
  • Bonus: also powers the planning and reranking engine if you don't have a Gemini/OpenAI/xAI key.

Other bonus sources (add anytime):

  • EXA_API_KEY=xxx - semantic web search, 1K free/month (exa.ai)
  • BSKY_HANDLE=you.bsky.social + BSKY_APP_PASSWORD=xxx - Bluesky (free app password)
  • BRAVE_API_KEY=xxx - Brave web search

Always add this last line: SETUP_COMPLETE=true

CRITICAL: NEVER overwrite an existing .env file. Before writing ANY key to ~/.config/last30days/.env:

  1. Check if the file exists: test -f ~/.config/last30days/.env
  2. If it exists, READ it first, then APPEND only missing keys using >> (double redirect)
  3. NEVER use > (single redirect) which destroys existing content
  4. If it doesn't exist, create it: mkdir -p ~/.config/last30days && touch ~/.config/last30days/.env

Then call AskUserQuestion: Question: "How do you want to add your keys?" Options:

  • "Open .env in my editor" - Creates the file with a commented template and opens it. You edit, save, and come back.
  • "Paste keys here" - Paste your API keys and I'll write the file for you.
  • "I'll do it myself" - I'll tell you the file path and you handle it.

If the user picks "Open .env in editor": Create ~/.config/last30days/.env if it doesn't exist (check first!), pre-populated with this template:

# /last30days configuration
# Uncomment and fill in the keys you want to use.

# X/Twitter (pick one):
# FROM_BROWSER=auto          # Free. Reads x.com cookies from your browser at search time.
#                             # Chrome on macOS prompts for Keychain access. Firefox/Safari don't.
# XAI_API_KEY=               # No browser access. Get a key at api.x.ai
# AUTH_TOKEN=                 # Manual: x.com -> F12 -> Application -> Cookies
# CT0=                        # (requires AUTH_TOKEN too)

# ScrapeCreators (10,000 free calls - scrapecreators.com):
# SCRAPECREATORS_API_KEY=    # Unlocks: TikTok, Instagram, Reddit backup (if public Reddit gets rate-limited)
#                             # Optional: add threads, pinterest, youtube_comments, tiktok_comments for more
# INCLUDE_SOURCES=tiktok,instagram

# YouTube: install yt-dlp (brew install yt-dlp) - no key needed

# Bluesky:
# BSKY_HANDLE=you.bsky.social
# BSKY_APP_PASSWORD=

# Web search:
# BRAVE_API_KEY=              # 2,000 free queries/month at brave.com/search/api
# OPENROUTER_API_KEY=         # Perplexity Sonar via OpenRouter

SETUP_COMPLETE=true

If the file already exists, do NOT overwrite it. Just open it. Run open ~/.config/last30days/.env on macOS to open in the default editor. Then tell the user: "Your .env is open. Edit it, save, and run /last30days again."

If the user picks "Paste keys here", write them to ~/.config/last30days/.env (create the file and parent dirs if needed, append without overwriting existing keys, always include SETUP_COMPLETE=true). If a SCRAPECREATORS_API_KEY was included, also append INCLUDE_SOURCES=tiktok,instagram and tell the user: "TikTok, Instagram, and Reddit backup are now on. Want to also add Threads, Pinterest, or YouTube comments? Add them to INCLUDE_SOURCES in your .env." Then offer the same ScrapeCreators sources opt-in modal as the auto-setup path (the "Which ScrapeCreators sources do you want on?" question above). Then proceed with research.

If the user picks "I'll do it myself", tell them: "Save the file at ~/.config/last30days/.env, then run /last30days <topic> to research anything." Then proceed with research using whatever sources are currently available.

If the user picks Skip: Proceed with research immediately using the user's original topic. Do NOT create or modify the .env file when the user picks Skip. Note: without setup, sources are limited to Reddit (threads and comments), HN, Polymarket, and GitHub (if gh CLI installed). X/Twitter and YouTube require setup.


Do I Need API Keys?

When users ask about API keys, setup, or how to unlock more sources, reference this:

You do NOT need API keys to use last30days. It works out of the box with Reddit (threads and comments), Hacker News, Polymarket, and GitHub (if gh CLI installed). Browser cookies for X/Twitter are equivalent to an API key - just log into x.com in any browser and last30days will find your session automatically.

Source unlock progression (all free):

  • Zero config (40% quality): Reddit (threads + comments), HN, Polymarket, GitHub (if gh installed) - works immediately
  • + X cookies (60%): Log into x.com in any browser. last30days scans your cookies automatically. No signup required.
  • + yt-dlp (80%): brew install yt-dlp - open source, 190K+ GitHub stars. Enables YouTube search and transcripts.
  • Auto setup does both X cookies + yt-dlp in 30 seconds.
  • Full free tier (80%): X + Reddit (with comments) + YouTube + HN + Polymarket + GitHub (if gh CLI installed)
  • + ScrapeCreators (100%): Adds TikTok, Instagram, and a Reddit backup. 10,000 free API calls, no credit card - scrapecreators.com. It's a bonus, not a requirement.

Key comparison: X browser cookies = same access as an API key (free, no signup). ScrapeCreators adds TikTok and Instagram for users who want those platforms.

last30days has no affiliation with any API provider - no referrals, no kickbacks.


CRITICAL: Parse User Intent

Before doing anything, parse the user's input for:

  1. TOPIC: What they want to learn about (e.g., "web app mockups", "Claude Code skills", "image generation")
  2. TARGET TOOL (if specified): Where they'll use the prompts (e.g., "Nano Banana Pro", "ChatGPT", "Midjourney")
  3. QUERY TYPE: What kind of research they want:
  • PROMPTING - "X prompts", "prompting for X", "X best practices" → User wants to learn techniques and get copy-paste prompts
  • RECOMMENDATIONS - "best X", "top X", "what X should I use", "recommended X" → User wants a LIST of specific things
  • NEWS - "what's happening with X", "X news", "latest on X" → User wants current events/updates
  • COMPARISON - "X vs Y", "X versus Y", "compare X and Y", "X or Y which is better" → User wants a side-by-side comparison
  • GENERAL - anything else → User wants broad understanding of the topic

Common patterns:

  • [topic] for [tool] → "web mockups for Nano Banana Pro" → TOOL IS SPECIFIED
  • [topic] prompts for [tool] → "UI design prompts for Midjourney" → TOOL IS SPECIFIED
  • Just [topic] → "iOS design mockups" → TOOL NOT SPECIFIED, that's OK
  • "best [topic]" or "top [topic]" → QUERY_TYPE = RECOMMENDATIONS
  • "what are the best [topic]" → QUERY_TYPE = RECOMMENDATIONS
  • "X vs Y" or "X versus Y" → QUERY_TYPE = COMPARISON, TOPIC_A = X, TOPIC_B = Y (split on vs or versus with spaces)

IMPORTANT: Do NOT ask about target tool before research.

  • If tool is specified in the query, use it
  • If tool is NOT specified, run research first, then ask AFTER showing results

Store these variables:

  • TOPIC = [extracted topic]
  • TARGET_TOOL = [extracted tool, or "unknown" if not specified]
  • QUERY_TYPE = [RECOMMENDATIONS | NEWS | HOW-TO | COMPARISON | GENERAL]
  • TOPIC_A = [first item] (only if COMPARISON)
  • TOPIC_B = [second item] (only if COMPARISON)

Confirm the topic with a branded, truthful message. Build ACTIVE_SOURCES_LIST by checking what's configured in .env:

  • Always active: Reddit, Hacker News, Polymarket
  • If gh CLI is installed (check which gh): add GitHub
  • If AUTH_TOKEN/CT0 or XAI_API_KEY or FROM_BROWSER is set: add X
  • If yt-dlp is installed (check which yt-dlp): add YouTube
  • If SCRAPECREATORS_API_KEY is set and INCLUDE_SOURCES contains tiktok: add TikTok
  • If SCRAPECREATORS_API_KEY is set and INCLUDE_SOURCES contains instagram: add Instagram
  • If SCRAPECREATORS_API_KEY is set and INCLUDE_SOURCES contains threads: add Threads
  • If SCRAPECREATORS_API_KEY is set and INCLUDE_SOURCES contains pinterest: add Pinterest
  • If BSKY_HANDLE and BSKY_APP_PASSWORD are set: add Bluesky
  • If OPENROUTER_API_KEY is set: add Perplexity

Then display (use "and more" if 5+ sources, otherwise list all with Oxford comma):

For GENERAL / NEWS / RECOMMENDATIONS / PROMPTING queries:

/last30days — searching {ACTIVE_SOURCES_LIST} for what people are saying about {TOPIC}.

For COMPARISON queries:

/last30days — comparing {TOPIC_A} vs {TOPIC_B} across {ACTIVE_SOURCES_LIST}.

Do NOT show a multi-line "Parsed intent" block with TOPIC=, TARGET_TOOL=, QUERY_TYPE= variables. Do NOT promise a specific time. Do NOT list sources that aren't configured.

Then proceed immediately to Step 0.5 / 0.55.


Step 0.5: Resolve X Handles (if topic could have X accounts)

If TOPIC looks like it could have its own X/Twitter account - people, creators, brands, products, tools, companies, communities (e.g., "Dor Brothers", "Jason Calacanis", "Nano Banana Pro", "Seedance", "Midjourney"), do WebSearches to find handles in three categories:

1. Primary handle (the entity itself):

WebSearch("{TOPIC} X twitter handle site:x.com")

2. Company/organization handle OR founder/creator handle -- This mapping is bidirectional:

  • If the topic is a PERSON, resolve their company's X handle. A CEO's story is inseparable from their company's story.
  • If the topic is a PRODUCT or COMPANY, resolve the founder/creator's personal X handle. The creator's personal account often has the most candid, high-signal content.
WebSearch("{TOPIC} company CEO of site:x.com")

OR for products:

WebSearch("{TOPIC} creator founder X twitter site:x.com")

Examples: Sam Altman -> @OpenAI, Dario Amodei -> @AnthropicAI, OpenClaw -> @steipete (Peter Steinberger), Paperclip -> @dotta, Claude Code -> @alexalbert__.

3. 1-2 related handles -- People/entities closely associated with the topic (spouse, collaborator, band member), PLUS 1-2 prominent commentator/media handles that regularly cover this topic:

WebSearch("{RELATED_PERSON_OR_ENTITY} X twitter handle site:x.com")

For a music artist, find music commentary accounts (e.g., @PopBase, @HotFreestyle, @DailyRapFacts). For a tech CEO, find tech media accounts (e.g., @TechCrunch, @TheInformation). For a product, find reviewer accounts in that category.

From the results, extract their X/Twitter handles. Look for:

  • Verified profile URLs like x.com/{handle} or twitter.com/{handle}
  • Mentions like "@handle" in bios, articles, or social profiles
  • "Follow @handle on X" patterns

Verify accounts are real, not parody/fan accounts. Check for:

  • Verified/blue checkmark in the search results
  • Official website linking to the X account
  • Consistent naming (e.g., @thedorbrothers for "The Dor Brothers", not @DorBrosFan)
  • If results only show fan/parody/news accounts (not the entity's own account), skip - the entity may not have an X presence

Pass handles to the CLI:

  • Primary: --x-handle={handle} (without @)
  • Related: --x-related={handle1},{handle2},{company_handle},{commentator_handles} (comma-separated, without @)

Example for "Kanye West":

  • Primary: --x-handle=kanyewest
  • Related: --x-related=travisscott,PopBase,HotFreestyle

Example for "Sam Altman":

  • Primary: --x-handle=sama
  • Related: --x-related=OpenAI,TechCrunch

Related handles are searched with lower weight (0.3) so they appear in results but don't dominate over the primary entity's content.

Note about @grok: Grok is Elon's AI on X (xAI). It often appears in search results with thoughtful, accurate analysis. When citing @grok in your synthesis, frame it as "per Grok's AI analysis of [article/topic]" rather than treating it as an independent human commentator.

Skip this step if:

  • TOPIC is clearly a generic concept, not an entity (e.g., "best rap songs 2026", "how to use Docker", "AI ethics debate")
  • TOPIC already contains @ (user provided the handle directly)
  • Using --quick depth
  • WebSearch shows no official X account exists for this entity

Store: RESOLVED_HANDLE = {handle or empty}, RESOLVED_RELATED = {comma-separated handles or empty}

Step 0.5b: Resolve GitHub Username (if topic is a person)

If TOPIC looks like a person (developer, creator, CEO, founder), also resolve their GitHub username for person-mode GitHub search:

WebSearch("{TOPIC} github profile site:github.com")

From the results, extract their GitHub username from URLs like github.com/{username}.

Verify the account is correct: Check that the profile description or pinned repos match the person you're researching. Common names may return multiple profiles.

Pass to the CLI: --github-user={username} (without @)

Example for "Peter Steinberger": --github-user=steipete Example for "Matt Van Horn": --github-user=mvanhorn

Person-mode GitHub tells a different story than keyword search. Instead of "who mentioned this person in an issue body," it answers: "What are they shipping? Where are they getting merged? What do their own projects look like?" The engine fetches PR velocity, top repos with star counts, release notes, and README summaries.

Skip this step if:

  • TOPIC is clearly NOT a person (products, concepts, events)
  • TOPIC already has --github-user specified by the user
  • Using --quick depth
  • WebSearch shows no GitHub profile for this person

Store: RESOLVED_GITHUB_USER = {username or empty}

Step 0.5c: Resolve GitHub Repos (if topic is a product/project)

If TOPIC looks like a product, tool, or open source project (not a person), resolve its GitHub repo for project-mode search:

WebSearch("{TOPIC} github repo site:github.com")

From the results, extract owner/repo from URLs like github.com/{owner}/{repo}.

Pass to the CLI: --github-repo={owner/repo}

For comparisons ("X vs Y"), resolve repos for both topics: --github-repo={repo_a},{repo_b}

Example for "OpenClaw": --github-repo=openclaw/openclaw Example for "OpenClaw vs Paperclip": --github-repo=openclaw/openclaw,paperclipai/paperclip

Project-mode GitHub fetches live star counts, README snippets, latest releases, and top issues directly from the API. This is always more accurate than blog posts or YouTube videos citing weeks-old numbers.

Skip this step if:

  • TOPIC is a person (use --github-user instead)
  • TOPIC has no GitHub presence (not a software project)
  • WebSearch shows no GitHub repo for this topic

Store: RESOLVED_GITHUB_REPOS = {comma-separated owner/repo or empty}


Agent Mode (--agent flag)

If --agent appears in ARGUMENTS (e.g., /last30days plaud granola --agent):

  1. Skip the intro display block ("I'll research X across Reddit...")
  2. Skip any AskUserQuestion calls - use TARGET_TOOL = "unknown" if not specified
  3. Run the research script and WebSearch exactly as normal
  4. Skip the "WAIT FOR USER RESPONSE" pause
  5. Skip the follow-up invitation ("I'm now an expert on X...")
  6. Output the complete research report and stop - do not wait for further input

Agent mode saves raw research data to ~/Documents/Last30Days/ automatically via --save-dir (handled by the script, no extra tool calls).

Agent mode report format:

## Research Report: {TOPIC}
Generated: {date} | Sources: Reddit, X, Bluesky, YouTube, TikTok, HN, Polymarket, Web

### Key Findings
[3-5 bullet points, highest-signal insights with citations]

The text continues at the source. Read the rest.

Source: written by One Giant Leap.

Related entries

There are more like this in the members library

The Codex library holds 7,009 entries. Members can search all of them by meaning and read every one in full.