Skip to content

support skill-scoped hooks#20528

Draft
abhinav-oai wants to merge 1 commit intomainfrom
abhinav/skill-hooks-frontmatter
Draft

support skill-scoped hooks#20528
abhinav-oai wants to merge 1 commit intomainfrom
abhinav/skill-hooks-frontmatter

Conversation

@abhinav-oai
Copy link
Copy Markdown
Collaborator

Why

Skills can already be distributed inside plugins, but today hooks only come from settings files and plugins. This adds the same frontmatter-based hook model to skills so a skill can carry behavior that only applies while that skill is active.

What

  • Parse hooks from skill frontmatter alongside existing skill metadata.
  • Build a turn-local hook overlay from the explicitly active skills and feed it through the existing hook runtime.
  • Add HookSource::Skill across protocol, analytics, and hook UI surfaces.
  • Skip SessionStart hooks declared by skills with a warning because skills activate after thread start.
  • Add coverage for parsing frontmatter hooks and for PreToolUse hooks applying only on the turn where the skill is active.

Verification

  • cargo test -p codex-hooks
  • cargo test -p codex-core-skills parses_hooks_from_skill_frontmatter
  • cargo test -p codex-core --test all suite::hooks::skill_pre_tool_use_blocks_only_while_skill_is_active
  • cargo test -p codex-app-server-protocol

Documentation

The public skills documentation on developers.openai.com/codex should be updated to describe skill-frontmatter hooks and note that SessionStart is not meaningful for skills.

Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request May 1, 2026
- anomalyco/opencode#25255: doom loop scope+filter-order fix (merge-as-is)
- openai/codex#20577: store-history fork migration (merge-after-nits)
- openai/codex#20528: skill-scoped hooks feature (merge-after-nits)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant