Opencode Routines

2 min read Original article ↗

Routines that run
when something happens.

Define a prompt, pick a model, attach a trigger. Opencode runs your routine on cron, on filesystem changes, or anywhere code lives.

Free for solo use · K to start anywhere

Triggers

Two kinds of when.

Schedule routines on a cron, or watch a directory and react to file changes — pull requests, log files, screenshots, anything.

cron On a schedule

0 9 * * 1-5 → weekday standup digest

filesystem On a file event

watch ~/screenshots → auto-OCR & file

What you get

Boring infrastructure for
interesting work.

01

Bring your own model

Anthropic, OpenAI, or anything OpenAI-compatible. Pick a default, or per-routine.

02

Inspect every run

Streamed output, tool calls, cost, and a follow-up prompt — all in one timeline.

03

Run it anywhere

Local CLI, your laptop, or a tiny VPS. State stored as plain files. No vendor lock-in.

Anatomy of a run

Every run is a conversation you can return to.

See the prompt, the tools the model used, and the result. Reply with a follow-up and the routine picks up right where it left off.

Streaming output, no spinners.

Replayable from any step.

Exportable as JSON or Markdown.

Settings

Plug in your favourite models.

Connect a provider once, then pin the models you actually use. Switch per routine when you need cheaper, faster, or smarter.

Stop checking things.
Let routines do it.