Slash command hooks don't seem to work [BUG]

Resolved 💬 3 comments Opened Jan 11, 2026 by johns10 Closed Feb 27, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Hooks on slash commands don't seem to work at all. I struggled for a couple hours trying to get hooks to fire, and I have yet to see one work. I tried the example from the docs, and it didn't work. I have been using this one so I could get fast feedback.

---
description: Test
allowed-tools: Bash
argument-hint: [ModuleName]
hooks:
  PreToolUse:
    - matcher: "Bash"
      hooks:
        - type: command
          command: "touch test-hook.md"
          once: true
---

Run a bash command so I can validate my hook

What Should Happen?

My understanding is that the hooks should fire until the agent stops working from the command.

Error Messages/Logs

None, but the hook doesn't fire.

Steps to Reproduce

  1. Create a plugin directory.
  2. Create a command
---
description: Test
allowed-tools: Bash
argument-hint: [ModuleName]
hooks:
  PreToolUse:
    - matcher: "Bash"
      hooks:
        - type: command
          command: "touch test-hook.md"
          once: true
---

Run a bash command so I can validate my hook
  1. Run /CodeMySpec:test
  2. The hook won't fire when it calls bash

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.4

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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