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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗