461 pages for hooks.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
Overview
Claude Code CLI · in the page
overview
…irst server end to end. > **Customize with instructions, skills, and hooks** > > [`CLAUDE.md`](/docs/en/memory) is a markdown file you add to your project root that Claude Code reads at the start of…
Choose a permission mode
Claude Code CLI · in the page
permission-modes
…and in the desktop app. Its config value is `default`, which is what hooks and SDK integrations use. The CLI accepts `manual` as an alias wherever you type the value, for example `claude --permission…
Configure permissions
Claude Code CLI · in the page
permissions
…permission-modes.md), or a [PreToolUse hook](#extend-permissions-with-hooks). When [auto mode](/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) is available to your session, the dialog…
Test plugins with evals
Claude Code CLI · in the page
plugin-evals
…un can access `claude plugin eval` loads the target plugin's skills, hooks, and agents and runs its eval suite on your machine, as you. Pointing it at a plugin is the same trust decision as `claude -…
Plugin commands reference
Claude Code CLI · in the page
plugins/cli-reference
…omponents...>` | Also scaffold starter files for `skills`, `agents`, `hooks`, `mcp`, `lsp`, `output-style`, or `channel` | | `-f, --force` | Overwrite an existing `.claude-plugin/` at the target | Sc…
Add components to a plugin
Claude Code CLI · in the page
plugins/components
# Add components to a plugin > Add skills, hooks, MCP servers, and every other component type to a Claude Code plugin, with an example that validates for each. A Claude Code plugin is built from com…
Create a Claude Code plugin
Claude Code CLI · in the page
plugins/create
…existing .claude/ setup. A plugin is a directory of skills, agents, hooks, and MCP servers, plus a `plugin.json` file, called the manifest, that names the plugin. Claude Code loads the directory as…
Host and maintain a marketplace
Claude Code CLI · in the page
plugins/host-marketplace
…nd reference them as `${CLAUDE_PLUGIN_ROOT}/scripts/<name>` from your hooks or MCP server configs [Sync your organization's plugins from a repository](https://claude.com/docs/plugins/org-sync) on cla…
Install and manage plugins
Claude Code CLI · in the page
plugins/install
…e or remove them later. Installing a plugin adds its skills, agents, hooks, and MCP servers to Claude Code on your machine. This page is for anyone using plugins on their own machine or account, whe…
Plugin loading reference
Claude Code CLI · in the page
plugins/loading
…er. Its `/<name>:<skill>` commands and agents are missing, as are its hooks and MCP servers. Unless skills are among the locked kinds, a `SKILL.md` at the folder's root still loads as a plain skill.…
Plugin manifest reference
Claude Code CLI · in the page
plugins/manifest-reference
…inside `.claude-plugin/`. That includes `skills/`, `commands/`, and `hooks/`. The following example sets most of the keys in the [Fields table](#fields). It passes validation in a plugin directory t…
Marketplace reference
Claude Code CLI · in the page
plugins/marketplace-reference
…erence), such as `description`, `version`, `author`, `commands`, and `hooks`. For when those fields apply, see [How an entry combines with plugin.json](#entry-and-plugin-json). The table lists the en…
Measure plugin cost and usage
Claude Code CLI · in the page
plugins/measure
…(3) format-all, format-code, lint-fix Agents (1) style-reviewer Hooks (1) PostToolUse (harness-only — no model context cost) MCP servers (1) formatter-tools (tool schemas resolved at runti…
Manage mods for your organization
Claude Code CLI · in the page
plugins/mods/admin
…ods from loading To keep every mod your users bring from running its hooks, set the `allowManagedModsOnly` option on the [built-in guard](#know-what-happens-by-default), a policy mod that Claude Code…
Use the mods API
Claude Code CLI · in the page
plugins/mods/api
…When the call reaches a running session, the user's [`Notification` hooks](/docs/en/hooks#notification) run with the type `plugin_notification`. They run even when the answer is `disabled`, and in a…
Create a mod
Claude Code CLI · in the page
plugins/mods/create
…[plugin](/docs/en/plugins/overview.md) with an entry file, called the hooks module: a JavaScript or TypeScript file whose functions Claude Code calls when events happen. To make one: * **Ask Claude t…
React to events with a mod
Claude Code CLI · in the page
plugins/mods/events
…ollows a note such as `Bash ran, and a plugin withheld its result:`. Hooks in your organization's [managed settings](/docs/en/server-managed-settings.md) run before any mod's `tool.call` hook. When a…
Interface gallery for mods
Claude Code CLI · in the page
plugins/mods/gallery
…mod** Create a directory named `gallery` with `.claude-plugin` and `hooks` directories inside it. [Create a mod](/docs/en/plugins/mods/create.md#write-a-mod-yourself) explains the files. Save the m…
Draw in the interface with a mod
Claude Code CLI · in the page
plugins/mods/interface
…row. **1. Create the plugin** A mod is a plugin with a manifest, a `hooks.json` that points to your code, and the code file. [Create a mod](/docs/en/plugins/mods/create.md#write-a-mod-yourself) expl…
Mods overview
Claude Code CLI · in the page
plugins/mods/overview
…mod works](#how-a-mod-works). > [!NOTE] > > Claude Code's existing [hooks](/docs/en/hooks.md) also run on events, as a shell command, HTTP request, or prompt you configure in a settings file. A mod'…
Mods reference
Claude Code CLI · in the page
plugins/mods/reference
# Mods reference > Complete reference for Claude Code mods: hooks module layout, events, mods API methods, render sites, elements by surface, limits, and settings. Look up any event a [mod](/docs/en…
Test a mod
Claude Code CLI · in the page
plugins/mods/test
…ocs/en/plugins/mods/reference#commands). A test fires the events your hooks handle and checks what the hooks did, so you catch a problem before it reaches a session. The first example tests the mod fr…
Troubleshoot a mod
Claude Code CLI · in the page
plugins/mods/troubleshoot
…messages, and read the debug log. When a mod's module or one of its hooks fails, Claude Code skips it and the session continues, so a broken mod can look like one that does nothing. Start by checkin…
Manage Claude Code plugins for your organization
Claude Code CLI · in the page
plugins/org
…ommand on the machine. When unset, it takes the value of `allowManagedHooksOnly` | Doesn't affect other source types | | `allowManagedHooksOnly` | Restricts which hooks run. See [`allowManagedHooksOnl…
Plugins overview
Claude Code CLI · in the page
plugins/overview
…r create one. A Claude Code plugin is a directory of skills, agents, hooks, MCP servers, or other components that Claude Code installs and loads as one unit. Most plugins come from a marketplace, whi…
Plugin security and trust
Claude Code CLI · in the page
plugins/security
…gin-before-you-install). Here's what an installed plugin can do: * **Hooks**: a plugin's [hooks](/docs/en/hooks.md) run as shell commands at points in Claude Code's lifecycle, such as before or after…
Troubleshoot plugins
Claude Code CLI · in the page
plugins/troubleshooting
…tplace reference](/docs/en/plugins/marketplace-reference.md) > * **A `hooks module not loaded` or `hooks module did not load` message**: the plugin is a [mod](/docs/en/plugins/mods/overview.md), so re…
How Claude Code uses prompt caching
Claude Code CLI · in the page
prompt-caching
…re this confirmation or skip it with a [PreModelSwitch hook](/docs/en/hooks.md#premodelswitch-decision-control). The [`opusplan` model setting](/docs/en/model-config#opusplan-model-setting) resolves…
Prompt library
Claude Code CLI · in the page
prompt-library
…ok-for": { title: "Add a hook for repeat behavior", teaches: "Hooks make a behavior automatic instead of something you have to remember to ask for. Describe the trigger and action and Claude w…
Quickstart
Claude Code CLI · in the page
quickstart
…de](/docs/en/features-overview.md): customize with CLAUDE.md, skills, hooks, MCP, and more See [advanced setup](/docs/en/setup.md) for installation options, manual updates, or uninstallation instruct…
Continue local sessions from any device with Remote Control
Claude Code CLI · in the page
remote-control
….md). Requires a git repository or a [`WorktreeCreate` hook](/docs/en/hooks#worktreecreate). • `session`: single-session mode. Serves exactly one session and rejects additional connections. Set at sta…
Choose a sandbox environment
Claude Code CLI · in the page
sandbox-environments
…The whole Claude Code process, including file tools, MCP servers, and hooks | No | Low | | [Dev container](#dev-containers) | Full development environment | Yes | Medium | | [Custom container](#custom…
Configure the sandboxed Bash tool
Claude Code CLI · in the page
sandboxing
…box covers shell commands only. Claude's file tools, MCP servers, and hooks [run outside it](#what-runs-outside-the-sandbox). The sandbox runs on macOS, Linux, and WSL2. On native Windows, Claude Cod…
Security
Claude Code CLI · in the page
security
…Audit or block settings changes during sessions with [`ConfigChange` hooks](/docs/en/hooks#configchange) ### Reporting security issues If you discover a security vulnerability in Claude Code: 1. D…
Catch security issues as Claude writes code
Claude Code CLI · in the page
security-guidance
…orcement, pair the plugin with a [hook that blocks the edit](/docs/en/hooks-guide.md#block-edits-to-protected-files) or a CI check. ### Add custom per-edit patterns Create `.claude/security-patterns…
Self-hosted environments
Claude Code CLI · in the page
self-hosted-environments
…iguration.md): wrapper scripts for per-session credentials, lifecycle hooks, on-demand runners, MCP servers, and permissions * [Test end to end](/docs/en/self-hosted-environments-testing.md): a CI smo…
Customize sessions in self-hosted environments
Claude Code CLI · in the page
self-hosted-environments-configuration
…sessions with wrapper scripts for per-session credentials, lifecycle hooks, and on-demand runner spawning. > [!NOTE] > > Self-hosted environments are in public beta on Team and Enterprise plans; an…
Deploy self-hosted environments to production
Claude Code CLI · in the page
self-hosted-environments-deploy
…k namespace The block applies to your wrapper script and lifecycle hooks too, since they share the container. Authenticate any token exchange with the [session JWT](/docs/en/self-hosted-environment…
Verify session identity in self-hosted environments
Claude Code CLI · in the page
self-hosted-environments-identity
…ripts). To match it to the `CLAUDE_RUNNER_SESSION_ID` that [lifecycle hooks](/docs/en/self-hosted-environments-configuration.md#lifecycle-hooks) receive, replace the `cse_` prefix with `session_`. | |…
Self-hosted environments quickstart
Claude Code CLI · in the page
self-hosted-environments-quickstart
…elf-hosted-environments-configuration.md): wrapper scripts, lifecycle hooks, on-demand runners, MCP servers, and permissions * [Test end to end](/docs/en/self-hosted-environments-testing.md): a CI smo…
Self-hosted environments reference
Claude Code CLI · in the page
self-hosted-environments-reference
…opic commit signing, turn on git push negotiation, and install commit hooks that append a `Co-authored-by:` trailer. Push negotiation requires Claude Code v2.1.257 or later. See [Configure git](/docs/…
Test self-hosted environments end to end
Claude Code CLI · in the page
self-hosted-environments-testing
…unner The read-back works through a Claude Code [Stop hook](/docs/en/hooks.md#stop): when Claude finishes a turn, the hook receives the final assistant message as `last_assistant_message` in its stdi…
Configure server-managed settings
Claude Code CLI · in the page
server-managed-settings
…imitations](#current-limitations) for that short list. This includes [hooks](/docs/en/hooks.md), [environment variables](/docs/en/env-vars.md), and [managed-only settings](/docs/en/managed-settings.md…
Manage sessions
Claude Code CLI · in the page
sessions
…* **React to session events**: read the `transcript_path` field that [hooks](/docs/en/hooks.md#common-input-fields) and [status line commands](/docs/en/statusline.md#available-data) receive as input.…
Claude Code settings
Claude Code CLI · in the page
settings
…**Project scope** is best for: * Team-shared settings (permissions, hooks, MCP servers) * Plugins the whole team should have * Standardizing tooling across collaborators **Local scope** is best for…
Example settings files
Claude Code CLI · in the page
settings-example
…o the repository so everyone who clones it gets the same permissions, hooks, and plugin marketplace. Save a file like this at `.claude/settings.json` at the top of the repository. What to know before…
All settings
Claude Code CLI · in the page
settings-reference
…`allowedHttpHookUrls`](#allowedhttphookurls) | Limit which URLs [HTTP hooks](/docs/en/hooks.md) can target | Hooks and automation | Any file | | [`allowedMcpServers`](#allowedmcpservers) | Allowlist w…
Extend Claude with skills
Claude Code CLI · in the page
skills
…MCP servers, and plugins compared with their context cost, and slow [hooks](/docs/en/hooks.md) * **`CLAUDE.md` files**: local `CLAUDE.md` files that duplicate checked-in ones, checked-in [`CLAUDE.md`…
Customize your status line
Claude Code CLI · in the page
statusline
…N object on stdin. The input includes the [base hook fields](/docs/en/hooks.md#common-input-fields), a `columns` field with the usable row width, and a `tasks` array with one entry per row, described…
Create custom subagents
Claude Code CLI · in the page
sub-agents
…te your own with custom prompts, tool restrictions, permission modes, hooks, and skills. The following sections show how to get started and customize subagents. ## Quickstart: create your first subag…