Manage Codex automations (list, create, pause, delete) using the sqlite database. Use when asked to create, pause, list, end, or modify Codex automations, or when referencing the Codex automation schema.
Codex stores automations in two places:
~/.codex/sqlite/codex-dev.db table automations~/.codex/automations/<slug>/automation.tomlThe sqlite DB is authoritative. TOML files are read by the scheduler but the DB is what the UI and CLI query.
CREATE TABLE automations (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
status TEXT NOT NULL, -- 'ACTIVE' | 'PAUSED'
cwds TEXT, -- JSON array of working directories
rrule TEXT, -- iCal RRULE string (e.g. "FREQ=DAILY;INTERVAL=1")
model TEXT, -- model slug (e.g. "o3")
reasoning_effort TEXT, -- 'low' | 'medium' | 'high'
prompt TEXT, -- the automation prompt
next_run_at TEXT, -- ISO 8601 timestamp
created_at TEXT -- ISO 8601 timestamp
);sqlite3 ~/.codex/sqlite/codex-dev.db "SELECT id, name, status, rrule, next_run_at FROM automations;"sqlite3 ~/.codex/sqlite/codex-dev.db "UPDATE automations SET status = 'PAUSED';"sqlite3 ~/.codex/sqlite/codex-dev.db "UPDATE automations SET status = 'PAUSED' WHERE name = '<name>';"sqlite3 ~/.codex/sqlite/codex-dev.db "UPDATE automations SET status = 'ACTIVE' WHERE name = '<name>';"sqlite3 ~/.codex/sqlite/codex-dev.db "INSERT INTO automations (id, name, status, cwds, rrule, model, reasoning_effort, prompt, next_run_at, created_at) VALUES (
lower(hex(randomblob(16))),
'<name>',
'ACTIVE',
'[\"<working-directory>\"]',
'FREQ=DAILY;INTERVAL=1',
'o3',
'medium',
'<prompt text>',
datetime('now'),
datetime('now')
);"sqlite3 ~/.codex/sqlite/codex-dev.db "DELETE FROM automations WHERE name = '<name>';"$CODEX_HOME does not resolve in sandboxed shell environments. Always use ~/.codex explicitly.~/.codex/automations/ may be stale. Trust the sqlite DB.ACTIVE and PAUSED (case-sensitive).