Add PreSkillUse and PostSkillUse hooks for explicit and implicit skill usage
Open 💬 3 comments Opened Apr 8, 2026 by blairhudson
What variant of Codex are you using?
CLI
What feature would you like to see?
I'd like to propose adding two skill lifecycle hooks PreSkillUse and PostSkillUse, for both explicit skill usage from selected/mentioned skills, and implicit skill usage detected from shell commands
Why I think this is the better direction than my earlier suggestion (moved to end of this description):
- It makes skills a first-class hook surface, similar to tools.
- It is more generally useful than end-of-turn summary metadata for integrations such as telemetry, audit logging, debugging, policy checks, UX / agent observability, etc.
- It lets downstream integrations consume Codex's canonical skill-usage decisions directly, without parsing rollout transcripts, reimplementing implicit shell-based skill detection or depending on analytics-only internal signals.
At minimum, these hooks would ideally expose: session_id, turn_id, cwd, transcript_path, model, permission_mode, hook_event_name , skill_name , skill_path, skill_scope, invocation_type (explicit or implicit)
From reviewing the current CLI internals:
- explicit skill usage is already known during the skill injection path
- implicit skill usage is already known during shell-command-based skill detection
- both of those paths already have the canonical skill name/path information needed to emit hook events
If two new hooks feel too large for a first step, PostSkillUse alone would still be very useful.
3 Comments
I implemented a prototype of Skill Use hooks here:
It currently does the following:
PreSkillUseandPostSkillUsehook eventsskill_nameas the matcher inputskill_name,skill_path,skill_scope,invocation_type, plus the usual turn/session/model context)Our team is currently leveraging claude hooks to collect skill/plugin use telemetry to measure adoption. Having either a Skill tool matcher or a PostSkillUse hook will enable our efforts to collect that data for codex users. At a minimum, we would like the hook payload to contain the session_id and plugin/skill identifier as well as any base session metadata.
Indexed this hook ticket in the umbrella tracker: #21753
Goal: collect the scattered Codex hook requests and bugs into one parity matrix for Full Claude Code Hook Parity (29+), while preserving this issue as the detailed thread for its specific behavior.