• AI-assisted operations

Let Claude Code add monitoring to your jobs

When Claude Code writes a scheduled job, it can create the check that watches it. Here's the setup, the prompts, and the guardrails that keep it safe.

Jason

Co-founder, Pingstack

Ask a coding agent for a nightly export job and you’ll get a pretty good one: a workflow file, a script, maybe a retry. What you almost never get is monitoring. Nobody asked for it, so the job ships, and the first time it stops running you hear about it from whoever needed the export.

Pingstack has an MCP server, so Claude Code can add the monitoring in the same change. It reads the job’s schedule, creates a matching heartbeat check, and adds a report step that only runs when the job succeeds.

Connect Claude Code

One command adds the server:

claude mcp add --transport http pingstack https://app.pingstack.io/mcp

In Claude Code, run /mcp, pick pingstack and sign in through your browser. An Owner or Admin on your Pingstack account approves the connection and picks its permissions. For this workflow it needs permission to create checks. Leave heartbeat URL access off (it’s off by default). Claude doesn’t need to read ping URLs.

I’d start with a read-only request, so you know which account you’re talking to:

Read my Pingstack account capabilities and list my checks. Don’t change anything.

If it names the wrong account, disconnect it in Pingstack settings and connect again.

Ask for a check that matches the job

Point Claude at the job:

Look at the nightly export job in .github/workflows/export.yml. Propose a Pingstack heartbeat check that matches its schedule and timezone, with a grace period that covers its runtime. Show me the configuration before you create it.

Claude reads cron: "15 2 * * *" from the workflow, knows GitHub Actions runs schedules in UTC, and proposes something like this:

SettingValue
NameNightly export
ScheduleCron 15 2 * * *
Time zoneUTC
Grace period45 minutes

Say yes and it creates the check. Ask it to add the check to a dashboard or a notification group and it’ll do that too, if your role allows it.

Add the report step

Add a step that reports success to Pingstack only after the export succeeds, reading the URL from a PINGSTACK_PING_URL secret. Don’t put the URL in the repository.

For GitHub Actions that’s a final step with if: success():

      - name: Report success to Pingstack
        if: success()
        run: curl --fail --silent --show-error --max-time 10 --retry 3 "$PINGSTACK_PING_URL" > /dev/null
        env:
          PINGSTACK_PING_URL: ${{ secrets.PINGSTACK_PING_URL }}

Claude picks the pattern that fits your scheduler. That’s a wrapper script for crontab, a container command for a Kubernetes CronJob, or Laravel’s pingOnSuccess for the Laravel scheduler. The recipes cover 25 schedulers.

Add the secret yourself

Open the new check in Pingstack, copy its ping URL and save it as the PINGSTACK_PING_URL secret. Do this step yourself! Anyone with the URL can report a run, and a chat transcript is a terrible place to keep a secret. That’s why the connection doesn’t need ping URL access in the first place.

Then run the job once and ask:

Has the nightly export check received a heartbeat? What’s its next deadline?

Make it the default

Add this to your project’s CLAUDE.md, and Claude proposes a check every time it adds or changes a scheduled job:

## Monitoring

When you add or change a scheduled job (cron, GitHub Actions schedule,
Kubernetes CronJob, Laravel scheduler task), propose a matching Pingstack
heartbeat check, show it to me before creating it, and add a success-only
report step that reads its URL from a secret. Never ask me to paste a ping
URL into chat.

I like this part the most. The check ships in the same pull request as the job, so there’s no follow-up ticket to forget about.

What Claude can’t do

The MCP connection works with your role’s permissions and your plan’s limits. Claude can create and update checks and dashboards, and read incidents, uptime, run history and latency. It can’t delete checks, publish a status page, change your plan or buy anything. If you’re at your plan’s check limit, the create fails and Pingstack hands back an upgrade link for a person to open.

I’d still review every write. The prompts above ask Claude to show the configuration first, and it’s a good habit to keep.

It also answers questions

The same connection reads your monitoring data, so you can ask things like:

Which checks had incidents in the last 7 days, and how long were they down?

What’s the p95 latency for the API check over the last 30 days?

That’s often faster than opening the dashboard, especially when you’re in the middle of fixing the thing that broke.

Try it

Free covers 15 checks, and MCP is on every plan. Start free, then follow the Claude Code recipe. Using Copilot CLI or another MCP client? Check out client setup.

Add your first check free.

Free for 15 checks
No card needed