You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for post-run hooks to execute custom scripts after each task #7396
I would like to request a new feature for the Codex CLI: native post-run hooks that allow users to automatically execute a command or script whenever a Codex task finishes.
Currently, the CLI does not provide any official mechanism to trigger actions after a task completes. The only workaround today is to manually chain commands using && (e.g., codex "task" && ./script.sh) or to create custom wrapper commands in settings.json, but these are partial solutions and do not offer the convenience or reliability of a built-in post-run hook system.
Why this is useful:
Post-run hooks would enable automation for multiple scenarios, such as:
Playing a notification sound when Codex finishes a long task
Triggering OS notifications
Running cleanup scripts or formatting tools
Logging task completions
Refreshing external services or triggering build processes
Performing actions conditionally based on task success or failure
This becomes especially valuable when Codex is used for long-running operations, full-file rewrites, refactors, or code generation workflows — situations where the user wants an automatic side effect when the job is done.
Thank you for considering this! Let me know if I can help clarify use cases or testing scenarios.
Activity
github-actions commentedon Nov 29, 2025
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
ffbdm commentedon Nov 29, 2025
Closing in favor of #3962.
etraut-openai commentedon Nov 29, 2025
I think we have this covered already. Refer to this documentation for details.