Side LaneNotes and tools from the side of a full-time job

Library / Audience

Weekly report

Claude Code command

One Claude Code command that reads your Substack stats in your browser, adds the week's posts and replies, and writes a one-page report with at most three next steps.

The storyNo Substack piece about this one yet. Read the notes

Substack spreads its numbers over four pages. This command puts them on one page once a week, next to the week's posts and replies, and compares them with last week.

What it does

What it will not do

The command

Save it as .claude/commands/weekly-report.md in your project and run /weekly-report in Claude Code. Replace <publication> with your Substack subdomain. It needs a browser tool that can read pages you are logged in to, such as the Claude in Chrome extension.

.claude/commands/weekly-report.md
---
description: Capture this week's Substack numbers from the browser, then build the weekly report
---

Build my weekly report. Read-only everywhere: change nothing on Substack, X or the scheduler.

1. Open a new browser tab.
2. Read the text of these pages (wait about 4 seconds after each loads):
   - `https://<publication>.substack.com/publish/stats/traffic`: "30d views" and the "Traffic by source" table (source, category, views, users, free subs).
   - `https://<publication>.substack.com/publish/stats/audience`: total followers, and subscribers if shown.
   - `https://<publication>.substack.com/publish/posts`: each published piece's title and views.
   - `https://<publication>.substack.com/publish/subscribers`: the subscriber count.
   If a page asks to log in or does not load, stop and say so.
3. Close the tab.
4. Write `data/substack-YYYY-MM-DD.json` (today's date) in this shape, using numbers only where you read them and leaving a field out otherwise:
   `{"date":"YYYY-MM-DD","subscribers":0,"followers":0,"views30d":0,"sources":[{"source":"","category":"","views":0,"users":0,"freeSubs":0}],"posts":[{"title":"","views":0,"newSubs":0}]}`
5. Read this week's posts and their numbers from the scheduler, and this week's rows from the reply log.
6. Write `data/report-YYYY-MM-DD.md` with: subscribers and followers against last week, views by source, each post with its numbers, replies sent, and no more than three next steps.
   With fewer than ten posts, list the numbers and rank nothing.
7. Add this week's row to the audience log.
8. Tell me the three numbers that changed most, and the next steps.

My own copy hands steps 5 and 6 to a small script that pulls post numbers from Buffer. This version asks Claude to do those steps, so it works with any scheduler.

Get the next note by email

Free. New notes and new library items go out through Substack.

Or read the notes first: sidelanenotes.substack.com