feat(release): v2.9.4 - move save into Python script, zero post-invitation noise

Add --save-dir flag to last30days.py that saves raw research output
during the existing script run. Remove entire "Save Research to
Documents" section from SKILL.md (~45 lines). No more extra tool
calls, no (No output), no multi-minute cogitation after invitation.

Tested: --mock confirms file creation and duplicate date suffixing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Van Horn
2026-03-06 16:27:53 -08:00
parent 28d223e43c
commit 6d5acb9121
4 changed files with 116 additions and 53 deletions
+4 -53
View File
@@ -30,7 +30,7 @@ metadata:
- prompts
---
# last30days v2.9.3: Research Any Topic from the Last 30 Days
# last30days v2.9.4: Research Any Topic from the Last 30 Days
Research ANY topic across Reddit, X, YouTube, TikTok, Hacker News, Polymarket, and the web. Surface what people are actually discussing, recommending, betting on, and debating right now.
@@ -123,7 +123,7 @@ If `--agent` appears in ARGUMENTS (e.g., `/last30days plaud granola --agent`):
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 still saves the research briefing to `~/Documents/Last30Days/` using the same logic as interactive mode (see "Save Research to Documents" section).
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:
@@ -167,7 +167,7 @@ if [ -z "${SKILL_ROOT:-}" ]; then
exit 1
fi
python3 "${SKILL_ROOT}/scripts/last30days.py" "$ARGUMENTS" --emit=compact --no-native-web # Add --x-handle=HANDLE if RESOLVED_HANDLE is set
python3 "${SKILL_ROOT}/scripts/last30days.py" "$ARGUMENTS" --emit=compact --no-native-web --save-dir=~/Documents/Last30Days # Add --x-handle=HANDLE if RESOLVED_HANDLE is set
```
Use a **timeout of 300000** (5 minutes) on the Bash call. The script typically takes 1-3 minutes.
@@ -498,58 +498,9 @@ For `/last30days war in Iran` (NEWS):
---
## Save Research to Documents
After displaying the invitation, save the complete research briefing to `~/Documents/Last30Days/`. This happens automatically on every run.
**Generate the filename** from TOPIC:
- Lowercase, replace spaces/special chars with hyphens, remove consecutive hyphens, trim to 60 chars
- Example: "Claude Code Best Practices" → `claude-code-best-practices.md`
- If file already exists, append today's date: `{slug}-YYYY-MM-DD.md`
**End your invitation with a single `📎` footer line:**
```
📎 ~/Documents/Last30Days/{slug}.md
```
**Then save using a foreground Bash command** (cat is instant - no delay):
```bash
mkdir -p ~/Documents/Last30Days && cat > ~/Documents/Last30Days/{slug}.md << 'RESEARCH_EOF'
# {TOPIC}
> Researched {date} | Query type: {QUERY_TYPE} | Target tool: {TARGET_TOOL or "general"}
## What I learned
{The full synthesis section you just displayed - all topics, patterns, and citations}
## Stats
{The full stats box with source counts and engagement - copy exactly as displayed}
## Follow-up suggestions
{The 2-3 specific suggestions from the invitation block}
---
*Generated by [last30days](https://github.com/mvanhorn/last30days-skill) v2.9.3*
RESEARCH_EOF
```
**CRITICAL RULES:**
1. NEVER use the `Write` tool - it displays "Wrote N lines..." which clutters the output
2. NEVER use `run_in_background: true` - background callbacks cause the model to re-engage, hallucinate fake user messages, and generate unsolicited responses
3. Use FOREGROUND Bash with `cat >` - it executes instantly (sub-second) and produces no output
4. The `📎` line is part of your text message, not a separate tool call
5. Do NOT output any text after the save Bash call. No "saved", no "ready for questions", nothing.
---
## WAIT FOR USER'S RESPONSE
**STOP and wait** for the user to respond. Do NOT generate any text after the save.
**STOP and wait** for the user to respond. Do NOT call any tools after displaying the invitation. The research script already saved raw data to `~/Documents/Last30Days/` via `--save-dir`.
---