modified How the agent loop works View current →
--- a/agent-loop.md +++ b/agent-loop.md @@ -159,7 +159,7 @@ * **`allowed_tools` / `allowedTools`** auto-approves listed tools. A read-only agent with `["Read", "Glob", "Grep"]` in its allowed tools list runs those tools without prompting. Tools not listed are still available but require permission. * **`disallowed_tools` / `disallowedTools`** blocks listed tools, regardless of other settings. See [Permissions](</docs/en/agent-sdk/permissions>) for the order that rules are checked before a tool runs. - * **`permission_mode` / `permissionMode`** controls what happens to tools that aren’t covered by allow or deny rules. See Permission mode for available modes. + * **`permission_mode` / `permissionMode`** controls how much human oversight you want. The SDK evaluates the active mode together with your allow and deny rules in a fixed order, described in [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>). See Permission mode for available modes. You can also scope individual tools with rules like `"Bash(npm *)"` to allow only specific commands. See [Permissions](</docs/en/agent-sdk/permissions>) for the full rule syntax. When a tool is denied, Claude receives a rejection message as the tool result and typically attempts a different approach or reports that it couldn’t proceed.
modified Give Claude custom tools View current →
--- a/custom-tools.md +++ b/custom-tools.md @@ -367,8 +367,6 @@ from typing import Any from claude_agent_sdk import tool - from claude_agent_sdk import tool - @tool( "fetch_data", "Fetch data from an API", @@ -481,8 +479,6 @@ import base64 import httpx - from claude_agent_sdk import tool - from claude_agent_sdk import tool # Define a tool that fetches an image from a URL and returns it to Claude
modified Desktop application View current →
--- a/desktop.md +++ b/desktop.md @@ -376,7 +376,7 @@ Ask a side question without derailing the session -A side chat lets you ask Claude a question that uses your session’s context but doesn’t add anything back to the main conversation. Use it when you want to understand a piece of code, check an assumption, or explore an idea without steering the session off course. Press **Cmd+;** on macOS or **Ctrl+;** on Windows to open a side chat, or type `/btw` in the prompt box. The side chat can read everything in the main thread up to that point. When you’re done, close the side chat and continue the main session where you left off. Side chats are available in local, SSH, and WSL sessions. +A side chat lets you ask Claude a question that uses your session’s context but doesn’t add anything back to the main conversation. Use it when you want to understand a piece of code, check an assumption, or explore an idea without steering the session off course. Press **Cmd+;** on macOS or **Ctrl+;** on Windows to open a side chat, or type `/btw` in the prompt box. The side chat can read everything in the main thread up to that point. When you’re done, close the side chat and continue the main session where you left off. Side chats are available in local, SSH, and WSL sessions. The desktop app doesn’t save side chats to disk, so you can’t return to one after you close the app. ###
modified Discover and install prebuilt plugins through marketplaces View current →
--- a/discover-plugins.md +++ b/discover-plugins.md @@ -28,7 +28,7 @@ Official Anthropic marketplace -Claude Code adds the official Anthropic marketplace (`claude-plugins-official`) automatically when you start it. If Claude Code can’t add it, for example because your network blocks the download, add it yourself with `/plugin marketplace add anthropics/claude-plugins-official`. To browse what’s available, run `/plugin` and go to the **Discover** tab, 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: +Claude Code adds the official Anthropic marketplace (`claude-plugins-official`) automatically the first time you start it interactively. If Claude Code can’t add it, for example because your network blocks the download or a [marketplace policy](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) blocked an earlier attempt, add it yourself with `/plugin marketplace add anthropics/claude-plugins-official`. To browse what’s available, run `/plugin` and go to the **Discover** tab, 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: /plugin install github@claude-plugins-official
modified Environment variables View current →
--- a/env-vars.md +++ b/env-vars.md @@ -217,7 +217,7 @@ `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`| Set to any non-empty value, such as `1`, to disable nonessential network traffic: auto-updates, telemetry, error reporting, the `/feedback` command, release notes, [gateway model discovery](</docs/en/llm-gateway-connect#add-gateway-models-to-the-model-picker>) refreshes, and availability checks such as the [fast mode](</docs/en/fast-mode#use-fast-mode-behind-proxies-and-llm-gateways>) check. **Setting it to`0` or `false` still disables this traffic**, unlike most on/off variables; unset the variable to allow it again. Also disables feature-flag fetching, which makes [Remote Control](</docs/en/remote-control#requirements>) unavailable. Official plugin marketplace auto-install isn’t covered; disable it with `CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL` `CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK`| Set to `1` to disable the non-streaming fallback when a streaming request fails mid-stream. Streaming errors propagate to the retry layer instead. Useful when a proxy or gateway causes the fallback to produce duplicate tool execution `CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK`| Set to `1` to send the `PushNotification` tool’s desktop notification even while you are typing in or focused on the terminal. By default the tool skips both the desktop notification and the [mobile push](</docs/en/remote-control#mobile-push-notifications>) when it detects recent keyboard activity or terminal focus. This variable disables only that local check, so the server can still suppress the mobile push when it detects that you are active. Requires Claude Code v2.1.193 or later -`CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`| Set to `1` to skip automatic addition of the official plugin marketplace on first run +`CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`| Set to `1` to disable automatic registration of the official plugin marketplace. Claude Code reads the variable when it is about to register the marketplace, usually during a machine’s first interactive launch. If the variable is set at that point, Claude Code skips the registration permanently. Unsetting the variable later doesn’t undo the skip. Run `claude plugin marketplace add anthropics/claude-plugins-official` to register the marketplace at any time `CLAUDE_CODE_DISABLE_POLICY_SKILLS`| Set to `1` to skip loading skills from the system-wide managed skills directory. Useful for container or CI sessions that should not load operator-provisioned skills `CLAUDE_CODE_DISABLE_TERMINAL_TITLE`| Set to `1` to disable automatic terminal title updates based on conversation context. In Agent SDK and `claude -p` sessions, this also skips the background small/fast-model request that generates the session title `CLAUDE_CODE_DISABLE_THINKING`| Set to `1` to omit the `thinking` parameter from API requests entirely. This is a compatibility option for proxies and gateways that reject the parameter. The variable’s behavior is unchanged from earlier versions; on models that think by default, omitting the parameter means the model may still think. To explicitly disable [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) on the Anthropic API, use `MAX_THINKING_TOKENS=0` instead, which is also ineffective on Fable 5 since it cannot have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>), `0` likewise omits the parameter, so the two variables behave the same there
modified Fullscreen rendering View current →
--- a/fullscreen.md +++ b/fullscreen.md @@ -1,4 +1,4 @@ -Fullscreen rendering is an opt-in research preview. Run `/tui fullscreen` to switch in your current conversation. Behavior may change based on feedback. +Fullscreen rendering is a research preview. If you first used Claude Code on or after May 6, 2026, Claude Code renders fullscreen by default; run `/tui default` to switch back. If you started earlier, you keep the classic renderer; run `/tui fullscreen` to switch in your current conversation. Behavior may change based on feedback. Fullscreen rendering is an alternative rendering path for the Claude Code CLI that eliminates flicker, keeps memory usage flat in long conversations, and adds mouse support. It draws the interface on the terminal’s alternate screen buffer, like `vim` or `htop`, and only renders messages that are currently visible. This reduces the amount of data sent to your terminal on each update. The difference is most noticeable in terminal emulators where rendering throughput is the bottleneck, such as the VS Code integrated terminal, tmux, and iTerm2. If your terminal scroll position jumps to the top while Claude is working, or the screen flashes as tool output streams in, this mode addresses those.
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -20,17 +20,19 @@ claude -p "What does the auth module do?" +Claude Code exits with code 0 on success and a non-zero code when the run fails, so your scripts can branch on the exit status. If you pass an invalid flag, Claude Code reports the error to stderr before the run starts. When a failure happens inside the run, such as missing authentication, Claude Code prints the failure as the result on stdout. + ### ​ 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: - - claude --bare -p "Summarize this file" --allowedTools "Read" - -In bare mode Claude has access to the Bash, file read, and file edit tools. Pass any context you need with a flag: +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. Set `ANTHROPIC_API_KEY` before running it, because bare mode doesn’t use your subscription login: + + claude --bare -p "Summarize README.md" --allowedTools "Read" + +Bare mode skips OAuth and the system keychain, so Claude Code only sees credentials you pass explicitly. For the Anthropic API, set `ANTHROPIC_API_KEY` in the environment, with a key created in the [Claude Console](<https://platform.claude.com>), or supply an `apiKeyHelper` in the `--settings` JSON. Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry continue to read their own provider credentials as usual. In bare mode Claude has access to the Bash, file read, and file edit tools. Pass any context you need with a flag: To load| Use ---|--- @@ -40,8 +42,6 @@ Custom agents| `--agents <json>` A plugin| `--plugin-dir <path>`, `--plugin-url <url>` -Bare mode skips OAuth and keychain reads. For Anthropic authentication, set `ANTHROPIC_API_KEY` or configure an `apiKeyHelper` in the JSON you pass to `--settings`. Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry use their usual provider credentials. - `--bare` is the recommended mode for scripted and SDK calls, and will become the default for `-p` in a future release. ### @@ -58,7 +58,7 @@ Examples -These examples highlight common CLI patterns. For CI and other scripted calls, add `--bare` so they don’t pick up whatever happens to be configured locally. +These examples highlight common CLI patterns. Where a command names a file such as `auth.py` or `build-error.txt`, substitute a file from your own project. In CI or other scripted environments, add `--bare` so Claude Code ignores any local configuration on the host. ### @@ -89,6 +89,8 @@ "lint:claude": "git diff main | claude -p \"you are a typo linter. for each typo in this diff, report filename:line on one line and the issue on the next. return nothing else.\"" } } + +Run it with `npm run lint:claude`. ### @@ -259,13 +261,13 @@ Customize the system prompt -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: +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. Save it as a shell script, for example `review.sh`: gh pr diff "$1" | claude -p \ --append-system-prompt "You are a security engineer. Review for vulnerabilities." \ --output-format json -See [system prompt flags](</docs/en/cli-reference#system-prompt-flags>) for more options including `--system-prompt` to fully replace the default prompt. +In the script, `"$1"` stands for the first argument you pass on the command line. Run `bash review.sh 123` and the shell replaces `"$1"` with `123`, so the script fetches the diff for PR 123. Claude Code prints the review as JSON, with the text in the `result` field. See [system prompt flags](</docs/en/cli-reference#system-prompt-flags>) for more options including `--system-prompt` to fully replace the default prompt. ###
modified Hooks reference View current →
--- a/hooks.md +++ b/hooks.md @@ -40,6 +40,7 @@ `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 +`DirectoryAdded`| When a working directory is added mid-session via `/add-dir` or the SDK `register_repo_root` control request `FileChanged`| When a watched file changes on disk. The `matcher` field specifies which filenames to watch `WorktreeCreate`| When a worktree is being created via `--worktree`, `isolation: "worktree"`, or for a background session. Replaces default git behavior `WorktreeRemove`| When a worktree is being removed at session exit, when a subagent finishes, or when you delete a background session @@ -205,6 +206,7 @@ `SubagentStop`| agent type| same values as `SubagentStart` `ConfigChange`| configuration source| `user_settings`, `project_settings`, `local_settings`, `policy_settings`, `skills` `CwdChanged`| no matcher support| always fires on every directory change +`DirectoryAdded`| how the directory was added| `slash_command`, `register_repo_root` `FileChanged`| literal filenames to watch (see FileChanged)| `.envrc|.env` `StopFailure`| error type| `rate_limit`, `overloaded`, `authentication_failed`, `oauth_org_not_allowed`, `billing_error`, `invalid_request`, `model_not_found`, `server_error`, `max_output_tokens`, `unknown` `InstructionsLoaded`| load reason| `session_start`, `nested_traversal`, `path_glob_match`, `include`, `compact` @@ -660,6 +662,7 @@ `Setup`| No| Shows stderr to user only `SessionEnd`| No| Shows stderr to user only `CwdChanged`| No| Shows stderr to user only +`DirectoryAdded`| No| Stderr goes to the debug log; the directory is already added `FileChanged`| No| Shows stderr to user only `PreCompact`| Yes| Blocks compaction `PostCompact`| No| Shows stderr to user only @@ -796,7 +799,7 @@ ElicitationResult| `hookSpecificOutput`| `action` (accept/decline/cancel), `content` (form field values override) MessageDisplay| `hookSpecificOutput`| `displayContent` replaces the displayed text on screen. Display-only: the transcript and what Claude sees keep the original SessionStart, Setup, SubagentStart| Context only| `hookSpecificOutput.additionalContext` adds context for Claude. SessionStart also accepts `initialUserMessage`, `watchPaths`, `sessionTitle`, and `reloadSkills`. No blocking or decision control -WorktreeRemove, Notification, SessionEnd, PostCompact, InstructionsLoaded, StopFailure, CwdChanged, FileChanged| None| No decision control. Used for side effects like logging or cleanup +WorktreeRemove, Notification, SessionEnd, PostCompact, InstructionsLoaded, StopFailure, CwdChanged, DirectoryAdded, FileChanged| None| No decision control. Used for side effects like logging or cleanup A few events can also rewrite content rather than only allow or block it: @@ -2409,6 +2412,46 @@ ​ +DirectoryAdded + +Runs after a working directory is added mid-session, with the `/add-dir` command or the SDK `register_repo_root` control request. Use this to prepare a newly added repository, for example by installing its dependencies. Claude Code doesn’t fire this event for directories you pass with the `--add-dir` startup flag; SessionStart covers those. DirectoryAdded fires after Claude Code has refreshed sandbox and permission state, so sandboxed tools already see the new directory when your hook runs. Hook commands themselves run unsandboxed. The matcher filters on how the directory was added: + +Matcher| When it fires +---|--- +`slash_command`| You add a directory with `/add-dir` +`register_repo_root`| An SDK client adds a directory with the `register_repo_root` control request + +#### + +​ + +DirectoryAdded input + +In addition to the common input fields, DirectoryAdded hooks receive `directory` and `source`. + +Field| Description +---|--- +`directory`| Absolute path of the directory that was added +`source`| How the directory was added, `"slash_command"` for `/add-dir` or `"register_repo_root"` for the SDK control request + + { + "session_id": "abc123", + "transcript_path": "/Users/.../.claude/projects/.../transcript.jsonl", + "cwd": "/Users/my-project", + "hook_event_name": "DirectoryAdded", + "directory": "/Users/my-other-repo", + "source": "slash_command" + } + +DirectoryAdded hooks have no decision control. They can’t block the add, which has already completed when the hook runs. Claude Code surfaces hook output differently per source: + + * `slash_command`: unlike on every other event, where you see the `systemMessage` and Claude doesn’t, Claude Code delivers the hook’s `systemMessage` to Claude as context on the next conversation turn. A count of failed hooks appears in the transcript; full failure output goes to the debug log + * `register_repo_root`: Claude Code writes `systemMessage` output and failure output to the debug log only + +### + +​ + FileChanged Runs when a watched file changes on disk. Useful for reloading environment variables when project configuration files are modified. The `matcher` for this event serves two roles: @@ -2806,6 +2849,7 @@ * `ConfigChange` * `CwdChanged` + * `DirectoryAdded` * `Elicitation` * `ElicitationResult` * `FileChanged`
modified Automate actions with hooks View current →
--- a/hooks-guide.md +++ b/hooks-guide.md @@ -436,6 +436,7 @@ `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 +`DirectoryAdded`| When a working directory is added mid-session via `/add-dir` or the SDK `register_repo_root` control request `FileChanged`| When a watched file changes on disk. The `matcher` field specifies which filenames to watch `WorktreeCreate`| When a worktree is being created via `--worktree`, `isolation: "worktree"`, or for a background session. Replaces default git behavior `WorktreeRemove`| When a worktree is being removed at session exit, when a subagent finishes, or when you delete a background session @@ -496,15 +497,21 @@ Hook input -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: - - { - "session_id": "abc123", // unique ID for this session - "cwd": "/Users/sarah/myproject", // working directory when the event fired - "hook_event_name": "PreToolUse", // which event triggered this hook - "tool_name": "Bash", // the tool Claude is about to use - "tool_input": { // the arguments Claude passed to the tool - "command": "npm test" // for Bash, this is the shell command +Every event includes common fields like `session_id`, a unique ID for the session, and `cwd`, the working directory when the event fired, but each event type adds different data. When Claude runs a Bash command, a `PreToolUse` hook receives these fields on stdin: + + * `hook_event_name`: the event that triggered the hook + * `tool_name`: the tool Claude is about to use + * `tool_input`: the arguments Claude passed to the tool. For Bash, its `command` field holds the shell command. + +For example, the hook input for an `npm test` command looks like this: + + { + "session_id": "abc123", + "cwd": "/Users/sarah/myproject", + "hook_event_name": "PreToolUse", + "tool_name": "Bash", + "tool_input": { + "command": "npm test" } }
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -112,7 +112,7 @@ ---|--- `?`| Toggle the keyboard shortcut help panel. Requires [fullscreen rendering](</docs/en/fullscreen>) `{` / `}`| Jump to the previous or next user prompt, like vim paragraph motion. Requires [fullscreen rendering](</docs/en/fullscreen>) -`Ctrl+E`| Toggle show all content. Available in the default renderer only, not in [fullscreen rendering](</docs/en/fullscreen>) +`Ctrl+E`| Toggle show all content. Available in the classic renderer only, not in [fullscreen rendering](</docs/en/fullscreen>) `[`| Write the full conversation to your terminal’s native scrollback so `Cmd+F`, tmux copy mode, and other native tools can search it. Requires [fullscreen rendering](</docs/en/fullscreen#search-and-review-the-conversation>) `v`| Write the conversation to a temporary file and open it in `$VISUAL` or `$EDITOR`. Requires [fullscreen rendering](</docs/en/fullscreen>) `q`, `Ctrl+C`, `Esc`| Exit transcript view. All three can be rebound via [`transcript:exit`](</docs/en/keybindings>) @@ -293,7 +293,7 @@ Reverse search with Ctrl+R -Press `Ctrl+R` to interactively search through your command history. In [fullscreen rendering](</docs/en/fullscreen>), `Ctrl+R` opens a search dialog instead: type to filter, press `Up` and `Down` to move through matches, and press `Ctrl+S` to cycle the scope through this session, this project, and all projects. Press `Enter` or `Tab` to place a match in the prompt input, or `Esc` to cancel. The steps below describe the default inline search: +Press `Ctrl+R` to interactively search through your command history. In [fullscreen rendering](</docs/en/fullscreen>), `Ctrl+R` opens a search dialog instead: type to filter, press `Up` and `Down` to move through matches, and press `Ctrl+S` to cycle the scope through this session, this project, and all projects. Press `Enter` or `Tab` to place a match in the prompt input, or `Esc` to cancel. The steps below describe the classic renderer’s inline search: 1. **Start search** : press `Ctrl+R` to activate reverse history search 2. **Type query** : enter text to search for in previous commands. The search term is highlighted in matching results
modified Customize keyboard shortcuts View current →
--- a/keybindings.md +++ b/keybindings.md @@ -189,7 +189,7 @@ `transcript:toggleShowAll`| Ctrl+E| Toggle show all content `transcript:exit`| q, Ctrl+C, Escape| Exit transcript view -`transcript:toggleShowAll` applies in the default renderer only; in [fullscreen rendering](</docs/en/fullscreen>), the transcript viewer doesn’t offer a show-all toggle. +`transcript:toggleShowAll` applies in the classic renderer only; in [fullscreen rendering](</docs/en/fullscreen>), the transcript viewer doesn’t offer a show-all toggle. ### @@ -207,7 +207,7 @@ `historySearch:execute`| Enter| Execute selected command `historySearch:cycleScope`| Ctrl+S| Cycle scope: session, project, everywhere -The `historySearch:next`, `historySearch:accept`, `historySearch:cancel`, and `historySearch:execute` defaults apply to the inline history search in the default renderer, which always searches prompts from all projects. `historySearch:cycleScope` takes effect only in [fullscreen rendering](</docs/en/fullscreen>), where `Ctrl+R` opens a search dialog instead and `Ctrl+S` cycles its scope. The dialog’s other keys are fixed and can’t be rebound: `Enter` or `Tab` places the highlighted match in the prompt input and `Esc` cancels. +The `historySearch:next`, `historySearch:accept`, `historySearch:cancel`, and `historySearch:execute` defaults apply to the inline history search in the classic renderer, which always searches prompts from all projects. `historySearch:cycleScope` takes effect only in [fullscreen rendering](</docs/en/fullscreen>), where `Ctrl+R` opens a search dialog instead and `Ctrl+S` cycles its scope. The dialog’s other keys are fixed and can’t be rebound: `Enter` or `Tab` places the highlighted match in the prompt input and `Esc` cancels. ###
modified Migrate to Claude Agent SDK View current →
--- a/migration-guide.md +++ b/migration-guide.md @@ -16,9 +16,7 @@ ---|---|--- **Package Name (TS/JS)**| `@anthropic-ai/claude-code`| `@anthropic-ai/claude-agent-sdk` **Python Package**| `claude-code-sdk`| `claude-agent-sdk` -**Documentation Location**| Claude Code docs| API Guide → Agent SDK section - -**Documentation Changes:** The Agent SDK documentation has moved from the Claude Code docs to the API Guide under a dedicated [Agent SDK](</docs/en/agent-sdk/overview>) section. The Claude Code docs now focus on the CLI tool and automation features. +**Documentation Location**| Claude Code docs| Claude Code docs → dedicated [Agent SDK](</docs/en/agent-sdk/overview>) section ##
modified Create and distribute a plugin marketplace View current →
--- a/plugin-marketplaces.md +++ b/plugin-marketplaces.md @@ -721,7 +721,12 @@ ] } -With this entry, the official marketplace registers itself automatically the first time you start Claude Code interactively, so you don’t need to pair it with `extraKnownMarketplaces`. In a non-interactive environment that runs before that first interactive launch, add it explicitly with `claude plugin marketplace add anthropics/claude-plugins-official` or include it in `extraKnownMarketplaces`. Allow specific marketplaces only: +With this entry, Claude Code keeps an already-registered official marketplace available and, on a fresh machine, registers the marketplace automatically the first time you start Claude Code interactively. Automatic registration doesn’t cover every machine. It most commonly misses: + + * Non-interactive environments that run before the machine’s first interactive launch. + * Machines where Claude Code already ran interactively under a policy that blocked the marketplace, such as the empty-array lockdown. Claude Code records the blocked attempt and doesn’t retry after the policy changes. + +On these machines, add the marketplace to [`extraKnownMarketplaces`](</docs/en/settings#extraknownmarketplaces>) in the same `managed-settings.json` so Claude Code registers it automatically, or run `claude plugin marketplace add anthropics/claude-plugins-official`. Allow specific marketplaces only: { "strictKnownMarketplaces": [ @@ -765,7 +770,7 @@ Use `".*"` as the `pathPattern` to allow any filesystem path while still controlling network sources with `hostPattern`. -`strictKnownMarketplaces` restricts what users can add, but doesn’t register marketplaces on its own. To make allowed marketplaces available automatically without users running `/plugin marketplace add`, pair it with [`extraKnownMarketplaces`](</docs/en/settings#extraknownmarketplaces>) in the same `managed-settings.json`. See [Using both together](</docs/en/settings#strictknownmarketplaces>). +`strictKnownMarketplaces` restricts what users can add, but doesn’t register marketplaces on its own. To register an allowed marketplace for users automatically, add it to [`extraKnownMarketplaces`](</docs/en/settings#extraknownmarketplaces>) in the same `managed-settings.json`.The official Anthropic marketplace is the only one Claude Code registers on its own, and only when the allowlist allows it. Automatic registration also misses some machines, such as non-interactive environments and machines where an earlier policy blocked it. To cover those machines, add the official marketplace to `extraKnownMarketplaces` as well. For the two settings side by side, see the [`strictKnownMarketplaces` reference](</docs/en/settings#strictknownmarketplaces>). ####
modified Create plugins View current →
--- a/plugins.md +++ b/plugins.md @@ -370,7 +370,7 @@ Anthropic maintains two public marketplaces for Claude Code plugins: - * **`claude-plugins-official`** : a curated set of plugins maintained by Anthropic. Registered automatically the first time you start Claude Code interactively. A non-interactive script that runs before that first launch must add it explicitly with `claude plugin marketplace add anthropics/claude-plugins-official`. + * **`claude-plugins-official`** : a curated set of plugins maintained by Anthropic. Claude Code registers it automatically the first time you start Claude Code interactively. If you run Claude Code non-interactively before that first interactive launch, or a [marketplace policy](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) blocked an earlier attempt, register it yourself with `claude plugin marketplace add anthropics/claude-plugins-official`. * **`claude-community`** : the public community marketplace where third-party submissions land after review. Users add it with `/plugin marketplace add anthropics/claude-plugins-community` and install from it as `@claude-community`. To submit your plugin for community-marketplace review, use one of the in-app forms:
modified Plugins reference View current →
--- a/plugins-reference.md +++ b/plugins-reference.md @@ -110,6 +110,7 @@ `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 +`DirectoryAdded`| When a working directory is added mid-session via `/add-dir` or the SDK `register_repo_root` control request `FileChanged`| When a watched file changes on disk. The `matcher` field specifies which filenames to watch `WorktreeCreate`| When a worktree is being created via `--worktree`, `isolation: "worktree"`, or for a background session. Replaces default git behavior `WorktreeRemove`| When a worktree is being removed at session exit, when a subagent finishes, or when you delete a background session
modified Automate work with routines View current →
--- a/routines.md +++ b/routines.md @@ -396,9 +396,9 @@ `/schedule` returns “Unknown command” -The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule`. The cause is usually one of the following: - - * You are authenticated with a Console API key or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login +The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule` in every case below except a Console API key with feature-flag fetching enabled. The cause is usually one of the following: + + * You are authenticated with a Console API key or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login * `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK` is set in your shell environment or in the `env` block of a [`settings.json` file](</docs/en/settings#available-settings>). These disable feature-flag fetching, which `/schedule` depends on * You are inside a Claude Code on the web session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead
modified Claude Code settings View current →
--- a/settings.md +++ b/settings.md @@ -1016,7 +1016,12 @@ ] } -With this entry, the official marketplace registers itself automatically the first time you start Claude Code interactively, so you don’t need to pair it with `extraKnownMarketplaces`. In a non-interactive environment that runs before that first interactive launch, add it explicitly with `claude plugin marketplace add anthropics/claude-plugins-official` or include it in `extraKnownMarketplaces`. Example: allow all marketplaces from an internal git server: +With this entry, Claude Code keeps an already-registered official marketplace available and, on a fresh machine, registers the marketplace automatically the first time you start Claude Code interactively. Automatic registration doesn’t cover every machine. It most commonly misses: + + * Non-interactive environments that run before the machine’s first interactive launch. + * Machines where Claude Code already ran interactively under a policy that blocked the marketplace, such as the empty-array lockdown. Claude Code records the blocked attempt and doesn’t retry after the policy changes. + +On these machines, add the marketplace to `extraKnownMarketplaces` in the same `managed-settings.json` so Claude Code registers it automatically, or run `claude plugin marketplace add anthropics/claude-plugins-official`. Example: allow all marketplaces from an internal git server: { "strictKnownMarketplaces": [ @@ -1081,7 +1086,7 @@ } } -With only `strictKnownMarketplaces` set, users can still add the allowed marketplace manually via `/plugin marketplace add`, but it is not available automatically. **Important notes** : +With only `strictKnownMarketplaces` set, users can still add an allowed marketplace manually via `/plugin marketplace add`. The official Anthropic marketplace is the only one Claude Code registers automatically, and only when the allowlist allows it. Automatic registration also misses some machines, most commonly non-interactive environments and machines where an earlier policy blocked the marketplace. To cover those machines, add the official marketplace to `extraKnownMarketplaces` too. **Important notes** : * Restrictions are checked before any network requests or filesystem operations * When blocked, users see clear error messages indicating the source is blocked by managed policy
modified Streaming Input View current →
--- a/streaming-vs-single-mode.md +++ b/streaming-vs-single-mode.md @@ -6,8 +6,8 @@ The Claude Agent SDK supports two distinct input modes for interacting with agents: - * **Streaming Input Mode** (Default & Recommended) - A persistent, interactive session - * **Single Message Input** \- One-shot queries that use session state and resuming + * **Streaming Input Mode** : a persistent, interactive session + * **Single Message Input** : one-shot queries that use session state and resuming This guide explains the differences, benefits, and use cases for each mode to help you choose the right approach for your application.
modified Create custom subagents View current →
--- a/sub-agents.md +++ b/sub-agents.md @@ -58,6 +58,7 @@ ---|---|--- statusline-setup| Sonnet| When you run `/statusline` to configure your status line claude-code-guide| Haiku| When you ask questions about Claude Code features +claude| Inherits| When you dispatch a [background session](</docs/en/agent-view>) from `claude agents` or `claude --bg` without naming an agent. Claude can also delegate to it like any other subagent Built-in subagents are registered by default in interactive sessions. To restrict them:
modified Troubleshoot installation and login View current →
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -58,9 +58,17 @@ The installer downloads from `downloads.claude.ai`. Verify you can reach it: + * macOS/Linux + + * Windows PowerShell + curl -sI https://downloads.claude.ai/claude-code-releases/latest -In PowerShell, run `curl.exe -sI` instead. PowerShell aliases `curl` to `Invoke-WebRequest`, which rejects the `-sI` flags. An `HTTP/2 200` line means you reached the server. Other results point to the cause: + curl.exe -sI https://downloads.claude.ai/claude-code-releases/latest + +PowerShell aliases `curl` to `Invoke-WebRequest`, which rejects the `-sI` flags, so call `curl.exe` explicitly. + +You reached the server if the first line shows a `200` status. You see `HTTP/2 200` on macOS and Linux, and `HTTP/1.1 200 OK` from the `curl.exe` included with Windows. Other results point to the cause: * `403`: usually a proxy or network filter blocking the host, or Claude Code is [not available in your region](<https://www.anthropic.com/supported-countries>) * `5xx`: usually a temporary service issue; wait a few minutes and retry