Skill-scoped hooks in SKILL.md frontmatter are not passed to forked subagent when using context: fork

Resolved 💬 5 comments Opened Mar 29, 2026 by Mapleeeeeeeeeee Closed May 2, 2026

Bug Description

When a local skill (.claude/skills/) defines hooks in its SKILL.md frontmatter alongside context: fork, the hooks are not forwarded to the forked subagent. The same hooks do work correctly in inline mode (without context: fork).

The model field in the same frontmatter works correctly in fork mode — confirming the frontmatter is being parsed, but hooks specifically are not propagated.

Reproduction

Minimal SKILL.md (.claude/skills/test-hook/SKILL.md):

---
name: test-hook
description: Test skill hooks in fork mode
context: fork
model: haiku
allowed-tools: Bash
hooks:
  PreToolUse:
    - matcher: "Bash"
      hooks:
        - type: command
          command: 'echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"additionalContext\":\"[test-hook] intercepted\"}}"'
---
Run this command:

\`\`\`bash
echo "hello from forked skill"
\`\`\`

Report whether the hook intercepted the Bash call.

Steps:

  1. Create the skill file above
  2. Run /test-hook
  3. Observe: Bash executes, no hook interception in system-reminder
  4. Remove context: fork and model: haiku from frontmatter
  5. Run /test-hook again
  6. Observe: Bash executes, hook interception appears as [test-hook] intercepted

Evidence from debug log

Fork mode — subagent Bash calls only match settings-level hooks:

[DEBUG] executePreToolHooks called for tool: Bash
[DEBUG] Found 6 hook matchers in settings    ← only settings hooks, no skill hooks
[DEBUG] Matched 2 unique hooks for query "Bash"
[DEBUG] Hook PreToolUse:Bash (PreToolUse) success: {}   ← empty, skill hook absent

Inline mode — same skill, hook fires:

PreToolUse:Bash hook additional context: [test-hook] intercepted

Expected Behavior

Hooks defined in SKILL.md frontmatter should be registered for the forked subagent's lifetime, just as they are in inline mode.

Actual Behavior

  • context: fork — correctly spawns subagent ✅
  • model: haiku — correctly applies to subagent ✅
  • hookssilently dropped, not forwarded to subagent ❌

Environment

  • Claude Code version: 2.1.87
  • OS: macOS (Darwin 24.6.0)
  • Skill location: .claude/skills/ (local, not plugin)

View original on GitHub ↗

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