| |
Two weeks ago, OpenAI introduced Codex Automations. The idea: define a trigger (a cron job, a push, a new issue), write instructions in natural language, and an agent runs it solo in an isolated worktree. No human intervention. While you sleep, the agent triages issues, summarizes CI failures, generates release briefs, and even improves its own instructions.
Sounds like magic, right? And it is, a little. But there’s one catch they didn’t emphasize too much in the keynote: you need the Codex App running on your desktop. macOS or Windows only. No headless servers. No running it on a mini PC and forgetting about it.
And that’s when I thought: “Wait. I already have this.”
The pieces you already have
If you’re using Claude Code, you already have 90% of the infrastructure. claude --print executes a prompt without an interactive session. You give it instructions; it gives you a result and shuts down. No GUI. No open terminal. Perfect for a cron job.
If you have a server that’s always on (a mini PC, Raspberry Pi, or a $5 VPS), you’ve got the scheduler. systemd or cron, whichever you prefer, has been working away in the background for decades while you sleep.
And if you use Gitea, GitHub, or any forge with an API, you already have a place to deposit the results: comments on PRs, new issues, or committed files.
Plainly put: Codex Automations is a pattern. Not a product. And that pattern is old news.
┌─────────────────────────────────────────────┐
│ systemd timer (every N hours) │
│ │ │
│ ▼ │
│ bash/fish script │
│ │ │
│ ├── git pull --ff-only │
│ ├── claude --print "prompt" │
│ ├── parse results │
│ ├── notify (Telegram/email) │
│ └── git push (if changes) │
└─────────────────────────────────────────────┘
Anatomy of an Automation
All automations follow the same structure. A script that:
- Updates the repo (
git pull) - Executes Claude Code in non-interactive mode
- Does something with the results
- Notifies and/or commits changes
Let’s build the first one. After that, the rest are just variations of the same theme.
The Base Script
| |
That’s it. The skeleton fits into 12 lines. The rest is about deciding which prompt to pass and what to do with $RESULT.
The systemd Timer
| |
| |
| |
At 3 a.m., systemd kicks off the script. Claude analyzes whatever you ask it to and deposits the result. You find out in the morning.
Example 1: Automatic PR Review
This is the most useful one. Every time there’s an open PR, Claude reviews it and leaves a comment.
Using a webhook is more elegant, but a cron job every 30 minutes works just as well for small teams:
| |
Each morning when you open Gitea, every PR has a comment with feedback. It doesn’t replace a human review, but it filters out the obvious: typos, unused imports, an if without an else that smells like a bug.
[rest of the examples and entire blog follow translated…]