Scheduled Recurring Automations
Every morning you open Slack to find three new bug reports from overnight users. You spend the first hour of your day just triaging — reproducing issues, locating relevant code, and prioritizing fixes. Codex automations can do this triage for you while you sleep, presenting you with a curated inbox of findings (and sometimes fixes) when you sit down at your desk.
What You’ll Walk Away With
Section titled “What You’ll Walk Away With”- A step-by-step guide to creating, testing, and scheduling local tasks in ChatGPT desktop
- Three production-ready automation recipes: bug fix triage, daily briefings, and skill creation
- Security configuration that keeps automations safe even when running unattended
- Cleanup strategies that prevent worktree sprawl from frequent automation runs
Persistent /goal Workflows (CLI v0.128+)
Section titled “Persistent /goal Workflows (CLI v0.128+)”The April 30, 2026 release added persistent /goal workflows — a first-class API for long-running, stateful objectives that survive across sessions. Unlike Claude Code’s /goal (which is session-scoped and clears on /clear), Codex’s /goal round-trips through the app-server and can be paused, inspected, and resumed from a different machine.
In current Codex, persisted goals and automatic continuation are stable and enabled by default. Use codex features list to verify the installed build; codex features disable goals is an explicit opt-out, not a setup prerequisite.
# Set a goal that persists across resumecodex> /goal every TODO in src/billing/ is resolved or stop after 25 turns
# Later, from a different terminal — resume is a subcommand, not a flagcodex resume <thread-id> # or: codex resume --last# Goal is still active; turn count, condition, evaluator history all preservedTUI controls (CLI v0.128+):
| Command | Action |
|---|---|
/goal <cond> | Set or replace the active goal |
/goal | Show status (condition, turns, tokens, evaluator’s last reason) |
/goal pause | Pause without clearing; preserves state for codex resume |
/goal resume | Resume a paused goal |
/goal clear | Clear the active goal |
Goals integrate with MultiAgentV2 (also v0.128+): a parent agent can set a goal that subagents work toward as a stable target rather than receiving per-turn directives.
Fit: Multi-step migrations, daily maintenance loops, long-running QA passes, content/docs pipelines, multi-agent work that needs a stable target.
/hooks Browser and Hook Execution
Section titled “/hooks Browser and Hook Execution”CLI v0.129.0 (May 7, 2026) added a /hooks browser inside the TUI — comprehensive plugin and hook management with workspace sharing, share access controls, source filtering, and local share-path tracking. Hooks also gained pre/post-compaction execution, so you can run cleanup or validation when the model compacts conversation context.
# Inside the TUI/hooks
# Lists all configured hooks, lets you toggle/edit/shareHooks are stable as of v0.124 and configurable inline in config.toml and requirements.toml.
MultiAgentV2 Configuration
Section titled “MultiAgentV2 Configuration”CLI v0.128.0 made MultiAgentV2 explicit and configurable instead of silently unbounded. The [multi_agent_v2] table exposes settings such as a cap on parallel subagents, a minimum delay between dispatches, a maximum spawn depth, and hints for which roots and subagent classes prefer v2. Confirm the exact key names against the current config reference before you commit them, since the surface is still evolving:
# config.toml — keys are illustrative; verify against the config reference[multi_agent_v2]thread_caps = 8 # max parallel subagentswait_time_ms = 250 # min delay between dispatchesmax_depth = 3 # how deep subagents can spawn subagentsPair with permission profiles (also v0.128) to give different subagent classes different sandbox profiles.
How Automations Work
Section titled “How Automations Work”This guide focuses on local scheduled tasks in ChatGPT desktop. The app must be running and the selected project available on disk. ChatGPT web can also create and manage scheduled tasks, but web runs cannot work directly in a folder on your computer. For Git repositories, choose a dedicated worktree when you want isolation from the main checkout.
Results appear in the Triage section of your sidebar inbox. If an automation finds nothing to report, it auto-archives. If it finds something actionable, it lands in your inbox as an unread item.
-
Create the automation by clicking the Automations section in the sidebar and defining a schedule and prompt.
-
Test the prompt manually first. Start a regular thread with the same prompt and verify the results are useful and scoped correctly.
-
Configure the schedule — hourly, daily, weekly, or custom cron-style intervals.
-
Review the first few runs closely. Adjust the prompt or cadence based on the quality of results.
-
Combine with skills by using
$skill-namein your automation prompt for structured, repeatable workflows.
Production-Ready Automation Recipes
Section titled “Production-Ready Automation Recipes”Recipe 1: Automatic Bug Fix from Your Own Commits
Section titled “Recipe 1: Automatic Bug Fix from Your Own Commits”First, create a skill that finds and fixes bugs from your recent changes:
---name: recent-code-bugfixdescription: Find and fix a bug introduced by the current author within the last week. Root cause must map directly to the author's own changes.---
# Recent Code Bugfix
1. Use git log --since=1.week --author=<author> to find recent changes2. Look for failures in tests, lint, or runtime errors tied to those changes3. Implement a minimal fix following project conventions4. Run the smallest relevant verification step5. Report the root cause, fix, and verificationThen create an automation with this prompt:
Check my commits from the last 24h and submit a $recent-code-bugfix.Recipe 2: Dependency and Security Scan
Section titled “Recipe 2: Dependency and Security Scan”Scan package.json, Cargo.toml, and requirements.txt for dependencieswith known CVEs. For each vulnerable dependency, check if a patchedversion exists that is compatible with our version constraints. If asafe upgrade path exists, update the dependency and run the test suite.Report all findings with severity levels.Recipe 3: Automatic Skill Creation
Section titled “Recipe 3: Automatic Skill Creation”Scan all of the ~/.codex/sessions files from the past day. If therehave been any issues using particular skills, update the skills to bemore helpful. If we've been doing something often that we should saveas a skill, create it. Only update skills if there's a good reason.Let me know if you make any.Security Configuration
Section titled “Security Configuration”Automations run unattended, so security settings matter more than for interactive threads:
| Sandbox Mode | Risk Level | Recommendation |
|---|---|---|
| Read-only | Lowest | Good for reporting and analysis automations |
| Workspace-write | Medium | Recommended for most automations; allows file edits within the project |
| Full access | Highest | Avoid for automations; the agent can modify files, run arbitrary commands, and access the network without asking |
Scheduled tasks run unattended with your default sandbox settings. Start with the narrowest sandbox that succeeds; approvals and sandboxing are separate, and managed requirements can further restrict both.
Worktree Cleanup for Automations
Section titled “Worktree Cleanup for Automations”Frequent automations create many worktrees. Without cleanup, this eats disk space fast. Best practices:
- Archive automation runs you have already reviewed
- Do not pin automation runs unless you intend to keep the worktree permanently
- ChatGPT desktop keeps the 15 most recent Codex-managed worktrees by default; adjust retention in Worktree settings
- A snapshot is saved before cleanup so you can restore later if needed
When This Breaks
Section titled “When This Breaks”- Local scheduled task does not run: ChatGPT desktop must be running and your computer awake. Enable “Prevent sleep while running” for overnight local tasks; web tasks have separate cloud availability and context.
- Results are too noisy: The prompt is too broad. Narrow the scope — specify exact directories, file patterns, or timeframes.
- Automation modifies wrong files: Check your sandbox mode. Read-only mode prevents accidental edits. Use workspace-write with explicit rules for what the automation should be allowed to change.
- Worktrees pile up: Archive old runs and unpin automations that are no longer needed. Check
$CODEX_HOME/worktreesfor orphaned directories.
What’s Next
Section titled “What’s Next”- Worktrees — Understand the worktree system that automations rely on
- ChatGPT Desktop Codex Mastery — Skills, multi-project management, and the full ChatGPT desktop workflow in Codex mode
- Cost Management — Automations consume credits; learn to budget them effectively