Changes on
59 changes detected
Show diff (195 lines)
--- a/agent-teams.md
+++ b/agent-teams.md
@@ -54,12 +54,6 @@
settings.json
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
@@ -74,12 +68,6 @@
After enabling agent teams, tell Claude to create an agent team and describe the task and the team structure you want in natural language. Claude creates the team, spawns teammates, and coordinates work based on your prompt. This example works well because the three roles are independent and can explore the problem without waiting on each other:
-Report incorrect code
-
-Copy
-
-Ask AI
-
I'm designing a CLI tool that helps developers track TODO comments across
their codebase. Create an agent team to explore this from different angles: one
teammate on UX, one on technical architecture, one playing devil's advocate.
@@ -109,24 +97,12 @@
The default is `"auto"`, which uses split panes if you’re already running inside a tmux session, and in-process otherwise. The `"tmux"` setting enables split-pane mode and auto-detects whether to use tmux or iTerm2 based on your terminal. To override, set `teammateMode` in your [settings.json](</docs/en/settings>):
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"teammateMode": "in-process"
}
To force in-process mode for a single session, pass it as a flag:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --teammate-mode in-process
Split-pane mode requires either [tmux](<https://github.com/tmux/tmux/wiki>) or iTerm2 with the [`it2` CLI](<https://github.com/mkusaka/it2>). To install manually:
@@ -142,12 +118,6 @@
Claude decides the number of teammates to spawn based on your task, or you can specify exactly what you want:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Create a team with 4 teammates to refactor these modules in parallel.
Use Sonnet for each teammate.
@@ -159,12 +129,6 @@
For complex or risky tasks, you can require teammates to plan before implementing. The teammate works in read-only plan mode until the lead approves their approach:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Spawn an architect teammate to refactor the authentication module.
Require plan approval before they make any changes.
@@ -202,12 +166,6 @@
To gracefully end a teammate’s session:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Ask the researcher teammate to shut down
The lead sends a shutdown request. The teammate can approve, exiting gracefully, or reject with an explanation.
@@ -220,12 +178,6 @@
When you’re done, ask the lead to clean up:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Clean up the team
This removes the shared team resources. When the lead runs cleanup, it checks for active teammates and fails if any are still running, so shut them down first.
@@ -238,9 +190,10 @@
Enforce quality gates with hooks
-Use [hooks](</docs/en/hooks>) to enforce rules when teammates finish work or tasks complete:
+Use [hooks](</docs/en/hooks>) to enforce rules when teammates finish work or tasks are created or completed:
* [`TeammateIdle`](</docs/en/hooks#teammateidle>): runs when a teammate is about to go idle. Exit with code 2 to send feedback and keep the teammate working.
+ * [`TaskCreated`](</docs/en/hooks#taskcreated>): runs when a task is being created. Exit with code 2 to prevent creation and send feedback.
* [`TaskCompleted`](</docs/en/hooks#taskcompleted>): runs when a task is being marked complete. Exit with code 2 to prevent completion and send feedback.
##
@@ -335,12 +288,6 @@
A single reviewer tends to gravitate toward one type of issue at a time. Splitting review criteria into independent domains means security, performance, and test coverage all get thorough attention simultaneously. The prompt assigns each teammate a distinct lens so they don’t overlap:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Create an agent team to review PR #142. Spawn three reviewers:
- One focused on security implications
- One checking performance impact
@@ -357,12 +304,6 @@
When the root cause is unclear, a single agent tends to find one plausible explanation and stop looking. The prompt fights this by making teammates explicitly adversarial: each one’s job is not only to investigate its own theory but to challenge the others’.
-Report incorrect code
-
-Copy
-
-Ask AI
-
Users report the app exits after one message instead of staying connected.
Spawn 5 agent teammates to investigate different hypotheses. Have them talk to
each other to try to disprove each other's theories, like a scientific
@@ -384,12 +325,6 @@
Teammates load project context automatically, including CLAUDE.md, MCP servers, and skills, but they don’t inherit the lead’s conversation history. See Context and communication for details. Include task-specific details in the spawn prompt:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Spawn a security reviewer teammate with the prompt: "Review the authentication module
at src/auth/ for security vulnerabilities. Focus on token handling, session
management, and input validation. The app uses JWT tokens stored in
@@ -429,12 +364,6 @@
Sometimes the lead starts implementing tasks itself instead of waiting for teammates. If you notice this:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Wait for your teammates to complete their tasks before proceeding
###
@@ -479,12 +408,6 @@
* Check that the task you gave Claude was complex enough to warrant a team. Claude decides whether to spawn teammates based on the task.
* If you explicitly requested split panes, ensure tmux is installed and available in your PATH:
-Report incorrect code
-
-Copy
-
-Ask AI
-
which tmux
* For iTerm2, verify the `it2` CLI is installed and the Python API is enabled in iTerm2 preferences.
@@ -523,12 +446,6 @@
Orphaned tmux sessions
If a tmux session persists after the team ends, it may not have been fully cleaned up. List sessions and kill the one created by the team:
-
-Report incorrect code
-
-Copy
-
-Ask AI
tmux ls
tmux kill-session -t <session-name>
Show diff (163 lines)
--- a/amazon-bedrock.md
+++ b/amazon-bedrock.md
@@ -40,21 +40,9 @@
Claude Code uses the default AWS SDK credential chain. Set up your credentials using one of these methods: **Option A: AWS CLI configuration**
-Report incorrect code
-
-Copy
-
-Ask AI
-
aws configure
**Option B: Environment variables (access key)**
-
-Report incorrect code
-
-Copy
-
-Ask AI
export AWS_ACCESS_KEY_ID=your-access-key-id
export AWS_SECRET_ACCESS_KEY=your-secret-access-key
@@ -62,34 +50,16 @@
**Option C: Environment variables (SSO profile)**
-Report incorrect code
-
-Copy
-
-Ask AI
-
aws sso login --profile=<your-profile-name>
export AWS_PROFILE=your-profile-name
**Option D: AWS Management Console credentials**
-Report incorrect code
-
-Copy
-
-Ask AI
-
aws login
[Learn more](<https://docs.aws.amazon.com/signin/latest/userguide/command-line-sign-in.html>) about `aws login`. **Option E: Bedrock API keys**
-Report incorrect code
-
-Copy
-
-Ask AI
-
export AWS_BEARER_TOKEN_BEDROCK=your-bedrock-api-key
Bedrock API keys provide a simpler authentication method without needing full AWS credentials. [Learn more about Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>).
@@ -103,12 +73,6 @@
Claude Code supports automatic credential refresh for AWS SSO and corporate identity providers. Add these settings to your Claude Code settings file (see [Settings](</docs/en/settings>) for file locations). When Claude Code detects that your AWS credentials are expired (either locally based on their timestamp or when Bedrock returns a credential error), it will automatically run your configured `awsAuthRefresh` and/or `awsCredentialExport` commands to obtain new credentials before retrying the request.
##### Example configuration
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"awsAuthRefresh": "aws sso login --profile myprofile",
@@ -120,12 +84,6 @@
##### Configuration settings explained
**`awsAuthRefresh`** : Use this for commands that modify the `.aws` directory, such as updating credentials, SSO cache, or config files. The command’s output is displayed to the user, but interactive input isn’t supported. This works well for browser-based SSO flows where the CLI displays a URL or code and you complete authentication in the browser. **`awsCredentialExport`** : Only use this if you can’t modify `.aws` and must directly return credentials. Output is captured silently and not shown to the user. The command must output JSON in this format:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"Credentials": {
@@ -143,12 +101,6 @@
Set the following environment variables to enable Bedrock:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Enable Bedrock integration
export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-east-1 # or your preferred region
@@ -171,12 +123,6 @@
Pin specific model versions for every deployment. If you use model aliases (`sonnet`, `opus`, `haiku`) without pinning, Claude Code may attempt to use a newer model version that isn’t available in your Bedrock account, breaking existing users when Anthropic releases updates.
Set these environment variables to specific Bedrock model IDs:
-
-Report incorrect code
-
-Copy
-
-Ask AI
export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-6-v1'
export ANTHROPIC_DEFAULT_SONNET_MODEL='us.anthropic.claude-sonnet-4-6'
@@ -191,12 +137,6 @@
To customize models further, use one of these methods:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Using inference profile ID
export ANTHROPIC_MODEL='global.anthropic.claude-sonnet-4-6'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='us.anthropic.claude-haiku-4-5-20251001-v1:0'
@@ -216,12 +156,6 @@
Map each model version to an inference profile
The `ANTHROPIC_DEFAULT_*_MODEL` environment variables configure one inference profile per model family. If your organization needs to expose several versions of the same family in the `/model` picker, each routed to its own application inference profile ARN, use the `modelOverrides` setting in your [settings file](</docs/en/settings#settings-files>) instead. This example maps three Opus versions to distinct ARNs so users can switch between them without bypassing your organization’s inference profiles:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"modelOverrides": {
@@ -240,12 +174,6 @@
IAM configuration
Create an IAM policy with the required permissions for Claude Code:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"Version": "2012-10-17",
@@ -293,12 +221,6 @@
[Amazon Bedrock Guardrails](<https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html>) let you implement content filtering for Claude Code. Create a Guardrail in the [Amazon Bedrock console](<https://console.aws.amazon.com/bedrock/>), publish a version, then add the Guardrail headers to your [settings file](</docs/en/settings>). Enable Cross-Region inference on your Guardrail if you’re using cross-region inference profiles. Example configuration:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"env": {
"ANTHROPIC_CUSTOM_HEADERS": "X-Amzn-Bedrock-GuardrailIdentifier: your-guardrail-id\nX-Amzn-Bedrock-GuardrailVersion: 1"
Show diff (230 lines)
--- a/best-practices.md
+++ b/best-practices.md
@@ -2,7 +2,7 @@
* * *
-Most best practices are based on one constraint: Claude’s context window fills up fast, and performance degrades as it fills. Claude’s context window holds your entire conversation, including every message, every file Claude reads, and every command output. However, this can fill up fast. A single debugging session or codebase exploration might generate and consume tens of thousands of tokens. This matters since LLM performance degrades as context fills. When the context window is getting full, Claude may start “forgetting” earlier instructions or making more mistakes. The context window is the most important resource to manage. Track context usage continuously with a [custom status line](</docs/en/statusline>), and see [Reduce token usage](</docs/en/costs#reduce-token-usage>) for strategies on reducing token usage.
+Most best practices are based on one constraint: Claude’s context window fills up fast, and performance degrades as it fills. Claude’s context window holds your entire conversation, including every message, every file Claude reads, and every command output. However, this can fill up fast. A single debugging session or codebase exploration might generate and consume tens of thousands of tokens. This matters since LLM performance degrades as context fills. When the context window is getting full, Claude may start “forgetting” earlier instructions or making more mistakes. The context window is the most important resource to manage. To see how a session fills up in practice, [watch an interactive walkthrough](</docs/en/context-window>) of what loads at startup and what each file read costs. Track context usage continuously with a [custom status line](</docs/en/statusline>), and see [Reduce token usage](</docs/en/costs#reduce-token-usage>) for strategies on reducing token usage.
* * *
@@ -44,12 +44,6 @@
claude (Plan Mode)
-Report incorrect code
-
-Copy
-
-Ask AI
-
read /src/auth and understand how we handle sessions and login.
also look at how we manage environment variables for secrets.
@@ -61,12 +55,6 @@
claude (Plan Mode)
-Report incorrect code
-
-Copy
-
-Ask AI
-
I want to add Google OAuth. What files need to change?
What's the session flow? Create a plan.
@@ -80,12 +68,6 @@
claude (Normal Mode)
-Report incorrect code
-
-Copy
-
-Ask AI
-
implement the OAuth flow from your plan. write tests for the
callback handler, run the test suite and fix any failures.
@@ -96,12 +78,6 @@
Ask Claude to commit with a descriptive message and create a PR.
claude (Normal Mode)
-
-Report incorrect code
-
-Copy
-
-Ask AI
commit with a descriptive message and open a PR
@@ -165,12 +141,6 @@
CLAUDE.md is a special file that Claude reads at the start of every conversation. Include Bash commands, code style, and workflow rules. This gives Claude persistent context it can’t infer from code alone. The `/init` command analyzes your codebase to detect build systems, test frameworks, and code patterns, giving you a solid foundation to refine. There’s no required format for CLAUDE.md files, but keep it short and human-readable. For example:
CLAUDE.md
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Code style
- Use ES modules (import/export) syntax, not CommonJS (require)
@@ -196,12 +166,6 @@
CLAUDE.md
-Report incorrect code
-
-Copy
-
-Ask AI
-
See @README.md for project overview and @package.json for available npm commands.
# Additional Instructions
@@ -272,12 +236,6 @@
[Skills](</docs/en/skills>) extend Claude’s knowledge with information specific to your project, team, or domain. Claude applies them automatically when relevant, or you can invoke them directly with `/skill-name`. Create a skill by adding a directory with a `SKILL.md` to `.claude/skills/`:
.claude/skills/api-conventions/SKILL.md
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: api-conventions
@@ -293,12 +251,6 @@
.claude/skills/fix-issue/SKILL.md
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: fix-issue
description: Fix a GitHub issue
@@ -328,12 +280,6 @@
[Subagents](</docs/en/sub-agents>) run in their own context with their own set of allowed tools. They’re useful for tasks that read many files or need specialized focus without cluttering your main conversation.
.claude/agents/security-reviewer.md
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: security-reviewer
@@ -399,12 +345,6 @@
Claude asks about things you might not have considered yet, including technical implementation, UI/UX, edge cases, and tradeoffs.
-Report incorrect code
-
-Copy
-
-Ask AI
-
I want to build [brief description]. Interview me in detail using the AskUserQuestion tool.
Ask about technical implementation, UI/UX, edge cases, concerns, and tradeoffs. Don't ask obvious questions, dig into the hard parts I might not have considered.
@@ -467,23 +407,11 @@
Since context is your fundamental constraint, subagents are one of the most powerful tools available. When Claude researches a codebase it reads lots of files, all of which consume your context. Subagents run in separate context windows and report back summaries:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Use subagents to investigate how our authentication system handles token
refresh, and whether we have any existing OAuth utilities I should reuse.
The subagent explores the codebase, reads relevant files, and reports back with findings, all without cluttering your main conversation. You can also use subagents for verification after Claude implements something:
-Report incorrect code
-
-Copy
-
-Ask AI
-
use a subagent to review this code for edge cases
###
@@ -507,12 +435,6 @@
Run `claude --continue` to pick up where you left off, or `--resume` to choose from recent sessions.
Claude Code saves conversations locally. When a task spans multiple sessions, you don’t have to re-explain the context:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude --continue # Resume the most recent conversation
claude --resume # Select from recent conversations
@@ -538,12 +460,6 @@
Use `claude -p "prompt"` in CI, pre-commit hooks, or scripts. Add `--output-format stream-json` for streaming JSON output.
With `claude -p "your prompt"`, you can run Claude non-interactively, without a session. Non-interactive mode is how you integrate Claude into CI pipelines, pre-commit hooks, or any automated workflow. The output formats let you parse results programmatically: plain text, JSON, or streaming JSON.
-
-Report incorrect code
-
-Copy
-
-Ask AI
# One-off queries
claude -p "Explain what this project does"
@@ -598,12 +514,6 @@
Write a script to loop through the list
-Report incorrect code
-
-Copy
-
-Ask AI
-
for file in $(cat files.txt); do
claude -p "Migrate $file from React to Vue. Return OK or FAIL." \
--allowedTools "Edit,Bash(git commit *)"
@@ -617,12 +527,6 @@
You can also integrate Claude into existing data/processing pipelines:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude -p "<your prompt>" --output-format json | your_command
Use `--verbose` for debugging during development, and turn it off in production.
@@ -634,12 +538,6 @@
Run autonomously with auto mode
For uninterrupted execution with background safety checks, use [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). A classifier model reviews commands before they run, blocking scope escalation, unknown infrastructure, and hostile-content-driven actions while letting routine work proceed without prompts.
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude --permission-mode auto -p "fix all lint errors"
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,41 @@
This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Run `claude --version` to check your installed version.
+
+
+
+2.1.85
+
+March 26, 2026
+
+ * Added `CLAUDE_CODE_MCP_SERVER_NAME` and `CLAUDE_CODE_MCP_SERVER_URL` environment variables to MCP `headersHelper` scripts, allowing one helper to serve multiple servers
+ * Added conditional `if` field for hooks using permission rule syntax (e.g., `Bash(git *)`) to filter when they run, reducing process spawning overhead
+ * Added timestamp markers in transcripts when scheduled tasks (`/loop`, `CronCreate`) fire
+ * Added trailing space after `[Image #N]` placeholder when pasting images
+ * Deep link queries (`claude-cli://open?q=…`) now support up to 5,000 characters, with a “scroll to review” warning for long pre-filled prompts
+ * MCP OAuth now follows RFC 9728 Protected Resource Metadata discovery to find the authorization server
+ * Plugins blocked by organization policy (`managed-settings.json`) can no longer be installed or enabled, and are hidden from marketplace views
+ * PreToolUse hooks can now satisfy `AskUserQuestion` by returning `updatedInput` alongside `permissionDecision: "allow"`, enabling headless integrations that collect answers via their own UI
+ * `tool_parameters` in OpenTelemetry tool_result events are now gated behind `OTEL_LOG_TOOL_DETAILS=1`
+ * Fixed `/compact` failing with “context exceeded” when the conversation has grown too large for the compact request itself to fit
+ * Fixed `/plugin enable` and `/plugin disable` failing when a plugin’s install location differs from where it’s declared in settings
+ * Fixed `--worktree` exiting with an error in non-git repositories before the `WorktreeCreate` hook could run
+ * Fixed `deniedMcpServers` setting not blocking claude.ai MCP servers
+ * Fixed `switch_display` in the computer-use tool returning “not available in this session” on multi-monitor setups
+ * Fixed crash when `OTEL_LOGS_EXPORTER`, `OTEL_METRICS_EXPORTER`, or `OTEL_TRACES_EXPORTER` is set to `none`
+ * Fixed diff syntax highlighting not working in non-native builds
+ * Fixed MCP step-up authorization failing when a refresh token exists — servers requesting elevated scopes via `403 insufficient_scope` now correctly trigger the re-authorization flow
+ * Fixed memory leak in remote sessions when a streaming response is interrupted
+ * Fixed persistent ECONNRESET errors during edge connection churn by using a fresh TCP connection on retry
+ * Fixed prompts getting stuck in the queue after running certain slash commands, with up-arrow unable to retrieve them
+ * Fixed Python Agent SDK: `type:'sdk'` MCP servers passed via `--mcp-config` are no longer dropped during startup
+ * Fixed raw key sequences appearing in the prompt when running over SSH or in the VS Code integrated terminal
+ * Fixed Remote Control session status staying stuck on “Requires Action” after a permission is resolved
+ * Fixed shift+enter and meta+enter being intercepted by typeahead suggestions instead of inserting newlines
+ * Fixed stale content bleeding through when scrolling up during streaming
+ * Fixed terminal left in enhanced keyboard mode after exit in Ghostty, Kitty, WezTerm, and other terminals supporting the Kitty keyboard protocol — Ctrl+C and Ctrl+D now work correctly after quitting
+ * Improved @-mention file autocomplete performance on large repositories
+ * Improved PowerShell dangerous command detection
+ * Improved scroll performance with large transcripts by replacing WASM yoga-layout with a pure TypeScript implementation
+ * Reduced UI stutter when compaction triggers on large sessions
Show diff (216 lines)
--- a/channels.md
+++ b/channels.md
@@ -38,12 +38,6 @@
In Claude Code, run:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin install telegram@claude-plugins-official
If Claude Code reports that the plugin is not found in any marketplace, your marketplace is either missing or outdated. Run `/plugin marketplace update claude-plugins-official` to refresh it, or `/plugin marketplace add anthropics/claude-plugins-official` if you haven’t added it before. Then retry the install.After installing, run `/reload-plugins` to activate the plugin’s configure command.
@@ -54,12 +48,6 @@
Run the configure command with the token from BotFather:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/telegram:configure <token>
This saves it to `~/.claude/channels/telegram/.env`. You can also set `TELEGRAM_BOT_TOKEN` in your shell environment before launching Claude Code.
@@ -70,12 +58,6 @@
Exit Claude Code and restart with the channel flag. This starts the Telegram plugin, which begins polling for messages from your bot:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --channels plugin:telegram@claude-plugins-official
5
@@ -88,21 +70,9 @@
Back in Claude Code, run:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/telegram:access pair <code>
Then lock down access so only your account can send messages:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/telegram:access policy allowlist
@@ -141,12 +111,6 @@
In Claude Code, run:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin install discord@claude-plugins-official
If Claude Code reports that the plugin is not found in any marketplace, your marketplace is either missing or outdated. Run `/plugin marketplace update claude-plugins-official` to refresh it, or `/plugin marketplace add anthropics/claude-plugins-official` if you haven’t added it before. Then retry the install.After installing, run `/reload-plugins` to activate the plugin’s configure command.
@@ -157,12 +121,6 @@
Run the configure command with the bot token you copied:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/discord:configure <token>
This saves it to `~/.claude/channels/discord/.env`. You can also set `DISCORD_BOT_TOKEN` in your shell environment before launching Claude Code.
@@ -173,12 +131,6 @@
Exit Claude Code and restart with the channel flag. This connects the Discord plugin so your bot can receive and respond to messages:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --channels plugin:discord@claude-plugins-official
7
@@ -191,22 +143,10 @@
Back in Claude Code, run:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/discord:access pair <code>
Then lock down access so only your account can send messages:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/discord:access policy allowlist
View the full [iMessage plugin source](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/imessage>).The iMessage channel reads your Messages database directly and sends replies through AppleScript. It requires macOS and needs no bot token or external service.
@@ -223,12 +163,6 @@
In Claude Code, run:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin install imessage@claude-plugins-official
If Claude Code reports that the plugin is not found in any marketplace, your marketplace is either missing or outdated. Run `/plugin marketplace update claude-plugins-official` to refresh it, or `/plugin marketplace add anthropics/claude-plugins-official` if you haven’t added it before. Then retry the install.
@@ -239,12 +173,6 @@
Exit Claude Code and restart with the channel flag:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --channels plugin:imessage@claude-plugins-official
4
@@ -260,12 +188,6 @@
Allow other senders
By default, only your own messages pass through. To let another contact reach Claude, add their handle:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/imessage:access allow +15551234567
@@ -291,12 +213,6 @@
Start a Claude Code session and run the install command:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin install fakechat@claude-plugins-official
If Claude Code reports that the plugin is not found in any marketplace, your marketplace is either missing or outdated. Run `/plugin marketplace update claude-plugins-official` to refresh it, or `/plugin marketplace add anthropics/claude-plugins-official` if you haven’t added it before. Then retry the install.
@@ -307,12 +223,6 @@
Exit Claude Code, then restart with `--channels` and pass the fakechat plugin you installed:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --channels plugin:fakechat@claude-plugins-official
The fakechat server starts automatically.
@@ -324,12 +234,6 @@
Push a message in
Open the fakechat UI at <http://localhost:8787> and type a message:
-
-Report incorrect code
-
-Copy
-
-Ask AI
hey, what's in my working directory?
@@ -382,12 +286,6 @@
Restrict which channel plugins can run
By default, any plugin on the Anthropic-maintained allowlist can register as a channel. Admins on Team and Enterprise plans can replace that allowlist with their own by setting `allowedChannelPlugins` in managed settings. Use this to restrict which official plugins are allowed, approve channels from your own internal marketplace, or both. Each entry names a plugin and the marketplace it comes from:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"channelsEnabled": true,
Show diff (282 lines)
--- a/channels-reference.md
+++ b/channels-reference.md
@@ -52,12 +52,6 @@
Create a new directory and install the MCP SDK:
-Report incorrect code
-
-Copy
-
-Ask AI
-
mkdir webhook-channel && cd webhook-channel
bun add @modelcontextprotocol/sdk
@@ -68,12 +62,6 @@
Create a file called `webhook.ts`. This is your entire channel server: it connects to Claude Code over stdio, and it listens for HTTP POSTs on port 8788. When a request arrives, it pushes the body to Claude as a channel event.
webhook.ts
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/usr/bin/env bun
import { Server } from '@modelcontextprotocol/sdk/server/index.js'
@@ -126,12 +114,6 @@
.mcp.json
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"mcpServers": {
"webhook": { "command": "bun", "args": ["./webhook.ts"] }
@@ -146,31 +128,13 @@
During the research preview, custom channels aren’t on the allowlist, so start Claude Code with the development flag:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --dangerously-load-development-channels server:webhook
When Claude Code starts, it reads your MCP config, spawns your `webhook.ts` as a subprocess, and the HTTP listener starts automatically on the port you configured (8788 in this example). You don’t need to run the server yourself.If you see “blocked by org policy,” your Team or Enterprise admin needs to [enable channels](</docs/en/channels#enterprise-controls>) first.In a separate terminal, simulate a webhook by sending an HTTP POST with a message to your server. This example sends a CI failure alert to port 8788 (or whichever port you configured):
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -X POST localhost:8788 -d "build failed on main: https://ci.example.com/run/1234"
The payload arrives in your Claude Code session as a `<channel>` tag:
-
-Report incorrect code
-
-Copy
-
-Ask AI
<channel source="webhook" path="/" method="POST">build failed on main: https://ci.example.com/run/1234</channel>
@@ -188,12 +152,6 @@
Test during the research preview
During the research preview, every channel must be on the [approved allowlist](</docs/en/channels#research-preview>) to register. The development flag bypasses the allowlist for specific entries after a confirmation prompt. This example shows both entry types:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Testing a plugin you're developing
claude --dangerously-load-development-channels plugin:yourplugin@yourmarketplace
@@ -221,12 +179,6 @@
`instructions`| `string`| Recommended. Added to Claude’s system prompt. Tell Claude what events to expect, what the `<channel>` tag attributes mean, whether to reply, and if so which tool to use and which attribute to pass back (like `chat_id`).
To create a one-way channel, omit `capabilities.tools`. This example shows a two-way setup with the channel capability, tools, and instructions set:
-
-Report incorrect code
-
-Copy
-
-Ask AI
import { Server } from '@modelcontextprotocol/sdk/server/index.js'
@@ -259,12 +211,6 @@
Your server pushes events by calling `mcp.notification()` on the `Server` instance. This example pushes a CI failure alert with two meta keys:
-Report incorrect code
-
-Copy
-
-Ask AI
-
await mcp.notification({
method: 'notifications/claude/channel',
params: {
@@ -275,12 +221,6 @@
The event arrives in Claude’s context wrapped in a `<channel>` tag. The `source` attribute is set automatically from your server’s configured name:
-Report incorrect code
-
-Copy
-
-Ask AI
-
<channel source="your-channel" severity="high" run_id="1234">
build failed on main: https://ci.example.com/run/1234
</channel>
@@ -304,12 +244,6 @@
Enable tool discovery
In your `Server` constructor in `webhook.ts`, add `tools: {}` to the capabilities so Claude Code knows your server offers tools:
-
-Report incorrect code
-
-Copy
-
-Ask AI
capabilities: {
experimental: { 'claude/channel': {} },
@@ -321,12 +255,6 @@
Register the reply tool
Add the following to `webhook.ts`. The `import` goes at the top of the file with your other imports; the two handlers go between the `Server` constructor and `mcp.connect()`. This registers a `reply` tool that Claude can call with a `chat_id` and `text`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
// Add this import at the top of webhook.ts
import { ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js'
@@ -366,23 +294,11 @@
Update the `instructions` string in your `Server` constructor so Claude knows to route replies back through the tool. This example tells Claude to pass `chat_id` from the inbound tag:
-Report incorrect code
-
-Copy
-
-Ask AI
-
instructions: 'Messages arrive as <channel source="webhook" chat_id="...">. Reply with the reply tool, passing the chat_id from the tag.'
Here’s the complete `webhook.ts` with two-way support. Outbound replies stream over `GET /events` using [Server-Sent Events](<https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events>) (SSE), so `curl -N localhost:8788/events` can watch them live; inbound chat arrives on `POST /`:
Full webhook.ts with reply tool
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/usr/bin/env bun
import { Server } from '@modelcontextprotocol/sdk/server/index.js'
@@ -483,12 +399,6 @@
An ungated channel is a prompt injection vector. Anyone who can reach your endpoint can put text in front of Claude. A channel listening to a chat platform or a public endpoint needs a real sender check before it emits anything. Check the sender against an allowlist before calling `mcp.notification()`. This example drops any message from a sender not in the set:
-Report incorrect code
-
-Copy
-
-Ask AI
-
const allowed = new Set(loadAllowlist()) // from your access.json or equivalent
// inside your message handler, before emitting:
@@ -561,12 +471,6 @@
In your `Server` constructor, add `claude/channel/permission: {}` alongside `claude/channel` under `experimental`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
capabilities: {
experimental: {
'claude/channel': {},
@@ -580,12 +484,6 @@
Handle the incoming request
Register a notification handler between your `Server` constructor and `mcp.connect()`. Claude Code calls it with the four request fields when a permission dialog opens. Your handler formats the prompt for your platform and includes instructions for replying with the ID:
-
-Report incorrect code
-
-Copy
-
-Ask AI
import { z } from 'zod'
@@ -616,12 +514,6 @@
Intercept the verdict in your inbound handler
Your inbound handler is the loop or callback that receives messages from your platform: the same place you gate on sender and emit `notifications/claude/channel` to forward chat to Claude. Add a check before the chat-forwarding call that recognizes the verdict format and emits the permission notification instead.The regex matches the ID format Claude Code generates: five letters, never `l`. The `/i` flag tolerates phone autocorrect capitalizing the reply; lowercase the captured ID before sending it back.
-
-Report incorrect code
-
-Copy
-
-Ask AI
// matches "y abcde", "yes abcde", "n abcde", "no abcde"
// [a-km-z] is the ID alphabet Claude Code uses (lowercase, skips 'l')
@@ -669,12 +561,6 @@
* **`POST /`** : the inbound side, the same handler as earlier, now with the verdict-format check inserted before the chat-forward branch.
Full webhook.ts with permission relay
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/usr/bin/env bun
import { Server } from '@modelcontextprotocol/sdk/server/index.js'
@@ -813,41 +699,17 @@
Test the verdict path in three terminals. The first is your Claude Code session, started with the development flag so it spawns `webhook.ts`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --dangerously-load-development-channels server:webhook
In the second, stream the outbound side so you can see Claude’s replies and any permission prompts as they fire:
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -N localhost:8788/events
In the third, send a message that will make Claude try to run a command:
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -d "list the files in this directory" -H "X-Sender: dev" localhost:8788
The local permission dialog opens in your Claude Code terminal. A moment later the prompt appears in the `/events` stream, including the five-letter ID. Approve it from the remote side:
-
-Report incorrect code
-
-Copy
-
-Ask AI
curl -d "yes <id>" -H "X-Sender: dev" localhost:8788
--- a/checkpointing.md
+++ b/checkpointing.md
@@ -80,12 +80,6 @@
Checkpointing does not track files modified by bash commands. For example, if Claude Code runs:
-Report incorrect code
-
-Copy
-
-Ask AI
-
rm file.txt
mv old.txt new.txt
cp source.txt dest.txt
Show diff (119 lines)
--- a/chrome.md
+++ b/chrome.md
@@ -45,12 +45,6 @@
Start Claude Code with the `--chrome` flag:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --chrome
You can also enable Chrome from within an existing session by running `/chrome`.
@@ -60,12 +54,6 @@
Ask Claude to use the browser
This example navigates to a page, interacts with it, and reports what it finds, all from your terminal or editor:
-
-Report incorrect code
-
-Copy
-
-Ask AI
Go to code.claude.com/docs, click on the search box,
type "hooks", and tell me what results appear
@@ -105,12 +93,6 @@
Test a local web application
When developing a web app, ask Claude to verify your changes work correctly:
-
-Report incorrect code
-
-Copy
-
-Ask AI
I just updated the login form validation. Can you open localhost:3000,
try submitting the form with invalid data, and check if the error
@@ -126,12 +108,6 @@
Claude can read console output to help diagnose problems. Tell Claude what patterns to look for rather than asking for all console output, since logs can be verbose:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Open the dashboard page and check the console for any errors when
the page loads.
@@ -144,12 +120,6 @@
Automate form filling
Speed up repetitive data entry tasks:
-
-Report incorrect code
-
-Copy
-
-Ask AI
I have a spreadsheet of customer contacts in contacts.csv. For each row,
go to the CRM at crm.example.com, click "Add Contact", and fill in the
@@ -165,12 +135,6 @@
Use Claude to write directly in your documents without API setup:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Draft a project update based on the recent commits and add it to my
Google Doc at docs.google.com/document/d/abc123
@@ -184,12 +148,6 @@
Pull structured information from websites:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Go to the product listings page and extract the name, price, and
availability for each item. Save the results as a CSV file.
@@ -202,12 +160,6 @@
Run multi-site workflows
Coordinate tasks across multiple websites:
-
-Report incorrect code
-
-Copy
-
-Ask AI
Check my calendar for meetings tomorrow, then for each meeting with
an external attendee, look up their company website and add a note
@@ -222,12 +174,6 @@
Record a demo GIF
Create shareable recordings of browser interactions:
-
-Report incorrect code
-
-Copy
-
-Ask AI
Record a GIF showing how to complete the checkout flow, from adding
an item to the cart through to the confirmation page.
Show diff (169 lines)
--- a/claude-code-on-the-web.md
+++ b/claude-code-on-the-web.md
@@ -37,7 +37,7 @@
1. Visit [claude.ai/code](<https://claude.ai/code>)
2. Connect your GitHub account
- 3. Install the Claude GitHub app in your repositories
+ 3. Install the Claude GitHub App in your repositories
4. Select your default environment
5. Submit your coding task
6. Review changes in diff view, iterate with comments, then create a pull request
@@ -75,6 +75,36 @@
+Auto-fix pull requests
+
+Claude can watch a pull request and automatically respond to CI failures and review comments. Claude subscribes to GitHub activity on the PR, and when a check fails or a reviewer leaves a comment, Claude investigates and pushes a fix if one is clear.
+
+Auto-fix requires the Claude GitHub App to be installed on your repository. If you haven’t already, install it from the [GitHub App page](<https://github.com/apps/claude>) or when prompted during setup.
+
+There are a few ways to turn on auto-fix depending on where the PR came from and what device you’re using:
+
+ * **PRs created in Claude Code on the web** : open the CI status bar and select **Auto-fix**
+ * **From the mobile app** : tell Claude to auto-fix the PR, for example “watch this PR and fix any CI failures or review comments”
+ * **Any existing PR** : paste the PR URL into a session and tell Claude to auto-fix it
+
+###
+
+
+
+How Claude responds to PR activity
+
+When auto-fix is active, Claude receives GitHub events for the PR including new review comments and CI check failures. For each event, Claude investigates and decides how to proceed:
+
+ * **Clear fixes** : if Claude is confident in a fix and it doesn’t conflict with earlier instructions, Claude makes the change, pushes it, and explains what was done in the session
+ * **Ambiguous requests** : if a reviewer’s comment could be interpreted multiple ways or involves something architecturally significant, Claude asks you before acting
+ * **Duplicate or no-action events** : if an event is a duplicate or requires no change, Claude notes it in the session and moves on
+
+Claude may reply to review comment threads on GitHub as part of resolving them. These replies are posted using your GitHub account, so they appear under your username, but each reply is labeled as coming from Claude Code so reviewers know it was written by the agent and not by you directly.
+
+##
+
+
+
Moving tasks between web and terminal
You can start new tasks on the web from your terminal, or pull web sessions into your terminal to continue locally. Web sessions persist even if you close your laptop, and you can monitor them from anywhere including the Claude mobile app.
@@ -89,12 +119,6 @@
Start a web session from the command line with the `--remote` flag:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --remote "Fix the authentication bug in src/auth/login.ts"
This creates a new web session on claude.ai. The task runs in the cloud while you continue working locally. Use `/tasks` to check progress, or open the session on claude.ai or the Claude mobile app to interact directly. From there you can steer Claude, provide feedback, or answer questions just like any other conversation.
@@ -107,31 +131,13 @@
**Plan locally, execute remotely** : For complex tasks, start Claude in plan mode to collaborate on the approach, then send work to the web:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --permission-mode plan
In plan mode, Claude can only read files and explore the codebase. Once you’re satisfied with the plan, start a remote session for autonomous execution:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --remote "Execute the migration plan in docs/migration-plan.md"
This pattern gives you control over the strategy while letting Claude execute autonomously in the cloud. **Run tasks in parallel** : Each `--remote` command creates its own web session that runs independently. You can kick off multiple tasks and they’ll all run simultaneously in separate sessions:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude --remote "Fix the flaky test in auth.spec.ts"
claude --remote "Update the API documentation"
@@ -253,12 +259,6 @@
Checking available tools
To see what’s pre-installed in your environment, ask Claude Code to run:
-
-Report incorrect code
-
-Copy
-
-Ask AI
check-tools
@@ -315,12 +315,6 @@
Environment variables must be specified as key-value pairs, in [`.env` format](<https://www.dotenv.org/>). For example:
-Report incorrect code
-
-Copy
-
-Ask AI
-
API_KEY=your_api_key
DEBUG=true
@@ -335,12 +329,6 @@
To check what’s already installed before adding it to your script, ask Claude to run `check-tools` in a cloud session.
To add a setup script, open the environment settings dialog and enter your script in the **Setup script** field. This example installs the `gh` CLI, which isn’t in the default image:
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/bin/bash
apt update && apt install -y gh
@@ -374,23 +362,11 @@
Custom environment images and snapshots are not yet supported. Use setup scripts to install packages when a session starts, or [SessionStart hooks](</docs/en/hooks#sessionstart>) for dependency installation that should also run in local environments. SessionStart hooks have known limitations. To configure automatic dependency installation with a setup script, open your environment settings and add a script:
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
npm install
pip install -r requirements.txt
Alternatively, you can use SessionStart hooks in your repository’s `.claude/settings.json` file for dependency installation that should also run in local environments:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -409,12 +385,6 @@
}
Create the corresponding script at `scripts/install_pkgs.sh`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/bin/bash
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -0,0 +1,80 @@
+Claude Code reads instructions, settings, skills, subagents, and memory from your project directory and from `~/.claude` in your home directory. Commit project files to git to share them with your team; files in `~/.claude` are personal configuration that applies across all your projects. Most users only edit `CLAUDE.md` and `settings.json`. The rest of the directory is optional: add skills, rules, or subagents as you need them. This page is an interactive explorer: click files in the tree to see what each one does, when it loads, and an example. For a quick reference, see the file reference table below.
+
+##
+
+
+
+What’s not shown
+
+The explorer covers the files you’ll interact with most. A few things live elsewhere:
+
+File| Location| Purpose
+---|---|---
+`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override. See [server-managed settings](</docs/en/server-managed-settings>).
+`CLAUDE.local.md`| Project root| Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`.
+
+##
+
+
+
+File reference
+
+This table lists every file the explorer covers. Project-scope files live in your repo under `.claude/` (or at the root for `CLAUDE.md` and `.mcp.json`). Global-scope files live in `~/.claude/` and apply across all projects.
+
+Several things can override what you put in these files:
+
+ * [Managed settings](</docs/en/server-managed-settings>) deployed by your organization take precedence over everything
+ * CLI flags like `--permission-mode` or `--settings` override `settings.json` for that session
+ * Some environment variables take precedence over their equivalent setting, but this varies: check the [environment variables reference](</docs/en/env-vars>) for each one
+
+See [settings precedence](</docs/en/settings#settings-precedence>) for the full order.
+
+Click a filename to open that node in the explorer above.
+
+File| Scope| Commit| What it does| Reference
+---|---|---|---|---
+`CLAUDE.md`| Project and global| ✓| Instructions loaded every session| [Memory](</docs/en/memory>)
+`rules/*.md`| Project and global| ✓| Topic-scoped instructions, optionally path-gated| [Rules](</docs/en/memory#organize-rules-with-claude/rules/>)
+`settings.json`| Project and global| ✓| Permissions, hooks, env vars, model defaults| [Settings](</docs/en/settings>)
+`settings.local.json`| Project only| | Your personal overrides, auto-gitignored| [Settings scopes](</docs/en/settings#settings-files>)
+`.mcp.json`| Project only| ✓| Team-shared MCP servers| [MCP scopes](</docs/en/mcp#mcp-installation-scopes>)
+`skills/<name>/SKILL.md`| Project and global| ✓| Reusable prompts invoked with `/name` or auto-invoked| [Skills](</docs/en/skills>)
+`commands/*.md`| Project and global| ✓| Single-file prompts; same mechanism as skills| [Skills](</docs/en/skills>)
+`output-styles/*.md`| Project and global| ✓| Custom system-prompt sections| [Output styles](</docs/en/output-styles>)
+`agents/*.md`| Project and global| ✓| Subagent definitions with their own prompt and tools| [Subagents](</docs/en/sub-agents>)
+`agent-memory/<name>/`| Project and global| ✓| Persistent memory for subagents| [Persistent memory](</docs/en/sub-agents#enable-persistent-memory>)
+`~/.claude.json`| Global only| | App state, OAuth, UI toggles, personal MCP servers| [Global config](</docs/en/settings#global-config-settings>)
+`projects/<project>/memory/`| Global only| | Auto memory: Claude’s notes to itself across sessions| [Auto memory](</docs/en/memory#auto-memory>)
+`keybindings.json`| Global only| | Custom keyboard shortcuts| [Keybindings](</docs/en/keybindings>)
+
+##
+
+
+
+Check what loaded
+
+The explorer shows what files can exist. To see what actually loaded in your current session, use these commands:
+
+Command| Shows
+---|---
+`/context`| Token usage by category: system prompt, memory files, skills, MCP tools, and messages
+`/memory`| Which CLAUDE.md and rules files loaded, plus auto-memory entries
+`/agents`| Configured subagents and their settings
+`/hooks`| Active hook configurations
+`/mcp`| Connected MCP servers and their status
+`/skills`| Available skills from project, user, and plugin sources
+`/permissions`| Current allow and deny rules
+`/doctor`| Installation and configuration diagnostics
+
+Run `/context` first for the overview, then the specific command for the area you want to investigate.
+
+##
+
+
+
+Related resources
+
+ * [Manage Claude’s memory](</docs/en/memory>): write and organize CLAUDE.md, rules, and auto memory
+ * [Configure settings](</docs/en/settings>): set permissions, hooks, environment variables, and model defaults
+ * [Create skills](</docs/en/skills>): build reusable prompts and workflows
+ * [Configure subagents](</docs/en/sub-agents>): define specialized agents with their own context
Show diff (101 lines)
--- a/code-review.md
+++ b/code-review.md
@@ -4,6 +4,7 @@
* How reviews work
* Setup
+ * Triggering reviews manually with `@claude review` and `@claude review once`
* Customizing reviews with `CLAUDE.md` and `REVIEW.md`
* Pricing
@@ -25,11 +26,31 @@
Marker| Severity| Meaning
---|---|---
-🔴| Normal| A bug that should be fixed before merging
+🔴| Important| A bug that should be fixed before merging
🟡| Nit| A minor issue, worth fixing but not blocking
🟣| Pre-existing| A bug that exists in the codebase but was not introduced by this PR
Findings include a collapsible extended reasoning section you can expand to understand why Claude flagged the issue and how it verified the problem.
+
+###
+
+
+
+Check run output
+
+Beyond the inline review comments, each review populates the **Claude Code Review** check run that appears alongside your CI checks. Expand its **Details** link to see a summary of every finding in one place, sorted by severity:
+
+Severity| File:Line| Issue
+---|---|---
+🔴 Important| `src/auth/session.ts:142`| Token refresh races with logout, leaving stale sessions active
+🟡 Nit| `src/auth/session.ts:88`| `parseExpiry` silently returns 0 on malformed input
+
+Each finding also appears as an annotation in the **Files changed** tab, marked directly on the relevant diff lines. Important findings render with a red marker, nits with a yellow warning, and pre-existing bugs with a gray notice. The check run always completes with a neutral conclusion so it never blocks merging through branch protection rules. If you want to gate merges on Code Review findings, read the severity breakdown from the check run output in your own CI. The last line of the Details text is a machine-readable comment your workflow can parse with `gh` and jq:
+
+ gh api repos/OWNER/REPO/check-runs/CHECK_RUN_ID \
+ --jq '.output.text | split("bughunter-severity: ")[1] | split(" -->")[0] | fromjson'
+
+This returns a JSON object with counts per severity, for example `{"normal": 2, "nit": 1, "pre_existing": 0}`. The `normal` key holds the count of Important findings; a non-zero value means Claude found at least one bug worth fixing before merge.
###
@@ -85,7 +106,7 @@
* **Once after PR creation** : review runs once when a PR is opened or marked ready for review
* **After every push** : review runs on every push to the PR branch, catching new issues as the PR evolves and auto-resolving threads when you fix flagged issues
- * **Manual** : reviews start only when someone comments `@claude review` on a PR; subsequent pushes to that PR are then reviewed automatically
+ * **Manual** : reviews start only when someone comments `@claude review` or `@claude review once` on a PR; `@claude review` also subscribes the PR to reviews on subsequent pushes
Reviewing on every push runs the most reviews and costs the most. Manual mode is useful for high-traffic repos where you want to opt specific PRs into review, or to only start reviewing your PRs once they’re ready.
@@ -97,14 +118,21 @@
Manually trigger reviews
-Comment `@claude review` on a pull request to start a review and opt that PR into push-triggered reviews going forward. This works regardless of the repository’s configured trigger: use it to opt specific PRs into review in Manual mode, or to get an immediate re-review in other modes. Either way, pushes to that PR trigger reviews from then on. For the comment to trigger a review:
+Two comment commands start a review on demand. Both work regardless of the repository’s configured trigger, so you can use them to opt specific PRs into review in Manual mode or to get an immediate re-review in other modes.
+
+Command| What it does
+---|---
+`@claude review`| Starts a review and subscribes the PR to push-triggered reviews going forward
+`@claude review once`| Starts a single review without subscribing the PR to future pushes
+
+Use `@claude review once` when you want feedback on the current state of a PR but don’t want every subsequent push to incur a review. This is useful for long-running PRs with frequent pushes, or when you want a one-off second opinion without changing the PR’s review behavior. For either command to trigger a review:
* Post it as a top-level PR comment, not an inline comment on a diff line
- * Put `@claude review` at the start of the comment
+ * Put the command at the start of the comment, with `once` on the same line if you’re using the one-shot form
* You must have owner, member, or collaborator access to the repository
- * The PR must be open and not a draft
-
-If a review is already running on that PR, the request is queued until the in-progress review completes. You can monitor progress via the check run on the PR.
+ * The PR must be open
+
+Unlike automatic triggers, manual triggers run on draft PRs, since an explicit request signals you want the review now regardless of draft status. If a review is already running on that PR, the request is queued until the in-progress review completes. You can monitor progress via the check run on the PR.
##
@@ -139,12 +167,6 @@
* Things Claude should skip: “don’t comment on formatting in generated code under `/gen/`”
Example `REVIEW.md`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Code Review Guidelines
@@ -192,7 +214,7 @@
* **After every push** : runs on each push, multiplying cost by the number of pushes
* **Manual** : no reviews until someone comments `@claude review` on a PR
-In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. Costs appear on your Anthropic bill regardless of whether your organization uses AWS Bedrock or Google Vertex AI for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings.
+In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. To run a single review without subscribing to future pushes, comment `@claude review once` instead. Costs appear on your Anthropic bill regardless of whether your organization uses AWS Bedrock or Google Vertex AI for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings.
##
Show diff (826 lines)
--- a/common-workflows.md
+++ b/common-workflows.md
@@ -18,63 +18,27 @@
Navigate to the project root directory
-Report incorrect code
-
-Copy
-
-Ask AI
-
cd /path/to/project
2
Start Claude Code
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude
3
Ask for a high-level overview
-Report incorrect code
-
-Copy
-
-Ask AI
-
give me an overview of this codebase
4
Dive deeper into specific components
-Report incorrect code
-
-Copy
-
-Ask AI
-
explain the main architecture patterns used here
-Report incorrect code
-
-Copy
-
-Ask AI
-
what are the key data models?
-
-Report incorrect code
-
-Copy
-
-Ask AI
how is authentication handled?
@@ -96,35 +60,17 @@
Ask Claude to find relevant files
-Report incorrect code
-
-Copy
-
-Ask AI
-
find the files that handle user authentication
2
Get context on how components interact
-Report incorrect code
-
-Copy
-
-Ask AI
-
how do these authentication files work together?
3
Understand the execution flow
-
-Report incorrect code
-
-Copy
-
-Ask AI
trace the login process from front-end to database
@@ -148,35 +94,17 @@
Share the error with Claude
-Report incorrect code
-
-Copy
-
-Ask AI
-
I'm seeing an error when I run npm test
2
Ask for fix recommendations
-Report incorrect code
-
-Copy
-
-Ask AI
-
suggest a few ways to fix the @ts-ignore in user.ts
3
Apply the fix
-
-Report incorrect code
-
-Copy
-
-Ask AI
update user.ts to add the null check you suggested
@@ -200,47 +128,23 @@
Identify legacy code for refactoring
-Report incorrect code
-
-Copy
-
-Ask AI
-
find deprecated API usage in our codebase
2
Get refactoring recommendations
-Report incorrect code
-
-Copy
-
-Ask AI
-
suggest how to refactor utils.js to use modern JavaScript features
3
Apply the changes safely
-Report incorrect code
-
-Copy
-
-Ask AI
-
refactor utils.js to use ES2024 features while maintaining the same behavior
4
Verify the refactoring
-
-Report incorrect code
-
-Copy
-
-Ask AI
run tests for the refactored code
@@ -264,12 +168,6 @@
View available subagents
-Report incorrect code
-
-Copy
-
-Ask AI
-
/agents
This shows all available subagents and lets you create new ones.
@@ -280,51 +178,21 @@
Claude Code automatically delegates appropriate tasks to specialized subagents:
-Report incorrect code
-
-Copy
-
-Ask AI
-
review my recent code changes for security issues
-Report incorrect code
-
-Copy
-
-Ask AI
-
run all tests and fix any failures
3
Explicitly request specific subagents
-Report incorrect code
-
-Copy
-
-Ask AI
-
use the code-reviewer subagent to check the auth module
-Report incorrect code
-
-Copy
-
-Ask AI
-
have the debugger subagent investigate why users can't log in
4
Create custom subagents for your workflow
-
-Report incorrect code
-
-Copy
-
-Ask AI
/agents
@@ -370,22 +238,10 @@
**Turn on Plan Mode during a session** You can switch into Plan Mode during a session using **Shift+Tab** to cycle through permission modes. If you are in Normal Mode, **Shift+Tab** first switches into Auto-Accept Mode, indicated by `⏵⏵ accept edits on` at the bottom of the terminal. A subsequent **Shift+Tab** will switch into Plan Mode, indicated by `⏸ plan mode on`. **Start a new session in Plan Mode** To start a new session in Plan Mode, use the `--permission-mode plan` flag:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --permission-mode plan
**Run “headless” queries in Plan Mode** You can also run a query in Plan Mode directly with `-p` (that is, in [“headless mode”](</docs/en/headless>)):
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --permission-mode plan -p "Analyze the authentication system and suggest improvements"
###
@@ -394,38 +250,14 @@
Example: Planning a complex refactor
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --permission-mode plan
-Report incorrect code
-
-Copy
-
-Ask AI
-
I need to refactor our authentication system to use OAuth2. Create a detailed migration plan.
Claude analyzes the current implementation and create a comprehensive plan. Refine with follow-ups:
-Report incorrect code
-
-Copy
-
-Ask AI
-
What about backward compatibility?
-Report incorrect code
-
-Copy
-
-Ask AI
-
How should we handle database migration?
Press `Ctrl+G` to open the plan in your default text editor, where you can edit it directly before Claude proceeds.
@@ -437,12 +269,6 @@
Configure Plan Mode as default
-
-Report incorrect code
-
-Copy
-
-Ask AI
// .claude/settings.json
{
@@ -467,48 +293,24 @@
Identify untested code
-Report incorrect code
-
-Copy
-
-Ask AI
-
find functions in NotificationsService.swift that are not covered by tests
2
Generate test scaffolding
-Report incorrect code
-
-Copy
-
-Ask AI
-
add tests for the notification service
3
Add meaningful test cases
-Report incorrect code
-
-Copy
-
-Ask AI
-
add test cases for edge conditions in the notification service
4
Run and verify tests
-Report incorrect code
-
-Copy
-
-Ask AI
-
run the new tests and fix any failures
Claude can generate tests that follow your project’s existing patterns and conventions. When asking for tests, be specific about what behavior you want to verify. Claude examines your existing test files to match the style, frameworks, and assertion patterns already in use. For comprehensive coverage, ask Claude to identify edge cases you might have missed. Claude can analyze your code paths and suggest tests for error conditions, boundary values, and unexpected inputs that are easy to overlook.
@@ -527,36 +329,18 @@
Summarize your changes
-Report incorrect code
-
-Copy
-
-Ask AI
-
summarize the changes I've made to the authentication module
2
Generate a pull request
-Report incorrect code
-
-Copy
-
-Ask AI
-
create a pr
3
Review and refine
-Report incorrect code
-
-Copy
-
-Ask AI
-
enhance the PR description with more context about the security improvements
When you create a PR using `gh pr create`, the session is automatically linked to that PR. You can resume it later with `claude --from-pr <number>`.
@@ -575,47 +359,23 @@
Identify undocumented code
-Report incorrect code
-
-Copy
-
-Ask AI
-
find functions without proper JSDoc comments in the auth module
2
Generate documentation
-Report incorrect code
-
-Copy
-
-Ask AI
-
add JSDoc comments to the undocumented functions in auth.js
3
Review and enhance
-Report incorrect code
-
-Copy
-
-Ask AI
-
improve the generated documentation with more context and examples
4
Verify documentation
-
-Report incorrect code
-
-Copy
-
-Ask AI
check if the documentation follows our project standards
@@ -649,67 +409,25 @@
Ask Claude to analyze the image
-Report incorrect code
-
-Copy
-
-Ask AI
-
What does this image show?
-Report incorrect code
-
-Copy
-
-Ask AI
-
Describe the UI elements in this screenshot
-Report incorrect code
-
-Copy
-
-Ask AI
-
Are there any problematic elements in this diagram?
3
Use images for context
-Report incorrect code
-
-Copy
-
-Ask AI
-
Here's a screenshot of the error. What's causing it?
-Report incorrect code
-
-Copy
-
-Ask AI
-
This is our current database schema. How should we modify it for the new feature?
4
Get code suggestions from visual content
-Report incorrect code
-
-Copy
-
-Ask AI
-
Generate CSS to match this design mockup
-
-Report incorrect code
-
-Copy
-
-Ask AI
What HTML structure would recreate this component?
@@ -735,12 +453,6 @@
Reference a single file
-Report incorrect code
-
-Copy
-
-Ask AI
-
Explain the logic in @src/utils/auth.js
This includes the full content of the file in the conversation.
@@ -749,12 +461,6 @@
Reference a directory
-Report incorrect code
-
-Copy
-
-Ask AI
-
What's the structure of @src/components?
This provides a directory listing with file information.
@@ -762,12 +468,6 @@
3
Reference MCP resources
-
-Report incorrect code
-
-Copy
-
-Ask AI
Show me the data from @github:repos/owner/repo/issues
@@ -851,22 +551,10 @@
Name a session at startup with `-n`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude -n auth-refactor
Or use `/rename` during a session, which also shows the name on the prompt bar:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/rename auth-refactor
You can also rename any session from the picker: run `/resume`, navigate to a session, and press `R`.
@@ -877,21 +565,9 @@
From the command line:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --resume auth-refactor
Or from inside an active session:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/resume auth-refactor
@@ -951,12 +627,6 @@
When working on multiple tasks at once, you need each Claude session to have its own copy of the codebase so changes don’t collide. Git worktrees solve this by creating separate working directories that each have their own files and branch, while sharing the same repository history and remote connections. This means you can have Claude working on a feature in one worktree while fixing a bug in another, without either session interfering with the other. Use the `--worktree` (`-w`) flag to create an isolated worktree and start Claude in it. The value you pass becomes the worktree directory name and branch name:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Start Claude in a worktree named "feature-auth"
# Creates .claude/worktrees/feature-auth/ with a new branch
claude --worktree feature-auth
@@ -966,12 +636,6 @@
If you omit the name, Claude generates a random one automatically:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Auto-generates a name like "bright-running-fox"
claude --worktree
@@ -1004,15 +668,25 @@
+Copy gitignored files to worktrees
+
+Git worktrees are fresh checkouts, so they don’t include untracked files like `.env` or `.env.local` from your main repository. To automatically copy these files when Claude creates a worktree, add a `.worktreeinclude` file to your project root. The file uses `.gitignore` syntax to list which files to copy. Only files that match a pattern and are also gitignored get copied, so tracked files are never duplicated.
+
+.worktreeinclude
+
+ .env
+ .env.local
+ config/secrets.json
+
+This applies to worktrees created with `--worktree`, subagent worktrees, and parallel sessions in the [desktop app](</docs/en/desktop#work-in-parallel-with-sessions>).
+
+###
+
+
+
Manage worktrees manually
For more control over worktree location and branch configuration, create worktrees with Git directly. This is useful when you need to check out a specific existing branch or place the worktree outside the repository.
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Create a worktree with a new branch
git worktree add ../project-feature-a -b feature-a
@@ -1060,12 +734,6 @@
* Linux
* Windows
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -1083,12 +751,6 @@
}
}
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"Notification": [
@@ -1105,12 +767,6 @@
}
}
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"Notification": [
@@ -1166,12 +822,6 @@
Suppose you want to use Claude Code as a linter or code reviewer. **Add Claude to your build script:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
// package.json
{
...
@@ -1195,12 +845,6 @@
Suppose you want to pipe data into Claude, and get back data in a structured format. **Pipe data through Claude:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
cat build-error.txt | claude -p 'concisely explain the root cause of this build error' > output.txt
Tips:
@@ -1221,12 +865,6 @@
Use text format (default)
-Report incorrect code
-
-Copy
-
-Ask AI
-
cat data.txt | claude -p 'summarize this data' --output-format text > summary.txt
This outputs just Claude’s plain text response (default behavior).
@@ -1235,12 +873,6 @@
Use JSON format
-Report incorrect code
-
-Copy
-
-Ask AI
-
cat code.py | claude -p 'analyze this code for bugs' --output-format json > analysis.json
This outputs a JSON array of messages with metadata including cost and duration.
@@ -1248,12 +880,6 @@
3
Use streaming JSON format
-
-Report incorrect code
-
-Copy
-
-Ask AI
cat log.txt | claude -p 'parse this log file for errors' --output-format stream-json
@@ -1300,51 +926,15 @@
Example questions
-Report incorrect code
-
-Copy
-
-Ask AI
-
can Claude Code create pull requests?
-Report incorrect code
-
-Copy
-
-Ask AI
-
how does Claude Code handle permissions?
-Report incorrect code
-
-Copy
-
-Ask AI
-
what skills are available?
-Report incorrect code
-
-Copy
-
-Ask AI
-
how do I use MCP with Claude Code?
-Report incorrect code
-
-Copy
-
-Ask AI
-
how do I configure Claude Code for Amazon Bedrock?
-
-Report incorrect code
-
-Copy
-
-Ask AI
what are the limitations of Claude Code?
--- a/context-window.md
+++ b/context-window.md
@@ -0,0 +1,36 @@
+Claude Code’s context window holds everything Claude knows about your session: your instructions, the files it reads, its own responses, and content that never appears in your terminal. The timeline below walks through what loads and when. See the written breakdown for the same content as a list.
+
+##
+
+
+
+What the timeline shows
+
+The session walks through a realistic flow with representative token counts:
+
+ * **Before you type anything** : CLAUDE.md, auto memory, MCP tool names, and skill descriptions all load into context. Your own setup may add more here, like an [output style](</docs/en/output-styles>) or text from [`--append-system-prompt`](</docs/en/cli-reference>), which both go into the system prompt the same way.
+ * **As Claude works** : each file read adds to context, [path-scoped rules](</docs/en/memory#path-specific-rules>) load automatically alongside matching files, and a [PostToolUse hook](</docs/en/hooks-guide>) fires after each edit.
+ * **The follow-up prompt** : a [subagent](</docs/en/sub-agents>) handles the research in its own separate context window, so the large file reads stay out of yours. Only the summary and a small metadata trailer come back.
+ * **At the end** : `/compact` replaces the conversation with a structured summary. Most startup content reloads automatically. The [skill](</docs/en/skills>) listing is the one exception.
+
+##
+
+
+
+Check your own session
+
+The visualization uses representative numbers. To see your actual context usage at any point, run `/context` for a live breakdown by category with optimization suggestions. Run `/memory` to check which CLAUDE.md and auto memory files loaded at startup.
+
+##
+
+
+
+Related resources
+
+For deeper coverage of the features shown in the timeline, see these pages:
+
+ * [Extend Claude Code](</docs/en/features-overview>): when to use CLAUDE.md vs skills vs rules vs hooks vs MCP
+ * [Store instructions and memories](</docs/en/memory>): CLAUDE.md hierarchy and auto memory
+ * [Subagents](</docs/en/sub-agents>): delegate research to a separate context window
+ * [Best practices](</docs/en/best-practices>): managing context as your primary constraint
+ * [Reduce token usage](</docs/en/costs#reduce-token-usage>): strategies for keeping context usage low
--- a/costs.md
+++ b/costs.md
@@ -15,12 +15,6 @@
The `/cost` command shows API token usage and is intended for API users. Claude Max and Pro subscribers have usage included in their subscription, so `/cost` data isn’t relevant for billing purposes. Subscribers can use `/stats` to view usage patterns.
The `/cost` command provides detailed token usage statistics for your current session:
-
-Report incorrect code
-
-Copy
-
-Ask AI
Total cost: $0.55
Total duration (API): 6m 19.7s
@@ -95,12 +89,6 @@
You can also customize compaction behavior in your CLAUDE.md:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Compact instructions
When you are using compact, please focus on test output and code changes
@@ -119,11 +107,10 @@
Reduce MCP server overhead
-Each MCP server adds tool definitions to your context, even when idle. Run `/context` to see what’s consuming space.
-
- * **Prefer CLI tools when available** : Tools like `gh`, `aws`, `gcloud`, and `sentry-cli` are more context-efficient than MCP servers because they don’t add persistent tool definitions. Claude can run CLI commands directly without the overhead.
+MCP tool definitions are [deferred by default](</docs/en/mcp#scale-with-mcp-tool-search>), so only tool names enter context until Claude uses a specific tool. Run `/context` to see what’s consuming space.
+
+ * **Prefer CLI tools when available** : Tools like `gh`, `aws`, `gcloud`, and `sentry-cli` are still more context-efficient than MCP servers because they don’t add any per-tool listing. Claude can run CLI commands directly.
* **Disable unused servers** : Run `/mcp` to see configured servers and disable any you’re not actively using.
- * **Tool search is automatic** : When MCP tool descriptions exceed 10% of your context window, Claude Code automatically defers them and loads tools on-demand via [tool search](</docs/en/mcp#scale-with-mcp-tool-search>). Since deferred tools only enter context when actually used, a lower threshold means fewer idle tool definitions consuming space. Set a lower threshold with `ENABLE_TOOL_SEARCH=auto:<N>` (for example, `auto:5` triggers when tools exceed 5% of your context window).
###
@@ -146,12 +133,6 @@
* filter-test-output.sh
Add this to your [settings.json](</docs/en/settings#settings-files>) to run the hook before every Bash command:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -171,12 +152,6 @@
The hook calls this script, which checks if the command is a test runner and modifies it to show only failures:
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
input=$(cat)
cmd=$(echo "$input" | jq -r '.tool_input.command')
--- a/desktop.md
+++ b/desktop.md
@@ -205,7 +205,7 @@
Work in parallel with sessions
-Click **\+ New session** in the sidebar to work on multiple tasks in parallel. For Git repositories, each session gets its own isolated copy of your project using [Git worktrees](</docs/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees>), so changes in one session don’t affect other sessions until you commit them. Worktrees are stored in `<project-root>/.claude/worktrees/` by default. You can change this to a custom directory in Settings → Claude Code under “Worktree location”. You can also set a branch prefix that gets prepended to every worktree branch name, which is useful for keeping Claude-created branches organized. To remove a worktree when you’re done, hover over the session in the sidebar and click the archive icon.
+Click **\+ New session** in the sidebar to work on multiple tasks in parallel. For Git repositories, each session gets its own isolated copy of your project using [Git worktrees](</docs/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees>), so changes in one session don’t affect other sessions until you commit them. Worktrees are stored in `<project-root>/.claude/worktrees/` by default. You can change this to a custom directory in Settings → Claude Code under “Worktree location”. You can also set a branch prefix that gets prepended to every worktree branch name, which is useful for keeping Claude-created branches organized. To remove a worktree when you’re done, hover over the session in the sidebar and click the archive icon. To include gitignored files like `.env` in new worktrees, create a [`.worktreeinclude` file](</docs/en/common-workflows#copy-gitignored-files-to-worktrees>) in your project root.
Session isolation requires [Git](<https://git-scm.com/downloads>). Most Macs include Git by default. Run `git --version` in Terminal to check. On Windows, Git is required for the Code tab to work: [download Git for Windows](<https://git-scm.com/downloads/win>), install it, and restart the app. If you run into Git errors, try a Cowork session to help troubleshoot your setup.
@@ -277,12 +277,6 @@
Configure preview servers
Claude automatically detects your dev server setup and stores the configuration in `.claude/launch.json` at the root of the folder you selected when starting the session. Preview uses this folder as its working directory, so if you selected a parent folder, subfolders with their own dev servers won’t be detected automatically. To work with a subfolder’s server, either start a session in that folder directly or add a configuration manually. To customize how your server starts, for example to use `yarn dev` instead of `npm run dev` or to change the port, edit the file manually or click **Edit configuration** in the Preview dropdown to open it in your code editor. The file supports JSON with comments.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"version": "0.0.1",
@@ -306,12 +300,6 @@
When `autoVerify` is enabled, Claude automatically verifies code changes after editing files. It takes screenshots, checks for errors, and confirms changes work before completing its response. Auto-verify is on by default. Disable it per-project by adding `"autoVerify": false` to `.claude/launch.json`, or toggle it from the **Preview** dropdown menu.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"version": "0.0.1",
"autoVerify": false,
@@ -374,12 +362,6 @@
This configuration runs a Next.js app using Yarn on port 3000:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"version": "0.0.1",
"configurations": [
@@ -393,12 +375,6 @@
}
For a monorepo with a frontend and an API server, define multiple configurations. The frontend uses `autoPort: true` so it picks a free port if 3000 is taken, while the API server requires port 8080 exactly:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"version": "0.0.1",
@@ -425,12 +401,6 @@
To run a Node.js script directly instead of using a package manager command, use the `program` field:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"version": "0.0.1",
"configurations": [
@@ -863,12 +833,6 @@
Remote sessions can create branches that don’t exist on your local machine. Click the branch name in the session toolbar to copy it, then fetch it locally:
-Report incorrect code
-
-Copy
-
-Ask AI
-
git fetch origin <branch-name>
git checkout <branch-name>
Show diff (262 lines)
--- a/discover-plugins.md
+++ b/discover-plugins.md
@@ -29,12 +29,6 @@
Official Anthropic marketplace
The official Anthropic marketplace (`claude-plugins-official`) is automatically available when you start Claude Code. Run `/plugin` and go to the **Discover** tab to browse what’s available, or view the catalog at [claude.com/plugins](<https://claude.com/plugins>). To install a plugin from the official marketplace, use `/plugin install <name>@claude-plugins-official`. For example, to install the GitHub integration:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/plugin install github@claude-plugins-official
@@ -139,12 +133,6 @@
From within Claude Code, run the `plugin marketplace add` command for the `anthropics/claude-code` marketplace:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace add anthropics/claude-code
This downloads the marketplace catalog and makes its plugins available to you.
@@ -174,12 +162,6 @@
For example, select **commit-commands** (a plugin that adds git workflow commands) and install it to your user scope.You can also install directly from the command line:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin install commit-commands@anthropics-claude-code
See [Configuration scopes](</docs/en/settings#configuration-scopes>) to learn more about scopes.
@@ -189,12 +171,6 @@
Use your new plugin
After installing, run `/reload-plugins` to activate the plugin. Plugin commands are namespaced by the plugin name, so **commit-commands** provides commands like `/commit-commands:commit`.Try it out by making a change to a file and running:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/commit-commands:commit
@@ -225,12 +201,6 @@
Add a GitHub repository that contains a `.claude-plugin/marketplace.json` file using the `owner/repo` format—where `owner` is the GitHub username or organization and `repo` is the repository name. For example, `anthropics/claude-code` refers to the `claude-code` repository owned by `anthropics`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace add anthropics/claude-code
###
@@ -241,32 +211,14 @@
Add any git repository by providing the full URL. This works with any Git host, including GitLab, Bitbucket, and self-hosted servers: Using HTTPS:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace add https://gitlab.com/company/plugins.git
Using SSH:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace add [[email protected]](</cdn-cgi/l/email-protection>):company/plugins.git
To add a specific branch or tag, append `#` followed by the ref:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace add https://gitlab.com/company/plugins.git#v1.0.0
###
@@ -277,22 +229,10 @@
Add a local directory that contains a `.claude-plugin/marketplace.json` file:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace add ./my-marketplace
You can also add a direct path to a `marketplace.json` file:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace add ./path/to/marketplace.json
###
@@ -303,12 +243,6 @@
Add a remote `marketplace.json` file via URL:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace add https://example.com/marketplace.json
URL-based marketplaces have some limitations compared to Git-based marketplaces. If you encounter “path not found” errors when installing plugins, see [Troubleshooting](</docs/en/plugin-marketplaces#plugins-with-relative-paths-fail-in-url-based-marketplaces>).
@@ -320,12 +254,6 @@
Install plugins
Once you’ve added marketplaces, you can install plugins directly (installs to user scope by default):
-
-Report incorrect code
-
-Copy
-
-Ask AI
/plugin install plugin-name@marketplace-name
@@ -347,41 +275,17 @@
Run `/plugin` and go to the **Installed** tab to view, enable, disable, or uninstall your plugins. Type to filter the list by plugin name or description. You can also manage plugins with direct commands. Disable a plugin without uninstalling:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin disable plugin-name@marketplace-name
Re-enable a disabled plugin:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin enable plugin-name@marketplace-name
Completely remove a plugin:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin uninstall plugin-name@marketplace-name
The `--scope` option lets you target a specific scope with CLI commands:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude plugin install formatter@your-org --scope project
claude plugin uninstall formatter@your-org --scope project
@@ -393,12 +297,6 @@
Apply plugin changes without restarting
When you install, enable, or disable plugins during a session, run `/reload-plugins` to pick up all changes without restarting:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/reload-plugins
@@ -433,31 +331,13 @@
You can also manage marketplaces with direct commands. List all configured marketplaces:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace list
Refresh plugin listings from a marketplace:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace update marketplace-name
Remove a marketplace:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/plugin marketplace remove marketplace-name
@@ -478,12 +358,6 @@
Official Anthropic marketplaces have auto-update enabled by default. Third-party and local development marketplaces have auto-update disabled by default. To disable all automatic updates entirely for both Claude Code and all plugins, set the `DISABLE_AUTOUPDATER` environment variable. See [Auto updates](</docs/en/setup#auto-updates>) for details. To keep plugin auto-updates enabled while disabling Claude Code auto-updates, set `FORCE_AUTOUPDATE_PLUGINS=true` along with `DISABLE_AUTOUPDATER`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export DISABLE_AUTOUPDATER=true
export FORCE_AUTOUPDATE_PLUGINS=true
@@ -496,12 +370,6 @@
Configure team marketplaces
Team admins can set up automatic marketplace installation for projects by adding marketplace configuration to `.claude/settings.json`. When team members trust the repository folder, Claude Code prompts them to install these marketplaces and plugins. Add `extraKnownMarketplaces` to your project’s `.claude/settings.json`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"extraKnownMarketplaces": {
--- a/env-vars.md
+++ b/env-vars.md
@@ -89,6 +89,7 @@
`CLAUDE_CODE_USE_VERTEX`| Use [Vertex](</docs/en/google-vertex-ai>)
`CLAUDE_CONFIG_DIR`| Customize where Claude Code stores its configuration and data files
`CLAUDE_ENV_FILE`| Path to a shell script that Claude Code sources before each Bash command. Use to persist virtualenv or conda activation across commands. Also populated dynamically by [SessionStart](</docs/en/hooks#persist-environment-variables>), [CwdChanged](</docs/en/hooks#cwdchanged>), and [FileChanged](</docs/en/hooks#filechanged>) hooks
+`CLAUDE_STREAM_IDLE_TIMEOUT_MS`| Timeout in milliseconds before the streaming idle watchdog closes a stalled connection. Default: `90000` (90 seconds). Increase this value if long-running tools or slow networks cause premature timeout errors
`DISABLE_AUTOUPDATER`| Set to `1` to disable automatic updates.
`DISABLE_COST_WARNINGS`| Set to `1` to disable cost warning messages
`DISABLE_ERROR_REPORTING`| Set to `1` to opt out of Sentry error reporting
@@ -99,7 +100,7 @@
`DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for Opus models
`DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for Sonnet models
`DISABLE_TELEMETRY`| Set to `1` to opt out of Statsig telemetry (note that Statsig events do not include user data like code, file paths, or bash commands)
-`ENABLE_CLAUDEAI_MCP_SERVERS`| Set to `false` to disable [claude.ai MCP servers](</docs/en/mcp#use-mcp-servers-from-claudeai>) in Claude Code. Enabled by default for logged-in users
+`ENABLE_CLAUDEAI_MCP_SERVERS`| Set to `false` to disable [claude.ai MCP servers](</docs/en/mcp#use-mcp-servers-from-claude-ai>) in Claude Code. Enabled by default for logged-in users
`ENABLE_TOOL_SEARCH`| Controls [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>). Unset: enabled by default, but disabled when `ANTHROPIC_BASE_URL` points to a non-first-party host. Values: `true` (always on including proxies), `auto` (enables at 10% context), `auto:N` (custom threshold, e.g., `auto:5` for 5%), `false` (disabled)
`FORCE_AUTOUPDATE_PLUGINS`| Set to `true` to force plugin auto-updates even when the main auto-updater is disabled via `DISABLE_AUTOUPDATER`
`HTTP_PROXY`| Specify HTTP proxy server for network connections
--- a/fast-mode.md
+++ b/fast-mode.md
@@ -118,12 +118,6 @@
By default, fast mode persists across sessions: if a user enables fast mode, it stays on in future sessions. Administrators on [Teams](<https://claude.com/pricing?utm_source=claude_code&utm_medium=docs&utm_content=fast_mode_teams#team-&-enterprise>) or [Enterprise](<https://anthropic.com/contact-sales?utm_source=claude_code&utm_medium=docs&utm_content=fast_mode_enterprise>) plans can prevent this by setting `fastModePerSessionOptIn` to `true` in [managed settings](</docs/en/settings#settings-files>) or [server-managed settings](</docs/en/server-managed-settings>). This causes each session to start with fast mode off, requiring users to explicitly enable it with `/fast`.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"fastModePerSessionOptIn": true
}
--- a/features-overview.md
+++ b/features-overview.md
@@ -154,7 +154,7 @@
Understand context costs
-Every feature you add consumes some of Claude’s context. Too much can fill up your context window, but it can also add noise that makes Claude less effective; skills may not trigger correctly, or Claude may lose track of your conventions. Understanding these trade-offs helps you build an effective setup.
+Every feature you add consumes some of Claude’s context. Too much can fill up your context window, but it can also add noise that makes Claude less effective; skills may not trigger correctly, or Claude may lose track of your conventions. Understanding these trade-offs helps you build an effective setup. For an interactive view of how these features combine in a running session, see [Explore the context window](</docs/en/context-window>).
###
@@ -168,7 +168,7 @@
---|---|---|---
**CLAUDE.md**| Session start| Full content| Every request
**Skills**| Session start + when used| Descriptions at start, full content when used| Low (descriptions every request)*
- **MCP servers**| Session start| All tool definitions and schemas| Every request
+ **MCP servers**| Session start| Tool names; full schemas on demand| Low until a tool is used
**Subagents**| When spawned| Fresh context with specified skills| Isolated from main session
**Hooks**| On trigger| Nothing (runs externally)| Zero, unless hook returns additional context
@@ -200,7 +200,7 @@
Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures only you trigger them.
-**When:** Session start.**What loads:** All tool definitions and JSON schemas from connected servers.**Context cost:** [Tool search](</docs/en/mcp#scale-with-mcp-tool-search>) (enabled by default) loads MCP tools up to 10% of context and defers the rest until needed.**Reliability note:** MCP connections can fail silently mid-session. If a server disconnects, its tools disappear without warning. Claude may try to use a tool that no longer exists. If you notice Claude failing to use an MCP tool it previously could access, check the connection with `/mcp`.
+**When:** Session start.**What loads:** Tool names from connected servers. Full JSON schemas stay deferred until Claude needs a specific tool.**Context cost:** [Tool search](</docs/en/mcp#scale-with-mcp-tool-search>) is on by default, so idle MCP tools consume minimal context.**Reliability note:** MCP connections can fail silently mid-session. If a server disconnects, its tools disappear without warning. Claude may try to use a tool that no longer exists. If you notice Claude failing to use an MCP tool it previously could access, check the connection with `/mcp`.
Run `/mcp` to see token costs per server. Disconnect servers you’re not actively using.
Show diff (132 lines)
--- a/github-actions.md
+++ b/github-actions.md
@@ -117,12 +117,6 @@
**Beta version:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- uses: anthropics/claude-code-action@beta
with:
mode: "tag"
@@ -134,12 +128,6 @@
**GA version (v1.0):**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- uses: anthropics/claude-code-action@v1
with:
prompt: "Review this PR for security issues"
@@ -164,12 +152,6 @@
Basic workflow
-
-Report incorrect code
-
-Copy
-
-Ask AI
name: Claude Code
on:
@@ -192,12 +174,6 @@
Using skills
-Report incorrect code
-
-Copy
-
-Ask AI
-
name: Code Review
on:
pull_request:
@@ -218,12 +194,6 @@
Custom automation with prompts
-Report incorrect code
-
-Copy
-
-Ask AI
-
name: Daily Report
on:
schedule:
@@ -246,12 +216,6 @@
In issue or PR comments:
-Report incorrect code
-
-Copy
-
-Ask AI
-
@claude implement this feature based on the issue description
@claude how should I implement user authentication for this endpoint?
@claude fix the TypeError in the user dashboard component
@@ -328,12 +292,6 @@
Configuration examples
The Claude Code Action v1 simplifies configuration with unified parameters:
-
-Report incorrect code
-
-Copy
-
-Ask AI
- uses: anthropics/claude-code-action@v1
with:
@@ -562,12 +520,6 @@
`APP_ID`| Your GitHub App ID (from app settings)
`APP_PRIVATE_KEY`| The private key you generated for your GitHub App
-Report incorrect code
-
-Copy
-
-Ask AI
-
name: Claude PR Action
permissions:
@@ -635,12 +587,6 @@
`APP_ID`| Your GitHub App ID (from app settings)
`APP_PRIVATE_KEY`| The private key you generated for your GitHub App
-Report incorrect code
-
-Copy
-
-Ask AI
-
name: Claude PR Action
permissions:
@@ -760,12 +706,6 @@
The `claude_args` parameter accepts any Claude Code CLI arguments:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude_args: "--max-turns 5 --model claude-sonnet-4-6 --mcp-config /path/to/config.json"
Common arguments:
Show diff (119 lines)
--- a/gitlab-ci-cd.md
+++ b/gitlab-ci-cd.md
@@ -64,12 +64,6 @@
* Go to **Settings** → **CI/CD** → **Variables**
* Add `ANTHROPIC_API_KEY` (masked, protected as needed)
2. **Add a Claude job to`.gitlab-ci.yml`**
-
-Report incorrect code
-
-Copy
-
-Ask AI
stages:
- ai
@@ -140,12 +134,6 @@
In an issue comment:
-Report incorrect code
-
-Copy
-
-Ask AI
-
@claude implement this feature based on the issue description
Claude analyzes the issue and codebase, writes changes in a branch, and opens an MR for review.
@@ -158,12 +146,6 @@
In an MR discussion:
-Report incorrect code
-
-Copy
-
-Ask AI
-
@claude suggest a concrete approach to cache the results of this API call
Claude proposes changes, adds code with appropriate caching, and updates the MR.
@@ -175,12 +157,6 @@
Fix bugs quickly
In an issue or MR comment:
-
-Report incorrect code
-
-Copy
-
-Ask AI
@claude fix the TypeError in the user dashboard component
@@ -232,12 +208,6 @@
* `AWS_REGION`
Add variables in Settings → CI/CD → Variables:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# For AWS Bedrock:
- AWS_ROLE_TO_ASSUME
@@ -281,12 +251,6 @@
Add variables in Settings → CI/CD → Variables:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# For Google Vertex AI:
- GCP_WORKLOAD_IDENTITY_PROVIDER
- GCP_SERVICE_ACCOUNT
@@ -307,12 +271,6 @@
Basic .gitlab-ci.yml (Claude API)
-
-Report incorrect code
-
-Copy
-
-Ask AI
stages:
- ai
@@ -355,12 +313,6 @@
* `AWS_ROLE_TO_ASSUME`: ARN of the IAM role for Bedrock access
* `AWS_REGION`: Bedrock region (for example, `us-west-2`)
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude-bedrock:
stage: ai
@@ -413,12 +365,6 @@
* `GCP_WORKLOAD_IDENTITY_PROVIDER`: Full provider resource name
* `GCP_SERVICE_ACCOUNT`: Service account email
* `CLOUD_ML_REGION`: Vertex region (for example, `us-east5`)
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude-vertex:
stage: ai
--- a/google-vertex-ai.md
+++ b/google-vertex-ai.md
@@ -38,12 +38,6 @@
Enable the Vertex AI API in your GCP project:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Set your project ID
gcloud config set project YOUR-PROJECT-ID
@@ -81,12 +75,6 @@
Set the following environment variables:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Enable Vertex AI integration
export CLAUDE_CODE_USE_VERTEX=1
export CLOUD_ML_REGION=global
@@ -117,12 +105,6 @@
Set these environment variables to specific Vertex AI model IDs:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'
export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-6'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5@20251001'
@@ -135,12 +117,6 @@
Small/fast model| `claude-haiku-4-5@20251001`
To customize models further:
-
-Report incorrect code
-
-Copy
-
-Ask AI
export ANTHROPIC_MODEL='claude-opus-4-6'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5@20251001'
Show diff (162 lines)
--- a/headless.md
+++ b/headless.md
@@ -3,12 +3,6 @@
The CLI was previously called “headless mode.” The `-p` flag and all CLI options work the same way.
To run Claude Code programmatically from the CLI, pass `-p` with your prompt and any [CLI options](</docs/en/cli-reference>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude -p "Find and fix the bug in auth.py" --allowedTools "Read,Edit,Bash"
@@ -28,12 +22,6 @@
This example asks Claude a question about your codebase and prints the response:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude -p "What does the auth module do?"
###
@@ -43,12 +31,6 @@
Start faster with bare mode
Add `--bare` to reduce startup time by skipping auto-discovery of hooks, skills, plugins, MCP servers, auto memory, and CLAUDE.md. Without it, `claude -p` loads the same [context](</docs/en/how-claude-code-works#the-context-window>) an interactive session would, including anything configured in the working directory or `~/.claude`. Bare mode is useful for CI and scripts where you need the same result on every machine. A hook in a teammate’s `~/.claude` or an MCP server in the project’s `.mcp.json` won’t run, because bare mode never reads them. Only flags you pass explicitly take effect. This example runs a one-off summarize task in bare mode and pre-approves the Read tool so the call completes without a permission prompt:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude --bare -p "Summarize this file" --allowedTools "Read"
@@ -88,33 +70,15 @@
This example returns a project summary as JSON with session metadata, with the text result in the `result` field:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude -p "Summarize this project" --output-format json
To get output conforming to a specific schema, use `--output-format json` with `--json-schema` and a [JSON Schema](<https://json-schema.org/>) definition. The response includes metadata about the request (session ID, usage, etc.) with the structured output in the `structured_output` field. This example extracts function names and returns them as an array of strings:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude -p "Extract the main function names from auth.py" \
--output-format json \
--json-schema '{"type":"object","properties":{"functions":{"type":"array","items":{"type":"string"}}},"required":["functions"]}'
Use a tool like [jq](<https://jqlang.github.io/jq/>) to parse the response and extract specific fields:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Extract the text result
claude -p "Summarize this project" --output-format json | jq -r '.result'
@@ -133,21 +97,9 @@
Use `--output-format stream-json` with `--verbose` and `--include-partial-messages` to receive tokens as they’re generated. Each line is a JSON object representing an event:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude -p "Explain recursion" --output-format stream-json --verbose --include-partial-messages
The following example uses [jq](<https://jqlang.github.io/jq/>) to filter for text deltas and display just the streaming text. The `-r` flag outputs raw strings (no quotes) and `-j` joins without newlines so tokens stream continuously:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude -p "Write a poem" --output-format stream-json --verbose --include-partial-messages | \
jq -rj 'select(.type == "stream_event" and .event.delta.type? == "text_delta") | .event.delta.text'
@@ -176,12 +128,6 @@
Use `--allowedTools` to let Claude use certain tools without prompting. This example runs a test suite and fixes failures, allowing Claude to execute Bash commands and read/edit files without asking for permission:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude -p "Run the test suite and fix any failures" \
--allowedTools "Bash,Read,Edit"
@@ -192,12 +138,6 @@
Create a commit
This example reviews staged changes and creates a commit with an appropriate message:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude -p "Look at my staged changes and create an appropriate commit" \
--allowedTools "Bash(git diff *),Bash(git log *),Bash(git status *),Bash(git commit *)"
@@ -214,12 +154,6 @@
Use `--append-system-prompt` to add instructions while keeping Claude Code’s default behavior. This example pipes a PR diff to Claude and instructs it to review for security vulnerabilities:
-Report incorrect code
-
-Copy
-
-Ask AI
-
gh pr diff "$1" | claude -p \
--append-system-prompt "You are a security engineer. Review for vulnerabilities." \
--output-format json
@@ -234,12 +168,6 @@
Use `--continue` to continue the most recent conversation, or `--resume` with a session ID to continue a specific conversation. This example runs a review, then sends follow-up prompts:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# First request
claude -p "Review this codebase for performance issues"
@@ -248,12 +176,6 @@
claude -p "Generate a summary of all issues found" --continue
If you’re running multiple conversations, capture the session ID to resume a specific one:
-
-Report incorrect code
-
-Copy
-
-Ask AI
session_id=$(claude -p "Start a review" --output-format json | jq -r '.session_id')
claude -p "Continue that review" --resume "$session_id"
Show diff (1218 lines)
--- a/hooks.md
+++ b/hooks.md
@@ -23,10 +23,11 @@
`Notification`| When Claude Code sends a notification
`SubagentStart`| When a subagent is spawned
`SubagentStop`| When a subagent finishes
+`TaskCreated`| When a task is being created via `TaskCreate`
+`TaskCompleted`| When a task is being marked as completed
`Stop`| When Claude finishes responding
`StopFailure`| When the turn ends due to an API error. Output and exit code are ignored
`TeammateIdle`| When an [agent team](</docs/en/agent-teams>) teammate is about to go idle
-`TaskCompleted`| When a task is being marked as completed
`InstructionsLoaded`| When a CLAUDE.md or `.claude/rules/*.md` file is loaded into context. Fires at session start and when files are lazily loaded during a session
`ConfigChange`| When a configuration file changes during a session
`CwdChanged`| When the working directory changes, for example when Claude executes a `cd` command. Useful for reactive environment management with tools like direnv
@@ -46,12 +47,6 @@
How a hook resolves
To see how these pieces fit together, consider this `PreToolUse` hook that blocks destructive shell commands. The hook runs `block-rm.sh` before every Bash tool call:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -71,12 +66,6 @@
The script reads the JSON input from stdin, extracts the command, and returns a `permissionDecision` of `"deny"` if it contains `rm -rf`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
# .claude/hooks/block-rm.sh
COMMAND=$(jq -r '.tool_input.command')
@@ -101,12 +90,6 @@
The `PreToolUse` event fires. Claude Code sends the tool input as JSON on stdin to the hook:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{ "tool_name": "Bash", "tool_input": { "command": "rm -rf /tmp/build" }, ... }
2
@@ -120,12 +103,6 @@
Hook handler runs
The script extracts `"rm -rf /tmp/build"` from the input and finds `rm -rf`, so it prints a decision to stdout:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hookSpecificOutput": {
@@ -204,15 +181,9 @@
`InstructionsLoaded`| load reason| `session_start`, `nested_traversal`, `path_glob_match`, `include`, `compact`
`Elicitation`| MCP server name| your configured MCP server names
`ElicitationResult`| MCP server name| same values as `Elicitation`
-`UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`| no matcher support| always fires on every occurrence
+`UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`| no matcher support| always fires on every occurrence
The matcher is a regex, so `Edit|Write` matches either tool and `Notebook.*` matches any tool starting with Notebook. The matcher runs against a field from the JSON input that Claude Code sends to your hook on stdin. For tool events, that field is `tool_name`. Each hook event section lists the full set of matcher values and the input schema for that event. This example runs a linting script only when Claude writes or edits a file:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -230,7 +201,7 @@
}
}
-`UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, and `CwdChanged` don’t support matchers and always fire on every occurrence. If you add a `matcher` field to these events, it is silently ignored.
+`UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, and `CwdChanged` don’t support matchers and always fire on every occurrence. If you add a `matcher` field to these events, it is silently ignored.
####
@@ -250,12 +221,6 @@
* `mcp__.*__write.*` matches any tool containing “write” from any server
This example logs all memory server operations and validates write operations from any MCP server:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -340,12 +305,6 @@
Claude Code sends the hook’s JSON input as the POST request body with `Content-Type: application/json`. The response body uses the same JSON output format as command hooks. Error handling differs from command hooks: non-2xx responses, connection failures, and timeouts all produce non-blocking errors that allow execution to continue. To block a tool call or deny a permission, return a 2xx response with a JSON body containing `decision: "block"` or a `hookSpecificOutput` with `permissionDecision: "deny"`. This example sends `PreToolUse` events to a local validation service, authenticating with a token from the `MY_TOKEN` environment variable:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"PreToolUse": [
@@ -400,12 +359,6 @@
This example uses `$CLAUDE_PROJECT_DIR` to run a style checker from the project’s `.claude/hooks/` directory after any `Write` or `Edit` tool call:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"PostToolUse": [
@@ -423,12 +376,6 @@
}
Define plugin hooks in `hooks/hooks.json` with an optional top-level `description` field. When a plugin is enabled, its hooks merge with your user and project hooks.This example runs a formatting script bundled with the plugin:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"description": "Automatic code formatting",
@@ -458,12 +405,6 @@
In addition to settings files and plugins, hooks can be defined directly in [skills](</docs/en/skills>) and [subagents](</docs/en/sub-agents>) using frontmatter. These hooks are scoped to the component’s lifecycle and only run when that component is active. All hook events are supported. For subagents, `Stop` hooks are automatically converted to `SubagentStop` since that is the event that fires when a subagent completes. Hooks use the same configuration format as settings-based hooks but are scoped to the component’s lifetime and cleaned up when it finishes. This skill defines a `PreToolUse` hook that runs a security validation script before each `Bash` command:
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: secure-operations
description: Perform operations with security checks
@@ -535,12 +476,6 @@
For example, a `PreToolUse` hook for a Bash command receives this on stdin:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/home/user/.claude/projects/.../transcript.jsonl",
@@ -562,12 +497,6 @@
Exit code output
The exit code from your hook command tells Claude Code whether the action should proceed, be blocked, or be ignored. **Exit 0** means success. Claude Code parses stdout for JSON output fields. JSON output is only processed on exit 0. For most events, stdout is only shown in verbose mode (`Ctrl+O`). The exceptions are `UserPromptSubmit` and `SessionStart`, where stdout is added as context that Claude can see and act on. **Exit 2** means a blocking error. Claude Code ignores stdout and any JSON in it. Instead, stderr text is fed back to Claude as an error message. The effect depends on the event: `PreToolUse` blocks the tool call, `UserPromptSubmit` rejects the prompt, and so on. See exit code 2 behavior for the full list. **Any other exit code** is a non-blocking error. stderr is shown in verbose mode (`Ctrl+O`) and execution continues. For example, a hook command script that blocks dangerous Bash commands:
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/bin/bash
# Reads JSON input from stdin, checks the command
@@ -596,6 +525,7 @@
`Stop`| Yes| Prevents Claude from stopping, continues the conversation
`SubagentStop`| Yes| Prevents the subagent from stopping
`TeammateIdle`| Yes| Prevents the teammate from going idle (teammate continues working)
+`TaskCreated`| Yes| Prevents the task from being created
`TaskCompleted`| Yes| Prevents the task from being marked as completed
`ConfigChange`| Yes| Blocks the configuration change from taking effect (except `policy_settings`)
`StopFailure`| No| Output and exit code are ignored
@@ -656,12 +586,6 @@
To stop Claude entirely regardless of event type:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{ "continue": false, "stopReason": "Build failed, fix errors before continuing" }
####
@@ -675,7 +599,7 @@
Events| Decision pattern| Key fields
---|---|---
UserPromptSubmit, PostToolUse, PostToolUseFailure, Stop, SubagentStop, ConfigChange| Top-level `decision`| `decision: "block"`, `reason`
-TeammateIdle, TaskCompleted| Exit code or `continue: false`| Exit code 2 blocks the action with stderr feedback. JSON `{"continue": false, "stopReason": "..."}` also stops the teammate entirely, matching `Stop` hook behavior
+TeammateIdle, TaskCreated, TaskCompleted| Exit code or `continue: false`| Exit code 2 blocks the action with stderr feedback. JSON `{"continue": false, "stopReason": "..."}` also stops the teammate entirely, matching `Stop` hook behavior
PreToolUse| `hookSpecificOutput`| `permissionDecision` (allow/deny/ask), `permissionDecisionReason`
PermissionRequest| `hookSpecificOutput`| `decision.behavior` (allow/deny)
WorktreeCreate| path return| Command hook prints path on stdout; HTTP hook returns `hookSpecificOutput.worktreePath`. Hook failure or missing path fails creation
@@ -693,24 +617,12 @@
Used by `UserPromptSubmit`, `PostToolUse`, `PostToolUseFailure`, `Stop`, `SubagentStop`, and `ConfigChange`. The only value is `"block"`. To allow the action to proceed, omit `decision` from your JSON, or exit 0 without any JSON at all:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"decision": "block",
"reason": "Test suite must pass before proceeding"
}
Uses `hookSpecificOutput` for richer control: allow, deny, or escalate to the user. You can also modify tool input before it runs or inject additional context for Claude. See PreToolUse decision control for the full set of options.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hookSpecificOutput": {
@@ -721,12 +633,6 @@
}
Uses `hookSpecificOutput` to allow or deny a permission request on behalf of the user. When allowing, you can also modify the tool’s input or apply permission rules so the user isn’t prompted again. See PermissionRequest decision control for the full set of options.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hookSpecificOutput": {
@@ -773,12 +679,6 @@
In addition to the common input fields, SessionStart hooks receive `source`, `model`, and optionally `agent_type`. The `source` field indicates how the session started: `"startup"` for new sessions, `"resume"` for resumed sessions, `"clear"` after `/clear`, or `"compact"` after compaction. The `model` field contains the model identifier. If you start Claude Code with `claude --agent <name>`, an `agent_type` field contains the agent name.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
@@ -800,12 +700,6 @@
---|---
`additionalContext`| String added to Claude’s context. Multiple hooks’ values are concatenated
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hookSpecificOutput": {
"hookEventName": "SessionStart",
@@ -820,12 +714,6 @@
Persist environment variables
SessionStart hooks have access to the `CLAUDE_ENV_FILE` environment variable, which provides a file path where you can persist environment variables for subsequent Bash commands. To set individual environment variables, write `export` statements to `CLAUDE_ENV_FILE`. Use append (`>>`) to preserve variables set by other hooks:
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/bin/bash
@@ -838,12 +726,6 @@
exit 0
To capture all environment changes from setup commands, compare the exported variables before and after:
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/bin/bash
@@ -889,12 +771,6 @@
`trigger_file_path`| Path to the file whose access triggered this load, for lazy loads
`parent_file_path`| Path to the parent instruction file that included this one, for `include` loads
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../transcript.jsonl",
@@ -929,12 +805,6 @@
In addition to the common input fields, UserPromptSubmit hooks receive the `prompt` field containing the text the user submitted.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
@@ -962,12 +832,6 @@
`decision`| `"block"` prevents the prompt from being processed and erases it from context. Omit to allow the prompt to proceed
`reason`| Shown to the user when `decision` is `"block"`. Not added to context
`additionalContext`| String added to Claude’s context
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"decision": "block",
@@ -1106,12 +970,6 @@
When a hook returns `"ask"`, the permission prompt displayed to the user includes a label identifying where the hook came from: for example, `[User]`, `[Project]`, `[Plugin]`, or `[Local]`. This helps users understand which configuration source is requesting confirmation.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
@@ -1141,12 +999,6 @@
PermissionRequest input
PermissionRequest hooks receive `tool_name` and `tool_input` fields like PreToolUse hooks, but without `tool_use_id`. An optional `permission_suggestions` array contains the “always allow” options the user would normally see in the permission dialog. The difference is when the hook fires: PermissionRequest hooks run when a permission dialog is about to be shown to the user, while PreToolUse hooks run before tool execution regardless of permission status.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"session_id": "abc123",
@@ -1185,12 +1037,6 @@
`message`| For `"deny"` only: tells Claude why the permission was denied
`interrupt`| For `"deny"` only: if `true`, stops Claude
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hookSpecificOutput": {
"hookEventName": "PermissionRequest",
@@ -1246,12 +1092,6 @@
PostToolUse input
`PostToolUse` hooks fire after a tool has already executed successfully. The input includes both `tool_input`, the arguments sent to the tool, and `tool_response`, the result it returned. The exact schema for both depends on the tool.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"session_id": "abc123",
@@ -1286,12 +1126,6 @@
`additionalContext`| Additional context for Claude to consider
`updatedMCPToolOutput`| For MCP tools only: replaces the tool’s output with the provided value
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"decision": "block",
"reason": "Explanation for decision",
@@ -1316,12 +1150,6 @@
PostToolUseFailure input
PostToolUseFailure hooks receive the same `tool_name` and `tool_input` fields as PostToolUse, along with error information as top-level fields:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"session_id": "abc123",
@@ -1356,12 +1184,6 @@
---|---
`additionalContext`| Additional context for Claude to consider alongside the error
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hookSpecificOutput": {
"hookEventName": "PostToolUseFailure",
@@ -1376,12 +1198,6 @@
Notification
Runs when Claude Code sends notifications. Matches on notification type: `permission_prompt`, `idle_prompt`, `auth_success`, `elicitation_dialog`. Omit the matcher to run hooks for all notification types. Use separate matchers to run different handlers depending on the notification type. This configuration triggers a permission-specific alert script when Claude needs permission approval and a different notification when Claude has been idle:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -1416,12 +1232,6 @@
In addition to the common input fields, Notification hooks receive `message` with the notification text, an optional `title`, and `notification_type` indicating which type fired.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
@@ -1454,12 +1264,6 @@
In addition to the common input fields, SubagentStart hooks receive `agent_id` with the unique identifier for the subagent and `agent_type` with the agent name (built-in agents like `"Bash"`, `"Explore"`, `"Plan"`, or custom agent names).
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
@@ -1475,12 +1279,6 @@
---|---
`additionalContext`| String added to the subagent’s context
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hookSpecificOutput": {
"hookEventName": "SubagentStart",
@@ -1503,12 +1301,6 @@
SubagentStop input
In addition to the common input fields, SubagentStop hooks receive `stop_hook_active`, `agent_id`, `agent_type`, `agent_transcript_path`, and `last_assistant_message`. The `agent_type` field is the value used for matcher filtering. The `transcript_path` is the main session’s transcript, while `agent_transcript_path` is the subagent’s own transcript stored in a nested `subagents/` folder. The `last_assistant_message` field contains the text content of the subagent’s final response, so hooks can access it without parsing the transcript file.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"session_id": "abc123",
@@ -1529,158 +1321,58 @@
-Stop
-
-Runs when the main Claude Code agent has finished responding. Does not run if the stoppage occurred due to a user interrupt. API errors fire StopFailure instead.
-
-####
-
-
-
-Stop input
-
-In addition to the common input fields, Stop hooks receive `stop_hook_active` and `last_assistant_message`. The `stop_hook_active` field is `true` when Claude Code is already continuing as a result of a stop hook. Check this value or process the transcript to prevent Claude Code from running indefinitely. The `last_assistant_message` field contains the text content of Claude’s final response, so hooks can access it without parsing the transcript file.
-
-Report incorrect code
-
-Copy
-
-Ask AI
-
- {
- "session_id": "abc123",
- "transcript_path": "~/.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
- "cwd": "/Users/...",
- "permission_mode": "default",
- "hook_event_name": "Stop",
- "stop_hook_active": true,
- "last_assistant_message": "I've completed the refactoring. Here's a summary..."
- }
-
-####
-
-
-
-Stop decision control
-
-`Stop` and `SubagentStop` hooks can control whether Claude continues. In addition to the JSON output fields available to all hooks, your hook script can return these event-specific fields:
-
-Field| Description
----|---
-`decision`| `"block"` prevents Claude from stopping. Omit to allow Claude to stop
-`reason`| Required when `decision` is `"block"`. Tells Claude why it should continue
-
-Report incorrect code
-
-Copy
-
-Ask AI
-
- {
- "decision": "block",
- "reason": "Must be provided when Claude is blocked from stopping"
- }
-
-###
-
-
-
-StopFailure
-
-Runs instead of Stop when the turn ends due to an API error. Output and exit code are ignored. Use this to log failures, send alerts, or take recovery actions when Claude cannot complete a response due to rate limits, authentication problems, or other API errors.
-
-####
-
-
-
-StopFailure input
-
-In addition to the common input fields, StopFailure hooks receive `error`, optional `error_details`, and optional `last_assistant_message`. The `error` field identifies the error type and is used for matcher filtering.
-
-Field| Description
----|---
-`error`| Error type: `rate_limit`, `authentication_failed`, `billing_error`, `invalid_request`, `server_error`, `max_output_tokens`, or `unknown`
-`error_details`| Additional details about the error, when available
-`last_assistant_message`| The rendered error text shown in the conversation. Unlike `Stop` and `SubagentStop`, where this field holds Claude’s conversational output, for `StopFailure` it contains the API error string itself, such as `"API Error: Rate limit reached"`
-
-Report incorrect code
-
-Copy
-
-Ask AI
-
- {
- "session_id": "abc123",
- "transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
- "cwd": "/Users/...",
- "hook_event_name": "StopFailure",
- "error": "rate_limit",
- "error_details": "429 Too Many Requests",
- "last_assistant_message": "API Error: Rate limit reached"
- }
-
-StopFailure hooks have no decision control. They run for notification and logging purposes only.
-
-###
-
-
-
-TeammateIdle
-
-Runs when an [agent team](</docs/en/agent-teams>) teammate is about to go idle after finishing its turn. Use this to enforce quality gates before a teammate stops working, such as requiring passing lint checks or verifying that output files exist. When a `TeammateIdle` hook exits with code 2, the teammate receives the stderr message as feedback and continues working instead of going idle. To stop the teammate entirely instead of re-running it, return JSON with `{"continue": false, "stopReason": "..."}`. TeammateIdle hooks do not support matchers and fire on every occurrence.
-
-####
-
-
-
-TeammateIdle input
-
-In addition to the common input fields, TeammateIdle hooks receive `teammate_name` and `team_name`.
-
-Report incorrect code
-
-Copy
-
-Ask AI
+TaskCreated
+
+Runs when a task is being created via the `TaskCreate` tool. Use this to enforce naming conventions, require task descriptions, or prevent certain tasks from being created. When a `TaskCreated` hook exits with code 2, the task is not created and the stderr message is fed back to the model as feedback. To stop the teammate entirely instead of re-running it, return JSON with `{"continue": false, "stopReason": "..."}`. TaskCreated hooks do not support matchers and fire on every occurrence.
+
+####
+
+
+
+TaskCreated input
+
+In addition to the common input fields, TaskCreated hooks receive `task_id`, `task_subject`, and optionally `task_description`, `teammate_name`, and `team_name`.
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
"cwd": "/Users/...",
"permission_mode": "default",
- "hook_event_name": "TeammateIdle",
- "teammate_name": "researcher",
+ "hook_event_name": "TaskCreated",
+ "task_id": "task-001",
+ "task_subject": "Implement user authentication",
+ "task_description": "Add login and signup endpoints",
+ "teammate_name": "implementer",
"team_name": "my-project"
}
Field| Description
---|---
-`teammate_name`| Name of the teammate that is about to go idle
-`team_name`| Name of the team
-
-####
-
-
-
-TeammateIdle decision control
-
-TeammateIdle hooks support two ways to control teammate behavior:
-
- * **Exit code 2** : the teammate receives the stderr message as feedback and continues working instead of going idle.
+`task_id`| Identifier of the task being created
+`task_subject`| Title of the task
+`task_description`| Detailed description of the task. May be absent
+`teammate_name`| Name of the teammate creating the task. May be absent
+`team_name`| Name of the team. May be absent
+
+####
+
+
+
+TaskCreated decision control
+
+TaskCreated hooks support two ways to control task creation:
+
+ * **Exit code 2** : the task is not created and the stderr message is fed back to the model as feedback.
* **JSON`{"continue": false, "stopReason": "..."}`**: stops the teammate entirely, matching `Stop` hook behavior. The `stopReason` is shown to the user.
-This example checks that a build artifact exists before allowing a teammate to go idle:
-
-Report incorrect code
-
-Copy
-
-Ask AI
+This example blocks tasks whose subjects don’t follow the required format:
#!/bin/bash
-
- if [ ! -f "./dist/output.js" ]; then
- echo "Build artifact missing. Run the build before stopping." >&2
+ INPUT=$(cat)
+ TASK_SUBJECT=$(echo "$INPUT" | jq -r '.task_subject')
+
+ if [[ ! "$TASK_SUBJECT" =~ ^\[TICKET-[0-9]+\] ]]; then
+ echo "Task subject must start with a ticket number, e.g. '[TICKET-123] Add feature'" >&2
exit 2
fi
@@ -1701,12 +1393,6 @@
TaskCompleted input
In addition to the common input fields, TaskCompleted hooks receive `task_id`, `task_subject`, and optionally `task_description`, `teammate_name`, and `team_name`.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"session_id": "abc123",
@@ -1742,12 +1428,6 @@
This example runs tests and blocks task completion if they fail:
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
INPUT=$(cat)
TASK_SUBJECT=$(echo "$INPUT" | jq -r '.task_subject')
@@ -1764,6 +1444,137 @@
+Stop
+
+Runs when the main Claude Code agent has finished responding. Does not run if the stoppage occurred due to a user interrupt. API errors fire StopFailure instead.
+
+####
+
+
+
+Stop input
+
+In addition to the common input fields, Stop hooks receive `stop_hook_active` and `last_assistant_message`. The `stop_hook_active` field is `true` when Claude Code is already continuing as a result of a stop hook. Check this value or process the transcript to prevent Claude Code from running indefinitely. The `last_assistant_message` field contains the text content of Claude’s final response, so hooks can access it without parsing the transcript file.
+
+ {
+ "session_id": "abc123",
+ "transcript_path": "~/.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
+ "cwd": "/Users/...",
+ "permission_mode": "default",
+ "hook_event_name": "Stop",
+ "stop_hook_active": true,
+ "last_assistant_message": "I've completed the refactoring. Here's a summary..."
+ }
+
+####
+
+
+
+Stop decision control
+
+`Stop` and `SubagentStop` hooks can control whether Claude continues. In addition to the JSON output fields available to all hooks, your hook script can return these event-specific fields:
+
+Field| Description
+---|---
+`decision`| `"block"` prevents Claude from stopping. Omit to allow Claude to stop
+`reason`| Required when `decision` is `"block"`. Tells Claude why it should continue
+
+ {
+ "decision": "block",
+ "reason": "Must be provided when Claude is blocked from stopping"
+ }
+
+###
+
+
+
+StopFailure
+
+Runs instead of Stop when the turn ends due to an API error. Output and exit code are ignored. Use this to log failures, send alerts, or take recovery actions when Claude cannot complete a response due to rate limits, authentication problems, or other API errors.
+
+####
+
+
+
+StopFailure input
+
+In addition to the common input fields, StopFailure hooks receive `error`, optional `error_details`, and optional `last_assistant_message`. The `error` field identifies the error type and is used for matcher filtering.
+
+Field| Description
+---|---
+`error`| Error type: `rate_limit`, `authentication_failed`, `billing_error`, `invalid_request`, `server_error`, `max_output_tokens`, or `unknown`
+`error_details`| Additional details about the error, when available
+`last_assistant_message`| The rendered error text shown in the conversation. Unlike `Stop` and `SubagentStop`, where this field holds Claude’s conversational output, for `StopFailure` it contains the API error string itself, such as `"API Error: Rate limit reached"`
+
+ {
+ "session_id": "abc123",
+ "transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
+ "cwd": "/Users/...",
+ "hook_event_name": "StopFailure",
+ "error": "rate_limit",
+ "error_details": "429 Too Many Requests",
+ "last_assistant_message": "API Error: Rate limit reached"
+ }
+
+StopFailure hooks have no decision control. They run for notification and logging purposes only.
+
+###
+
+
+
+TeammateIdle
+
+Runs when an [agent team](</docs/en/agent-teams>) teammate is about to go idle after finishing its turn. Use this to enforce quality gates before a teammate stops working, such as requiring passing lint checks or verifying that output files exist. When a `TeammateIdle` hook exits with code 2, the teammate receives the stderr message as feedback and continues working instead of going idle. To stop the teammate entirely instead of re-running it, return JSON with `{"continue": false, "stopReason": "..."}`. TeammateIdle hooks do not support matchers and fire on every occurrence.
+
+####
+
+
+
+TeammateIdle input
+
+In addition to the common input fields, TeammateIdle hooks receive `teammate_name` and `team_name`.
+
+ {
+ "session_id": "abc123",
+ "transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
+ "cwd": "/Users/...",
+ "permission_mode": "default",
+ "hook_event_name": "TeammateIdle",
+ "teammate_name": "researcher",
+ "team_name": "my-project"
+ }
+
+Field| Description
+---|---
+`teammate_name`| Name of the teammate that is about to go idle
+`team_name`| Name of the team
+
+####
+
+
+
+TeammateIdle decision control
+
+TeammateIdle hooks support two ways to control teammate behavior:
+
+ * **Exit code 2** : the teammate receives the stderr message as feedback and continues working instead of going idle.
+ * **JSON`{"continue": false, "stopReason": "..."}`**: stops the teammate entirely, matching `Stop` hook behavior. The `stopReason` is shown to the user.
+
+This example checks that a build artifact exists before allowing a teammate to go idle:
+
+ #!/bin/bash
+
+ if [ ! -f "./dist/output.js" ]; then
+ echo "Build artifact missing. Run the build before stopping." >&2
+ exit 2
+ fi
+
+ exit 0
+
+###
+
+
+
ConfigChange
Runs when a configuration file changes during a session. Use this to audit settings changes, enforce security policies, or block unauthorized modifications to configuration files. ConfigChange hooks fire for changes to settings files, managed policy settings, and skill files. The `source` field in the input tells you which type of configuration changed, and the optional `file_path` field provides the path to the changed file. The matcher filters on the configuration source:
@@ -1777,12 +1588,6 @@
`skills`| A skill file in `.claude/skills/` changes
This example logs all configuration changes for security auditing:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -1807,12 +1612,6 @@
In addition to the common input fields, ConfigChange hooks receive `source` and optionally `file_path`. The `source` field indicates which configuration type changed, and `file_path` provides the path to the specific file that was modified.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
@@ -1835,12 +1634,6 @@
`decision`| `"block"` prevents the configuration change from being applied. Omit to allow the change
`reason`| Explanation shown to the user when `decision` is `"block"`
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"decision": "block",
"reason": "Configuration changes to project settings require admin approval"
@@ -1863,12 +1656,6 @@
CwdChanged input
In addition to the common input fields, CwdChanged hooks receive `old_cwd` and `new_cwd`.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"session_id": "abc123",
@@ -1914,12 +1701,6 @@
`file_path`| Absolute path to the file that changed
`event`| What happened: `"change"` (file modified), `"add"` (file created), or `"unlink"` (file deleted)
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../transcript.jsonl",
@@ -1950,12 +1731,6 @@
WorktreeCreate
When you run `claude --worktree` or a [subagent uses `isolation: "worktree"`](</docs/en/sub-agents#choose-the-subagent-scope>), Claude Code creates an isolated working copy using `git worktree`. If you configure a WorktreeCreate hook, it replaces the default git behavior, letting you use a different version control system like SVN, Perforce, or Mercurial. The hook must return the absolute path to the created worktree directory. Claude Code uses this path as the working directory for the isolated session. Command hooks print it on stdout; HTTP hooks return it via `hookSpecificOutput.worktreePath`. This example creates an SVN working copy and prints the path for Claude Code to use. Replace the repository URL with your own:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -1982,12 +1757,6 @@
In addition to the common input fields, WorktreeCreate hooks receive the `name` field. This is a slug identifier for the new worktree, either specified by the user or auto-generated (for example, `bold-oak-a3f2`).
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
@@ -2016,12 +1785,6 @@
WorktreeRemove
The cleanup counterpart to WorktreeCreate. This hook fires when a worktree is being removed, either when you exit a `--worktree` session and choose to remove it, or when a subagent with `isolation: "worktree"` finishes. For git-based worktrees, Claude handles cleanup automatically with `git worktree remove`. If you configured a WorktreeCreate hook for a non-git version control system, pair it with a WorktreeRemove hook to handle cleanup. Without one, the worktree directory is left on disk. Claude Code passes the path returned by WorktreeCreate as `worktree_path` in the hook input. This example reads that path and removes the directory:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -2046,12 +1809,6 @@
In addition to the common input fields, WorktreeRemove hooks receive the `worktree_path` field, which is the absolute path to the worktree being removed.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
@@ -2082,12 +1839,6 @@
PreCompact input
In addition to the common input fields, PreCompact hooks receive `trigger` and `custom_instructions`. For `manual`, `custom_instructions` contains what the user passes into `/compact`. For `auto`, `custom_instructions` is empty.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"session_id": "abc123",
@@ -2118,12 +1869,6 @@
PostCompact input
In addition to the common input fields, PostCompact hooks receive `trigger` and `compact_summary`. The `compact_summary` field contains the conversation summary generated by the compact operation.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"session_id": "abc123",
@@ -2161,12 +1906,6 @@
In addition to the common input fields, SessionEnd hooks receive a `reason` field indicating why the session ended. See the reason table above for all values.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
@@ -2177,12 +1916,6 @@
SessionEnd hooks have no decision control. They cannot block session termination but can perform cleanup tasks. SessionEnd hooks have a default timeout of 1.5 seconds. This applies to session exit, `/clear`, and switching sessions via interactive `/resume`. If your hooks need more time, set the `CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS` environment variable to a higher value in milliseconds. Any per-hook `timeout` setting is also capped by this value.
-Report incorrect code
-
-Copy
-
-Ask AI
-
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS=5000 claude
###
@@ -2200,12 +1933,6 @@
Elicitation input
In addition to the common input fields, Elicitation hooks receive `mcp_server_name`, `message`, and optional `mode`, `url`, `elicitation_id`, and `requested_schema` fields. For form-mode elicitation (the most common case):
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"session_id": "abc123",
@@ -2226,12 +1953,6 @@
For URL-mode elicitation (browser-based authentication):
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123",
"transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
@@ -2252,12 +1973,6 @@
To respond programmatically without showing the dialog, return a JSON object with `hookSpecificOutput`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hookSpecificOutput": {
"hookEventName": "Elicitation",
@@ -2290,12 +2005,6 @@
ElicitationResult input
In addition to the common input fields, ElicitationResult hooks receive `mcp_server_name`, `action`, and optional `mode`, `elicitation_id`, and `content` fields.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"session_id": "abc123",
@@ -2318,12 +2027,6 @@
To override the user’s response, return a JSON object with `hookSpecificOutput`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hookSpecificOutput": {
"hookEventName": "ElicitationResult",
@@ -2354,6 +2057,7 @@
* `Stop`
* `SubagentStop`
* `TaskCompleted`
+ * `TaskCreated`
* `UserPromptSubmit`
Events that support `command` and `http` hooks but not `prompt` or `agent`:
@@ -2396,12 +2100,6 @@
Set `type` to `"prompt"` and provide a `prompt` string instead of a `command`. Use the `$ARGUMENTS` placeholder to inject the hook’s JSON input data into your prompt text. Claude Code sends the combined prompt and input to a fast Claude model, which returns a JSON decision. This `Stop` hook asks the LLM to evaluate whether all tasks are complete before allowing Claude to finish:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"Stop": [
@@ -2432,12 +2130,6 @@
The LLM must respond with JSON containing:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"ok": true | false,
"reason": "Explanation for the decision"
@@ -2455,12 +2147,6 @@
Example: Multi-criteria Stop hook
This `Stop` hook uses a detailed prompt to check three conditions before allowing Claude to stop. If `"ok"` is `false`, Claude continues working with the provided reason as its next instruction. `SubagentStop` hooks use the same format to evaluate whether a [subagent](</docs/en/sub-agents>) should stop:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -2518,12 +2204,6 @@
The response schema is the same as prompt hooks: `{ "ok": true }` to allow or `{ "ok": false, "reason": "..." }` to block. This `Stop` hook verifies that all unit tests pass before allowing Claude to finish:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"Stop": [
@@ -2555,12 +2235,6 @@
Configure an async hook
Add `"async": true` to a command hook’s configuration to run it in the background without blocking Claude. This field is only available on `type: "command"` hooks. This hook runs a test script after every `Write` tool call. Claude continues working immediately while `run-tests.sh` executes for up to 120 seconds. When the script finishes, its output is delivered on the next conversation turn:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -2598,12 +2272,6 @@
This hook starts a test suite in the background whenever Claude writes a file, then reports the results back to Claude when the tests finish. Save this script to `.claude/hooks/run-tests-async.sh` in your project and make it executable with `chmod +x`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
# run-tests-async.sh
@@ -2627,12 +2295,6 @@
fi
Then add this configuration to `.claude/settings.json` in your project root. The `async: true` flag lets Claude keep working while tests run:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -2703,12 +2365,6 @@
On Windows, you can run individual hooks in PowerShell by setting `"shell": "powershell"` on a command hook. Hooks spawn PowerShell directly, so this works regardless of whether `CLAUDE_CODE_USE_POWERSHELL_TOOL` is set. Claude Code auto-detects `pwsh.exe` (PowerShell 7+) with a fallback to `powershell.exe` (5.1).
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"PostToolUse": [
@@ -2734,12 +2390,6 @@
Run `claude --debug` to see hook execution details, including which hooks matched, their exit codes, and output. Toggle verbose mode with `Ctrl+O` to see hook progress in the transcript.
-Report incorrect code
-
-Copy
-
-Ask AI
-
[DEBUG] Executing hooks for PostToolUse:Write
[DEBUG] Getting matching hook commands for PostToolUse with query: Write
[DEBUG] Found 1 hook matchers in settings
Show diff (385 lines)
--- a/hooks-guide.md
+++ b/hooks-guide.md
@@ -15,12 +15,6 @@
Add the hook to your settings
Open `~/.claude/settings.json` and add a `Notification` hook. The example below uses `osascript` for macOS; see Get notified when Claude needs input for Linux and Windows commands.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -84,12 +78,6 @@
* Windows (PowerShell)
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"Notification": [
@@ -106,12 +94,6 @@
}
}
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"Notification": [
@@ -128,12 +110,6 @@
}
}
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"Notification": [
@@ -158,12 +134,6 @@
Automatically run [Prettier](<https://prettier.io/>) on every file Claude edits, so formatting stays consistent without manual intervention. This hook uses the `PostToolUse` event with an `Edit|Write` matcher, so it runs only after file-editing tools. The command extracts the edited file path with [`jq`](<https://jqlang.github.io/jq/>) and passes it to Prettier. Add this to `.claude/settings.json` in your project root:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"PostToolUse": [
@@ -195,12 +165,6 @@
Create the hook script
Save this to `.claude/hooks/protect-files.sh`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/bin/bash
# protect-files.sh
@@ -225,12 +189,6 @@
Hook scripts must be executable for Claude Code to run them:
-Report incorrect code
-
-Copy
-
-Ask AI
-
chmod +x .claude/hooks/protect-files.sh
3
@@ -239,12 +197,6 @@
Add a `PreToolUse` hook to `.claude/settings.json` that runs the script before any `Edit` or `Write` tool call:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"PreToolUse": [
@@ -269,12 +221,6 @@
When Claude’s context window fills up, compaction summarizes the conversation to free space. This can lose important details. Use a `SessionStart` hook with a `compact` matcher to re-inject critical context after every compaction. Any text your command writes to stdout is added to Claude’s context. This example reminds Claude of project conventions and recent work. Add this to `.claude/settings.json` in your project root:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"SessionStart": [
@@ -301,12 +247,6 @@
Track when settings or skills files change during a session. The `ConfigChange` event fires when an external process or editor modifies a configuration file, so you can log changes for compliance or block unauthorized modifications. This example appends each change to an audit log. Add this to `~/.claude/settings.json`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"ConfigChange": [
@@ -333,12 +273,6 @@
Some projects set different environment variables depending on which directory you are in. Tools like [direnv](<https://direnv.net/>) do this automatically in your shell, but Claude’s Bash tool does not pick up those changes on its own. A `CwdChanged` hook fixes this: it runs each time Claude changes directory, so you can reload the correct variables for the new location. The hook writes the updated values to `CLAUDE_ENV_FILE`, which Claude Code applies before each Bash command. Add this to `~/.claude/settings.json`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"CwdChanged": [
@@ -356,12 +290,6 @@
To react to specific files instead of every directory change, use `FileChanged` with a `matcher` listing the filenames to watch (pipe-separated). The `matcher` both configures which files to watch and filters which hooks run. This example watches `.envrc` and `.env` for changes in the current directory:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"FileChanged": [
@@ -388,12 +316,6 @@
Skip the approval dialog for tool calls you always allow. This example auto-approves `ExitPlanMode`, the tool Claude calls when it finishes presenting a plan and asks to proceed, so you aren’t prompted every time a plan is ready. Unlike the exit-code examples above, auto-approval requires your hook to write a JSON decision to stdout. A `PermissionRequest` hook fires when Claude Code is about to show a permission dialog, and returning `"behavior": "allow"` answers it on your behalf. The matcher scopes the hook to `ExitPlanMode` only, so no other prompts are affected. Add this to `~/.claude/settings.json`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"PermissionRequest": [
@@ -411,12 +333,6 @@
}
When the hook approves, Claude Code exits plan mode and restores whatever permission mode was active before you entered plan mode. The transcript shows “Allowed by PermissionRequest hook” where the dialog would have appeared. The hook path always keeps the current conversation: it cannot clear context and start a fresh implementation session the way the dialog can. To set a specific permission mode instead, your hook’s output can include an `updatedPermissions` array with a `setMode` entry. The `mode` value is any permission mode like `default`, `acceptEdits`, or `bypassPermissions`, and `destination: "session"` applies it for the current session only. To switch the session to `acceptEdits`, your hook writes this JSON to stdout:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hookSpecificOutput": {
@@ -451,10 +367,11 @@
`Notification`| When Claude Code sends a notification
`SubagentStart`| When a subagent is spawned
`SubagentStop`| When a subagent finishes
+`TaskCreated`| When a task is being created via `TaskCreate`
+`TaskCompleted`| When a task is being marked as completed
`Stop`| When Claude finishes responding
`StopFailure`| When the turn ends due to an API error. Output and exit code are ignored
`TeammateIdle`| When an [agent team](</docs/en/agent-teams>) teammate is about to go idle
-`TaskCompleted`| When a task is being marked as completed
`InstructionsLoaded`| When a CLAUDE.md or `.claude/rules/*.md` file is loaded into context. Fires at session start and when files are lazily loaded during a session
`ConfigChange`| When a configuration file changes during a session
`CwdChanged`| When the working directory changes, for example when Claude executes a `cd` command. Useful for reactive environment management with tools like direnv
@@ -489,12 +406,6 @@
Every event includes common fields like `session_id` and `cwd`, but each event type adds different data. For example, when Claude runs a Bash command, a `PreToolUse` hook receives something like this on stdin:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"session_id": "abc123", // unique ID for this session
"cwd": "/Users/sarah/myproject", // working directory when the event fired
@@ -515,12 +426,6 @@
Your script tells Claude Code what to do next by writing to stdout or stderr and exiting with a specific code. For example, a `PreToolUse` hook that wants to block a command:
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
INPUT=$(cat)
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command')
@@ -550,12 +455,6 @@
For example, a `PreToolUse` hook can deny a tool call and tell Claude why, or escalate it to the user for approval:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
@@ -579,12 +478,6 @@
Filter hooks with matchers
Without a matcher, a hook fires on every occurrence of its event. Matchers let you narrow that down. For example, if you want to run a formatter only after file edits (not after every tool call), add a matcher to your `PostToolUse` hook:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -616,7 +509,7 @@
`Elicitation`| MCP server name| your configured MCP server names
`ElicitationResult`| MCP server name| same values as `Elicitation`
`FileChanged`| filename (basename of the changed file)| `.envrc`, `.env`, any filename you want to watch
-`UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, `CwdChanged`| no matcher support| always fires on every occurrence
+`UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, `CwdChanged`| no matcher support| always fires on every occurrence
A few more examples showing matchers on different event types:
@@ -628,12 +521,6 @@
Match only `Bash` tool calls and log each command to a file. The `PostToolUse` event fires after the command completes, so `tool_input.command` contains what ran. The hook receives the event data as JSON on stdin, and `jq -r '.tool_input.command'` extracts just the command string, which `>>` appends to the log file:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"PostToolUse": [
@@ -652,12 +539,6 @@
MCP tools use a different naming convention than built-in tools: `mcp__<server>__<tool>`, where `<server>` is the MCP server name and `<tool>` is the tool it provides. For example, `mcp__github__search_repositories` or `mcp__filesystem__read_file`. Use a regex matcher to target all tools from a specific server, or match across servers with a pattern like `mcp__.*__write.*`. See [Match MCP tools](</docs/en/hooks#match-mcp-tools>) in the reference for the full list of examples.The command below extracts the tool name from the hook’s JSON input with `jq` and writes it to stderr, where it shows up in verbose mode (`Ctrl+O`):
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"PreToolUse": [
@@ -675,12 +556,6 @@
}
The `SessionEnd` event supports matchers on the reason the session ended. This hook only fires on `clear` (when you run `/clear`), not on normal exits:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -732,12 +607,6 @@
This example uses a `Stop` hook to ask the model whether all requested tasks are complete. If the model returns `"ok": false`, Claude keeps working and uses the `reason` as its next instruction:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"Stop": [
@@ -762,12 +631,6 @@
Agent-based hooks
When verification requires inspecting files or running commands, use `type: "agent"` hooks. Unlike prompt hooks which make a single LLM call, agent hooks spawn a subagent that can read files, search code, and use other tools to verify conditions before returning a decision. Agent hooks use the same `"ok"` / `"reason"` response format as prompt hooks, but with a longer default timeout of 60 seconds and up to 50 tool-use turns. This example verifies that tests pass before allowing Claude to stop:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -794,12 +657,6 @@
HTTP hooks
Use `type: "http"` hooks to POST event data to an HTTP endpoint instead of running a shell command. The endpoint receives the same JSON that a command hook would receive on stdin, and returns results through the HTTP response body using the same JSON format. HTTP hooks are useful when you want a web server, cloud function, or external service to handle hook logic: for example, a shared audit service that logs tool use events across a team. This example posts every tool use to a local logging service:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -863,12 +720,6 @@
* Your script exited with a non-zero code unexpectedly. Test it manually by piping sample JSON:
-Report incorrect code
-
-Copy
-
-Ask AI
-
echo '{"tool_name":"Bash","tool_input":{"command":"ls"}}' | ./my-hook.sh
echo $? # Check the exit code
@@ -895,12 +746,6 @@
Stop hook runs forever
Claude keeps working in an infinite loop instead of stopping. Your Stop hook script needs to check whether it already triggered a continuation. Parse the `stop_hook_active` field from the JSON input and exit early if it’s `true`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/bin/bash
INPUT=$(cat)
@@ -917,22 +762,10 @@
Claude Code shows a JSON parsing error even though your hook script outputs valid JSON. When Claude Code runs a hook, it spawns a shell that sources your profile (`~/.zshrc` or `~/.bashrc`). If your profile contains unconditional `echo` statements, that output gets prepended to your hook’s JSON:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Shell ready on arm64
{"decision": "block", "reason": "Not allowed"}
Claude Code tries to parse this as JSON and fails. To fix this, wrap echo statements in your shell profile so they only run in interactive shells:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# In ~/.zshrc or ~/.bashrc
if [[ $- == *i* ]]; then
Show diff (117 lines)
--- a/how-claude-code-works.md
+++ b/how-claude-code-works.md
@@ -55,7 +55,7 @@
* **Your terminal.** Any command you could run: build tools, git, package managers, system utilities, scripts. If you can do it from the command line, Claude can too.
* **Your git state.** Current branch, uncommitted changes, and recent commit history.
* **Your[CLAUDE.md](</docs/en/memory>).** A markdown file where you store project-specific instructions, conventions, and context that Claude should know every session.
- * **[Auto memory](</docs/en/memory#auto-memory>).** Learnings Claude saves automatically as you work, like project patterns and your preferences. The first 200 lines of MEMORY.md are loaded at the start of each session.
+ * **[Auto memory](</docs/en/memory#auto-memory>).** Learnings Claude saves automatically as you work, like project patterns and your preferences. The first 200 lines or 25KB of MEMORY.md, whichever comes first, load at the start of each session.
* **Extensions you configure.** [MCP servers](</docs/en/mcp>) for external services, [skills](</docs/en/skills>) for workflows, [subagents](</docs/en/sub-agents>) for delegated work, and [Claude in Chrome](</docs/en/chrome>) for browser interaction.
Because Claude sees your whole project, it can work across it. When you ask Claude to “fix the authentication bug,” it searches for relevant files, reads multiple files to understand context, makes coordinated edits across them, runs tests to verify the fix, and commits the changes if you ask. This is different from inline code assistants that only see the current file.
@@ -114,12 +114,6 @@
When you resume a session with `claude --continue` or `claude --resume`, you pick up where you left off using the same session ID. New messages append to the existing conversation. Your full conversation history is restored, but session-scoped permissions are not. You’ll need to re-approve those. To branch off and try a different approach without affecting the original session, use the `--fork-session` flag:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --continue --fork-session
This creates a new session ID while preserving the conversation history up to that point. The original session remains unchanged. Like resume, forked sessions don’t inherit session-scoped permissions. **Same session in multiple terminals** : If you resume the same session in multiple terminals, both terminals write to the same session file. Messages from both get interleaved, like two people writing in the same notebook. Nothing corrupts, but the conversation becomes jumbled. Each terminal only sees its own messages during the session, but if you resume that session later, you’ll see everything interleaved. For parallel work from the same starting point, use `--fork-session` to give each terminal its own clean session.
@@ -130,7 +124,7 @@
The context window
-Claude’s context window holds your conversation history, file contents, command outputs, [CLAUDE.md](</docs/en/memory>), [auto memory](</docs/en/memory#auto-memory>), loaded skills, and system instructions. As you work, context fills up. Claude compacts automatically, but instructions from early in the conversation can get lost. Put persistent rules in CLAUDE.md, and run `/context` to see what’s using space.
+Claude’s context window holds your conversation history, file contents, command outputs, [CLAUDE.md](</docs/en/memory>), [auto memory](</docs/en/memory#auto-memory>), loaded skills, and system instructions. As you work, context fills up. Claude compacts automatically, but instructions from early in the conversation can get lost. Put persistent rules in CLAUDE.md, and run `/context` to see what’s using space. For an interactive walkthrough of what loads and when, see [Explore the context window](</docs/en/context-window>).
####
@@ -138,7 +132,7 @@
When context fills up
-Claude Code manages context automatically as you approach the limit. It clears older tool outputs first, then summarizes the conversation if needed. Your requests and key code snippets are preserved; detailed instructions from early in the conversation may be lost. Put persistent rules in CLAUDE.md rather than relying on conversation history. To control what’s preserved during compaction, add a “Compact Instructions” section to CLAUDE.md or run `/compact` with a focus (like `/compact focus on the API changes`). Run `/context` to see what’s using space. MCP servers add tool definitions to every request, so a few servers can consume significant context before you start working. Run `/mcp` to check per-server costs.
+Claude Code manages context automatically as you approach the limit. It clears older tool outputs first, then summarizes the conversation if needed. Your requests and key code snippets are preserved; detailed instructions from early in the conversation may be lost. Put persistent rules in CLAUDE.md rather than relying on conversation history. To control what’s preserved during compaction, add a “Compact Instructions” section to CLAUDE.md or run `/compact` with a focus (like `/compact focus on the API changes`). Run `/context` to see what’s using space. MCP tool definitions are deferred by default and loaded on demand via [tool search](</docs/en/mcp#scale-with-mcp-tool-search>), so only tool names consume context until Claude uses a specific tool. Run `/mcp` to check per-server costs.
####
@@ -209,22 +203,10 @@
Claude Code is conversational. You don’t need perfect prompts. Start with what you want, then refine:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Fix the login bug
[Claude investigates, tries something]
-Report incorrect code
-
-Copy
-
-Ask AI
-
That's not quite right. The issue is in the session handling.
[Claude adjusts approach] When the first attempt isn’t right, you don’t start over. You iterate.
@@ -244,12 +226,6 @@
Be specific upfront
The more precise your initial prompt, the fewer corrections you’ll need. Reference specific files, mention constraints, and point to example patterns.
-
-Report incorrect code
-
-Copy
-
-Ask AI
The checkout flow is broken for users with expired cards.
Check src/payments/ for the issue, especially token refresh.
@@ -265,12 +241,6 @@
Claude performs better when it can check its own work. Include test cases, paste screenshots of expected UI, or define the output you want.
-Report incorrect code
-
-Copy
-
-Ask AI
-
Implement validateEmail. Test cases: '[[email protected]](</cdn-cgi/l/email-protection>)' → true,
'invalid' → false, '[[email protected]](</cdn-cgi/l/email-protection>)' → false. Run the tests after.
@@ -284,12 +254,6 @@
For complex problems, separate research from coding. Use plan mode (`Shift+Tab` twice) to analyze the codebase first:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Read src/auth/ and understand how we handle sessions.
Then create a plan for adding OAuth support.
@@ -303,12 +267,6 @@
Think of delegating to a capable colleague. Give context and direction, then trust Claude to figure out the details:
-Report incorrect code
-
-Copy
-
-Ask AI
-
The checkout flow is broken for users with expired cards.
The relevant code is in src/payments/. Can you investigate and fix it?
--- a/interactive-mode.md
+++ b/interactive-mode.md
@@ -47,7 +47,7 @@
Shortcut| Description| Context
---|---|---
`Ctrl+K`| Delete to end of line| Stores deleted text for pasting
-`Ctrl+U`| Delete entire line| Stores deleted text for pasting
+`Ctrl+U`| Delete from cursor to line start| Stores deleted text for pasting. Repeat to clear across lines in multiline input
`Ctrl+Y`| Paste deleted text| Paste text deleted with `Ctrl+K` or `Ctrl+U`
`Alt+Y` (after `Ctrl+Y`)| Cycle paste history| After pasting, cycle through previously deleted text. Requires Option as Meta on macOS
`Alt+B`| Move cursor back one word| Word navigation. Requires Option as Meta on macOS
@@ -291,12 +291,6 @@
Run bash commands directly without going through Claude by prefixing your input with `!`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
! npm test
! git status
! ls -la
@@ -325,12 +319,6 @@
The suggestion runs as a background request that reuses the parent conversation’s prompt cache, so the additional cost is minimal. Claude Code skips suggestion generation when the cache is cold to avoid unnecessary cost. Suggestions are automatically skipped after the first turn of a conversation, in non-interactive mode, and in plan mode. To disable prompt suggestions entirely, set the environment variable or toggle the setting in `/config`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false
##
@@ -340,12 +328,6 @@
Side questions with /btw
Use `/btw` to ask a quick question about your current work without adding to the conversation history. This is useful when you want a fast answer but don’t want to clutter the main context or derail Claude from a long-running task.
-
-Report incorrect code
-
-Copy
-
-Ask AI
/btw what was the name of that config file again?
--- a/jetbrains.md
+++ b/jetbrains.md
@@ -65,19 +65,7 @@
Use the `/ide` command in any external terminal to connect Claude Code to your JetBrains IDE and activate all features:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude
-
-Report incorrect code
-
-Copy
-
-Ask AI
/ide
--- a/keybindings.md
+++ b/keybindings.md
@@ -19,12 +19,6 @@
`bindings`| Array of binding blocks by context
This example binds `Ctrl+E` to open an external editor in the chat context, and unbinds `Ctrl+U`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"$schema": "https://www.schemastore.org/claude-code-keybindings.json",
@@ -123,6 +117,7 @@
`chat:fastMode`| Meta+O| Toggle fast mode
`chat:thinkingToggle`| Cmd+T / Meta+T| Toggle extended thinking
`chat:submit`| Enter| Submit message
+`chat:newline`| (unbound)| Insert a newline without submitting
`chat:undo`| Ctrl+_| Undo last action
`chat:externalEditor`| Ctrl+G, Ctrl+X Ctrl+E| Open in external editor
`chat:stash`| Ctrl+S| Stash current prompt
@@ -406,12 +401,6 @@
For example:
-Report incorrect code
-
-Copy
-
-Ask AI
-
ctrl+k Single key with modifier
shift+tab Shift + Tab
meta+p Command/Meta + P
@@ -432,12 +421,6 @@
Chords
Chords are sequences of keystrokes separated by spaces:
-
-Report incorrect code
-
-Copy
-
-Ask AI
ctrl+k ctrl+s Press Ctrl+K, release, then Ctrl+S
@@ -461,12 +444,6 @@
Unbind default shortcuts
Set an action to `null` to unbind a default shortcut:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"bindings": [
@@ -479,6 +456,23 @@
]
}
+This also works for chord bindings. Unbinding every chord that shares a prefix frees that prefix for use as a single-key binding:
+
+ {
+ "bindings": [
+ {
+ "context": "Chat",
+ "bindings": {
+ "ctrl+x ctrl+k": null,
+ "ctrl+x ctrl+e": null,
+ "ctrl+x": "chat:newline"
+ }
+ }
+ ]
+ }
+
+If you unbind some but not all chords on a prefix, pressing the prefix still enters chord-wait mode for the remaining bindings.
+
##
Show diff (102 lines)
--- a/llm-gateway.md
+++ b/llm-gateway.md
@@ -81,12 +81,6 @@
Simplest method using a fixed API key:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Set in environment
export ANTHROPIC_AUTH_TOKEN=sk-litellm-static-key
@@ -105,12 +99,6 @@
1. Create an API key helper script:
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
# ~/bin/get-litellm-key.sh
@@ -125,23 +113,11 @@
2. Configure Claude Code settings to use the helper:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"apiKeyHelper": "~/bin/get-litellm-key.sh"
}
3. Set token refresh interval:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Refresh every hour (3600000 ms)
export CLAUDE_CODE_API_KEY_HELPER_TTL_MS=3600000
@@ -155,12 +131,6 @@
Unified endpoint (recommended)
Using LiteLLM’s [Anthropic format endpoint](<https://docs.litellm.ai/docs/anthropic_unified>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
export ANTHROPIC_BASE_URL=https://litellm-server:4000
@@ -180,23 +150,11 @@
Using [pass-through endpoint](<https://docs.litellm.ai/docs/pass_through/anthropic_completion>):
-Report incorrect code
-
-Copy
-
-Ask AI
-
export ANTHROPIC_BASE_URL=https://litellm-server:4000/anthropic
##### Amazon Bedrock through LiteLLM
Using [pass-through endpoint](<https://docs.litellm.ai/docs/pass_through/bedrock>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
export ANTHROPIC_BEDROCK_BASE_URL=https://litellm-server:4000/bedrock
export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1
@@ -205,12 +163,6 @@
##### Google Vertex AI through LiteLLM
Using [pass-through endpoint](<https://docs.litellm.ai/docs/pass_through/vertex_ai>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
export ANTHROPIC_VERTEX_BASE_URL=https://litellm-server:4000/vertex_ai/v1
export ANTHROPIC_VERTEX_PROJECT_ID=your-gcp-project-id
Show diff (780 lines)
--- a/mcp.md
+++ b/mcp.md
@@ -43,12 +43,6 @@
HTTP servers are the recommended option for connecting to remote MCP servers. This is the most widely supported transport for cloud-based services.
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Basic syntax
claude mcp add --transport http <name> <url>
@@ -67,12 +61,6 @@
The SSE (Server-Sent Events) transport is deprecated. Use HTTP servers instead, where available.
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Basic syntax
claude mcp add --transport sse <name> <url>
@@ -91,12 +79,6 @@
Stdio servers run as local processes on your machine. They’re ideal for tools that need direct system access or custom scripts.
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Basic syntax
claude mcp add [options] <name> -- <command> [args...]
@@ -118,12 +100,6 @@
Managing your servers
Once configured, you can manage your MCP servers with these commands:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# List all configured servers
claude mcp list
@@ -166,12 +142,6 @@
**Windows Users** : On native Windows (not WSL), local MCP servers that use `npx` require the `cmd /c` wrapper to ensure proper execution.
-Report incorrect code
-
-Copy
-
-Ask AI
-
# This creates command="cmd" which Windows can execute
claude mcp add --transport stdio my-server -- cmd /c npx -y @some/package
@@ -191,12 +161,6 @@
* Plugin servers are managed through plugin installation (not `/mcp` commands)
**Example plugin MCP configuration** : In `.mcp.json` at plugin root:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"mcpServers": {
@@ -212,12 +176,6 @@
Or inline in `plugin.json`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"name": "my-plugin",
"mcpServers": {
@@ -237,12 +195,6 @@
**Viewing plugin MCP servers** :
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Within Claude Code, see all MCP servers including plugin ones
/mcp
@@ -272,12 +224,6 @@
The term “local scope” for MCP servers differs from general local settings. MCP local-scoped servers are stored in `~/.claude.json` (your home directory), while general local settings use `.claude/settings.local.json` (in the project directory). See [Settings](</docs/en/settings#settings-files>) for details on settings file locations.
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Add a local-scoped server (default)
claude mcp add --transport http stripe https://mcp.stripe.com
@@ -292,22 +238,10 @@
Project-scoped servers enable team collaboration by storing configurations in a `.mcp.json` file at your project’s root directory. This file is designed to be checked into version control, ensuring all team members have access to the same MCP tools and services. When you add a project-scoped server, Claude Code automatically creates or updates this file with the appropriate configuration structure.
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Add a project-scoped server
claude mcp add --transport http paypal --scope project https://mcp.paypal.com/mcp
The resulting `.mcp.json` file follows a standardized format:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"mcpServers": {
@@ -329,12 +263,6 @@
User-scoped servers are stored in `~/.claude.json` and provide cross-project accessibility, making them available across all projects on your machine while remaining private to your user account. This scope works well for personal utility servers, development tools, or services you frequently use across different projects.
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Add a user server
claude mcp add --transport http hubspot --scope user https://mcp.hubspot.com/anthropic
@@ -362,7 +290,7 @@
Scope hierarchy and precedence
-MCP server configurations follow a clear precedence hierarchy. When servers with the same name exist at multiple scopes, the system resolves conflicts by prioritizing local-scoped servers first, followed by project-scoped servers, and finally user-scoped servers. This design ensures that personal configurations can override shared ones when needed.
+MCP server configurations follow a clear precedence hierarchy. When servers with the same name exist at multiple scopes, the system resolves conflicts by prioritizing local-scoped servers first, followed by project-scoped servers, and finally user-scoped servers. This design ensures that personal configurations can override shared ones when needed. If a server is configured both locally and through a claude.ai connector, the local configuration takes precedence and the connector entry is skipped.
###
@@ -384,12 +312,6 @@
* `headers` \- For HTTP server authentication
**Example with variable expansion:**
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"mcpServers": {
@@ -417,48 +339,18 @@
Example: Monitor errors with Sentry
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
Authenticate with your Sentry account:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/mcp
Then debug production issues:
-Report incorrect code
-
-Copy
-
-Ask AI
-
What are the most common errors in the last 24 hours?
-Report incorrect code
-
-Copy
-
-Ask AI
-
Show me the stack trace for error ID abc123
-Report incorrect code
-
-Copy
-
-Ask AI
-
Which deployment introduced these new errors?
###
@@ -467,48 +359,18 @@
Example: Connect to GitHub for code reviews
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
Authenticate if needed by selecting “Authenticate” for GitHub:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/mcp
Then work with GitHub:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Review PR #456 and suggest improvements
-Report incorrect code
-
-Copy
-
-Ask AI
-
Create a new issue for the bug we just found
-Report incorrect code
-
-Copy
-
-Ask AI
-
Show me all open PRs assigned to me
###
@@ -516,40 +378,16 @@
Example: Query your PostgreSQL database
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude mcp add --transport stdio db -- npx -y @bytebase/dbhub \
--dsn "postgresql://readonly:[[email protected]](</cdn-cgi/l/email-protection>):5432/analytics"
Then query your database naturally:
-Report incorrect code
-
-Copy
-
-Ask AI
-
What's our total revenue this month?
-Report incorrect code
-
-Copy
-
-Ask AI
-
Show me the schema for the orders table
-Report incorrect code
-
-Copy
-
-Ask AI
-
Find customers who haven't made a purchase in 90 days
##
@@ -566,12 +404,6 @@
For example:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
2
@@ -579,12 +411,6 @@
Use the /mcp command within Claude Code
In Claude code, use the command:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/mcp
@@ -606,12 +432,6 @@
Some MCP servers require a specific redirect URI registered in advance. By default, Claude Code picks a random available port for the OAuth callback. Use `--callback-port` to fix the port so it matches a pre-registered redirect URI of the form `http://localhost:PORT/callback`. You can use `--callback-port` on its own (with dynamic client registration) or together with `--client-id` (with pre-configured credentials).
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Fixed callback port with dynamic client registration
claude mcp add --transport http \
--callback-port 8080 \
@@ -647,46 +467,22 @@
Use `--client-id` to pass your app’s client ID. The `--client-secret` flag prompts for the secret with masked input:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude mcp add --transport http \
--client-id your-client-id --client-secret --callback-port 8080 \
my-server https://mcp.example.com/mcp
Include the `oauth` object in the JSON config and pass `--client-secret` as a separate flag:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude mcp add-json my-server \
'{"type":"http","url":"https://mcp.example.com/mcp","oauth":{"clientId":"your-client-id","callbackPort":8080}}' \
--client-secret
Use `--callback-port` without a client ID to fix the port while using dynamic client registration:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude mcp add-json my-server \
'{"type":"http","url":"https://mcp.example.com/mcp","oauth":{"callbackPort":8080}}'
Set the secret via environment variable to skip the interactive prompt:
-
-Report incorrect code
-
-Copy
-
-Ask AI
MCP_CLIENT_SECRET=your-secret claude mcp add --transport http \
--client-id your-client-id --client-secret --callback-port 8080 \
@@ -713,12 +509,6 @@
Override OAuth metadata discovery
If your MCP server returns errors on the standard OAuth metadata endpoint (`/.well-known/oauth-authorization-server`) but exposes a working OIDC endpoint, you can tell Claude Code to fetch OAuth metadata directly from a URL you specify, bypassing the standard discovery chain. Set `authServerMetadataUrl` in the `oauth` object of your server’s config in `.mcp.json`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"mcpServers": {
@@ -742,12 +532,6 @@
If your MCP server uses an authentication scheme other than OAuth (such as Kerberos, short-lived tokens, or an internal SSO), use `headersHelper` to generate request headers at connection time. Claude Code runs the command and merges its output into the connection headers.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"mcpServers": {
"internal-api": {
@@ -760,12 +544,6 @@
The command can also be inline:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"mcpServers": {
"internal-api": {
@@ -798,12 +576,6 @@
Add an MCP server from JSON
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Basic syntax
claude mcp add-json <name> '<json>'
@@ -819,12 +591,6 @@
2
Verify the server was added
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude mcp get weather-api
@@ -846,12 +612,6 @@
Import servers from Claude Desktop
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Basic syntax
claude mcp add-from-claude-desktop
@@ -864,12 +624,6 @@
3
Verify the servers were imported
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude mcp list
@@ -907,24 +661,12 @@
In Claude Code, use the command:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/mcp
Claude.ai servers appear in the list with indicators showing they come from Claude.ai.
To disable claude.ai MCP servers in Claude Code, set the `ENABLE_CLAUDEAI_MCP_SERVERS` environment variable to `false`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
ENABLE_CLAUDEAI_MCP_SERVERS=false claude
##
@@ -934,23 +676,11 @@
Use Claude Code as an MCP server
You can use Claude Code itself as an MCP server that other applications can connect to:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Start Claude as a stdio MCP server
claude mcp serve
You can use this in Claude Desktop by adding this configuration to claude_desktop_config.json:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"mcpServers": {
@@ -965,21 +695,9 @@
**Configuring the executable path** : The `command` field must reference the Claude Code executable. If the `claude` command is not in your system’s PATH, you’ll need to specify the full path to the executable.To find the full path:
-Report incorrect code
-
-Copy
-
-Ask AI
-
which claude
Then use the full path in your configuration:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"mcpServers": {
@@ -1014,12 +732,6 @@
To increase the limit for tools that produce large outputs:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Set a higher limit for MCP tool outputs
export MAX_MCP_OUTPUT_TOKENS=50000
claude
@@ -1071,20 +783,8 @@
Use the format `@server:protocol://resource/path` to reference a resource:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Can you analyze @github:issue://123 and suggest a fix?
-Report incorrect code
-
-Copy
-
-Ask AI
-
Please review the API documentation at @docs:file://api/authentication
3
@@ -1092,12 +792,6 @@
Multiple resource references
You can reference multiple resources in a single prompt:
-
-Report incorrect code
-
-Copy
-
-Ask AI
Compare @postgres:schema://users with @docs:file://database/user-model
@@ -1114,7 +808,7 @@
Scale with MCP Tool Search
-When you have many MCP servers configured, tool definitions can consume a significant portion of your context window. MCP Tool Search solves this by dynamically loading tools on-demand instead of preloading all of them.
+Tool search keeps MCP context usage low by deferring tool definitions until Claude needs them. Only tool names load at session start, so adding more MCP servers has minimal impact on your context window.
###
@@ -1122,12 +816,7 @@
How it works
-Claude Code automatically enables Tool Search when your MCP tool descriptions would consume more than 10% of the context window. You can adjust this threshold or disable tool search entirely. When triggered:
-
- 1. MCP tools are deferred rather than loaded into context upfront
- 2. Claude uses a search tool to discover relevant MCP tools when needed
- 3. Only the tools Claude actually needs are loaded into context
- 4. MCP tools continue to work exactly as before from your perspective
+Tool search is enabled by default. MCP tools are deferred rather than loaded into context upfront, and Claude uses a search tool to discover relevant ones when a task needs them. Only the tools Claude actually uses enter context. From your perspective, MCP tools work exactly as before. If you prefer threshold-based loading, set `ENABLE_TOOL_SEARCH=auto` to load schemas upfront when they fit within 10% of the context window and defer only the overflow. See Configure tool search for all options.
###
@@ -1140,6 +829,8 @@
* What category of tasks your tools handle
* When Claude should search for your tools
* Key capabilities your server provides
+
+Claude Code truncates tool descriptions and server instructions at 2KB each. Keep them concise to avoid truncation, and put critical details near the start.
###
@@ -1157,12 +848,6 @@
`auto:<N>`| Activates at custom threshold, where `<N>` is a percentage (e.g., `auto:5` for 5%)
`false`| Disabled, all MCP tools loaded upfront
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Use a custom 5% threshold
ENABLE_TOOL_SEARCH=auto:5 claude
@@ -1170,12 +855,6 @@
ENABLE_TOOL_SEARCH=false claude
Or set the value in your [settings.json `env` field](</docs/en/settings#available-settings>). You can also disable the MCPSearch tool specifically using the `disallowedTools` setting:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"permissions": {
@@ -1207,12 +886,6 @@
Execute a prompt without arguments
-Report incorrect code
-
-Copy
-
-Ask AI
-
/mcp__github__list_prs
3
@@ -1221,19 +894,7 @@
Many prompts accept arguments. Pass them space-separated after the command:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/mcp__github__pr_review 456
-
-Report incorrect code
-
-Copy
-
-Ask AI
/mcp__jira__create_issue "Bug in login flow" high
@@ -1276,12 +937,6 @@
These are system-wide paths (not user home directories like `~/Library/...`) that require administrator privileges. They are designed to be deployed by IT administrators.
The `managed-mcp.json` file uses the same format as a standard `.mcp.json` file:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"mcpServers": {
@@ -1334,12 +989,6 @@
Example configuration
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"allowedMcpServers": [
// Allow by server name
@@ -1409,12 +1058,6 @@
Example: URL-only allowlist
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"allowedMcpServers": [
{ "serverUrl": "https://mcp.company.com/*" },
@@ -1431,12 +1074,6 @@
Example: Command-only allowlist
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"allowedMcpServers": [
{ "serverCommand": ["npx", "-y", "approved-package"] }
@@ -1450,12 +1087,6 @@
* HTTP server named “my-api”: ❌ Blocked (no name entries to match)
Example: Mixed name and command allowlist
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"allowedMcpServers": [
@@ -1474,12 +1105,6 @@
Example: Name-only allowlist
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"allowedMcpServers": [
{ "serverName": "github" },
Show diff (196 lines)
--- a/memory.md
+++ b/memory.md
@@ -23,7 +23,7 @@
**Who writes it**| You| Claude
**What it contains**| Instructions and rules| Learnings and patterns
**Scope**| Project, user, or org| Per working tree
-**Loaded into**| Every session| Every session (first 200 lines)
+**Loaded into**| Every session| Every session (first 200 lines or 25KB)
**Use for**| Coding standards, workflows, project architecture| Build commands, debugging insights, preferences Claude discovers
Use CLAUDE.md files when you want to guide Claude’s behavior. Auto memory lets Claude learn from your corrections without manual effort. Subagents can also maintain their own auto memory. See [subagent configuration](</docs/en/sub-agents#enable-persistent-memory>) for details.
@@ -70,7 +70,7 @@
Write effective instructions
-CLAUDE.md files are loaded into the context window at the start of every session, consuming tokens alongside your conversation. Because they’re context rather than enforced configuration, how you write instructions affects how reliably Claude follows them. Specific, concise, well-structured instructions work best. **Size** : target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence. If your instructions are growing large, split them using imports or `.claude/rules/` files. **Structure** : use markdown headers and bullets to group related instructions. Claude scans structure the same way readers do: organized sections are easier to follow than dense paragraphs. **Specificity** : write instructions that are concrete enough to verify. For example:
+CLAUDE.md files are loaded into the context window at the start of every session, consuming tokens alongside your conversation. The [context window visualization](</docs/en/context-window>) shows where CLAUDE.md loads relative to the rest of the startup context. Because they’re context rather than enforced configuration, how you write instructions affects how reliably Claude follows them. Specific, concise, well-structured instructions work best. **Size** : target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence. If your instructions are growing large, split them using imports or `.claude/rules/` files. **Structure** : use markdown headers and bullets to group related instructions. Claude scans structure the same way readers do: organized sections are easier to follow than dense paragraphs. **Specificity** : write instructions that are concrete enough to verify. For example:
* “Use 2-space indentation” instead of “Format code properly”
* “Run `npm test` before committing” instead of “Test your changes”
@@ -86,12 +86,6 @@
CLAUDE.md files can import additional files using `@path/to/import` syntax. Imported files are expanded and loaded into context at launch alongside the CLAUDE.md that references them. Both relative and absolute paths are allowed. Relative paths resolve relative to the file containing the import, not the working directory. Imported files can recursively import other files, with a maximum depth of five hops. To pull in a README, package.json, and a workflow guide, reference them with `@` syntax anywhere in your CLAUDE.md:
-Report incorrect code
-
-Copy
-
-Ask AI
-
See @README for project overview and @package.json for available npm commands for this project.
# Additional Instructions
@@ -99,12 +93,6 @@
For personal preferences you don’t want to check in, import a file from your home directory. The import goes in the shared CLAUDE.md, but the file it points to stays on your machine:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Individual Preferences
- @~/.claude/my-project-instructions.md
@@ -122,12 +110,6 @@
CLAUDE.md
-Report incorrect code
-
-Copy
-
-Ask AI
-
@AGENTS.md
## Claude Code
@@ -150,12 +132,6 @@
The `--add-dir` flag gives Claude access to additional directories outside your main working directory. By default, CLAUDE.md files from these directories are not loaded. To also load CLAUDE.md files from additional directories, including `CLAUDE.md`, `.claude/CLAUDE.md`, and `.claude/rules/*.md`, set the `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD` environment variable:
-Report incorrect code
-
-Copy
-
-Ask AI
-
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 claude --add-dir ../shared-config
###
@@ -175,12 +151,6 @@
Set up rules
Place markdown files in your project’s `.claude/rules/` directory. Each file should cover one topic, with a descriptive filename like `testing.md` or `api-design.md`. All `.md` files are discovered recursively, so you can organize rules into subdirectories like `frontend/` or `backend/`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
your-project/
├── .claude/
@@ -200,12 +170,6 @@
Rules can be scoped to specific files using YAML frontmatter with the `paths` field. These conditional rules only apply when Claude is working with files matching the specified patterns.
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
paths:
- "src/api/**/*.ts"
@@ -228,12 +192,6 @@
You can specify multiple patterns and use brace expansion to match multiple extensions in one pattern:
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
paths:
- "src/**/*.{ts,tsx}"
@@ -249,12 +207,6 @@
The `.claude/rules/` directory supports symlinks, so you can maintain a shared set of rules and link them into multiple projects. Symlinks are resolved and loaded normally, and circular symlinks are detected and handled gracefully. This example links both a shared directory and an individual file:
-Report incorrect code
-
-Copy
-
-Ask AI
-
ln -s ~/shared-claude-rules .claude/rules/shared
ln -s ~/company-standards/security.md .claude/rules/security.md
@@ -265,12 +217,6 @@
User-level rules
Personal rules in `~/.claude/rules/` apply to every project on your machine. Use them for preferences that aren’t project-specific:
-
-Report incorrect code
-
-Copy
-
-Ask AI
~/.claude/rules/
├── preferences.md # Your personal coding preferences
@@ -330,12 +276,6 @@
In large monorepos, ancestor CLAUDE.md files may contain instructions that aren’t relevant to your work. The `claudeMdExcludes` setting lets you skip specific files by path or glob pattern. This example excludes a top-level CLAUDE.md and a rules directory from a parent folder. Add it to `.claude/settings.local.json` so the exclusion stays local to your machine:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"claudeMdExcludes": [
"**/monorepo/CLAUDE.md",
@@ -363,12 +303,6 @@
Auto memory is on by default. To toggle it, open `/memory` in a session and use the auto memory toggle, or set `autoMemoryEnabled` in your project settings:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"autoMemoryEnabled": false
}
@@ -383,23 +317,11 @@
Each project gets its own memory directory at `~/.claude/projects/<project>/memory/`. The `<project>` path is derived from the git repository, so all worktrees and subdirectories within the same repo share one auto memory directory. Outside a git repo, the project root is used instead. To store auto memory in a different location, set `autoMemoryDirectory` in your user or local settings:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"autoMemoryDirectory": "~/my-custom-memory-dir"
}
This setting is accepted from policy, local, and user settings. It is not accepted from project settings (`.claude/settings.json`) to prevent a shared project from redirecting auto memory writes to sensitive locations. The directory contains a `MEMORY.md` entrypoint and optional topic files:
-
-Report incorrect code
-
-Copy
-
-Ask AI
~/.claude/projects/<project>/memory/
├── MEMORY.md # Concise index, loaded into every session
@@ -415,7 +337,7 @@
How it works
-The first 200 lines of `MEMORY.md` are loaded at the start of every conversation. Content beyond line 200 is not loaded at session start. Claude keeps `MEMORY.md` concise by moving detailed notes into separate topic files. This 200-line limit applies only to `MEMORY.md`. CLAUDE.md files are loaded in full regardless of length, though shorter files produce better adherence. Topic files like `debugging.md` or `patterns.md` are not loaded at startup. Claude reads them on demand using its standard file tools when it needs the information. Claude reads and writes memory files during your session. When you see “Writing memory” or “Recalled memory” in the Claude Code interface, Claude is actively updating or reading from `~/.claude/projects/<project>/memory/`.
+The first 200 lines of `MEMORY.md`, or the first 25KB, whichever comes first, are loaded at the start of every conversation. Content beyond that threshold is not loaded at session start. Claude keeps `MEMORY.md` concise by moving detailed notes into separate topic files. This limit applies only to `MEMORY.md`. CLAUDE.md files are loaded in full regardless of length, though shorter files produce better adherence. Topic files like `debugging.md` or `patterns.md` are not loaded at startup. Claude reads them on demand using its standard file tools when it needs the information. Claude reads and writes memory files during your session. When you see “Writing memory” or “Recalled memory” in the Claude Code interface, Claude is actively updating or reading from `~/.claude/projects/<project>/memory/`.
###
--- a/microsoft-foundry.md
+++ b/microsoft-foundry.md
@@ -46,21 +46,9 @@
3. Copy **API Key**
4. Set the environment variable:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export ANTHROPIC_FOUNDRY_API_KEY=your-azure-api-key
**Option B: Microsoft Entra ID authentication** When `ANTHROPIC_FOUNDRY_API_KEY` is not set, Claude Code automatically uses the Azure SDK [default credential chain](<https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication/credential-chains#defaultazurecredential-overview>). This supports a variety of methods for authenticating local and remote workloads. On local environments, you commonly may use the Azure CLI:
-
-Report incorrect code
-
-Copy
-
-Ask AI
az login
@@ -73,12 +61,6 @@
3\. Configure Claude Code
Set the following environment variables to enable Microsoft Foundry:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Enable Microsoft Foundry integration
export CLAUDE_CODE_USE_FOUNDRY=1
@@ -98,12 +80,6 @@
Set the model variables to match the deployment names you created in step 1:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'
export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-6'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5'
@@ -117,12 +93,6 @@
Azure RBAC configuration
The `Azure AI User` and `Cognitive Services User` default roles include all required permissions for invoking Claude models. For more restrictive permissions, create a custom role with the following:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"permissions": [
Show diff (119 lines)
--- a/model-config.md
+++ b/model-config.md
@@ -48,12 +48,6 @@
Example usage:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Start with Opus
claude --model opus
@@ -61,12 +55,6 @@
/model sonnet
Example settings file:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"permissions": {
@@ -83,12 +71,6 @@
Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, Config tool, or `ANTHROPIC_MODEL` environment variable.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"availableModels": ["sonnet", "haiku"]
}
@@ -113,12 +95,6 @@
* **model** : sets the explicit model override, taking precedence over the Default
This example ensures all users run Sonnet 4.6 and can only choose between Sonnet and Haiku:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"model": "sonnet",
@@ -199,12 +175,6 @@
To disable 1M context entirely, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. This removes 1M model variants from the model picker. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through extra usage, tokens are billed to extra usage. If your account supports 1M context, the option appears in the model picker (`/model`) in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Use the opus[1m] or sonnet[1m] alias
/model opus[1m]
/model sonnet[1m]
@@ -230,12 +200,6 @@
Add a custom model option
Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for LLM gateway deployments or testing model IDs that Claude Code does not list by default. This example sets all three variables to make a gateway-routed Opus deployment selectable:
-
-Report incorrect code
-
-Copy
-
-Ask AI
export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-4-6"
export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway"
@@ -279,12 +243,6 @@
Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'`
Apply the same pattern for `ANTHROPIC_DEFAULT_SONNET_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6[1m]'
@@ -318,12 +276,6 @@
When `_SUPPORTED_CAPABILITIES` is set, listed capabilities are enabled and unlisted capabilities are disabled for the matching pinned model. When the variable is unset, Claude Code falls back to built-in detection based on the model ID. This example pins Opus to a Bedrock custom model ARN, sets a friendly name, and declares its capabilities:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export ANTHROPIC_DEFAULT_OPUS_MODEL='arn:aws:bedrock:us-east-1:123456789012:custom-model/abc'
export ANTHROPIC_DEFAULT_OPUS_MODEL_NAME='Opus via Bedrock'
export ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION='Opus 4.6 routed through a Bedrock custom endpoint'
@@ -336,12 +288,6 @@
Override model IDs per version
The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Bedrock inference profile ARN, Vertex AI version name, or Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#settings-files>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"modelOverrides": {
Show diff (133 lines)
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -7,12 +7,6 @@
Quick start
Configure OpenTelemetry using environment variables:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# 1. Enable telemetry
export CLAUDE_CODE_ENABLE_TELEMETRY=1
@@ -46,12 +40,6 @@
Administrator configuration
Administrators can configure OpenTelemetry settings for all users through the [managed settings file](</docs/en/settings#settings-files>). This allows for centralized control of telemetry settings across an organization. See the [settings precedence](</docs/en/settings#settings-precedence>) for more information about how settings are applied. Example managed settings configuration:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"env": {
@@ -95,7 +83,7 @@
`OTEL_METRIC_EXPORT_INTERVAL`| Export interval in milliseconds (default: 60000)| `5000`, `60000`
`OTEL_LOGS_EXPORT_INTERVAL`| Logs export interval in milliseconds (default: 5000)| `1000`, `10000`
`OTEL_LOG_USER_PROMPTS`| Enable logging of user prompt content (default: disabled)| `1` to enable
-`OTEL_LOG_TOOL_DETAILS`| Enable logging of tool input arguments, MCP server/tool names, and skill names in tool events (default: disabled)| `1` to enable
+`OTEL_LOG_TOOL_DETAILS`| Enable logging of tool parameters (bash commands, MCP server/tool names, skill names) and tool input arguments in tool events (default: disabled)| `1` to enable
`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE`| Metrics temporality preference (default: `delta`). Set to `cumulative` if your backend expects cumulative temporality| `delta`, `cumulative`
`CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS`| Interval for refreshing dynamic headers (default: 1740000ms / 29 minutes)| `900000`
@@ -131,12 +119,6 @@
Add to your `.claude/settings.json`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"otelHeadersHelper": "/bin/generate_opentelemetry_headers.sh"
}
@@ -149,12 +131,6 @@
The script must output valid JSON with string key-value pairs representing HTTP headers:
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
# Example: Multiple headers
echo "{\"Authorization\": \"Bearer $(get-token.sh)\", \"X-API-Key\": \"$(get-api-key.sh)\"}"
@@ -174,12 +150,6 @@
Multi-team organization support
Organizations with multiple teams or departments can add custom attributes to distinguish between different groups using the `OTEL_RESOURCE_ATTRIBUTES` environment variable:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Add custom attributes for team identification
export OTEL_RESOURCE_ATTRIBUTES="department=engineering,team.id=platform,cost_center=eng-123"
@@ -200,13 +170,7 @@
**Examples:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- # ❌ Invalid - contains spaces
+ # ❌ Invalid - contains spaces
export OTEL_RESOURCE_ATTRIBUTES="org.name=John's Organization"
# ✅ Valid - use underscores or camelCase instead
@@ -225,12 +189,6 @@
Example configurations
Set these environment variables before running `claude`. Each block shows a complete configuration for a different exporter or deployment scenario:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Console debugging (1-second intervals)
export CLAUDE_CODE_ENABLE_TELEMETRY=1
@@ -478,11 +436,11 @@
* `decision_source`: Decision source - `"config"`, `"hook"`, `"user_permanent"`, `"user_temporary"`, `"user_abort"`, or `"user_reject"`
* `tool_result_size_bytes`: Size of the tool result in bytes
* `mcp_server_scope`: MCP server scope identifier (for MCP tools)
- * `tool_parameters`: JSON string containing tool-specific parameters (when available)
+ * `tool_parameters` (when `OTEL_LOG_TOOL_DETAILS=1`): JSON string containing tool-specific parameters
* For Bash tool: includes `bash_command`, `full_command`, `timeout`, `description`, `dangerouslyDisableSandbox`, and `git_commit_id` (the commit SHA, when a `git commit` command succeeds)
- * For MCP tools (when `OTEL_LOG_TOOL_DETAILS=1`): includes `mcp_server_name`, `mcp_tool_name`
- * For Skill tool (when `OTEL_LOG_TOOL_DETAILS=1`): includes `skill_name`
- * `tool_input` (when `OTEL_LOG_TOOL_DETAILS=1`): JSON-serialized tool arguments. Individual values over 512 characters are truncated, and the full payload is bounded to ~4 K characters. Applies to all tools including MCP tools.
+ * For MCP tools: includes `mcp_server_name`, `mcp_tool_name`
+ * For Skill tool: includes `skill_name`
+ * `tool_input` (when `OTEL_LOG_TOOL_DETAILS=1`): JSON-serialized tool arguments with long strings truncated. Bounded to ~4 K characters. Applies to all tools including MCP tools.
####
@@ -664,10 +622,10 @@
Security and privacy
* Telemetry is opt-in and requires explicit configuration
- * Raw file contents and code snippets are not included in metrics or events. Tool execution events include bash commands and file paths in the `tool_parameters` field, which may contain sensitive values. If your commands may include secrets, configure your telemetry backend to filter or redact `tool_parameters`
+ * Raw file contents and code snippets are not included in metrics or events
* When authenticated via OAuth, `user.email` is included in telemetry attributes. If this is a concern for your organization, work with your telemetry backend to filter or redact this field
* User prompt content is not collected by default. Only prompt length is recorded. To include prompt content, set `OTEL_LOG_USER_PROMPTS=1`
- * Tool input arguments are not logged by default. To include them, set `OTEL_LOG_TOOL_DETAILS=1`. When enabled, `tool_result` events include MCP server/tool names and skill names plus a `tool_input` attribute with file paths, URLs, search patterns, and other arguments. Individual values over 512 characters are truncated and the total is bounded to ~4 K characters, but the arguments may still contain sensitive values. Configure your telemetry backend to filter or redact `tool_input` as needed
+ * Tool input arguments and parameters are not logged by default. To include them, set `OTEL_LOG_TOOL_DETAILS=1`. When enabled, tool_result events include a `tool_parameters` attribute (bash commands, MCP server/tool names, skill names) and a `tool_input` attribute (file paths, URLs, search patterns, and other arguments). Individual values over 512 characters are truncated and the total is bounded to ~4 K characters, but the arguments may still contain sensitive values. Configure your telemetry backend to filter or redact these attributes as needed
##
--- a/network-config.md
+++ b/network-config.md
@@ -15,12 +15,6 @@
Environment variables
Claude Code respects standard proxy environment variables:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# HTTPS proxy (recommended)
export HTTPS_PROXY=https://proxy.example.com:8080
@@ -45,12 +39,6 @@
If your proxy requires basic authentication, include credentials in the proxy URL:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export HTTPS_PROXY=http://username:password@proxy.example.com:8080
Avoid hardcoding passwords in scripts. Use environment variables or secure credential storage instead.
@@ -65,12 +53,6 @@
If your enterprise environment uses custom CAs for HTTPS connections (whether through a proxy or direct API access), configure Claude Code to trust them:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export NODE_EXTRA_CA_CERTS=/path/to/ca-cert.pem
##
@@ -80,12 +62,6 @@
mTLS authentication
For enterprise environments requiring client certificate authentication:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Client certificate for authentication
export CLAUDE_CODE_CLIENT_CERT=/path/to/client-cert.pem
--- a/output-styles.md
+++ b/output-styles.md
@@ -32,12 +32,6 @@
Run `/config` and select **Output style** to pick a style from a menu. Your selection is saved to `.claude/settings.local.json` at the [local project level](</docs/en/settings>). To set a style without the menu, edit the `outputStyle` field directly in a settings file:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"outputStyle": "Explanatory"
}
@@ -51,12 +45,6 @@
Create a custom output style
Custom output styles are Markdown files with frontmatter and the text that will be added to the system prompt:
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: My Custom Style
Show diff (110 lines)
--- a/overview.md
+++ b/overview.md
@@ -28,65 +28,29 @@
**macOS, Linux, WSL:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- curl -fsSL https://claude.ai/install.sh | bash
+ curl -fsSL https://claude.ai/install.sh | bash
**Windows PowerShell:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- irm https://claude.ai/install.ps1 | iex
+ irm https://claude.ai/install.ps1 | iex
**Windows CMD:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
+ curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
**Windows requires[Git for Windows](<https://git-scm.com/downloads/win>).** Install it first if you don’t have it.
Native installations automatically update in the background to keep you on the latest version.
-Report incorrect code
-
-Copy
-
-Ask AI
-
brew install --cask claude-code
Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes.
-
-Report incorrect code
-
-Copy
-
-Ask AI
winget install Anthropic.ClaudeCode
WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.
Then start Claude Code in any project:
-
-Report incorrect code
-
-Copy
-
-Ask AI
cd your-project
claude
@@ -126,12 +90,6 @@
Claude Code handles the tedious tasks that eat up your day: writing tests for untested code, fixing lint errors across a project, resolving merge conflicts, updating dependencies, and writing release notes.
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude "write tests for the auth module, run them, and fix any failures"
Build features and fix bugs
@@ -141,12 +99,6 @@
Create commits and pull requests
Claude Code works directly with git. It stages changes, writes commit messages, creates branches, and opens pull requests.
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude "commit my changes with a descriptive message"
@@ -167,12 +119,6 @@
Pipe, script, and automate with the CLI
Claude Code is composable and follows the Unix philosophy. Pipe logs into it, run it in CI, or chain it with other tools:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Analyze recent log output
tail -200 app.log | claude -p "Slack me if you see any anomalies"
Show diff (117 lines)
--- a/permission-modes.md
+++ b/permission-modes.md
@@ -27,21 +27,9 @@
**During a session** : press `Shift+Tab` to cycle through `default` → `acceptEdits` → `plan` → `auto`. The current mode appears in the status bar. `auto` does not appear in the cycle until you pass `--enable-auto-mode` at startup. Auto also requires a Team (or Enterprise/API once available) plan and Claude Sonnet 4.6 or Opus 4.6, so the option may remain unavailable even with the flag. If `bypassPermissions` is also enabled, it appears in the cycle between `plan` and `auto`.**At startup** : pass the mode as a CLI flag:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --permission-mode plan
**As a default** : set `defaultMode` in your [settings file](</docs/en/settings#settings-files>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"permissions": {
@@ -50,12 +38,6 @@
}
**Non-interactively** : the same flag works with `-p` for scripted runs:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude -p "refactor auth" --permission-mode acceptEdits
@@ -88,12 +70,6 @@
Auto and Bypass permissions appear in the selector only after you enable them in Desktop settings. See the [Desktop guide](</docs/en/desktop#choose-a-permission-mode>) for details.
**During a session** : use the mode dropdown next to the prompt box on [claude.ai/code](<https://claude.ai/code>) or in the Claude mobile app.For [Claude Code on the web](</docs/en/claude-code-on-the-web>) sessions running on Anthropic’s cloud VMs, the dropdown offers Auto accept edits and Plan mode. Ask permissions and Auto are not available for cloud sessions.For [Remote Control](</docs/en/remote-control>) sessions running on your local machine, the dropdown offers Ask permissions, Auto accept edits, and Plan mode. You can also set the starting mode when you launch the local host:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude remote-control --permission-mode acceptEdits
@@ -146,31 +122,13 @@
Enter plan mode for a single request by prefixing your prompt with `/plan`, or switch the whole session into plan mode by pressing `Shift+Tab` to cycle through permission modes. You can also start in plan mode from the CLI:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --permission-mode plan
This example starts a planning session for a complex refactor:
-Report incorrect code
-
-Copy
-
-Ask AI
-
I need to refactor our authentication system to use OAuth2. Create a detailed migration plan.
Claude analyzes the current implementation and creates a plan. Refine with follow-ups:
-
-Report incorrect code
-
-Copy
-
-Ask AI
What about backward compatibility?
How should we handle database migration?
@@ -267,12 +225,6 @@
`dontAsk` mode auto-denies every tool that is not explicitly allowed. Only actions matching your `/permissions` allow rules or `permissions.allow` settings can execute. If a tool has an explicit `ask` rule, the action is also denied rather than prompting. This makes the mode fully non-interactive, suitable for CI pipelines or restricted environments where you pre-define exactly what Claude is permitted to do.
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --permission-mode dontAsk
##
@@ -283,21 +235,9 @@
`bypassPermissions` mode disables all permission prompts and safety checks. Every tool call executes immediately without any verification. Only use this in isolated environments like containers, VMs, or devcontainers without internet access, where Claude Code cannot cause damage to your host system.
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --permission-mode bypassPermissions
The `--dangerously-skip-permissions` flag is equivalent to `--permission-mode bypassPermissions`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude -p "refactor the auth module" --dangerously-skip-permissions
--- a/permissions.md
+++ b/permissions.md
@@ -94,12 +94,6 @@
Wildcard patterns
Bash rules support glob patterns with `*`. Wildcards can appear at any position in the command. This configuration allows npm and git commit commands while blocking git push:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"permissions": {
@@ -222,12 +216,6 @@
Add these rules to the `deny` array in your settings or use the `--disallowedTools` CLI flag to disable specific agents. To disable the Explore agent:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"permissions": {
"deny": ["Agent(Explore)"]
@@ -295,6 +283,7 @@
`allowManagedPermissionRulesOnly`| When `true`, prevents user and project settings from defining `allow`, `ask`, or `deny` permission rules. Only rules in managed settings apply
`allowManagedHooksOnly`| When `true`, prevents loading of user, project, and plugin hooks. Only managed hooks and SDK hooks are allowed
`allowManagedMcpServersOnly`| When `true`, only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. See [Managed MCP configuration](</docs/en/mcp#managed-mcp-configuration>)
+`allowedChannelPlugins`| Allowlist of channel plugins that may push messages. Replaces the default Anthropic allowlist when set. Requires `channelsEnabled: true`. See [Restrict which channel plugins can run](</docs/en/channels#restrict-which-channel-plugins-can-run>)
`blockedMarketplaces`| Blocklist of marketplace sources. Blocked sources are checked before downloading, so they never touch the filesystem. See [managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>)
`sandbox.network.allowManagedDomainsOnly`| When `true`, only `allowedDomains` and `WebFetch(domain:...)` allow rules from managed settings are respected. Non-allowed domains are blocked automatically without prompting the user. Denied domains still merge from all sources
`sandbox.filesystem.allowManagedReadPathsOnly`| When `true`, only `allowRead` paths from managed settings are respected. `allowRead` entries from user, project, and local settings are ignored
@@ -325,12 +314,6 @@
Define trusted infrastructure
For most organizations, `autoMode.environment` is the only field you need to set. It tells the classifier which repos, buckets, and domains are trusted, without touching the built-in block and allow rules. The classifier uses `environment` to decide what “external” means: any destination not listed is a potential exfiltration target.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"autoMode": {
@@ -353,12 +336,6 @@
* **Additional context** : regulated-industry constraints, multi-tenant infrastructure, or compliance requirements that affect what the classifier should treat as risky
A useful starting template: fill in the bracketed fields and remove any lines that don’t apply:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"autoMode": {
@@ -383,12 +360,6 @@
Override the block and allow rules
Two additional fields let you replace the classifier’s built-in rule lists: `autoMode.soft_deny` controls what gets blocked, and `autoMode.allow` controls which exceptions apply. Each is an array of prose descriptions, read as natural-language rules. Inside the classifier, the precedence is: `soft_deny` rules block first, then `allow` rules override as exceptions, then explicit user intent overrides both. If the user’s message directly and specifically describes the exact action Claude is about to take, the classifier allows it even if a `soft_deny` rule matches. General requests don’t count: asking Claude to “clean up the repo” does not authorize force-pushing, but asking Claude to “force-push this branch” does. To loosen: remove rules from `soft_deny` when the defaults block something your pipeline already guards against with PR review, CI, or staging environments, or add to `allow` when the classifier repeatedly flags a routine pattern the default exceptions don’t cover. To tighten: add to `soft_deny` for risks specific to your environment that the defaults miss, or remove from `allow` to hold a default exception to the block rules. In all cases, run `claude auto-mode defaults` to get the full default lists, then copy and edit: never start from an empty list.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"autoMode": {
@@ -419,12 +390,6 @@
Because setting `allow` or `soft_deny` replaces the defaults, start any customization by copying the full default lists. Three CLI subcommands help you inspect and validate:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude auto-mode defaults # the built-in environment, allow, and soft_deny rules
claude auto-mode config # what the classifier actually uses: your settings where set, defaults otherwise
claude auto-mode critique # get AI feedback on your custom allow and soft_deny rules
Show diff (484 lines)
--- a/plugin-marketplaces.md
+++ b/plugin-marketplaces.md
@@ -27,12 +27,6 @@
Create the directory structure
-Report incorrect code
-
-Copy
-
-Ask AI
-
mkdir -p my-marketplace/.claude-plugin
mkdir -p my-marketplace/plugins/quality-review-plugin/.claude-plugin
mkdir -p my-marketplace/plugins/quality-review-plugin/skills/quality-review
@@ -44,12 +38,6 @@
Create a `SKILL.md` file that defines what the `/quality-review` skill does.
my-marketplace/plugins/quality-review-plugin/skills/quality-review/SKILL.md
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
description: Review code for bugs, security, and performance
@@ -72,12 +60,6 @@
my-marketplace/plugins/quality-review-plugin/.claude-plugin/plugin.json
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"name": "quality-review-plugin",
"description": "Adds a /quality-review skill for quick code reviews",
@@ -91,12 +73,6 @@
Create the marketplace catalog that lists your plugin.
my-marketplace/.claude-plugin/marketplace.json
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "my-plugins",
@@ -118,12 +94,6 @@
Add the marketplace and install the plugin.
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace add ./my-marketplace
/plugin install quality-review-plugin@my-plugins
@@ -133,12 +103,6 @@
Select some code in your editor and run your new command.
-Report incorrect code
-
-Copy
-
-Ask AI
-
/quality-review
To learn more about what plugins can do, including hooks, agents, MCP servers, and LSP servers, see [Plugins](</docs/en/plugins>).
@@ -152,12 +116,6 @@
Create the marketplace file
Create `.claude-plugin/marketplace.json` in your repository root. This file defines your marketplace’s name, owner information, and a list of plugins with their sources. Each plugin entry needs at minimum a `name` and `source` (where to fetch it from). See the full schema below for all available fields.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "company-tools",
@@ -310,12 +268,6 @@
For plugins in the same repository, use a path starting with `./`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"name": "my-plugin",
"source": "./plugins/my-plugin"
@@ -330,12 +282,6 @@
GitHub repositories
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "github-plugin",
@@ -346,12 +292,6 @@
}
You can pin to a specific branch, tag, or commit:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "github-plugin",
@@ -375,12 +315,6 @@
Git repositories
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"name": "git-plugin",
"source": {
@@ -390,12 +324,6 @@
}
You can pin to a specific branch, tag, or commit:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "git-plugin",
@@ -421,12 +349,6 @@
Use `git-subdir` to point to a plugin that lives inside a subdirectory of a git repository. Claude Code uses a sparse, partial clone to fetch only the subdirectory, minimizing bandwidth for large monorepos.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"name": "my-plugin",
"source": {
@@ -437,12 +359,6 @@
}
You can pin to a specific branch, tag, or commit:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "my-plugin",
@@ -472,12 +388,6 @@
Plugins distributed as npm packages are installed using `npm install`. This works with any package on the public npm registry or a private registry your team hosts.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"name": "my-npm-plugin",
"source": {
@@ -487,12 +397,6 @@
}
To pin to a specific version, add the `version` field:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "my-npm-plugin",
@@ -504,12 +408,6 @@
}
To install from a private or internal registry, add the `registry` field:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "my-npm-plugin",
@@ -534,12 +432,6 @@
Advanced plugin entries
This example shows a plugin entry using many of the optional fields, including custom paths for commands, agents, hooks, and MCP servers:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "enterprise-tools",
@@ -638,12 +530,6 @@
Any git hosting service works, such as GitLab, Bitbucket, and self-hosted servers. Users add with the full repository URL:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace add https://gitlab.com/company/plugins.git
###
@@ -662,12 +548,6 @@
Set the token in your shell configuration (for example, `.bashrc`, `.zshrc`) or pass it when running Claude Code:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
For CI/CD environments, configure the token as a secret environment variable. GitHub Actions automatically provides `GITHUB_TOKEN` for repositories in the same organization.
@@ -679,12 +559,6 @@
Test locally before distribution
Test your marketplace locally before sharing:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/plugin marketplace add ./my-local-marketplace
/plugin install test-plugin@my-local-marketplace
@@ -698,12 +572,6 @@
Require marketplaces for your team
You can configure your repository so team members are automatically prompted to install your marketplace when they trust the project folder. Add your marketplace to `.claude/settings.json`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"extraKnownMarketplaces": {
@@ -718,12 +586,6 @@
You can also specify which plugins should be enabled by default:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"enabledPlugins": {
"code-formatter@company-tools": true,
@@ -740,12 +602,6 @@
Pre-populate plugins for containers
For container images and CI environments, you can pre-populate a plugins directory at build time so Claude Code starts with marketplaces and plugins already available, without cloning anything at runtime. Set the `CLAUDE_CODE_PLUGIN_SEED_DIR` environment variable to point at this directory. To layer multiple seed directories, separate paths with `:` on Unix or `;` on Windows. Claude Code searches each directory in order, and the first seed that contains a given marketplace or plugin cache wins. The seed directory mirrors the structure of `~/.claude/plugins`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
$CLAUDE_CODE_PLUGIN_SEED_DIR/
known_marketplaces.json
@@ -781,23 +637,11 @@
Disable all marketplace additions:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"strictKnownMarketplaces": []
}
Allow specific marketplaces only:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"strictKnownMarketplaces": [
@@ -819,12 +663,6 @@
Allow all marketplaces from an internal git server using regex pattern matching on the host:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"strictKnownMarketplaces": [
{
@@ -836,12 +674,6 @@
Allow filesystem-based marketplaces from a specific directory using regex pattern matching on the path:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"strictKnownMarketplaces": [
{
@@ -891,12 +723,6 @@
The plugin’s `plugin.json` must declare a different `version` at each pinned ref or commit. If two refs or commits have the same manifest version, Claude Code treats them as identical and skips the update.
##### Example
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "stable-tools",
@@ -912,12 +738,6 @@
]
}
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"name": "latest-tools",
"plugins": [
@@ -936,12 +756,6 @@
Assign each marketplace to the appropriate user group through managed settings. For example, the stable group receives:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"extraKnownMarketplaces": {
"stable-tools": {
@@ -955,12 +769,6 @@
The early-access group receives `latest-tools` instead:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"extraKnownMarketplaces": {
"latest-tools": {
@@ -980,41 +788,17 @@
Test your marketplace before sharing. Validate your marketplace JSON syntax:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude plugin validate .
Or from within Claude Code:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin validate .
Add the marketplace for testing:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/plugin marketplace add ./path/to/marketplace
Install a test plugin to verify everything works:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/plugin install test-plugin@marketplace-name
@@ -1103,12 +887,6 @@
**Symptoms** : Plugin installation or marketplace updates fail with a timeout error like “Git clone timed out after 120s” or “Git pull timed out after 120s”. **Cause** : Claude Code uses a 120-second timeout for all git operations, including cloning plugin repositories and pulling marketplace updates. Large repositories or slow network connections may exceed this limit. **Solution** : Increase the timeout using the `CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS` environment variable. The value is in milliseconds:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS=300000 # 5 minutes
###
@@ -1120,12 +898,6 @@
**Symptoms** : Added a marketplace via URL (such as `https://example.com/marketplace.json`), but plugins with relative path sources like `"./plugins/my-plugin"` fail to install with “path not found” errors. **Cause** : URL-based marketplaces only download the `marketplace.json` file itself. They do not download plugin files from the server. Relative paths in the marketplace entry reference files on the remote server that were not downloaded. **Solutions** :
* **Use external sources** : Change plugin entries to use GitHub, npm, or git URL sources instead of relative paths:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{ "name": "my-plugin", "source": { "source": "github", "repo": "owner/repo" } }
Show diff (264 lines)
--- a/plugins.md
+++ b/plugins.md
@@ -61,12 +61,6 @@
Every plugin lives in its own directory containing a manifest and your skills, agents, or hooks. Create one now:
-Report incorrect code
-
-Copy
-
-Ask AI
-
mkdir my-first-plugin
2
@@ -75,23 +69,11 @@
The manifest file at `.claude-plugin/plugin.json` defines your plugin’s identity: its name, description, and version. Claude Code uses this metadata to display your plugin in the plugin manager.Create the `.claude-plugin` directory inside your plugin folder:
-Report incorrect code
-
-Copy
-
-Ask AI
-
mkdir my-first-plugin/.claude-plugin
Then create `my-first-plugin/.claude-plugin/plugin.json` with this content:
my-first-plugin/.claude-plugin/plugin.json
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "my-first-plugin",
@@ -117,23 +99,11 @@
Skills live in the `skills/` directory. Each skill is a folder containing a `SKILL.md` file. The folder name becomes the skill name, prefixed with the plugin’s namespace (`hello/` in a plugin named `my-first-plugin` creates `/my-first-plugin:hello`).Create a skill directory in your plugin folder:
-Report incorrect code
-
-Copy
-
-Ask AI
-
mkdir -p my-first-plugin/skills/hello
Then create `my-first-plugin/skills/hello/SKILL.md` with this content:
my-first-plugin/skills/hello/SKILL.md
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
description: Greet the user with a friendly message
@@ -148,22 +118,10 @@
Run Claude Code with the `--plugin-dir` flag to load your plugin:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --plugin-dir ./my-first-plugin
Once Claude Code starts, try your new skill:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/my-first-plugin:hello
You’ll see Claude respond with a greeting. Run `/help` to see your skill listed under the plugin namespace.
@@ -178,12 +136,6 @@
my-first-plugin/skills/hello/SKILL.md
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
description: Greet the user with a personalized message
---
@@ -193,12 +145,6 @@
Greet the user named "$ARGUMENTS" warmly and ask how you can help them today. Make the greeting personal and encouraging.
Run `/reload-plugins` to pick up the changes, then try the skill with your name:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/my-first-plugin:hello Alex
@@ -251,12 +197,6 @@
Plugins can include [Agent Skills](</docs/en/skills>) to extend Claude’s capabilities. Skills are model-invoked: Claude automatically uses them based on the task context. Add a `skills/` directory at your plugin root with Skill folders containing `SKILL.md` files:
-Report incorrect code
-
-Copy
-
-Ask AI
-
my-plugin/
├── .claude-plugin/
│ └── plugin.json
@@ -266,12 +206,6 @@
Each `SKILL.md` needs frontmatter with `name` and `description` fields, followed by instructions:
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: code-review
description: Reviews code for best practices and potential issues. Use when reviewing code, checking PRs, or analyzing code quality.
@@ -296,12 +230,6 @@
LSP (Language Server Protocol) plugins give Claude real-time code intelligence. If you need to support a language that doesn’t have an official LSP plugin, you can create your own by adding an `.lsp.json` file to your plugin:
.lsp.json
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"go": {
@@ -325,12 +253,6 @@
settings.json
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"agent": "security-reviewer"
}
@@ -352,12 +274,6 @@
Test your plugins locally
Use the `--plugin-dir` flag to test plugins during development. This loads your plugin directly without requiring installation.
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude --plugin-dir ./my-plugin
@@ -368,12 +284,6 @@
* Verify hooks work as expected
You can load multiple plugins at once by specifying the flag multiple times:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude --plugin-dir ./plugin-one --plugin-dir ./plugin-two
@@ -437,23 +347,11 @@
Create a new plugin directory:
-Report incorrect code
-
-Copy
-
-Ask AI
-
mkdir -p my-plugin/.claude-plugin
Create the manifest file at `my-plugin/.claude-plugin/plugin.json`:
my-plugin/.claude-plugin/plugin.json
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "my-plugin",
@@ -467,12 +365,6 @@
Copy your existing configurations to the plugin directory:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Copy commands
cp -r .claude/commands my-plugin/
@@ -488,23 +380,11 @@
If you have hooks in your settings, create a hooks directory:
-Report incorrect code
-
-Copy
-
-Ask AI
-
mkdir my-plugin/hooks
Create `my-plugin/hooks/hooks.json` with your hooks configuration. Copy the `hooks` object from your `.claude/settings.json` or `settings.local.json`, since the format is the same. The command receives hook input as JSON on stdin, so use `jq` to extract the file path:
my-plugin/hooks/hooks.json
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -523,12 +403,6 @@
Load your plugin to verify everything works:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --plugin-dir ./my-plugin
Test each component: run your commands, check agents appear in `/agents`, and verify hooks trigger correctly.
Show diff (314 lines)
--- a/plugins-reference.md
+++ b/plugins-reference.md
@@ -15,12 +15,6 @@
Skills
Plugins add skills to Claude Code, creating `/name` shortcuts that you or Claude can invoke. **Location** : `skills/` or `commands/` directory in plugin root **File format** : Skills are directories with `SKILL.md`; commands are simple markdown files **Skill structure** :
-
-Report incorrect code
-
-Copy
-
-Ask AI
skills/
├── pdf-processor/
@@ -45,12 +39,6 @@
Agents
Plugins can provide specialized subagents for specific tasks that Claude can invoke automatically when appropriate. **Location** : `agents/` directory in plugin root **File format** : Markdown files describing agent capabilities **Agent structure** :
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: agent-name
@@ -79,12 +67,6 @@
Hooks
Plugins can provide event handlers that respond to Claude Code events automatically. **Location** : `hooks/hooks.json` in plugin root, or inline in plugin.json **Format** : JSON configuration with event matchers and actions **Hook configuration** :
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -115,10 +97,11 @@
`Notification`| When Claude Code sends a notification
`SubagentStart`| When a subagent is spawned
`SubagentStop`| When a subagent finishes
+`TaskCreated`| When a task is being created via `TaskCreate`
+`TaskCompleted`| When a task is being marked as completed
`Stop`| When Claude finishes responding
`StopFailure`| When the turn ends due to an API error. Output and exit code are ignored
`TeammateIdle`| When an [agent team](</docs/en/agent-teams>) teammate is about to go idle
-`TaskCompleted`| When a task is being marked as completed
`InstructionsLoaded`| When a CLAUDE.md or `.claude/rules/*.md` file is loaded into context. Fires at session start and when files are lazily loaded during a session
`ConfigChange`| When a configuration file changes during a session
`CwdChanged`| When the working directory changes, for example when Claude executes a `cd` command. Useful for reactive environment management with tools like direnv
@@ -145,12 +128,6 @@
MCP servers
Plugins can bundle Model Context Protocol (MCP) servers to connect Claude Code with external tools and services. **Location** : `.mcp.json` in plugin root, or inline in plugin.json **Format** : Standard MCP server configuration **MCP server configuration** :
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"mcpServers": {
@@ -192,12 +169,6 @@
**Location** : `.lsp.json` in plugin root, or inline in `plugin.json` **Format** : JSON configuration mapping language server names to their configurations **`.lsp.json` file format**:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"go": {
"command": "gopls",
@@ -209,12 +180,6 @@
}
**Inline in`plugin.json`**:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "my-plugin",
@@ -297,12 +262,6 @@
Complete schema
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "plugin-name",
@@ -382,12 +341,6 @@
The `userConfig` field declares values that Claude Code prompts the user for when the plugin is enabled. Use this instead of requiring users to hand-edit `settings.json`.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"userConfig": {
"api_endpoint": {
@@ -411,12 +364,6 @@
The `channels` field lets a plugin declare one or more message channels that inject content into the conversation. Each channel binds to an MCP server that the plugin provides.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"channels": [
{
@@ -446,12 +393,6 @@
**Path examples** :
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"commands": [
"./specialized/deploy.md",
@@ -470,12 +411,6 @@
Environment variables
Claude Code provides two variables for referencing plugin paths. Both are substituted inline anywhere they appear in skill content, agent content, hook commands, and MCP or LSP server configs. Both are also exported as environment variables to hook processes and MCP or LSP server subprocesses. **`${CLAUDE_PLUGIN_ROOT}`** : the absolute path to your plugin’s installation directory. Use this to reference scripts, binaries, and config files bundled with the plugin. This path changes when the plugin updates, so files you write here do not survive an update. **`${CLAUDE_PLUGIN_DATA}`** : a persistent directory for plugin state that survives updates. Use this for installed dependencies such as `node_modules` or Python virtual environments, generated code, caches, and any other files that should persist across plugin versions. The directory is created automatically the first time this variable is referenced.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -500,12 +435,6 @@
The `${CLAUDE_PLUGIN_DATA}` directory resolves to `~/.claude/plugins/data/{id}/`, where `{id}` is the plugin identifier with characters outside `a-z`, `A-Z`, `0-9`, `_`, and `-` replaced by `-`. For a plugin installed as `formatter@my-marketplace`, the directory is `~/.claude/plugins/data/formatter-my-marketplace/`. A common use is installing language dependencies once and reusing them across sessions and plugin updates. Because the data directory outlives any single plugin version, a check for directory existence alone cannot detect when an update changes the plugin’s dependency manifest. The recommended pattern compares the bundled manifest against a copy in the data directory and reinstalls when they differ. This `SessionStart` hook installs `node_modules` on the first run and again whenever a plugin update includes a changed `package.json`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"hooks": {
"SessionStart": [
@@ -523,12 +452,6 @@
The `diff` exits nonzero when the stored copy is missing or differs from the bundled one, covering both first run and dependency-changing updates. If `npm install` fails, the trailing `rm` removes the copied manifest so the next session retries. Scripts bundled in `${CLAUDE_PLUGIN_ROOT}` can then run against the persisted `node_modules`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"mcpServers": {
"routines": {
@@ -574,12 +497,6 @@
If your plugin needs to access files outside its directory, you can create symbolic links to external files within your plugin directory. Symlinks are honored during the copy process:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Inside your plugin directory
ln -s /path/to/shared-utils ./shared-utils
@@ -600,12 +517,6 @@
Standard plugin layout
A complete plugin follows this structure:
-
-Report incorrect code
-
-Copy
-
-Ask AI
enterprise-plugin/
├── .claude-plugin/ # Metadata directory (optional)
@@ -676,12 +587,6 @@
Install a plugin from available marketplaces.
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude plugin install <plugin> [options]
**Arguments:**
@@ -697,12 +602,6 @@
Scope determines which settings file the installed plugin is added to. For example, —scope project writes to `enabledPlugins` in .claude/settings.json, making the plugin available to everyone who clones the project repository. **Examples:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Install to user scope (default)
claude plugin install formatter@my-marketplace
@@ -719,12 +618,6 @@
plugin uninstall
Remove an installed plugin.
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude plugin uninstall <plugin> [options]
@@ -750,12 +643,6 @@
Enable a disabled plugin.
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude plugin enable <plugin> [options]
**Arguments:**
@@ -777,12 +664,6 @@
Disable a plugin without uninstalling it.
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude plugin disable <plugin> [options]
**Arguments:**
@@ -803,12 +684,6 @@
plugin update
Update a plugin to the latest version.
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude plugin update <plugin> [options]
@@ -923,12 +798,6 @@
**Symptoms** : Plugin loads but components (commands, agents, hooks) are missing. **Correct structure** : Components must be at the plugin root, not inside `.claude-plugin/`. Only `plugin.json` belongs in `.claude-plugin/`.
-Report incorrect code
-
-Copy
-
-Ask AI
-
my-plugin/
├── .claude-plugin/
│ └── plugin.json ← Only manifest here
@@ -957,12 +826,6 @@
Version management
Follow semantic versioning for plugin releases:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"name": "my-plugin",
Show diff (317 lines)
--- a/quickstart.md
+++ b/quickstart.md
@@ -31,54 +31,24 @@
**macOS, Linux, WSL:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- curl -fsSL https://claude.ai/install.sh | bash
+ curl -fsSL https://claude.ai/install.sh | bash
**Windows PowerShell:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- irm https://claude.ai/install.ps1 | iex
+ irm https://claude.ai/install.ps1 | iex
**Windows CMD:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
+ curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
**Windows requires[Git for Windows](<https://git-scm.com/downloads/win>).** Install it first if you don’t have it.
Native installations automatically update in the background to keep you on the latest version.
-Report incorrect code
-
-Copy
-
-Ask AI
-
brew install --cask claude-code
Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes.
-Report incorrect code
-
-Copy
-
-Ask AI
-
winget install Anthropic.ClaudeCode
WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.
@@ -90,21 +60,9 @@
Step 2: Log in to your account
Claude Code requires an account to use. When you start an interactive session with the `claude` command, you’ll need to log in:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude
# You'll be prompted to log in on first use
-
-Report incorrect code
-
-Copy
-
-Ask AI
/login
# Follow the prompts to log in with your account
@@ -125,12 +83,6 @@
Open your terminal in any project directory and start Claude Code:
-Report incorrect code
-
-Copy
-
-Ask AI
-
cd /path/to/your/project
claude
@@ -146,64 +98,22 @@
Let’s start with understanding your codebase. Try one of these commands:
-Report incorrect code
-
-Copy
-
-Ask AI
-
what does this project do?
Claude will analyze your files and provide a summary. You can also ask more specific questions:
-Report incorrect code
-
-Copy
-
-Ask AI
-
what technologies does this project use?
-Report incorrect code
-
-Copy
-
-Ask AI
-
where is the main entry point?
-Report incorrect code
-
-Copy
-
-Ask AI
-
explain the folder structure
You can also ask Claude about its own capabilities:
-Report incorrect code
-
-Copy
-
-Ask AI
-
what can Claude Code do?
-Report incorrect code
-
-Copy
-
-Ask AI
-
how do I create custom skills in Claude Code?
-Report incorrect code
-
-Copy
-
-Ask AI
-
can Claude Code work with Docker?
Claude Code reads your project files as needed. You don’t have to manually add context.
@@ -215,12 +125,6 @@
Step 5: Make your first code change
Now let’s make Claude Code do some actual coding. Try a simple task:
-
-Report incorrect code
-
-Copy
-
-Ask AI
add a hello world function to the main file
@@ -241,46 +145,16 @@
Claude Code makes Git operations conversational:
-Report incorrect code
-
-Copy
-
-Ask AI
-
what files have I changed?
-Report incorrect code
-
-Copy
-
-Ask AI
-
commit my changes with a descriptive message
You can also prompt for more complex Git operations:
-Report incorrect code
-
-Copy
-
-Ask AI
-
create a new branch called feature/quickstart
-Report incorrect code
-
-Copy
-
-Ask AI
-
show me the last 5 commits
-Report incorrect code
-
-Copy
-
-Ask AI
-
help me resolve merge conflicts
##
@@ -291,21 +165,9 @@
Claude is proficient at debugging and feature implementation. Describe what you want in natural language:
-Report incorrect code
-
-Copy
-
-Ask AI
-
add input validation to the user registration form
Or fix existing issues:
-
-Report incorrect code
-
-Copy
-
-Ask AI
there's a bug where users can submit empty forms - fix it
@@ -324,41 +186,17 @@
There are a number of ways to work with Claude: **Refactor code**
-Report incorrect code
-
-Copy
-
-Ask AI
-
refactor the authentication module to use async/await instead of callbacks
**Write tests**
-Report incorrect code
-
-Copy
-
-Ask AI
-
write unit tests for the calculator functions
**Update documentation**
-Report incorrect code
-
-Copy
-
-Ask AI
-
update the README with installation instructions
**Code review**
-
-Report incorrect code
-
-Copy
-
-Ask AI
review my changes and suggest improvements
@@ -402,12 +240,6 @@
Break complex tasks into steps:
-Report incorrect code
-
-Copy
-
-Ask AI
-
1. create a new database table for user profiles
2. create an API endpoint to get and update user profiles
3. build a webpage that allows users to see and edit their information
@@ -416,19 +248,7 @@
Before making changes, let Claude understand your code:
-Report incorrect code
-
-Copy
-
-Ask AI
-
analyze the database schema
-
-Report incorrect code
-
-Copy
-
-Ask AI
build a dashboard showing products that are most frequently returned by our UK customers
Show diff (103 lines)
--- a/remote-control.md
+++ b/remote-control.md
@@ -39,12 +39,6 @@
* From an existing session
Navigate to your project directory and run:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude remote-control
@@ -62,43 +56,19 @@
To start a normal interactive Claude Code session with Remote Control enabled, use the `--remote-control` flag (or `--rc`):
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --remote-control
Optionally pass a name for the session:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --remote-control "My Project"
This gives you a full interactive session in your terminal that you can also control from claude.ai or the Claude app. Unlike `claude remote-control` (server mode), you can type messages locally while the session is also available remotely.
If you’re already in a Claude Code session and want to continue it remotely, use the `/remote-control` (or `/rc`) command:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/remote-control
Pass a name as an argument to set a custom session title:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/remote-control My Project
@@ -169,6 +139,30 @@
+”Remote Control requires a claude.ai subscription”
+
+You’re not authenticated with a claude.ai account. Run `claude auth login` and choose the claude.ai option. If `ANTHROPIC_API_KEY` is set in your environment, unset it first.
+
+###
+
+
+
+”Remote Control requires a full-scope login token”
+
+You’re authenticated with a long-lived token from `claude setup-token` or the `CLAUDE_CODE_OAUTH_TOKEN` environment variable. These tokens are limited to inference-only and cannot establish Remote Control sessions. Run `claude auth login` to authenticate with a full-scope session token instead.
+
+###
+
+
+
+”Unable to determine your organization for Remote Control eligibility”
+
+Your cached account information is stale or incomplete. Run `claude auth login` to refresh it.
+
+###
+
+
+
”Remote Control is not yet enabled for your account”
The eligibility check can fail with certain environment variables present:
@@ -197,12 +191,6 @@
”Remote credentials fetch failed”
Claude Code could not obtain a short-lived credential from the Anthropic API to establish the connection. Re-run with `--verbose` to see the full error:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude remote-control --verbose
--- a/sandboxing.md
+++ b/sandboxing.md
@@ -93,20 +93,8 @@
* Fedora
-Report incorrect code
-
-Copy
-
-Ask AI
-
sudo apt-get install bubblewrap socat
-Report incorrect code
-
-Copy
-
-Ask AI
-
sudo dnf install bubblewrap socat
###
@@ -117,12 +105,6 @@
You can enable sandboxing by running the `/sandbox` command:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/sandbox
This opens a menu where you can choose between sandbox modes. If required dependencies are missing (such as `bubblewrap` or `socat` on Linux), the menu displays installation instructions for your platform. By default, if the sandbox cannot start (missing dependencies, unsupported platform, or platform restrictions), Claude Code shows a warning and runs commands without sandboxing. To make this a hard failure instead, set [`sandbox.failIfUnavailable`](</docs/en/settings#sandbox-settings>) to `true`. This is intended for managed deployments that require sandboxing as a security gate.
@@ -152,12 +134,6 @@
Granting subprocess write access to specific paths
By default, sandboxed commands can only write to the current working directory. If subprocess commands like `kubectl`, `terraform`, or `npm` need to write outside the project directory, use `sandbox.filesystem.allowWrite` to grant access to specific paths:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"sandbox": {
@@ -177,12 +153,6 @@
`./` or no prefix| Relative to the project root for project settings, or to `~/.claude` for user settings| `./output` in `.claude/settings.json` resolves to `<project-root>/output`
The older `//path` prefix for absolute paths still works. If you previously used single-slash `/path` expecting project-relative resolution, switch to `./path`. This syntax differs from [Read and Edit permission rules](</docs/en/permissions#read-and-edit>), which use `//path` for absolute and `/path` for project-relative. Sandbox filesystem paths use standard conventions: `/tmp/build` is an absolute path. You can also deny write or read access using `sandbox.filesystem.denyWrite` and `sandbox.filesystem.denyRead`. These are merged with any paths from `Edit(...)` and `Read(...)` permission rules. To re-allow reading specific paths within a denied region, use `sandbox.filesystem.allowRead`, which takes precedence over `denyRead`. When `allowManagedReadPathsOnly` is enabled in managed settings, only managed `allowRead` entries are respected; user, project, and local `allowRead` entries are ignored. For example, to block reading from the entire home directory while still allowing reads from the current project, add this to your project’s `.claude/settings.json`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"sandbox": {
@@ -318,12 +288,6 @@
* Log all network requests
* Integrate with existing security infrastructure
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"sandbox": {
"network": {
@@ -365,12 +329,6 @@
The sandbox runtime is available as an open source npm package for use in your own agent projects. This enables the broader AI agent community to build safer, more secure autonomous systems. This can also be used to sandbox other programs you may wish to run. For example, to sandbox an MCP server you could run:
-Report incorrect code
-
-Copy
-
-Ask AI
-
npx @anthropic-ai/sandbox-runtime <command-to-sandbox>
For implementation details and source code, visit the [GitHub repository](<https://github.com/anthropic-experimental/sandbox-runtime>).
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -32,12 +32,6 @@
The `/loop` [bundled skill](</docs/en/skills#bundled-skills>) is the quickest way to schedule a recurring prompt. Pass an optional interval and a prompt, and Claude sets up a cron job that fires in the background while the session stays open.
-Report incorrect code
-
-Copy
-
-Ask AI
-
/loop 5m check if the deployment finished and tell me what happened
Claude parses the interval, converts it to a cron expression, schedules the job, and confirms the cadence and job ID.
@@ -66,12 +60,6 @@
The scheduled prompt can itself be a command or skill invocation. This is useful for re-running a workflow you’ve already packaged.
-Report incorrect code
-
-Copy
-
-Ask AI
-
/loop 20m /review-pr 1234
Each time the job fires, Claude runs `/review-pr 1234` as if you had typed it.
@@ -84,19 +72,7 @@
For one-shot reminders, describe what you want in natural language instead of using `/loop`. Claude schedules a single-fire task that deletes itself after running.
-Report incorrect code
-
-Copy
-
-Ask AI
-
remind me at 3pm to push the release branch
-
-Report incorrect code
-
-Copy
-
-Ask AI
in 45 minutes, check whether the integration tests passed
@@ -110,19 +86,7 @@
Ask Claude in natural language to list or cancel tasks, or reference the underlying tools directly.
-Report incorrect code
-
-Copy
-
-Ask AI
-
what scheduled tasks do I have?
-
-Report incorrect code
-
-Copy
-
-Ask AI
cancel the deploy check job
--- a/server-managed-settings.md
+++ b/server-managed-settings.md
@@ -46,12 +46,6 @@
Define your settings
Add your configuration as JSON. All [settings available in `settings.json`](</docs/en/settings#available-settings>) are supported, including [hooks](</docs/en/hooks>), [environment variables](</docs/en/env-vars>), and [managed-only settings](</docs/en/permissions#managed-only-settings>) like `allowManagedPermissionRulesOnly`.This example enforces a permission deny list and prevents users from bypassing permissions:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"permissions": {
@@ -66,12 +60,6 @@
}
Hooks use the same format as in `settings.json`.This example runs an audit script after every file edit across the organization:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -88,12 +76,6 @@
To configure the [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) classifier so it knows which repos, buckets, and domains your organization trusts:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"autoMode": {
"environment": [
Show diff (378 lines)
--- a/settings.md
+++ b/settings.md
@@ -120,12 +120,6 @@
Claude Code automatically creates timestamped backups of configuration files and retains the five most recent backups to prevent data loss.
Example settings.json
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
@@ -332,12 +326,6 @@
The older `//path` prefix for absolute paths still works. If you previously used single-slash `/path` expecting project-relative resolution, switch to `./path`. This syntax differs from [Read and Edit permission rules](</docs/en/permissions#read-and-edit>), which use `//path` for absolute and `/path` for project-relative. Sandbox filesystem paths use standard conventions: `/tmp/build` is an absolute path. **Configuration example:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"sandbox": {
"enabled": true,
@@ -380,33 +368,15 @@
**Default commit attribution:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.6 <[[email protected]](</cdn-cgi/l/email-protection>)>
**Default pull request attribution:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
🤖 Generated with [Claude Code](https://claude.com/claude-code)
**Example:**
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"attribution": {
@@ -425,12 +395,6 @@
Configure a custom command for `@` file path autocomplete. The built-in file suggestion uses fast filesystem traversal, but large monorepos may benefit from project-specific indexing such as a pre-built file index or custom tooling.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"fileSuggestion": {
"type": "command",
@@ -440,21 +404,9 @@
The command runs with the same environment variables as [hooks](</docs/en/hooks>), including `CLAUDE_PROJECT_DIR`. It receives JSON via stdin with a `query` field:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{"query": "src/comp"}
Output newline-separated file paths to stdout (currently limited to 15):
-
-Report incorrect code
-
-Copy
-
-Ask AI
src/components/Button.tsx
src/components/Modal.tsx
@@ -462,12 +414,6 @@
**Example:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
query=$(cat | jq -r '.query')
your-repo-file-index --query "$query" | head -20
@@ -485,23 +431,11 @@
**Restrict HTTP hook URLs:** Limit which URLs HTTP hooks can target. Supports `*` as a wildcard for matching. When the array is defined, HTTP hooks targeting non-matching URLs are silently blocked.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"allowedHttpHookUrls": ["https://hooks.example.com/*", "http://localhost:*"]
}
**Restrict HTTP hook environment variables:** Limit which environment variable names HTTP hooks can interpolate into header values. Each hook’s effective `allowedEnvVars` is the intersection of its own list and this setting.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"httpHookAllowedEnvVars": ["MY_TOKEN", "HOOK_SECRET"]
@@ -569,12 +503,6 @@
To prevent Claude Code from accessing files containing sensitive information like API keys, secrets, and environment files, use the `permissions.deny` setting in your `.claude/settings.json` file:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"permissions": {
"deny": [
@@ -617,12 +545,6 @@
Plugin settings
Plugin-related settings in `settings.json`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"enabledPlugins": {
@@ -652,12 +574,6 @@
**Example** :
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"enabledPlugins": {
"code-formatter@team-tools": true,
@@ -680,12 +596,6 @@
4. Installation respects trust boundaries and requires explicit consent
**Example** :
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"extraKnownMarketplaces": {
@@ -713,12 +623,6 @@
* `settings`: inline marketplace declared directly in settings.json without a separate hosted repository (uses `name` and `plugins`)
Use `source: 'settings'` to declare a small set of plugins inline without setting up a hosted marketplace repository. Plugins listed here must reference external sources such as GitHub or npm. You still need to enable each plugin separately in `enabledPlugins`.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"extraKnownMarketplaces": {
@@ -769,12 +673,6 @@
1. **GitHub repositories** :
-Report incorrect code
-
-Copy
-
-Ask AI
-
{ "source": "github", "repo": "acme-corp/approved-plugins" }
{ "source": "github", "repo": "acme-corp/security-tools", "ref": "v2.0" }
{ "source": "github", "repo": "acme-corp/plugins", "ref": "main", "path": "marketplace" }
@@ -783,12 +681,6 @@
2. **Git repositories** :
-Report incorrect code
-
-Copy
-
-Ask AI
-
{ "source": "git", "url": "https://gitlab.example.com/tools/plugins.git" }
{ "source": "git", "url": "https://bitbucket.org/acme-corp/plugins.git", "ref": "production" }
{ "source": "git", "url": "ssh://[[email protected]](</cdn-cgi/l/email-protection>)/plugins.git", "ref": "v3.1", "path": "approved" }
@@ -797,12 +689,6 @@
3. **URL-based marketplaces** :
-Report incorrect code
-
-Copy
-
-Ask AI
-
{ "source": "url", "url": "https://plugins.example.com/marketplace.json" }
{ "source": "url", "url": "https://cdn.example.com/marketplace.json", "headers": { "Authorization": "Bearer ${TOKEN}" } }
@@ -812,12 +698,6 @@
4. **NPM packages** :
-Report incorrect code
-
-Copy
-
-Ask AI
-
{ "source": "npm", "package": "@acme-corp/claude-plugins" }
{ "source": "npm", "package": "@acme-corp/approved-marketplace" }
@@ -825,12 +705,6 @@
5. **File paths** :
-Report incorrect code
-
-Copy
-
-Ask AI
-
{ "source": "file", "path": "/usr/local/share/claude/acme-marketplace.json" }
{ "source": "file", "path": "/opt/acme-corp/plugins/marketplace.json" }
@@ -838,24 +712,12 @@
6. **Directory paths** :
-Report incorrect code
-
-Copy
-
-Ask AI
-
{ "source": "directory", "path": "/usr/local/share/claude/acme-plugins" }
{ "source": "directory", "path": "/opt/acme-corp/approved-marketplaces" }
Fields: `path` (required: absolute path to directory containing `.claude-plugin/marketplace.json`)
7. **Host pattern matching** :
-
-Report incorrect code
-
-Copy
-
-Ask AI
{ "source": "hostPattern", "hostPattern": "^github\\.example\\.com$" }
{ "source": "hostPattern", "hostPattern": "^gitlab\\.internal\\.example\\.com$" }
@@ -868,12 +730,6 @@
* `npm`, `file`, `directory`: not supported for host pattern matching
**Configuration examples** : Example: allow specific marketplaces only:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"strictKnownMarketplaces": [
@@ -899,23 +755,11 @@
Example - Disable all marketplace additions:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"strictKnownMarketplaces": []
}
Example: allow all marketplaces from an internal git server:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"strictKnownMarketplaces": [
@@ -933,12 +777,6 @@
* The `path` field must match exactly (or both be undefined)
Examples of sources that **do NOT match** :
-
-Report incorrect code
-
-Copy
-
-Ask AI
// These are DIFFERENT sources:
{ "source": "github", "repo": "acme-corp/plugins" }
@@ -962,12 +800,6 @@
**Format difference** : `strictKnownMarketplaces` uses direct source objects:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"strictKnownMarketplaces": [
{ "source": "github", "repo": "acme-corp/plugins" }
@@ -975,12 +807,6 @@
}
`extraKnownMarketplaces` requires named marketplaces:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"extraKnownMarketplaces": {
@@ -991,12 +817,6 @@
}
**Using both together** : `strictKnownMarketplaces` is a policy gate: it controls what users may add but does not register any marketplaces. To both restrict and pre-register a marketplace for all users, set both in `managed-settings.json`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"strictKnownMarketplaces": [
Show diff (368 lines)
--- a/setup.md
+++ b/setup.md
@@ -45,66 +45,30 @@
**macOS, Linux, WSL:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- curl -fsSL https://claude.ai/install.sh | bash
+ curl -fsSL https://claude.ai/install.sh | bash
**Windows PowerShell:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- irm https://claude.ai/install.ps1 | iex
+ irm https://claude.ai/install.ps1 | iex
**Windows CMD:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
- curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
+ curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
**Windows requires[Git for Windows](<https://git-scm.com/downloads/win>).** Install it first if you don’t have it.
Native installations automatically update in the background to keep you on the latest version.
-Report incorrect code
-
-Copy
-
-Ask AI
-
brew install --cask claude-code
Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes.
-Report incorrect code
-
-Copy
-
-Ask AI
-
winget install Anthropic.ClaudeCode
WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.
After installation completes, open a terminal in the project you want to work in and start Claude Code:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude
If you encounter any issues during installation, see the [troubleshooting guide](</docs/en/troubleshooting>).
@@ -116,12 +80,6 @@
Set up on Windows
Claude Code on Windows requires [Git for Windows](<https://git-scm.com/downloads/win>) or WSL. You can launch `claude` from PowerShell, CMD, or Git Bash. Claude Code uses Git Bash internally to run commands. You do not need to run PowerShell as Administrator. **Option 1: Native Windows with Git Bash** Install [Git for Windows](<https://git-scm.com/downloads/win>), then run the install command from PowerShell or CMD. If Claude Code can’t find your Git Bash installation, set the path in your [settings.json file](</docs/en/settings>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"env": {
@@ -139,21 +97,9 @@
The native installer on Alpine and other musl/uClibc-based distributions requires `libgcc`, `libstdc++`, and `ripgrep`. Install these using your distribution’s package manager, then set `USE_BUILTIN_RIPGREP=0`. This example installs the required packages on Alpine:
-Report incorrect code
-
-Copy
-
-Ask AI
-
apk add libgcc libstdc++ ripgrep
Then set `USE_BUILTIN_RIPGREP` to `0` in your [`settings.json`](</docs/en/settings#available-settings>) file:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"env": {
@@ -169,21 +115,9 @@
After installing, confirm Claude Code is working:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --version
For a more detailed check of your installation and configuration, run [`claude doctor`](</docs/en/troubleshooting#get-more-help>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude doctor
@@ -225,12 +159,6 @@
* `"stable"`: use a version that is typically about one week old, skipping releases with major regressions
Configure this via `/config` → **Auto-update channel** , or add it to your [settings.json file](</docs/en/settings>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"autoUpdatesChannel": "stable"
@@ -245,12 +173,6 @@
Disable auto-updates
Set `DISABLE_AUTOUPDATER` to `"1"` in the `env` key of your [`settings.json`](</docs/en/settings#available-settings>) file:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"env": {
@@ -266,12 +188,6 @@
To apply an update immediately without waiting for the next background check, run:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude update
##
@@ -296,28 +212,10 @@
* Windows CMD
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -fsSL https://claude.ai/install.sh | bash
-Report incorrect code
-
-Copy
-
-Ask AI
-
irm https://claude.ai/install.ps1 | iex
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
To install the stable version:
@@ -328,28 +226,10 @@
* Windows CMD
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -fsSL https://claude.ai/install.sh | bash -s stable
-Report incorrect code
-
-Copy
-
-Ask AI
-
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd stable && del install.cmd
To install a specific version number:
@@ -360,28 +240,10 @@
* Windows CMD
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -fsSL https://claude.ai/install.sh | bash -s 1.0.58
-Report incorrect code
-
-Copy
-
-Ask AI
-
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 1.0.58
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd 1.0.58 && del install.cmd
###
@@ -399,12 +261,6 @@
Migrate from npm to native
If you previously installed Claude Code with npm, switch to the native installer:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Install the native binary
curl -fsSL https://claude.ai/install.sh | bash
@@ -421,12 +277,6 @@
Install with npm
If you need npm installation for compatibility reasons, you must have [Node.js 18+](<https://nodejs.org/en/download>) installed. Install the package globally:
-
-Report incorrect code
-
-Copy
-
-Ask AI
npm install -g @anthropic-ai/claude-code
@@ -465,21 +315,9 @@
* Windows PowerShell
-Report incorrect code
-
-Copy
-
-Ask AI
-
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
-Report incorrect code
-
-Copy
-
-Ask AI
-
Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force
Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force
@@ -491,12 +329,6 @@
Remove the Homebrew cask:
-Report incorrect code
-
-Copy
-
-Ask AI
-
brew uninstall --cask claude-code
###
@@ -507,12 +339,6 @@
Remove the WinGet package:
-Report incorrect code
-
-Copy
-
-Ask AI
-
winget uninstall Anthropic.ClaudeCode
###
@@ -523,12 +349,6 @@
Remove the global npm package:
-Report incorrect code
-
-Copy
-
-Ask AI
-
npm uninstall -g @anthropic-ai/claude-code
###
@@ -544,12 +364,6 @@
* macOS, Linux, WSL
* Windows PowerShell
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Remove user settings and state
rm -rf ~/.claude
@@ -559,12 +373,6 @@
rm -rf .claude
rm -f .mcp.json
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Remove user settings and state
Remove-Item -Path "$env:USERPROFILE\.claude" -Recurse -Force
Remove-Item -Path "$env:USERPROFILE\.claude.json" -Force
Show diff (298 lines)
--- a/skills.md
+++ b/skills.md
@@ -40,12 +40,6 @@
Create a directory for the skill in your personal skills folder. Personal skills are available across all your projects.
-Report incorrect code
-
-Copy
-
-Ask AI
-
mkdir -p ~/.claude/skills/explain-code
2
@@ -53,12 +47,6 @@
Write SKILL.md
Every skill needs a `SKILL.md` file with two parts: YAML frontmatter (between `---` markers) that tells Claude when to use the skill, and markdown content with instructions Claude follows when the skill is invoked. The `name` field becomes the `/slash-command`, and the `description` helps Claude decide when to load it automatically.Create `~/.claude/skills/explain-code/SKILL.md`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: explain-code
@@ -80,21 +68,9 @@
You can test it two ways:**Let Claude invoke it automatically** by asking something that matches the description:
-Report incorrect code
-
-Copy
-
-Ask AI
-
How does this code work?
**Or invoke it directly** with the skill name:
-
-Report incorrect code
-
-Copy
-
-Ask AI
/explain-code src/auth/login.ts
@@ -124,12 +100,6 @@
Automatic discovery from nested directories
When you work with files in subdirectories, Claude Code automatically discovers skills from nested `.claude/skills/` directories. For example, if you’re editing a file in `packages/frontend/`, Claude Code also looks for skills in `packages/frontend/.claude/skills/`. This supports monorepo setups where packages have their own skills. Each skill is a directory with `SKILL.md` as the entrypoint:
-
-Report incorrect code
-
-Copy
-
-Ask AI
my-skill/
├── SKILL.md # Main instructions (required)
@@ -169,12 +139,6 @@
Skill files can contain any instructions, but thinking about how you want to invoke them helps guide what to include: **Reference content** adds knowledge Claude applies to your current work. Conventions, patterns, style guides, domain knowledge. This content runs inline so Claude can use it alongside your conversation context.
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: api-conventions
description: API design patterns for this codebase
@@ -187,12 +151,6 @@
**Task content** gives Claude step-by-step instructions for a specific action, like deployments, commits, or code generation. These are often actions you want to invoke directly with `/skill-name` rather than letting Claude decide when to run them. Add `disable-model-invocation: true` to prevent Claude from triggering it automatically.
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: deploy
description: Deploy the application to production
@@ -214,12 +172,6 @@
Frontmatter reference
Beyond the markdown content, you can configure skill behavior using YAML frontmatter fields between `---` markers at the top of your `SKILL.md` file:
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: my-skill
@@ -245,6 +197,7 @@
`context`| No| Set to `fork` to run in a forked subagent context.
`agent`| No| Which subagent type to use when `context: fork` is set.
`hooks`| No| Hooks scoped to this skill’s lifecycle. See [Hooks in skills and agents](</docs/en/hooks#hooks-in-skills-and-agents>) for configuration format.
+`paths`| No| Glob patterns that limit when this skill is activated. Accepts a comma-separated string or a YAML list. When set, Claude loads the skill automatically only when working with files matching the patterns. Uses the same format as [path-specific rules](</docs/en/memory#path-specific-rules>).
`shell`| No| Shell to use for `!`command`` blocks in this skill. Accepts `bash` (default) or `powershell`. Setting `powershell` runs inline shell commands via PowerShell on Windows. Requires `CLAUDE_CODE_USE_POWERSHELL_TOOL=1`.
####
@@ -265,12 +218,6 @@
**Example using substitutions:**
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: session-logger
description: Log activity for this session
@@ -287,12 +234,6 @@
Add supporting files
Skills can include multiple files in their directory. This keeps `SKILL.md` focused on the essentials while letting Claude access detailed reference material only when needed. Large reference docs, API specifications, or example collections don’t need to load into context every time the skill runs.
-
-Report incorrect code
-
-Copy
-
-Ask AI
my-skill/
├── SKILL.md (required - overview and navigation)
@@ -303,12 +244,6 @@
Reference supporting files from `SKILL.md` so Claude knows what each file contains and when to load it:
-Report incorrect code
-
-Copy
-
-Ask AI
-
## Additional resources
- For complete API details, see [reference.md](reference.md)
@@ -328,12 +263,6 @@
* **`user-invocable: false`** : Only Claude can invoke the skill. Use this for background knowledge that isn’t actionable as a command. A `legacy-system-context` skill explains how an old system works. Claude should know this when relevant, but `/legacy-system-context` isn’t a meaningful action for users to take.
This example creates a deploy skill that only you can trigger. The `disable-model-invocation: true` field prevents Claude from running it automatically:
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: deploy
@@ -366,12 +295,6 @@
Use the `allowed-tools` field to limit which tools Claude can use when a skill is active. This skill creates a read-only mode where Claude can explore files but not modify them:
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: safe-reader
description: Read files without making changes
@@ -385,12 +308,6 @@
Pass arguments to skills
Both you and Claude can pass arguments when invoking a skill. Arguments are available via the `$ARGUMENTS` placeholder. This skill fixes a GitHub issue by number. The `$ARGUMENTS` placeholder gets replaced with whatever follows the skill name:
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: fix-issue
@@ -408,12 +325,6 @@
When you run `/fix-issue 123`, Claude receives “Fix GitHub issue 123 following our coding standards…” If you invoke a skill with arguments but the skill doesn’t include `$ARGUMENTS`, Claude Code appends `ARGUMENTS: <your input>` to the end of the skill content so Claude still sees what you typed. To access individual arguments by position, use `$ARGUMENTS[N]` or the shorter `$N`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: migrate-component
description: Migrate a component from one framework to another
@@ -424,12 +335,6 @@
Running `/migrate-component SearchBar React Vue` replaces `$ARGUMENTS[0]` with `SearchBar`, `$ARGUMENTS[1]` with `React`, and `$ARGUMENTS[2]` with `Vue`. The same skill using the `$N` shorthand:
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: migrate-component
description: Migrate a component from one framework to another
@@ -451,12 +356,6 @@
Inject dynamic context
The `!`<command>`` syntax runs shell commands before the skill content is sent to Claude. The command output replaces the placeholder, so Claude receives actual data, not the command itself. This skill summarizes a pull request by fetching live PR data with the GitHub CLI. The `!`gh pr diff`` and other commands run first, and their output gets inserted into the prompt:
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: pr-summary
@@ -511,12 +410,6 @@
This skill runs research in a forked Explore agent. The skill content becomes the task, and the agent provides read-only tools optimized for codebase exploration:
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: deep-research
description: Research a topic thoroughly
@@ -547,22 +440,10 @@
By default, Claude can invoke any skill that doesn’t have `disable-model-invocation: true` set. Skills that define `allowed-tools` grant Claude access to those tools without per-use approval when the skill is active. Your [permission settings](</docs/en/permissions>) still govern baseline approval behavior for all other tools. Built-in commands like `/compact` and `/init` are not available through the Skill tool. Three ways to control which skills Claude can invoke: **Disable all skills** by denying the Skill tool in `/permissions`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Add to deny rules:
Skill
**Allow or deny specific skills** using [permission rules](</docs/en/permissions>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Allow only specific skills
Skill(commit)
@@ -595,21 +476,9 @@
Skills can bundle and run scripts in any language, giving Claude capabilities beyond what’s possible in a single prompt. One powerful pattern is generating visual output: interactive HTML files that open in your browser for exploring data, debugging, or creating reports. This example creates a codebase explorer: an interactive tree view where you can expand and collapse directories, see file sizes at a glance, and identify file types by color. Create the Skill directory:
-Report incorrect code
-
-Copy
-
-Ask AI
-
mkdir -p ~/.claude/skills/codebase-visualizer/scripts
Create `~/.claude/skills/codebase-visualizer/SKILL.md`. The description tells Claude when to activate this Skill, and the instructions tell Claude to run the bundled script:
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: codebase-visualizer
@@ -645,12 +514,6 @@
* A **collapsible tree** where you can expand and collapse directories, with color-coded file type indicators
The script requires Python but uses only built-in libraries, so there are no packages to install:
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/usr/bin/env python3
"""Generate an interactive collapsible tree visualization of a codebase."""
Show diff (210 lines)
--- a/statusline.md
+++ b/statusline.md
@@ -25,12 +25,6 @@
The `/statusline` command accepts natural language instructions describing what you want displayed. Claude Code generates a script file in `~/.claude/` and updates your settings automatically:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/statusline show model name and context percentage with a progress bar
###
@@ -40,12 +34,6 @@
Manually configure a status line
Add a `statusLine` field to your user settings (`~/.claude/settings.json`, where `~` is your home directory) or [project settings](</docs/en/settings#settings-files>). Set `type` to `"command"` and point `command` to a script path or an inline shell command. For a full walkthrough of creating a script, see Build a status line step by step.
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"statusLine": {
@@ -57,12 +45,6 @@
The `command` field runs in a shell, so you can also use inline commands instead of a script file. This example uses `jq` to parse the JSON input and display the model name and context percentage:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"statusLine": {
"type": "command",
@@ -98,12 +80,6 @@
Claude Code sends JSON data to your script via stdin. This script uses [`jq`](<https://jqlang.github.io/jq/>), a command-line JSON parser you may need to install, to extract the model name, directory, and context percentage, then prints a formatted line.Save this to `~/.claude/statusline.sh` (where `~` is your home directory, such as `/Users/username` on macOS or `/home/username` on Linux):
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
# Read JSON data that Claude Code sends to stdin
input=$(cat)
@@ -123,12 +99,6 @@
Mark the script as executable so your shell can run it:
-Report incorrect code
-
-Copy
-
-Ask AI
-
chmod +x ~/.claude/statusline.sh
3
@@ -136,12 +106,6 @@
Add to settings
Tell Claude Code to run your script as the status line. Add this configuration to `~/.claude/settings.json`, which sets `type` to `"command"` (meaning “run this shell command”) and points `command` to your script:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"statusLine": {
@@ -207,12 +171,6 @@
Your status line command receives this JSON structure via stdin:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"cwd": "/current/working/directory",
"session_id": "abc123...",
@@ -337,12 +295,6 @@
Node.js
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
# Read all of stdin into a variable
input=$(cat)
@@ -378,12 +330,6 @@
Node.js
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
input=$(cat)
@@ -422,12 +368,6 @@
Node.js
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
input=$(cat)
@@ -458,12 +398,6 @@
Node.js
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
input=$(cat)
@@ -508,12 +442,6 @@
Python
Node.js
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/bin/bash
input=$(cat)
@@ -546,12 +474,6 @@
Node.js
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
input=$(cat)
@@ -579,12 +501,6 @@
Python
Node.js
-
-Report incorrect code
-
-Copy
-
-Ask AI
#!/bin/bash
input=$(cat)
@@ -632,12 +548,6 @@
statusline.ps1
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"statusLine": {
"type": "command",
@@ -651,12 +561,6 @@
statusline.sh
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"statusLine": {
"type": "command",
Show diff (450 lines)
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -1,4 +1,4 @@
-Subagents are specialized AI assistants that handle specific types of tasks. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent’s description, it delegates to that subagent, which works independently and returns results.
+Subagents are specialized AI assistants that handle specific types of tasks. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent’s description, it delegates to that subagent, which works independently and returns results. To see the context savings in practice, the [context window visualization](</docs/en/context-window>) walks through a session where a subagent handles research in its own separate window.
If you need multiple agents working in parallel and communicating with each other, see [agent teams](</docs/en/agent-teams>) instead. Subagents work within a single session; agent teams coordinate across separate sessions.
@@ -76,12 +76,6 @@
In Claude Code, run:
-Report incorrect code
-
-Copy
-
-Ask AI
-
/agents
2
@@ -95,12 +89,6 @@
Generate with Claude
Select **Generate with Claude**. When prompted, describe the subagent:
-
-Report incorrect code
-
-Copy
-
-Ask AI
A code improvement agent that scans files and suggests improvements
for readability, performance, and best practices. It should explain
@@ -137,12 +125,6 @@
Save and try it out
Review the configuration summary. Press `s` or `Enter` to save, or press `e` to save and edit the file in your editor. The subagent is available immediately. Try it:
-
-Report incorrect code
-
-Copy
-
-Ask AI
Use the code-improver agent to suggest improvements in this project
@@ -188,12 +170,6 @@
Plugin’s `agents/` directory| Where plugin is enabled| 4 (lowest)| Installed with [plugins](</docs/en/plugins>)
**Project subagents** (`.claude/agents/`) are ideal for subagents specific to a codebase. Check them into version control so your team can use and improve them collaboratively. **User subagents** (`~/.claude/agents/`) are personal subagents available in all your projects. **CLI-defined subagents** are passed as JSON when launching Claude Code. They exist only for that session and aren’t saved to disk, making them useful for quick testing or automation scripts. You can define multiple subagents in a single `--agents` call:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude --agents '{
"code-reviewer": {
@@ -221,12 +197,6 @@
Subagent files use YAML frontmatter for configuration, followed by the system prompt in Markdown:
Subagents are loaded at session start. If you create a subagent by manually adding a file, restart your session or use `/agents` to load it immediately.
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: code-reviewer
@@ -302,12 +272,6 @@
Subagents can use any of Claude Code’s [internal tools](</docs/en/tools-reference>). By default, subagents inherit all tools from the main conversation, including MCP tools. To restrict tools, use either the `tools` field (allowlist) or the `disallowedTools` field (denylist). This example uses `tools` to exclusively allow Read, Grep, Glob, and Bash. The subagent can’t edit files, write files, or use any MCP tools:
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: safe-researcher
description: Research agent with restricted capabilities
@@ -316,12 +280,6 @@
This example uses `disallowedTools` to inherit every tool from the main conversation except Write and Edit. The subagent keeps Bash, MCP tools, and everything else:
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: no-writes
description: Inherits every tool except file writes
@@ -340,12 +298,6 @@
In version 2.1.63, the Task tool was renamed to Agent. Existing `Task(...)` references in settings and agent definitions still work as aliases.
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: coordinator
description: Coordinates work across specialized agents
@@ -354,12 +306,6 @@
This is an allowlist: only the `worker` and `researcher` subagents can be spawned. If the agent tries to spawn any other type, the request fails and the agent sees only the allowed types in its prompt. To block specific agents while allowing all others, use `permissions.deny` instead. To allow spawning any subagent without restrictions, use `Agent` without parentheses:
-Report incorrect code
-
-Copy
-
-Ask AI
-
tools: Agent, Read, Bash
If `Agent` is omitted from the `tools` list entirely, the agent cannot spawn any subagents. This restriction only applies to agents running as the main thread with `claude --agent`. Subagents cannot spawn other subagents, so `Agent(agent_type)` has no effect in subagent definitions.
@@ -371,12 +317,6 @@
Scope MCP servers to a subagent
Use the `mcpServers` field to give a subagent access to [MCP](</docs/en/mcp>) servers that aren’t available in the main conversation. Inline servers defined here are connected when the subagent starts and disconnected when it finishes. String references share the parent session’s connection. Each entry in the list is either an inline server definition or a string referencing an MCP server already configured in your session:
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: browser-tester
@@ -423,12 +363,6 @@
Use the `skills` field to inject skill content into a subagent’s context at startup. This gives the subagent domain knowledge without requiring it to discover and load skills during execution.
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: api-developer
description: Implement API endpoints following team conventions
@@ -451,12 +385,6 @@
The `memory` field gives the subagent a persistent directory that survives across conversations. The subagent uses this directory to build up knowledge over time, such as codebase patterns, debugging insights, and architectural decisions.
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: code-reviewer
description: Reviews code for quality and best practices
@@ -477,7 +405,7 @@
When memory is enabled:
* The subagent’s system prompt includes instructions for reading and writing to the memory directory.
- * The subagent’s system prompt also includes the first 200 lines of `MEMORY.md` in the memory directory, with instructions to curate `MEMORY.md` if it exceeds 200 lines.
+ * The subagent’s system prompt also includes the first 200 lines or 25KB of `MEMORY.md` in the memory directory, whichever comes first, with instructions to curate `MEMORY.md` if it exceeds that limit.
* Read, Write, and Edit tools are automatically enabled so the subagent can manage its memory files.
##### Persistent memory tips
@@ -487,12 +415,6 @@
* Ask the subagent to update its memory after completing a task: “Now that you’re done, save what you learned to your memory.” Over time, this builds a knowledge base that makes the subagent more effective.
* Include memory instructions directly in the subagent’s markdown file so it proactively maintains its own knowledge base:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Update your agent memory as you discover codepaths, patterns, library
locations, and key architectural decisions. This builds up institutional
knowledge across conversations. Write concise notes about what you found
@@ -505,12 +427,6 @@
Conditional rules with hooks
For more dynamic control over tool usage, use `PreToolUse` hooks to validate operations before they execute. This is useful when you need to allow some operations of a tool while blocking others. This example creates a subagent that only allows read-only database queries. The `PreToolUse` hook runs the script specified in `command` before each Bash command executes:
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: db-reader
@@ -526,12 +442,6 @@
Claude Code [passes hook input as JSON](</docs/en/hooks#pretooluse-input>) via stdin to hook commands. The validation script reads this JSON, extracts the Bash command, and [exits with code 2](</docs/en/hooks#exit-code-2-behavior-per-event>) to block write operations:
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
# ./scripts/validate-readonly-query.sh
@@ -556,12 +466,6 @@
You can prevent Claude from using specific subagents by adding them to the `deny` array in your [settings](</docs/en/settings#permission-settings>). Use the format `Agent(subagent-name)` where `subagent-name` matches the subagent’s name field.
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"permissions": {
"deny": ["Agent(Explore)", "Agent(my-custom-agent)"]
@@ -570,12 +474,6 @@
This works for both built-in and custom subagents. You can also use the `--disallowedTools` CLI flag:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --disallowedTools "Agent(Explore)"
See [Permissions documentation](</docs/en/permissions#tool-specific-permission-rules>) for more details on permission rules.
@@ -606,12 +504,6 @@
`Stop`| (none)| When the subagent finishes (converted to `SubagentStop` at runtime)
This example validates Bash commands with the `PreToolUse` hook and runs a linter after file edits with `PostToolUse`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: code-reviewer
@@ -645,12 +537,6 @@
`SubagentStop`| Agent type name| When a subagent completes
Both events support matchers to target specific agent types by name. This example runs a setup script only when the `db-agent` subagent starts, and a cleanup script when any subagent stops:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"hooks": {
@@ -702,42 +588,18 @@
For natural language, there’s no special syntax. Name the subagent and Claude typically delegates:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Use the test-runner subagent to fix failing tests
Have the code-reviewer subagent look at my recent changes
**@-mention the subagent.** Type `@` and pick the subagent from the typeahead, the same way you @-mention files. This ensures that specific subagent runs rather than leaving the choice to Claude:
-Report incorrect code
-
-Copy
-
-Ask AI
-
@"code-reviewer (agent)" look at the auth changes
Your full message still goes to Claude, which writes the subagent’s task prompt based on what you asked. The @-mention controls which subagent Claude invokes, not what prompt it receives. Subagents provided by an enabled [plugin](</docs/en/plugins>) appear in the typeahead as `<plugin-name>:<agent-name>`. You can also type the mention manually without using the picker: `@agent-<name>` for local subagents, or `@agent-<plugin-name>:<agent-name>` for plugin subagents. **Run the whole session as a subagent.** Pass [`--agent <name>`](</docs/en/cli-reference>) to start a session where the main thread itself takes on that subagent’s system prompt, tool restrictions, and model:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --agent code-reviewer
The subagent’s system prompt replaces the default Claude Code system prompt entirely, the same way [`--system-prompt`](</docs/en/cli-reference>) does. `CLAUDE.md` files and project memory still load through the normal message flow. The agent name appears as `@<name>` in the startup header so you can confirm it’s active. This works with built-in and custom subagents, and the choice persists when you resume the session. For a plugin-provided subagent, pass the scoped name: `claude --agent <plugin-name>:<agent-name>`. To make it the default for every session in a project, set `agent` in `.claude/settings.json`:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"agent": "code-reviewer"
@@ -777,12 +639,6 @@
One of the most effective uses for subagents is isolating operations that produce large amounts of output. Running tests, fetching documentation, or processing log files can consume significant context. By delegating these to a subagent, the verbose output stays in the subagent’s context while only the relevant summary returns to your main conversation.
-Report incorrect code
-
-Copy
-
-Ask AI
-
Use a subagent to run the test suite and report only the failing tests with their error messages
####
@@ -793,12 +649,6 @@
For independent investigations, spawn multiple subagents to work simultaneously:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Research the authentication, database, and API modules in parallel using separate subagents
Each subagent explores its area independently, then Claude synthesizes the findings. This works best when the research paths don’t depend on each other.
@@ -814,12 +664,6 @@
Chain subagents
For multi-step workflows, ask Claude to use subagents in sequence. Each subagent completes its task and returns results to Claude, which then passes relevant context to the next subagent.
-
-Report incorrect code
-
-Copy
-
-Ask AI
Use the code-reviewer subagent to find performance issues, then use the optimizer subagent to fix them
@@ -860,12 +704,6 @@
Each subagent invocation creates a new instance with fresh context. To continue an existing subagent’s work instead of starting over, ask Claude to resume it. Resumed subagents retain their full conversation history, including all previous tool calls, results, and reasoning. The subagent picks up exactly where it stopped rather than starting fresh. When a subagent completes, Claude receives its agent ID. Claude uses the `SendMessage` tool with the agent’s ID as the `to` field to resume it. To resume a subagent, ask Claude to continue the previous work:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Use the code-reviewer subagent to review the authentication module
[Agent completes]
@@ -885,12 +723,6 @@
Auto-compaction
Subagents support automatic compaction using the same logic as the main conversation. By default, auto-compaction triggers at approximately 95% capacity. To trigger compaction earlier, set `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` to a lower percentage (for example, `50`). See [environment variables](</docs/en/env-vars>) for details. Compaction events are logged in subagent transcript files:
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"type": "system",
@@ -925,12 +757,6 @@
Code reviewer
A read-only subagent that reviews code without modifying it. This example shows how to design a focused subagent with limited tool access (no Edit or Write) and a detailed prompt that specifies exactly what to look for and how to format output.
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: code-reviewer
@@ -971,12 +797,6 @@
A subagent that can both analyze and fix issues. Unlike the code reviewer, this one includes Edit because fixing bugs requires modifying code. The prompt provides a clear workflow from diagnosis to verification.
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: debugger
description: Debugging specialist for errors, test failures, and unexpected behavior. Use proactively when encountering any issues.
@@ -1016,12 +836,6 @@
A domain-specific subagent for data analysis work. This example shows how to create subagents for specialized workflows outside of typical coding tasks. It explicitly sets `model: sonnet` for more capable analysis.
-Report incorrect code
-
-Copy
-
-Ask AI
-
---
name: data-scientist
description: Data analysis expert for SQL queries, BigQuery operations, and data insights. Use proactively for data analysis tasks and queries.
@@ -1060,12 +874,6 @@
Database query validator
A subagent that allows Bash access but validates commands to permit only read-only SQL queries. This example shows how to use `PreToolUse` hooks for conditional validation when you need finer control than the `tools` field provides.
-
-Report incorrect code
-
-Copy
-
-Ask AI
---
name: db-reader
@@ -1090,12 +898,6 @@
Claude Code [passes hook input as JSON](</docs/en/hooks#pretooluse-input>) via stdin to hook commands. The validation script reads this JSON, extracts the command being executed, and checks it against a list of SQL write operations. If a write operation is detected, the script [exits with code 2](</docs/en/hooks#exit-code-2-behavior-per-event>) to block execution and returns an error message to Claude via stderr. Create the validation script anywhere in your project. The path must match the `command` field in your hook configuration:
-Report incorrect code
-
-Copy
-
-Ask AI
-
#!/bin/bash
# Blocks SQL write operations, allows SELECT queries
@@ -1119,12 +921,6 @@
Make the script executable:
-Report incorrect code
-
-Copy
-
-Ask AI
-
chmod +x ./scripts/validate-readonly-query.sh
The hook receives JSON via stdin with the Bash command in `tool_input.command`. Exit code 2 blocks the operation and feeds the error message back to Claude. See [Hooks](</docs/en/hooks#exit-code-output>) for details on exit codes and [Hook input](</docs/en/hooks#pretooluse-input>) for the complete input schema.
--- a/terminal-config.md
+++ b/terminal-config.md
@@ -56,12 +56,6 @@
If notifications aren’t appearing, verify that your terminal app has notification permissions in your OS settings. When running Claude Code inside tmux, notifications and the [terminal progress bar](</docs/en/settings#global-config-settings>) only reach the outer terminal, such as iTerm2, Kitty, or Ghostty, if you enable passthrough in your tmux configuration:
-Report incorrect code
-
-Copy
-
-Ask AI
-
set -g allow-passthrough on
Without this setting, tmux intercepts the escape sequences and they do not reach the terminal application. Other terminals, including the default macOS Terminal, do not support native notifications. Use [notification hooks](</docs/en/hooks#notification>) instead.
--- a/third-party-integrations.md
+++ b/third-party-integrations.md
@@ -50,12 +50,6 @@
Route Bedrock traffic through your corporate proxy by setting the following [environment variables](</docs/en/env-vars>):
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Enable Bedrock
export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-east-1
@@ -64,12 +58,6 @@
export HTTPS_PROXY='https://proxy.example.com:8080'
Route Bedrock traffic through your LLM gateway by setting the following [environment variables](</docs/en/env-vars>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Enable Bedrock
export CLAUDE_CODE_USE_BEDROCK=1
@@ -90,12 +78,6 @@
Route Foundry traffic through your corporate proxy by setting the following [environment variables](</docs/en/env-vars>):
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Enable Microsoft Foundry
export CLAUDE_CODE_USE_FOUNDRY=1
export ANTHROPIC_FOUNDRY_RESOURCE=your-resource
@@ -105,12 +87,6 @@
export HTTPS_PROXY='https://proxy.example.com:8080'
Route Foundry traffic through your LLM gateway by setting the following [environment variables](</docs/en/env-vars>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Enable Microsoft Foundry
export CLAUDE_CODE_USE_FOUNDRY=1
@@ -131,12 +107,6 @@
Route Vertex AI traffic through your corporate proxy by setting the following [environment variables](</docs/en/env-vars>):
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Enable Vertex
export CLAUDE_CODE_USE_VERTEX=1
export CLOUD_ML_REGION=us-east5
@@ -146,12 +116,6 @@
export HTTPS_PROXY='https://proxy.example.com:8080'
Route Vertex AI traffic through your LLM gateway by setting the following [environment variables](</docs/en/env-vars>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Enable Vertex
export CLAUDE_CODE_USE_VERTEX=1
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -65,12 +65,6 @@
Set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1` in your environment or in `settings.json`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"env": {
"CLAUDE_CODE_USE_POWERSHELL_TOOL": "1"
Show diff (796 lines)
--- a/troubleshooting.md
+++ b/troubleshooting.md
@@ -42,12 +42,6 @@
The installer downloads from `storage.googleapis.com`. Verify you can reach it:
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -sI https://storage.googleapis.com
If this fails, your network may be blocking the connection. Common causes:
@@ -58,12 +52,6 @@
If you’re behind a corporate proxy, set `HTTPS_PROXY` and `HTTP_PROXY` to your proxy’s address before installing. Ask your IT team for the proxy URL if you don’t know it, or check your browser’s proxy settings. This example sets both proxy variables, then runs the installer through your proxy:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
curl -fsSL https://claude.ai/install.sh | bash
@@ -82,21 +70,9 @@
* Windows CMD
-Report incorrect code
-
-Copy
-
-Ask AI
-
echo $PATH | tr ':' '\n' | grep local/bin
If there’s no output, the directory is missing. Add it to your shell configuration:
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Zsh (macOS default)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
@@ -108,59 +84,23 @@
Alternatively, close and reopen your terminal.Verify the fix worked:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --version
-Report incorrect code
-
-Copy
-
-Ask AI
-
$env:PATH -split ';' | Select-String 'local\\bin'
If there’s no output, add the install directory to your User PATH:
-
-Report incorrect code
-
-Copy
-
-Ask AI
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')
Restart your terminal for the change to take effect.Verify the fix worked:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --version
-Report incorrect code
-
-Copy
-
-Ask AI
-
echo %PATH% | findstr /i "local\bin"
If there’s no output, open System Settings, go to Environment Variables, and add `%USERPROFILE%\.local\bin` to your User PATH variable. Restart your terminal.Verify the fix worked:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --version
###
@@ -177,67 +117,25 @@
List all `claude` binaries found in your PATH:
-Report incorrect code
-
-Copy
-
-Ask AI
-
which -a claude
Check whether the native installer and npm versions are present:
-Report incorrect code
-
-Copy
-
-Ask AI
-
ls -la ~/.local/bin/claude
-Report incorrect code
-
-Copy
-
-Ask AI
-
ls -la ~/.claude/local/
-Report incorrect code
-
-Copy
-
-Ask AI
-
npm -g ls @anthropic-ai/claude-code 2>/dev/null
-
-Report incorrect code
-
-Copy
-
-Ask AI
where.exe claude
Test-Path "$env:LOCALAPPDATA\Claude Code\claude.exe"
If you find multiple installations, keep only one. The native install at `~/.local/bin/claude` is recommended. Remove any extra installations: Uninstall an npm global install:
-Report incorrect code
-
-Copy
-
-Ask AI
-
npm uninstall -g @anthropic-ai/claude-code
Remove a Homebrew install on macOS:
-Report incorrect code
-
-Copy
-
-Ask AI
-
brew uninstall --cask claude-code
###
@@ -247,24 +145,12 @@
Check directory permissions
The installer needs write access to `~/.local/bin/` and `~/.claude/`. If installation fails with permission errors, check whether these directories are writable:
-
-Report incorrect code
-
-Copy
-
-Ask AI
test -w ~/.local/bin && echo "writable" || echo "not writable"
test -w ~/.claude && echo "writable" || echo "not writable"
If either directory isn’t writable, create the install directory and set your user as the owner:
-Report incorrect code
-
-Copy
-
-Ask AI
-
sudo mkdir -p ~/.local/bin
sudo chown -R $(whoami) ~/.local
@@ -276,32 +162,14 @@
If `claude` is installed but crashes or hangs on startup, run these checks to narrow down the cause. Confirm the binary exists and is executable:
-Report incorrect code
-
-Copy
-
-Ask AI
-
ls -la $(which claude)
On Linux, check for missing shared libraries. If `ldd` shows missing libraries, you may need to install system packages. On Alpine Linux and other musl-based distributions, see [Alpine Linux setup](</docs/en/setup#alpine-linux-and-musl-based-distributions>).
-Report incorrect code
-
-Copy
-
-Ask AI
-
ldd $(which claude) | grep "not found"
Run a quick sanity check that the binary can execute:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude --version
##
@@ -319,45 +187,21 @@
Install script returns HTML instead of a shell script
When running the install command, you may see one of these errors:
-
-Report incorrect code
-
-Copy
-
-Ask AI
bash: line 1: syntax error near unexpected token `<'
bash: line 1: `<!DOCTYPE html>'
On PowerShell, the same problem appears as:
-Report incorrect code
-
-Copy
-
-Ask AI
-
Invoke-Expression: Missing argument in parameter list.
This means the install URL returned an HTML page instead of the install script. If the HTML page says “App unavailable in region,” Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). Otherwise, this can happen due to network issues, regional routing, or a temporary service disruption. **Solutions:**
1. **Use an alternative install method** : On macOS or Linux, install via Homebrew:
-Report incorrect code
-
-Copy
-
-Ask AI
-
brew install --cask claude-code
On Windows, install via WinGet:
-
-Report incorrect code
-
-Copy
-
-Ask AI
winget install Anthropic.ClaudeCode
@@ -390,33 +234,15 @@
1. **Check network stability** : Claude Code binaries are hosted on Google Cloud Storage. Test that you can reach it:
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -fsSL https://storage.googleapis.com -o /dev/null
If the command completes silently, your connection is fine and the issue is likely intermittent. Retry the install command. If you see an error, your network may be blocking the download.
2. **Try an alternative install method** : On macOS or Linux:
-Report incorrect code
-
-Copy
-
-Ask AI
-
brew install --cask claude-code
On Windows:
-Report incorrect code
-
-Copy
-
-Ask AI
-
winget install Anthropic.ClaudeCode
###
@@ -429,43 +255,19 @@
1. **Update your system CA certificates** : On Ubuntu/Debian:
-Report incorrect code
-
-Copy
-
-Ask AI
-
sudo apt-get update && sudo apt-get install ca-certificates
On macOS via Homebrew:
-Report incorrect code
-
-Copy
-
-Ask AI
-
brew install ca-certificates
2. **On Windows, enable TLS 1.2** in PowerShell before running the installer:
-
-Report incorrect code
-
-Copy
-
-Ask AI
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
irm https://claude.ai/install.ps1 | iex
3. **Check for proxy or firewall interference** : corporate proxies that perform TLS inspection can cause these errors, including `unable to get local issuer certificate`. Set `NODE_EXTRA_CA_CERTS` to your corporate CA certificate bundle:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem
Ask your IT team for the certificate file if you don’t have it. You can also try on a direct connection to confirm the proxy is the cause.
@@ -480,43 +282,19 @@
1. **Test connectivity directly** :
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -sI https://storage.googleapis.com
2. **If behind a proxy** , set `HTTPS_PROXY` so the installer can route through it. See [proxy configuration](</docs/en/network-config#proxy-configuration>) for details.
-
-Report incorrect code
-
-Copy
-
-Ask AI
export HTTPS_PROXY=http://proxy.example.com:8080
curl -fsSL https://claude.ai/install.sh | bash
3. **If on a restricted network** , try a different network or VPN, or use an alternative install method: On macOS or Linux:
-Report incorrect code
-
-Copy
-
-Ask AI
-
brew install --cask claude-code
On Windows:
-Report incorrect code
-
-Copy
-
-Ask AI
-
winget install Anthropic.ClaudeCode
###
@@ -529,32 +307,14 @@
* **`irm` not recognized**: you’re in CMD, not PowerShell. You have two options: Open PowerShell by searching for “PowerShell” in the Start menu, then run the original install command:
-Report incorrect code
-
-Copy
-
-Ask AI
-
irm https://claude.ai/install.ps1 | iex
Or stay in CMD and use the CMD installer instead:
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
* **`&&` not valid**: you’re in PowerShell but ran the CMD installer command. Use the PowerShell installer:
-Report incorrect code
-
-Copy
-
-Ask AI
-
irm https://claude.ai/install.ps1 | iex
###
@@ -564,12 +324,6 @@
Install killed on low-memory Linux servers
If you see `Killed` during installation on a VPS or cloud instance:
-
-Report incorrect code
-
-Copy
-
-Ask AI
Setting up Claude Code...
Installing Claude Code native build latest...
@@ -578,12 +332,6 @@
The Linux OOM killer terminated the process because the system ran out of memory. Claude Code requires at least 4 GB of available RAM. **Solutions:**
1. **Add swap space** if your server has limited RAM. Swap uses disk space as overflow memory, letting the install complete even with low physical RAM. Create a 2 GB swap file and enable it:
-
-Report incorrect code
-
-Copy
-
-Ask AI
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
@@ -592,12 +340,6 @@
Then retry the installation:
-Report incorrect code
-
-Copy
-
-Ask AI
-
curl -fsSL https://claude.ai/install.sh | bash
2. **Close other processes** to free memory before installing.
@@ -613,23 +355,11 @@
1. **Set a working directory** before running the installer. When run from `/`, the installer scans the entire filesystem, which causes excessive memory usage. Setting `WORKDIR` limits the scan to a small directory:
-Report incorrect code
-
-Copy
-
-Ask AI
-
WORKDIR /tmp
RUN curl -fsSL https://claude.ai/install.sh | bash
2. **Increase Docker memory limits** if using Docker Desktop:
-Report incorrect code
-
-Copy
-
-Ask AI
-
docker build --memory=4g .
###
@@ -647,12 +377,6 @@
Windows: “Claude Code on Windows requires git-bash”
Claude Code on native Windows needs [Git for Windows](<https://git-scm.com/downloads/win>), which includes Git Bash. **If Git is not installed** , download and install it from [git-scm.com/downloads/win](<https://git-scm.com/downloads/win>). During setup, select “Add to PATH.” Restart your terminal after installing. **If Git is already installed** but Claude Code still can’t find it, set the path in your [settings.json file](</docs/en/settings>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"env": {
@@ -670,23 +394,11 @@
If you see errors about missing shared libraries like `libstdc++.so.6` or `libgcc_s.so.1` after installation, the installer may have downloaded the wrong binary variant for your system.
-Report incorrect code
-
-Copy
-
-Ask AI
-
Error loading shared library libstdc++.so.6: No such file or directory
This can happen on glibc-based systems that have musl cross-compilation packages installed, causing the installer to misdetect the system as musl. **Solutions:**
1. **Check which libc your system uses** :
-
-Report incorrect code
-
-Copy
-
-Ask AI
ldd /bin/ls | head -1
@@ -694,12 +406,6 @@
2. **If you’re on glibc but got the musl binary** , remove the installation and reinstall. You can also manually download the correct binary from the GCS bucket at `https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/{VERSION}/manifest.json`. File a [GitHub issue](<https://github.com/anthropics/claude-code/issues>) with the output of `ldd /bin/ls` and `ls /lib/libc.musl*`.
3. **If you’re actually on musl** (Alpine Linux), install the required packages:
-Report incorrect code
-
-Copy
-
-Ask AI
-
apk add libgcc libstdc++ ripgrep
###
@@ -710,35 +416,17 @@
If the installer prints `Illegal instruction` instead of the OOM `Killed` message, the downloaded binary doesn’t match your CPU architecture. This commonly happens on ARM servers that receive an x86 binary, or on older CPUs that lack required instruction sets.
-Report incorrect code
-
-Copy
-
-Ask AI
-
bash: line 142: 2238232 Illegal instruction "$binary_path" install ${TARGET:+"$TARGET"}
**Solutions:**
1. **Verify your architecture** :
-
-Report incorrect code
-
-Copy
-
-Ask AI
uname -m
`x86_64` means 64-bit Intel/AMD, `aarch64` means ARM64. If the binary doesn’t match, [file a GitHub issue](<https://github.com/anthropics/claude-code/issues>) with the output.
2. **Try an alternative install method** while the architecture issue is resolved:
-Report incorrect code
-
-Copy
-
-Ask AI
-
brew install --cask claude-code
###
@@ -748,12 +436,6 @@
`dyld: cannot load` on macOS
If you see `dyld: cannot load` or `Abort trap: 6` during installation, the binary is incompatible with your macOS version or hardware.
-
-Report incorrect code
-
-Copy
-
-Ask AI
dyld: cannot load 'claude-2.1.42-darwin-x64' (load command 0x80000034 is unknown)
Abort trap: 6
@@ -764,12 +446,6 @@
2. **Update macOS** if you’re on an older version. The binary uses load commands that older macOS versions don’t support.
3. **Try Homebrew** as an alternative install method:
-Report incorrect code
-
-Copy
-
-Ask AI
-
brew install --cask claude-code
###
@@ -789,12 +465,6 @@
* Experiencing broken functionality after switching Node versions with nvm in WSL
To resolve this issue, fix your Linux PATH to ensure the Linux node/npm versions take priority: **Primary solution: Ensure nvm is properly loaded in your shell** The most common cause is that nvm isn’t loaded in non-interactive shells. Add the following to your shell configuration file (`~/.bashrc`, `~/.zshrc`, etc.):
-
-Report incorrect code
-
-Copy
-
-Ask AI
# Load nvm if it exists
export NVM_DIR="$HOME/.nvm"
@@ -803,22 +473,10 @@
Or run directly in your current session:
-Report incorrect code
-
-Copy
-
-Ask AI
-
source ~/.nvm/nvm.sh
**Alternative: Adjust PATH order** If nvm is properly loaded but Windows paths still take priority, you can explicitly prepend your Linux paths to PATH in your shell configuration:
-Report incorrect code
-
-Copy
-
-Ask AI
-
export PATH="$HOME/.nvm/versions/node/$(node -v)/bin:$PATH"
Avoid disabling Windows PATH importing via `appendWindowsPath = false` as this breaks the ability to call Windows executables from WSL. Similarly, avoid uninstalling Node.js from Windows if you use it for Windows development.
@@ -835,20 +493,8 @@
* Fedora
-Report incorrect code
-
-Copy
-
-Ask AI
-
sudo apt-get install bubblewrap socat
-Report incorrect code
-
-Copy
-
-Ask AI
-
sudo dnf install bubblewrap socat
WSL1 does not support sandboxing. If you see “Sandboxing requires WSL2”, you need to upgrade to WSL2 or run Claude Code without sandboxing.
@@ -860,12 +506,6 @@
Permission errors during installation
If the native installer fails with permission errors, the target directory may not be writable. See Check directory permissions. If you previously installed with npm and are hitting npm-specific permission errors, switch to the native installer:
-
-Report incorrect code
-
-Copy
-
-Ask AI
curl -fsSL https://claude.ai/install.sh | bash
@@ -931,12 +571,6 @@
If you see `API Error: 400 ... "This organization has been disabled"` despite having an active Claude subscription, an `ANTHROPIC_API_KEY` environment variable is overriding your subscription. This commonly happens when an old API key from a previous employer or project is still set in your shell profile. When `ANTHROPIC_API_KEY` is present and you have approved it, Claude Code uses that key instead of your subscription’s OAuth credentials. In non-interactive mode (`-p`), the key is always used when present. See [authentication precedence](</docs/en/authentication#authentication-precedence>) for the full resolution order. To use your subscription instead, unset the environment variable and remove it from your shell profile:
-Report incorrect code
-
-Copy
-
-Ask AI
-
unset ANTHROPIC_API_KEY
claude
@@ -949,12 +583,6 @@
OAuth login fails in WSL2
Browser-based login in WSL2 may fail if WSL can’t open your Windows browser. Set the `BROWSER` environment variable:
-
-Report incorrect code
-
-Copy
-
-Ask AI
export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"
claude
@@ -997,12 +625,6 @@
To reset Claude Code to default settings, you can remove the configuration files:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# Reset all user settings and state
rm ~/.claude.json
rm -rf ~/.claude/
@@ -1052,12 +674,6 @@
If Search tool, `@file` mentions, custom agents, and custom skills aren’t working, install system `ripgrep`:
-Report incorrect code
-
-Copy
-
-Ask AI
-
# macOS (Homebrew)
brew install ripgrep
@@ -1117,35 +733,17 @@
1. Find your WSL2 IP address:
-Report incorrect code
-
-Copy
-
-Ask AI
-
wsl hostname -I
# Example output: 172.21.123.45
2. Open PowerShell as Administrator and create a firewall rule:
-Report incorrect code
-
-Copy
-
-Ask AI
-
New-NetFirewallRule -DisplayName "Allow WSL2 Internal Traffic" -Direction Inbound -Protocol TCP -Action Allow -RemoteAddress 172.21.0.0/16 -LocalAddress 172.21.0.0/16
Adjust the IP range based on your WSL2 subnet from step 1.
3. Restart both your IDE and Claude Code
**Option 2: Switch to mirrored networking** Add to `.wslconfig` in your Windows user directory:
-
-Report incorrect code
-
-Copy
-
-Ask AI
[wsl2]
networkingMode=mirrored
@@ -1202,12 +800,6 @@
If you notice code blocks like this in generated markdown:
-Report incorrect code
-
-Copy
-
-Ask AI
-
```
function example() {
return "hello";
@@ -1215,12 +807,6 @@
```text
Instead of properly tagged blocks like:
-
-Report incorrect code
-
-Copy
-
-Ask AI
```javascript
function example() {
--- a/voice-dictation.md
+++ b/voice-dictation.md
@@ -18,22 +18,10 @@
Run `/voice` to toggle voice dictation on. The first time you enable it, Claude Code runs a microphone check. On macOS, this triggers the system microphone permission prompt for your terminal if it has never been granted.
-Report incorrect code
-
-Copy
-
-Ask AI
-
/voice
Voice mode enabled. Hold Space to record. Dictation language: en (/config to change).
Voice dictation persists across sessions. Run `/voice` again to turn it off, or set it directly in your [user settings file](</docs/en/settings>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"voiceEnabled": true
@@ -52,12 +40,6 @@
To skip the warmup, rebind to a modifier combination like `meta+k`. Modifier combos start recording on the first keypress.
Your speech appears in the prompt as you speak, dimmed until the transcript is finalized. Release `Space` to stop recording and finalize the text. The transcript is inserted at your cursor position and the cursor stays at the end of the inserted text, so you can mix typing and dictation in any order. Hold `Space` again to append another recording, or move the cursor first to insert speech elsewhere in the prompt:
-
-Report incorrect code
-
-Copy
-
-Ask AI
> refactor the auth middleware to ▮
# hold Space, speak "use the new token validation helper"
@@ -100,12 +82,6 @@
Set the language in `/config` or directly in settings. You can use either the [BCP 47 language code](<https://en.wikipedia.org/wiki/IETF_language_tag>) or the language name:
-Report incorrect code
-
-Copy
-
-Ask AI
-
{
"language": "japanese"
}
@@ -119,12 +95,6 @@
Rebind the push-to-talk key
The push-to-talk key is bound to `voice:pushToTalk` in the `Chat` context and defaults to `Space`. Rebind it in [`~/.claude/keybindings.json`](</docs/en/keybindings>):
-
-Report incorrect code
-
-Copy
-
-Ask AI
{
"bindings": [
Show diff (106 lines)
--- a/vs-code.md
+++ b/vs-code.md
@@ -90,12 +90,6 @@
Use @-mentions to give Claude context about specific files or folders. When you type `@` followed by a file or folder name, Claude reads that content and can answer questions about it or make changes to it. Claude Code supports fuzzy matching, so you can type partial names to find what you need:
-Report incorrect code
-
-Copy
-
-Ask AI
-
> Explain the logic in @auth (fuzzy matches auth.js, AuthService.ts, etc.)
> What's in @src/components/ (include a trailing slash for folders)
@@ -227,12 +221,6 @@
Automate browser tasks with Chrome
Connect Claude to your Chrome browser to test web apps, debug with console logs, and automate browser workflows without leaving VS Code. This requires the [Claude in Chrome extension](<https://chromewebstore.google.com/detail/claude/fcoeoabgfenejglbffodgkkbkcdhcgfn>) version 1.0.36 or higher. Type `@browser` in the prompt box followed by what you want Claude to do:
-
-Report incorrect code
-
-Copy
-
-Ask AI
@browser go to localhost:3000 and check the console for errors
@@ -268,12 +256,6 @@
The extension registers a URI handler at `vscode://anthropic.claude-code/open`. Use it to open a new Claude Code tab from your own tooling: a shell alias, a browser bookmarklet, or any script that can open a URL. If VS Code isn’t already running, opening the URL launches it first. If VS Code is already running, the URL opens in whichever window is currently focused. Invoke the handler with your operating system’s URL opener. On macOS:
-Report incorrect code
-
-Copy
-
-Ask AI
-
open "vscode://anthropic.claude-code/open"
Use `xdg-open` on Linux or `start` on Windows. The handler accepts two optional query parameters:
@@ -284,12 +266,6 @@
`session`| A session ID to resume instead of starting a new conversation. The session must belong to the workspace currently open in VS Code. If the session isn’t found, a fresh conversation starts instead. If the session is already open in a tab, that tab is focused. To capture a session ID programmatically, see [Continue conversations](</docs/en/headless#continue-conversations>).
For example, to open a tab pre-filled with “review my changes”:
-
-Report incorrect code
-
-Copy
-
-Ask AI
vscode://anthropic.claude-code/open?prompt=review%20my%20changes
@@ -398,12 +374,6 @@
MCP (Model Context Protocol) servers give Claude access to external tools, databases, and APIs. To add an MCP server, open the integrated terminal (`Ctrl+`` or `Cmd+``) and run:
-Report incorrect code
-
-Copy
-
-Ask AI
-
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
Once configured, ask Claude to use the tools (e.g., “Review PR #456”). To manage MCP servers without leaving VS Code, type `/mcp` in the chat panel. The MCP management dialog lets you enable or disable servers, reconnect to a server, and manage OAuth authentication. See the [MCP documentation](</docs/en/mcp>) for available servers.
@@ -423,12 +393,6 @@
Create commits and pull requests
Claude can stage changes, write commit messages, and create pull requests based on your work:
-
-Report incorrect code
-
-Copy
-
-Ask AI
> commit my changes with a descriptive message
> create a pr for this feature
@@ -443,12 +407,6 @@
Use git worktrees for parallel tasks
Use the `--worktree` (`-w`) flag to start Claude in an isolated worktree with its own files and branch:
-
-Report incorrect code
-
-Copy
-
-Ask AI
claude --worktree feature-auth
@@ -569,12 +527,6 @@
To also remove extension data and reset all settings:
-Report incorrect code
-
-Copy
-
-Ask AI
-
rm -rf ~/.vscode/globalStorage/anthropic.claude-code
For additional help, see the [troubleshooting guide](</docs/en/troubleshooting>).