Lastxdays
Research and summarize what happened in the last N days (or a date range) about a topic, optionally
- Rating
- 4.3 (252 reviews)
- Downloads
- 36,545 downloads
- Version
- 1.0.0
Overview
Research and summarize what happened in the last N days (or a date range) about a topic, optionally using Reddit.
Complete Documentation
View Source →
lastXdays Skill
Summarize what happened in the last N days (or a specific YYYY-MM-DD → YYYY-MM-DD range) about a user-provided topic.
Default behavior is web-first (web_search + selective web_fetch). If optional credentials/data are available, you may ingest Reddit via API and X via x-cli (preferred), API, or local archive, falling back to web search if unavailable.
Trigger Patterns
Activate when the user message contains any of:
lastXdays/lastxdayslast x days- A question like: "what happened in the last N days" (optionally followed by a topic)
Default Model
Default to sonnet (anthropic/claude-sonnet-4-6) when spawning as a subagent.
Use flash (openrouter/google/gemini-2.0-flash-001) only for simple single-source lookups (one topic, one platform, straightforward synthesis with no file reading required). Flash is unreliable for multi-step agentic work requiring tool chaining (search → fetch → read files → synthesize → report). When in doubt, use sonnet.
Input Parsing
Parse from the user message:
1) Date range (preferred if explicit)
If the user supplies a range like:from 2026-01-10 to 2026-02-082026-01-10 → 2026-02-08
start = YYYY-MM-DDend = YYYY-MM-DD- Ignore
Nif both are present.
2) Days (N)
Otherwise, inferN:
- Look for an integer
Nassociated with the request, e.g.: lastxdays 77 lastxdayswhat happened in the last 14 days (about|re:)- Default:
N = 30 - Clamp:
N = min(max(N, 1), 365)
3) Sources (optional)
Supported:web|reddit|x|all.Accept any of:
for web/sources webfor reddit/sources redditfor x/sources xfor all/sources all
sources = all.4) Topic
- The remaining text (after removing trigger words, N/range, and source phrases) is the topic.
- If topic is empty/unclear, ask exactly one clarifying question and stop.
Date Range (freshness)
Use an inclusive range in local time:
freshness = start + "to" + end(e.g.,2026-01-10to2026-02-08)
node scripts/lastxdays_range.js
Optional non-web ingestion (Reddit/X)
Use this helper to ingest Reddit/X when possible:
node scripts/lastxdays_ingest.js --source=reddit|x --topic "..." --start YYYY-MM-DD --end YYYY-MM-DD --limit 40
- Reddit: official API via OAuth (if credentials exist), else returns
fallback:true - X:
x-clisearch first (if installed/configured), then Twitter API v2 recent search (if bearer token + range <= ~7 days), then local archive at~/clawd/data/x-archive/, else returnsfallback:true
- Reddit:
REDDIT_CLIENT_IDREDDIT_CLIENT_SECRET- either
REDDIT_REFRESH_TOKEN(recommended) orREDDIT_USERNAME+REDDIT_PASSWORD - optional:
REDDIT_USER_AGENT - X API (optional; only works for recent ranges on most tiers):
X_BEARER_TOKEN(also acceptsTWITTER_BEARER_TOKEN)- x-cli (optional, preferred for agent use):
- Install:
uv tool install x-cli(or from source) - Configure credentials in
~/.config/x-cli/.env(supports shared setup with x-mcp) - If present,
lastxdays_ingest.jsuses it before raw API/archive for X search
- Reads
~/.config/last30days/.envif present (does not hard-fail if missing) - Environment variables override
.envvalues (file only fills blanks)
Research Procedure
1) Compute start/end/freshness.
2) For each requested source:
Web
- Query:
- Run
web_searchwithfreshness(count 5–8) - Optionally
web_fetch2–6 best links
- Run
node scripts/lastxdays_ingest.js --source=reddit ... - If it returns
fallback:false, treat returneditems[]as “Notable links” (each has a Reddit permalink URL). - If
items[]is empty / too small to be useful (e.g., <3), you may also run the web fallback to broaden coverage.
fallback:true):
- Run
web_searchwith querysite:reddit.com/rand the samefreshness
X
Preferred:- Run
node scripts/lastxdays_ingest.js --source=x ... - If
mode=x-cli,mode=api, ormode=archive, treat returneditems[]as “Notable links” (each has a URL) - If
mode=x-cli, note that X results came from localx-cliexecution - If
mode=archive, note that links come from the local X archive - If
items[]is empty / too small to be useful (e.g., <3), you may also run the web fallback to broaden coverage.
fallback:true):
- Run
web_searchwith querysite:x.comand the samefreshness - Expect
web_fetchto fail often onx.com; rely on snippets when needed
- Prefer authoritative sources for Web
- Prefer high-engagement or highly-informative posts for Reddit/X
- Keep total links/items shown to ~10–20 max
Output Format (Markdown)
Title:
## lastXdays —days — - If an explicit range was used, you may replace
withdays YYYY-MM-DD → YYYY-MM-DD.
1) Date range used
YYYY-MM-DD → YYYY-MM-DD(and optionally the freshness string)
- 3–7 bullets summarizing the dominant storylines/trends
- Web
- X
- Markdown link
- One line: why it matters
- If snippet-only (fetch failed/unavailable), say so
- 3 copy/pasteable next searches
Smoke tests (local)
Date range helper:
node scripts/lastxdays_range.js 7
node scripts/lastxdays_ingest.js --source=reddit --topic "OpenClaw security vulnerability CVE" --start 2026-02-07 --end 2026-02-08 --limit 20 --pretty
node scripts/lastxdays_ingest.js --source=x --topic "OpenClaw" --start 2026-02-07 --end 2026-02-08 --limit 20 --pretty
x-cli -v -j tweet search "OpenClaw since:2026-02-07 until:2026-02-09" --max 20
Examples
lastxdays AI agents for weblast x days 10 bitcoin ETF flowswhat happened in the last 7 days about OpenAI for reddit14 lastXdays Apple Vision Pro for weblastxdays 30 OpenAI sources alllastxdays from 2026-01-01 to 2026-01-15 about Anthropic sources reddit
Installation
openclaw install lastxdays
Tags
Quick Info
Ready to Install?
Get started with this skill in seconds
Related Skills
4claw
4claw — a moderated imageboard for AI agents.
Aap Passport
Agent Attestation Protocol - The Reverse Turing Test.
Acestep Lyrics Transcription
Transcribe audio to timestamped lyrics using OpenAI Whisper or ElevenLabs Scribe API.
Adaptive Suite
A continuously adaptive skill suite that empowers Clawdbot.