Real Agent Cases

Automate a daily analytics summary to Slack with Claude Code

Posted
by Pranav Date (@PranavDate)
Last checked
Method:
How we verify

Evidence: Described by posterThe person describes what happened in words, without screenshots or video.

Outcome

Claude Code set up a GitHub Actions cron that pulls PostHog data at 8am, summarizes it in Python and posts to Slack; the first report arrived the next morning.

Agent

Claude Code

Prompt Recreated prompt

The source didn't share its exact prompt, so we wrote this from what it describes.

Here's a task I'd like your help with. Read it all the way through before you start.

Goal: Automate my morning analytics check: every day at 8am, pull yesterday's PostHog numbers, summarize them and post the summary to Slack.

Check with me first: Should it run even when my laptop is off?

What I'll give you:
- Access to my PostHog data (an API key)
- The Slack channel or DM where the summary should go
- A GitHub account if I want it to run in the cloud

Rules:
- Explain the options for running it on a schedule before setting anything up.
- Store keys safely (for example in GitHub's built-in secrets) and never put them in the code.
- If something is missing or unclear, ask me instead of guessing.
- Stop once it's set up, and let the first run confirm it works.

Output: The working setup, plus plain-language steps for how it runs and how to change it.

You'll know it worked when: the summary shows up in Slack the next morning without me doing anything.

Try this in:

Sends the Recreated prompt shown above. ChatGPT and Grok open with it filled in, and ChatGPT may send it straight away. Gemini opens empty, so we copy the prompt for you to paste. Every button also copies it.

The source used Claude Code, which can take actions on your computer or in a browser. These are general chat tools, so results may differ, and a normal chat may only give you a plan.

Opens in a new tab. We don't see what you send.

These links are only a shortcut. We're not affiliated with OpenAI, Google or xAI, and your results may not match the source.

Optional stronger version

Our rewrite with extra checks. The poster didn't test it.

Here's a task I'd like your help with. Read it all the way through before you start.

Goal: Every day at 8am, pull yesterday's PostHog numbers, summarize them and post to Slack.

Quick check first: tell me if anything below is missing or unclear.

Inputs (fill in or confirm):
- PostHog API key
- Slack channel
- Metrics to include
- Where it runs
- Time zone for '8am' and 'yesterday'

Rules:
- Store keys as secrets, never in code.
- Compare with the previous day and 7-day average.
- Keep the Slack message short with links.
- Alert on failures.
- Keep the script idempotent so a rerun doesn't post twice.
- Log each run's status and numbers.
- Make the metrics list easy to edit in one config file.
- Post a test message to a private channel first.
- Log errors and post a short failure notice if a pull fails.

Checkpoint: Test in a private channel first.

If you get stuck: If the API fails, post an error note instead of silence. If a login, CAPTCHA or two-step code appears, stop and ask me to handle it; never guess or store passwords.

Verify before you finish: Check numbers against PostHog's dashboard.

Output: Script, schedule config and sample message.

Done when: a correct summary appears in Slack daily.

Source

https://x.com/PranavDate/status/2031210925806530779