# Claude Code plugin hooks run without asking. Here is how to check them

> Plugin hooks run shell commands on events like every file edit, with no prompt. What a hook can do, how to read a plugin's hooks.json, and how Calyban checks each one.

Published by Calyban (https://calyban.com/blog/claude-code-plugin-hooks-safety), 2026-11-22.

Most of what a Claude Code plugin adds waits for you or the model to use it: a skill, a slash command, a subagent. Hooks don't. A hook is a shell command that Claude Code runs automatically on an event (before a tool runs, after a file edit, when a session starts) without asking each time.

That's what makes hooks useful, and what makes them the part of a plugin worth reading first.

## What can a hook do?

Anything your user account can. A formatter hook runs `prettier` after every edit. A guard hook blocks `rm -rf`. A bad hook could just as easily send your environment variables somewhere on every session start. Claude Code shows you hooks when you install a plugin, but a long `hooks.json` full of script paths is easy to approve without reading.

## Where are a plugin's hooks?

In the plugin's `hooks/hooks.json`. Each entry names an event and the command to run:

```json
{
  "hooks": {
    "PostToolUse": [
      { "matcher": "Edit|Write", "hooks": [{ "type": "command", "command": "npx prettier --write \"$CLAUDE_FILE_PATHS\"" }] }
    ]
  }
}
```

Read the `command` fields. If one runs a script file, open the script too. In Claude Code, `/hooks` lists every hook currently active, plugin or not.

## How does Calyban check them?

Plugins are installed by Claude Code itself, so Calyban checks them right after the download, and again whenever you open **Safety**. For hooks it does more than for ordinary files:

- **Each hook command is checked on its own**, with the events it runs on, against the same rules as everything else: download-and-run, reverse shells, reading credential files and sending data out, encoded payloads, destructive commands, persistence.
- **Findings in hooks keep their full severity.** A download-and-run line quoted in a test file is downgraded, because nothing runs a test on its own. The same line in a hook isn't, and the finding says that it runs without the agent asking.
- **Scripts a hook calls** are part of the plugin's files, so they're checked too.

<figure><img src="/media/v13-safety.webp" alt="Calyban Safety page with a high-risk download-and-run finding and its file and line" width="1280" height="800" loading="lazy"><figcaption>A high-risk finding names the file and line. Hook findings also say which event runs them.</figcaption></figure>

## When does the check run?

Claude Code downloads plugins itself, so Calyban checks the files the moment they land. A plugin can't run anything until you start a new session, so the findings are in front of you before any hook ever fires. A hook that fetches a script from a URL at run time is flagged as download-and-run, so you know to look at that URL yourself.

The rest of 1.3's safety changes: [What's new in Calyban's safety check](/blog/calyban-safety-check-1-3). The general risks of skills and plugins: [Are Claude Code skills and plugins safe?](/blog/are-claude-code-skills-safe) Found a hook that should have been flagged? [Discord](https://discord.gg/pHDNtgYvWn).
