feat: Comprehensive hooks system for tool, file, and event lifecycle#9796
feat: Comprehensive hooks system for tool, file, and event lifecycle#9796am-will wants to merge 1 commit intoopenai:mainfrom
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
Implements a hooks system that allows external commands to be triggered at various lifecycle events during Codex execution: - Tool hooks: before/after tool execution with input/output access - File hooks: before/after file write operations - Event hooks: prompt gating, stop hooks, compact mode, notifications - Global hooks ordering for predictable execution - Project-level hook configuration via codex.json Includes full test coverage for hook events and tool hooks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Our contribution guidelines state that we're not accepting feature contributions at this time. We need to make sure that all new features are well designed, compose well with both existing and upcoming features, fit into our roadmap, and are consistent across all Codex surfaces (CLI, IDE extension, web). If you would like to propose a new feature, please file or upvote an enhancement request in the issue tracker. We will generally prioritize new features based on community feedback. |
|
Sorry boss, I didn't read it 😆 Codex was the one that replied to you. Thanks though. Love the new features you've dropped 🙌
|
…odex) Extend generate.sh to support hooks generation for multiple AI platforms: - Cursor: .cursor/hooks.json with beforeShellExecution, afterFileEdit, stop - OpenCode: .opencode/hooks/lifecycle.sh for session events - Codex CLI: codex.toml with notify configuration Platform hooks support matrix: | Platform | Config | Events | |-------------|---------------------------|--------| | Claude Code | .claude/settings.json | 6 events (full support) | | Cursor | .cursor/hooks.json | 6 events (full support) | | OpenCode | .opencode/hooks/*.sh | 4 events (via oh-my-opencode) | | Codex CLI | codex.toml | 1 event (agent-turn-complete) | | Aider | .aider.conf.yml | indirect (auto_lint, test_cmd) | | Continue | .continuerc.json | data events only | Sources: - Cursor: https://cursor.com/docs/agent/hooks - OpenCode: https://deepwiki.com/code-yeongyu/oh-my-opencode - Codex: openai/codex#9796 https://claude.ai/code/session_01SZuzCsugSMHuU62fbTNBUv
Summary
Test plan