Feature request: Support prompt hooks for PreToolUse event

Resolved 💬 3 comments Opened Jan 27, 2026 by dusty-du Closed Jan 31, 2026

Feature Request

Add support for type: "prompt" hooks on the PreToolUse event.

Use Case

I want to automatically remind Claude to load a skill before using certain MCP tools. For example, when using mcp__ios-simulator__* tools, Claude should first load the ios-simulator skill which contains usage instructions.

Currently, I'm trying to configure:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "mcp__ios-simulator__.*",
        "hooks": [
          {
            "type": "prompt",
            "prompt": "The ios-simulator MCP tool is being used. If the ios-simulator skill has not been loaded yet in this conversation, invoke it now using the Skill tool with skill='ios-simulator' before proceeding."
          }
        ]
      }
    ]
  }
}

Current Behavior

The hook fires and matches correctly, but fails with an API error:

Hooks: Model response: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"output_config: Extra inputs are not permitted"}}

The tool then proceeds anyway.

Expected Behavior

The prompt hook should evaluate and either:

  • Inject the prompt result into Claude's context before the tool executes
  • Allow blocking the tool based on the LLM's ok: true/false response

Workarounds Considered

  • Command hooks: Can block or output messages, but can't make context-aware decisions about whether a skill is already loaded
  • UserPromptSubmit hooks: Could match keywords, but is imprecise and doesn't guarantee the skill loads before the specific tool is used

Environment

  • Claude Code version: Latest (as of 2025-01-27)
  • OS: macOS

View original on GitHub ↗

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