๐ช๐ฉ OpenCrons โ Automated AI Scheduler
Why OpenCrons ยท
Install ยท
How it works ยท
Quick start ยท
Telegram bot ยท
CLI reference ยท
Configuration ยท
Security ยท
Roadmap
OpenCrons is an open-source scheduler that runs Claude Code (claude -p) jobs on cron schedules. It pairs a terminal-native TUI with a Telegram bot โ so you can define, monitor, and chat with your AI jobs from anywhere. Built for developers, researchers, and teams who want structured, repeatable AI automation.
Built with Go ยท Cobra ยท Charmbracelet ยท SQLite ยท Catppuccin Mocha
โ ๏ธ Security
OpenCrons is a young project โ security coverage is incomplete. Use it with this in mind.
Agent execution model
Every scheduled job runs claude -p with --permission-mode bypassPermissions. This means:
- No sandbox โ the agent process runs with your full user permissions, in your working directory, with access to your filesystem, network, and any tools Claude Code can invoke
- No tool restrictions by default โ unless you explicitly set
disallowed_tools on a job, the agent can read files, write files, run shell commands, and call external services
- Unattended โ jobs trigger on a cron schedule with no human in the loop to approve or reject individual actions
This is intentional for automation โ but it means the prompt is the security boundary. A poorly scoped prompt can lead to unintended writes, deletions, or network calls.
Practical guidance:
- Scope prompts tightly to the task at hand
- Use
disallowed_tools to restrict capabilities where possible (e.g. Bash(rm:*))
- Set a
working_dir that contains only what the job needs access to
- Review execution logs regularly (
opencrons logs)
- Keep your Claude Code version up to date
Known limitations
- Prompt files are stored as plain Markdown โ no encryption at rest
settings.json stores your Telegram bot token in plaintext
- No audit log beyond the SQLite execution records
- No rate limiting or circuit breaker on job execution
This project just released and does not yet cover all security aspects. Contributions and issues are welcome.
Why OpenCrons ๐ก
The OAuth lockdown changed the game
In January 2026, Anthropic deployed server-side restrictions that blocked third-party tools from authenticating with Claude Pro and Max subscription OAuth tokens. Tools like OpenCode, OpenClaw, and other Third-party stopped working overnight. The official policy is clear:
OAuth authentication (used with Free, Pro, and Max plans) is intended exclusively for Claude Code and Claude.ai. Using OAuth tokens in any other product, tool, or service is not permitted.
โ Claude Code Docs โ Legal and compliance
But here's the thing โ claude -p is Claude Code. It's Anthropic's own CLI, running with your own subscription, exactly as intended. No OAuth hijacking, no third-party token routing, no terms of service violations. Just Claude Code doing what Claude Code was built to do.
OpenCrons wraps claude -p in a structured scheduler. Every job is a direct invocation of Claude Code โ the same binary, the same auth, the same process you'd run by hand in your terminal. Nothing in between.
OpenClaw is great, but cron deserves better
OpenClaw is a fantastic personal AI assistant โ WhatsApp, Telegram, iMessage, 500+ integrations. But for many developers, 80โ90% of what they actually use it for is cron jobs: daily code reviews, morning briefings, CI monitoring, scheduled cleanups.
OpenCrons takes that core use case and gives it the dedicated tooling it deserves:
|
OpenClaw |
OpenCrons |
| ๐ฏ Focus |
General-purpose AI assistant |
Purpose-built cron scheduler |
| ๐๏ธ Visibility |
Jobs buried in a JSON file |
Interactive TUI + structured logs |
| ๐ Tracking |
Minimal job history |
SQLite with cost, tokens, status per run |
| ๐ Auth |
Uses Claude Code OAuth |
Uses Claude Code directly โ fully compliant |
If you need a Swiss Army knife, use OpenClaw. If you need your cron jobs to just work โ with clear visibility, cost tracking, and a beautiful interface โ that's OpenCrons.
๐ฆ Install
Requires Go 1.25+ and Claude Code.
go install github.com/DikaVer/opencrons/cmd/opencrons@latest
That's it. The binary lands in $GOPATH/bin โ already in your PATH if Go is set up correctly.
๐จ Build from source
git clone https://github.com/DikaVer/opencrons.git
cd opencrons
# Linux / macOS
sudo make install
# Windows
go install ./cmd/opencrons/
๐๏ธ Uninstall
# Linux / macOS
sudo make uninstall
# Windows (PowerShell)
Remove-Item "$(go env GOPATH)\bin\opencrons.exe"
Verify:
opencrons --help
โ๏ธ How it works
OpenCrons has three modes of operation:
| Mode |
What it does |
| ๐ฅ๏ธ Interactive TUI |
Run opencrons with no args. A full-screen menu for creating, editing, and managing jobs. |
| โจ๏ธ CLI commands |
Scriptable subcommands โ opencrons add, opencrons list, opencrons run, etc. |
| ๐ฌ Telegram bot |
Runs inside the daemon. Chat with Claude, trigger jobs, and get notifications โ all from your phone. |
The execution flow
๐ You define a job
โ โฐ cron schedule triggers it
โ ๐ OpenCrons reads the prompt file
โ ๐ pipes it to `claude -p` with your configured model & effort
โ ๐ captures output, cost, and token usage
โ ๐พ logs everything to SQLite
โ ๐ฌ (optionally) sends a summary to Telegram
Every job runs as an isolated subprocess with --permission-mode bypassPermissions for unattended operation, and --output-format json for structured result parsing.
๐ Quick start
1. Run the setup wizard
opencrons setup
The wizard walks you through:
- ๐ Provider โ detects your Anthropic configuration
- ๐ฌ Messenger โ connect a Telegram bot (optional)
- ๐ค Chat defaults โ pick a default model and effort level
- โก Daemon mode โ background process or OS service
2. Create your first job
opencrons add
The interactive wizard asks for a name, cron schedule, working directory, model, and prompt. Or go fully non-interactive:
opencrons add --non-interactive \
--name "daily-review" \
--schedule "0 9 * * *" \
--working-dir "/path/to/project" \
--prompt-content "Review open PRs and summarize findings." \
--model sonnet
3. Start the daemon
opencrons start
The daemon runs your cron jobs, watches for config changes (hot-reload), and starts the Telegram bot if configured. Stop it with opencrons stop.
4. Check the logs
opencrons logs # all jobs
opencrons logs daily-review # specific job
opencrons logs daily-review -n 50 # specific job, last 50 entries
๐ฌ Telegram bot
The Telegram integration turns OpenCrons into a remote AI assistant you can reach from your pocket.
Setup
- ๐ค Create a bot via @BotFather on Telegram
- ๐ง Run
opencrons setup or opencrons settings to configure the bot token
- ๐ Pair your account:
- Verification code โ OpenCrons generates a code, you send it to your bot to prove ownership
Bot commands
| Command |
Action |
/new |
๐ Start a fresh chat session |
/stop |
๐ Cancel a running query |
/jobs |
๐ Browse and trigger jobs |
/model |
๐ง Switch model (Sonnet, Opus, Haiku) |
/effort |
โก Adjust effort level |
/status |
๐ Daemon and session info |
/help |
โ Show all commands |
Send any text message to chat with Claude directly. Sessions persist across messages โ Claude remembers context until you /new.
๐ CLI reference
๐ Job management
opencrons add # create a job (interactive wizard)
opencrons list # list all jobs
opencrons edit <name> # edit a job
opencrons remove <name> # delete a job (--force to skip confirmation)
opencrons enable <name> # enable a disabled job
opencrons disable <name> # disable a job
opencrons validate # validate all job configs
โถ๏ธ Execution
opencrons run <name> # run a job immediately
opencrons logs [name] # view execution logs (-n to set limit)
๐ Daemon
opencrons start # start the daemon (foreground)
opencrons start --install # install as OS service
opencrons stop # stop the daemon
opencrons status # check daemon status
๐ง Settings
opencrons setup # first-time setup wizard
opencrons settings # manage all settings
opencrons debug [on|off] # toggle debug logging
๐ณ๏ธ Global flags
opencrons --verbose # verbose output (any subcommand)
opencrons --help # help for any command
๐๏ธ Configuration
Job config
Each job is a YAML file in schedules/ with a corresponding prompt in prompts/.
| Field |
Description |
Default |
name |
Unique identifier (alphanumeric, hyphens, underscores) |
required |
schedule |
Cron expression (0 9 * * *) |
required |
working_dir |
Project directory for execution |
required |
prompt_file |
Markdown file with the prompt |
<name>.md |
model |
sonnet, opus, or haiku |
provider default |
effort |
low, medium, high, or max |
high |
timeout |
Seconds before killing the job |
300 |
disallowed_tools |
Tool restrictions (e.g. Bash(git:*)) |
none |
summary_enabled |
Generate execution summary |
false |
enabled |
Whether the job runs on schedule |
true |
๐ Directory structure
OpenCrons stores its configuration and data in a platform-specific directory:
| Platform |
Path |
| ๐ง Linux |
~/.opencrons/ or $XDG_CONFIG_HOME/opencrons/ |
| ๐ macOS |
~/.opencrons/ or $XDG_CONFIG_HOME/opencrons/ |
| ๐ช Windows |
%APPDATA%\opencrons\ |
~/.opencrons/
โโโ .agents/ # agent config directory (canonical)
โ โโโ skills/ # scheduling skill + plugin skills
โโโ .claude/ โ .agents/ # provider symlink (Anthropic)
โโโ AGENTS.md # agent instructions (canonical)
โโโ CLAUDE.md โ AGENTS.md # provider symlink (Anthropic)
โโโ schedules/ # job configs (YAML)
โโโ prompts/ # prompt files (Markdown)
โโโ logs/ # execution stdout/stderr
โโโ summary/ # execution summaries
โโโ data/opencrons.db # SQLite database
โโโ settings.json # all settings
โโโ opencrons.pid # daemon lock file
The .agents/ directory and AGENTS.md file are the canonical (real) locations. Provider-specific names like .claude/ and CLAUDE.md are created as symlinks so that each provider's tooling finds what it expects. On Windows without developer mode, junctions and hard links are used as fallbacks.
๐ค Agent instructions (AGENTS.md)
OpenCrons copies AGENTS.md and .agents/ into your config directory during setup. AGENTS.md is injected into every job as context โ it acts as a shared system prompt so Claude understands it's running inside OpenCrons.
You can customize it to add project-wide instructions, coding standards, or constraints that apply to all your scheduled jobs.
A ready-to-use example is included in the repo at .workspace-example/ โ it's copied automatically on first run via opencrons setup.
|
Linux |
macOS |
Windows |
| CLI & TUI |
โ
|
โ
|
โ
|
| Daemon |
โ
|
โ
|
โ
|
| OS service install |
โ
|
โ
|
โ
|
๐ How jobs execute
When a job triggers, OpenCrons:
- ๐ Reads the prompt file and prepends a task preamble
- ๐ Optionally appends a summary prompt
- ๐ Pipes everything via stdin to
claude -p (avoids argument length limits)
- ๐ Passes
--effort, --model, --permission-mode bypassPermissions, --output-format json
- ๐ Captures stdout/stderr to log files
- ๐ Parses the JSON response for cost, token usage, and result
- ๐พ Writes execution records to SQLite
Config changes are picked up automatically โ the daemon watches the schedules/ directory with fsnotify and hot-reloads jobs without restart.
๐บ๏ธ Roadmap
OpenCrons is focused on Claude Code today, but the vision is broader.
๐ Coming soon
- ๐ง Anthropic API โ run jobs directly with Anthropic API without requiring Claude Code installed โ lower overhead, API key auth, usage-based billing
- ๐ค OpenAI API โ first-class support for the OpenAI API โ same scheduling, same TUI, same logs, different provider
- โจ๏ธ Codex CLI support โ run OpenAI's Codex CLI alongside Claude Code jobs
- ๐ Plugin system โ interactive, controllable integrations:
| Plugin |
What it does |
| ๐ GitHub |
Auto-review PRs, create issues, merge when checks pass |
| ๐ง Email |
Morning digest, inbox triage, auto-replies |
| ๐ Linear |
Create/update issues from job results, sync sprint status |
| ๐ฌ Slack |
Post summaries, respond to threads, channel notifications |
| ๐ Custom |
Bring your own plugin โ webhook-based architecture |
๐ฎ Future ideas
- ๐ท๏ธ Job tags and filtering
- ๐ฑ Push notifications (beyond Telegram)
- ๐ Multi-provider jobs โ run the same prompt against Claude and GPT in parallel, compare results
- ๐ง Agent task memory โ persistent per-job memory that survives between runs; agents accumulate context across executions rather than starting cold each time
- ๐ Workflow agent pipeline โ chain multiple agents into a directed pipeline where each agent's output becomes the next one's input; branch on conditions, fan out in parallel, merge results
- ๐ฆ Sandbox environment โ run agents inside an isolated container or VM with restricted filesystem and network access, so
bypassPermissions is safer by construction
Have an idea? Open an issue โ contributions are welcome.
๐ ๏ธ Development
make build # build binary
make build-all # cross-compile (linux + windows)
make test # run tests
make lint # golangci-lint
make tidy # go mod tidy
make clean # remove build artifacts
Architecture
cmd/opencrons/ โ entry point
internal/
โโโ cmd/ โ Cobra commands + TUI menu
โโโ config/ โ job config, YAML I/O, prompt files
โโโ tui/ โ interactive wizards and menus
โโโ executor/ โ claude -p command builder and runner
โโโ storage/ โ SQLite (execution logs, chat sessions)
โโโ daemon/ โ cron orchestrator, hot-reload, OS service
โโโ platform/ โ cross-platform paths, PID, settings
โโโ provider/ โ AI provider interface
โโโ messenger/telegram/ โ Telegram bot handlers
โโโ chat/ โ chat session manager
โโโ logger/ โ debug logging
โโโ ui/ โ shared styles (Catppuccin Mocha)