What
Running a slash command (like /compact) can now be routed through a new command.run hook chain before it executes. Hooks are user- or project-defined scripts that run at specific points in Claude Code's workflow. With this change:
- A hook can intercept a slash command before it runs
- A hook's own output text can "retell" (override) the text the command would otherwise have produced
Why
This lets hook authors customize or replace what happens when a slash command runs, rather than only reacting to it afterward.
Names in the bundlecommand.run
Documented inclaude-code/plugins/mods/api
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Confirmed since
Anthropic's documentation has since written up command.run, on Troubleshoot a mod.
### `no command.run hook answered it`plugins/mods/troubleshoot see the edit
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
Anthropic's documentation has since written up command.run, on Troubleshoot a mod.