# cron-and-intervals

> Claude/Codex skill by [@val-town](https://omgskills.com/library/val-town/index.md) · 10 stars · Updated 2026-10-13

Use when building a val that runs on a schedule — periodic jobs, recurring tasks, polling, cron jobs, monitoring, alerting. Covers the interval handler signature, cron expressions, the UTC timezone constraint, and the \`lastRunAt\` pattern for detecting new items since the previous run.

## Install

```sh
git clone https://github.com/val-town/plugins /tmp/plugins && ln -s /tmp/plugins/plugin/skills/cron-and-intervals ~/.claude/skills/cron-and-intervals
```

## From README

Cron / Interval Vals Interval vals (fileType: "interval") run on a recurring schedule defined by a cron expression. Use them for polling external APIs, sending reminders, running cleanups, generating reports, or any work that should happen on a clock rather than in response to a request. Basic handler The file must have an export — export default for the handler. Timezone Cron expressions run in UTC. Convert any human-readable schedule (e.g. "9am Eastern") to UTC before writing the cron expression. Daylight savings is not handled — pick a UTC time that's close enough year-round. The lastRunAt pattern interval.lastRunAt is the timestamp of the previous successful run (or undefined on the first run). Use it to fetch only items created since the last run, instead of re-scanning everything: This makes the val idempotent against missed runs and avoids reprocessing.

## Links

- HTML page: https://omgskills.com/library/val-town/plugins/plugin/skills/cron-and-intervals/
- GitHub: https://github.com/val-town/plugins
- Author: [@val-town](https://omgskills.com/library/val-town/index.md)

## More from this repo

- [blob-storage](https://omgskills.com/library/val-town/plugins/plugin/skills/blob-storage/index.md) — Used when a val needs simple key/value persistence — JSON documents, cached responses, uploaded files, or binary assets.
   - [@val-town](https://omgskills.com/library/val-town/index.md) · 10 stars
- [client-side-js](https://omgskills.com/library/val-town/plugins/plugin/skills/client-side-js/index.md) — Used when a val needs to ship JavaScript that runs in the browser — React apps, vanilla DOM scripts, canvas/games,...
   - [@val-town](https://omgskills.com/library/val-town/index.md) · 10 stars
- [create-skill](https://omgskills.com/library/val-town/plugins/plugin/skills/create-skill/index.md) — Used when the user wants to persist a preference, skill, or knowledge.
   - [@val-town](https://omgskills.com/library/val-town/index.md) · 10 stars
