modified Best Practices for Claude Code View current →
--- a/best-practices.md +++ b/best-practices.md @@ -396,7 +396,7 @@ * For more control, run `/compact <instructions>`, like `/compact Focus on the API changes` * To compact only part of the conversation, use `Esc + Esc` or `/rewind`, select a message checkpoint, and choose **Summarize from here**. This condenses messages from that point forward while keeping earlier context intact. * Customize compaction behavior in CLAUDE.md with instructions like `"When compacting, always preserve the full list of modified files and any test commands"` to ensure critical context survives summarization - * For quick questions that don’t need to stay in context, use [`/btw`](</docs/en/interactive-mode#side-questions-with-btw>). The answer appears in a dismissible overlay and never enters conversation history, so you can check a detail without growing context. + * For quick questions that don’t need to stay in context, use [`/btw`](</docs/en/interactive-mode#side-questions-with-%2Fbtw>). The answer appears in a dismissible overlay and never enters conversation history, so you can check a detail without growing context. ###
modified Changelog View current →
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,35 @@ 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.116 + +April 20, 2026 + + * `/resume` on large sessions is significantly faster (up to 67% on 40MB+ sessions) and handles sessions with many dead-fork entries more efficiently + * Faster MCP startup when multiple stdio servers are configured; `resources/templates/list` is now deferred to first `@`-mention + * Smoother fullscreen scrolling in VS Code, Cursor, and Windsurf terminals — `/terminal-setup` now configures the editor’s scroll sensitivity + * Thinking spinner now shows progress inline (“still thinking”, “thinking more”, “almost done thinking”), replacing the separate hint row + * `/config` search now matches option values (e.g. searching “vim” finds the Editor mode setting) + * `/doctor` can now be opened while Claude is responding, without waiting for the current turn to finish + * `/reload-plugins` and background plugin auto-update now auto-install missing plugin dependencies from marketplaces you’ve already added + * Bash tool now surfaces a hint when `gh` commands hit GitHub’s API rate limit, so agents can back off instead of retrying + * The Usage tab in Settings now shows your 5-hour and weekly usage immediately and no longer fails when the usage endpoint is rate-limited + * Agent frontmatter `hooks:` now fire when running as a main-thread agent via `--agent` + * Slash command menu now shows “No commands match” when your filter has zero results, instead of disappearing + * Security: sandbox auto-allow no longer bypasses the dangerous-path safety check for `rm`/`rmdir` targeting `/`, `$HOME`, or other critical system directories + * Fixed Devanagari and other Indic scripts rendering with broken column alignment in the terminal UI + * Fixed Ctrl+- not triggering undo in terminals using the Kitty keyboard protocol (iTerm2, Ghostty, kitty, WezTerm, Windows Terminal) + * Fixed Cmd+Left/Right not jumping to line start/end in terminals that use the Kitty keyboard protocol (Warp fullscreen, kitty, Ghostty, WezTerm) + * Fixed Ctrl+Z hanging the terminal when Claude Code is launched via a wrapper process (e.g. `npx`, `bun run`) + * Fixed scrollback duplication in inline mode where resizing the terminal or large output bursts would repeat earlier conversation history + * Fixed modal search dialogs overflowing the screen at short terminal heights, hiding the search box and keyboard hints + * Fixed scattered blank cells and disappearing composer chrome in the VS Code integrated terminal during scrolling + * Fixed an intermittent API 400 error related to cache control TTL ordering that could occur when a parallel request completed during request setup + * Fixed `/branch` rejecting conversations with transcripts larger than 50MB + * Fixed `/resume` silently showing an empty conversation on large session files instead of reporting the load error + * Fixed `/plugin` Installed tab showing the same item twice when it appears under Needs attention or Favorites + * Fixed `/update` and `/tui` not working after entering a worktree mid-session ​
modified Explore the .claude directory View current →
--- a/claude-directory.md +++ b/claude-directory.md @@ -1,4 +1,12 @@ -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. If you set [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>), every `~/.claude` path on this page lives under that directory instead. 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. +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. On Windows, `~/.claude` resolves to `%USERPROFILE%\.claude`. If you set [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>), every `~/.claude` path on this page lives under that directory instead. 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. + +## + +​ + +Explore the directory + +Click files in the tree to see what each one does, when it loads, and an example. ## @@ -12,9 +20,29 @@ ---|---|--- `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`. -Installed plugins| `~/.claude/plugins/`| Cloned marketplaces, installed plugin versions, and per-plugin data, managed by `claude plugin` commands. Orphaned versions are deleted 7 days after a plugin update or uninstall. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>). +Installed plugins| `~/.claude/plugins`| Cloned marketplaces, installed plugin versions, and per-plugin data, managed by `claude plugin` commands. Orphaned versions are deleted 7 days after a plugin update or uninstall. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>). `~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below. + +## + +​ + +Choose the right file + +Different kinds of customization live in different files. Use this table to find where a change belongs. + +You want to| Edit| Scope| Reference +---|---|---|--- +Give Claude project context and conventions| `CLAUDE.md`| project or global| [Memory](</docs/en/memory>) +Allow or block specific tool calls| `settings.json` `permissions` or `hooks`| project or global| [Permissions](</docs/en/permissions>), [Hooks](</docs/en/hooks>) +Run a script before or after tool calls| `settings.json` `hooks`| project or global| [Hooks](</docs/en/hooks>) +Set environment variables for the session| `settings.json` `env`| project or global| [Settings](</docs/en/settings#available-settings>) +Keep personal overrides out of git| `settings.local.json`| project only| [Settings scopes](</docs/en/settings#settings-files>) +Add a prompt or capability you invoke with `/name`| `skills/<name>/SKILL.md`| project or global| [Skills](</docs/en/skills>) +Define a specialized subagent with its own tools| `agents/*.md`| project or global| [Subagents](</docs/en/sub-agents>) +Connect external tools over MCP| `.mcp.json`| project only| [MCP](</docs/en/mcp>) +Change how Claude formats responses| `output-styles/*.md`| project or global| [Output styles](</docs/en/output-styles>) ## @@ -55,6 +83,31 @@ ​ +Troubleshoot configuration + +If a setting, hook, or file isn’t taking effect, scan the symptoms below. + +Symptom| Cause| Fix +---|---|--- +Hook never fires| `matcher` is a JSON array instead of a string| Use a single string with `|` to match multiple tools, for example `"Edit|Write"`. See [matcher patterns](</docs/en/hooks#matcher-patterns>). +Hook never fires| `matcher` value is lowercase, for example `"bash"`| Matching is case-sensitive. Tool names are capitalized: `Bash`, `Edit`, `Write`, `Read`. +Hook never fires| Hooks are in a standalone `.claude/hooks.json` file| There is no standalone hooks file. Define hooks under the `"hooks"` key in `settings.json`. See [hook configuration](</docs/en/hooks>). +Permissions, hooks, or env set globally are ignored| Configuration was added to `~/.claude.json`| `~/.claude.json` holds app state and UI toggles. `permissions`, `hooks`, and `env` belong in `~/.claude/settings.json`. These are two different files. +A `settings.json` value seems ignored| The same key is set in `settings.local.json`| `settings.local.json` overrides `settings.json`, and both override `~/.claude/settings.json`. See [settings precedence](</docs/en/settings#settings-precedence>). +Skill doesn’t appear in `/skills`| Skill file is at `.claude/skills/name.md` instead of in a folder| Use a folder with `SKILL.md` inside: `.claude/skills/name/SKILL.md`. +Subdirectory `CLAUDE.md` instructions seem ignored| Subdirectory files load on demand, not at session start| They load when Claude reads a file in that directory with the Read tool, not at launch and not when writing or creating files there. See [how CLAUDE.md files load](</docs/en/memory#how-claude-md-files-load>). +Subagent ignores `CLAUDE.md` instructions| Subagents don’t always inherit project memory| Put critical rules in the agent file body, which becomes the subagent’s system prompt. See [subagent configuration](</docs/en/sub-agents>). +Cleanup logic never runs at session end| No `SessionEnd` hook configured| `SessionStart` and `SessionEnd` both exist. See the [hook events list](</docs/en/hooks#hook-events>). +MCP servers in `.mcp.json` never load| File is under `.claude/` or uses Claude Desktop’s config format| Project MCP config lives at the repository root as `.mcp.json`, not inside `.claude/`. See [MCP configuration](</docs/en/mcp>). +Project MCP server added but doesn’t appear| The one-time approval prompt was dismissed| Project-scoped servers require approval. Run `/mcp` to see status and approve. +MCP server fails to start from some directories| `command` or `args` uses a relative file path| Use absolute paths for local scripts. Executables on your `PATH` like `npx` or `uvx` work as-is. +MCP server starts without expected environment variables| Variables are in `settings.json` `env`, which doesn’t propagate to MCP child processes| Set per-server `env` inside `.mcp.json` instead. +`Bash(rm *)` deny rule doesn’t block `/bin/rm` or `find -delete`| Prefix rules match the literal command string, not the underlying executable| Add explicit patterns for each variant, or use a [PreToolUse hook](</docs/en/hooks-guide>) or the [sandbox](</docs/en/sandboxing>) for a hard guarantee. + +## + +​ + Check what loaded The explorer shows what files can exist. To see what actually loaded in your current session, use these commands:
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -7,7 +7,7 @@ `/autofix-pr [prompt]`| Spawn a [Claude Code on the web](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>) session that watches the current branch’s PR and pushes fixes when CI fails or reviewers leave comments. Detects the open PR from your checked-out branch with `gh pr view`; to watch a different PR, check out its branch first. By default the remote session is told to fix every CI failure and review comment; pass a prompt to give it different instructions, for example `/autofix-pr only fix lint and type errors`. Requires the `gh` CLI and access to [Claude Code on the web](</docs/en/claude-code-on-the-web#who-can-use-claude-code-on-the-web>) `/batch <instruction>`| **[Skill](</docs/en/skills#bundled-skills>).** Orchestrate large-scale changes across a codebase in parallel. Researches the codebase, decomposes the work into 5 to 30 independent units, and presents a plan. Once approved, spawns one background agent per unit in an isolated [git worktree](</docs/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees>). Each agent implements its unit, runs tests, and opens a pull request. Requires a git repository. Example: `/batch migrate src/ from Solid to React` `/branch [name]`| Create a branch of the current conversation at this point. Switches you into the branch and preserves the original, which you can return to with `/resume`. Alias: `/fork` -`/btw <question>`| Ask a quick [side question](</docs/en/interactive-mode#side-questions-with-btw>) without adding to the conversation +`/btw <question>`| Ask a quick [side question](</docs/en/interactive-mode#side-questions-with-%2Fbtw>) without adding to the conversation `/chrome`| Configure [Claude in Chrome](</docs/en/chrome>) settings `/claude-api`| **[Skill](</docs/en/skills#bundled-skills>).** Load Claude API reference material for your project’s language (Python, TypeScript, Java, Go, Ruby, C#, PHP, or cURL) and Managed Agents reference. Covers tool use, streaming, batches, structured outputs, and common pitfalls. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk` `/clear`| Start a new conversation with empty context. The previous conversation stays available in `/resume`. To free up context while continuing the same conversation, use `/compact` instead. Aliases: `/reset`, `/new` @@ -75,11 +75,11 @@ `/tasks`| List and manage background tasks. Also available as `/bashes` `/team-onboarding`| Generate a team onboarding guide from your Claude Code usage history. Claude analyzes your sessions, commands, and MCP server usage from the past 30 days and produces a markdown guide a teammate can paste as a first message to get set up quickly `/teleport`| Pull a [Claude Code on the web](</docs/en/claude-code-on-the-web#from-web-to-terminal>) session into this terminal: opens a picker, then fetches the branch and conversation. Also available as `/tp`. Requires a claude.ai subscription -`/terminal-setup`| Configure terminal keybindings for Shift+Enter and other shortcuts. Only visible in terminals that need it, like VS Code, Alacritty, or Warp -`/theme`| Change the color theme. Includes an `auto` option that follows your terminal’s dark or light mode, light and dark variants, colorblind-accessible (daltonized) themes, and ANSI themes that use your terminal’s color palette +`/terminal-setup`| Configure terminal keybindings for Shift+Enter and other shortcuts. Only visible in terminals that need it, like VS Code, Cursor, Windsurf, Alacritty, or Zed +`/theme`| Change the color theme. Includes an `auto` option that matches your terminal’s light or dark background, light and dark variants, colorblind-accessible (daltonized) themes, and ANSI themes that use your terminal’s color palette `/tui [default|fullscreen]`| Set the terminal UI renderer and relaunch into it with your conversation intact. `fullscreen` enables the [flicker-free alt-screen renderer](</docs/en/fullscreen>). With no argument, prints the active renderer `/ultraplan <prompt>`| Draft a plan in an [ultraplan](</docs/en/ultraplan>) session, review it in your browser, then execute remotely or send it back to your terminal -`/ultrareview [PR]`| Run a deep, multi-agent code review in a cloud sandbox with [ultrareview](</docs/en/ultrareview>). Includes 3 free runs on Pro and Max, then requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) +`/ultrareview [PR]`| Run a deep, multi-agent code review in a cloud sandbox with [ultrareview](</docs/en/ultrareview>). Includes 3 free runs on Pro and Max through May 5, 2026, then requires [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) `/upgrade`| Open the upgrade page to switch to a higher plan tier `/usage`| Show plan usage limits and rate limit status `/vim`| Removed in v2.1.92. To toggle between Vim and Normal editing modes, use `/config` → Editor mode
modified Common workflows View current →
--- a/common-workflows.md +++ b/common-workflows.md @@ -384,6 +384,16 @@ * Specify the documentation style you want (JSDoc, docstrings, etc.) * Ask for examples in the documentation * Request documentation for public APIs, interfaces, and complex logic + +* * * + +## + +​ + +Work in notes and non-code folders + +Claude Code works in any directory. Run it inside a notes vault, a documentation folder, or any collection of markdown files to search, edit, and reorganize content the same way you would code. The `.claude/` directory and `CLAUDE.md` sit alongside other tools’ config directories without conflict. Claude reads files fresh on each tool call, so it sees edits you make in another application the next time it reads that file. * * *
modified Use Claude Code Desktop View current →
--- a/desktop.md +++ b/desktop.md @@ -593,6 +593,29 @@ Once added, the connection appears in the environment dropdown. Select it to start a session on that machine. Claude runs on the remote machine with access to its files and tools. The remote machine must run Linux or macOS, and Claude Code must be installed on it. Once connected, SSH sessions support permission modes, connectors, plugins, and MCP servers. +#### + +​ + +Pre-configure SSH connections for your team + +Administrators can distribute SSH connections to team members by adding `sshConfigs` to a [managed settings](</docs/en/settings#settings-precedence>) file. Connections defined this way appear in each user’s environment dropdown automatically and are shown as managed, so users can select them but cannot edit or delete them in the app. The following example pre-configures a single connection that opens in `~/projects` on the remote host: + + { + "sshConfigs": [ + { + "id": "shared-dev-vm", + "name": "Shared Dev VM", + "sshHost": "user@dev.example.com", + "sshPort": 22, + "sshIdentityFile": "~/.ssh/id_ed25519", + "startDirectory": "~/projects" + } + ] + } + +Each entry requires `id`, `name`, and `sshHost`. The `sshPort`, `sshIdentityFile`, and `startDirectory` fields are optional. Users can also add `sshConfigs` to their own `~/.claude/settings.json`, which is where connections added through the dialog are stored. + ## ​ @@ -627,6 +650,7 @@ `permissions.disableBypassPermissionsMode`| set to `"disable"` to prevent users from enabling Bypass permissions mode. `disableAutoMode`| set to `"disable"` to prevent users from enabling [Auto](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) mode. Removes Auto from the mode selector. Also accepted under `permissions`. `autoMode`| customize what the auto mode classifier trusts and blocks across your organization. See [Configure the auto mode classifier](</docs/en/permissions#configure-the-auto-mode-classifier>). +`sshConfigs`| pre-configure SSH connections that appear in the environment dropdown. Users cannot edit or delete managed connections. `permissions.disableBypassPermissionsMode` and `disableAutoMode` also work in user and project settings, but placing them in managed settings prevents users from overriding them. `autoMode` is read from user settings, `.claude/settings.local.json`, and managed settings, but not from the checked-in `.claude/settings.json`: a cloned repo cannot inject its own classifier rules. For the complete list of managed-only settings including `allowManagedPermissionRulesOnly` and `allowManagedHooksOnly`, see [managed-only settings](</docs/en/permissions#managed-only-settings>). Remote managed settings uploaded through the admin console currently apply to CLI and IDE sessions only. For Desktop-specific restrictions, use the admin console controls above.
modified Environment variables View current →
--- a/env-vars.md +++ b/env-vars.md @@ -142,7 +142,7 @@ `CLAUDE_CONFIG_DIR`| Override the configuration directory (default: `~/.claude`). All settings, credentials, session history, and plugins are stored under this path. Useful for running multiple accounts side by side: for example, `alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'` `CLAUDE_ENABLE_BYTE_WATCHDOG`| Set to `1` to force-enable the byte-level streaming idle watchdog, or set to `0` to force-disable it. When unset, the watchdog is enabled by default for Anthropic API connections. The byte watchdog aborts a connection when no bytes arrive on the wire for the duration set by `CLAUDE_STREAM_IDLE_TIMEOUT_MS`, with a minimum of 5 minutes, independent of the event-level watchdog `CLAUDE_ENABLE_STREAM_WATCHDOG`| Set to `1` to enable the event-level streaming idle watchdog. Off by default. For Bedrock, Vertex, and Foundry, this is the only idle watchdog available. Configure the timeout with `CLAUDE_STREAM_IDLE_TIMEOUT_MS` -`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_ENV_FILE`| Path to a shell script whose contents Claude Code runs before each Bash command in the same shell process, so exports in the file are visible to the 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_REMOTE_CONTROL_SESSION_NAME_PREFIX`| Prefix for auto-generated [Remote Control](</docs/en/remote-control>) session names when no explicit name is provided. Defaults to your machine’s hostname, producing names like `myhost-graceful-unicorn`. The `--remote-control-session-name-prefix` CLI flag sets the same value for a single invocation `CLAUDE_STREAM_IDLE_TIMEOUT_MS`| Timeout in milliseconds before the streaming idle watchdog closes a stalled connection. For the byte-level watchdog on the Anthropic API: default and minimum `300000` (5 minutes); lower values are silently clamped to absorb extended thinking pauses and proxy buffering. For the event-level watchdog: default `90000` (90 seconds), no minimum. For third-party providers, requires `CLAUDE_ENABLE_STREAM_WATCHDOG=1` `DISABLE_AUTOUPDATER`| Set to `1` to disable automatic updates
modified Hooks reference View current →
--- a/hooks.md +++ b/hooks.md @@ -47,7 +47,7 @@ How a hook resolves -To see how these pieces fit together, consider this `PreToolUse` hook that blocks destructive shell commands. The `matcher` narrows to Bash tool calls and the `if` condition narrows further to commands starting with `rm`, so `block-rm.sh` only spawns when both filters match: +To see how these pieces fit together, consider this `PreToolUse` hook that blocks destructive shell commands. The `matcher` narrows to Bash tool calls and the `if` condition narrows further to Bash subcommands matching `rm *`, so `block-rm.sh` only spawns when both filters match: { "hooks": { @@ -104,7 +104,7 @@ If condition checks -The `if` condition `"Bash(rm *)"` matches because the command starts with `rm`, so this handler spawns. If the command had been `npm test`, the `if` check would fail and `block-rm.sh` would never run, avoiding the process spawn overhead. The `if` field is optional; without it, every handler in the matched group runs. +The `if` condition `"Bash(rm *)"` matches because `rm -rf /tmp/build` is a subcommand matching `rm *`, so this handler spawns. If the command had been `npm test`, the `if` check would fail and `block-rm.sh` would never run, avoiding the process spawn overhead. The `if` field is optional; without it, every handler in the matched group runs. 4 @@ -217,7 +217,7 @@ } } -`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. For tool events, you can filter more narrowly by setting the `if` field on individual hook handlers. `if` uses [permission rule syntax](</docs/en/permissions>) to match against the tool name and arguments together, so `"Bash(git *)"` runs only for `git` commands and `"Edit(*.ts)"` runs only for TypeScript files. +`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. For tool events, you can filter more narrowly by setting the `if` field on individual hook handlers. `if` uses [permission rule syntax](</docs/en/permissions>) to match against the tool name and arguments together, so `"Bash(git *)"` runs when any subcommand of the Bash input matches `git *` and `"Edit(*.ts)"` runs only for TypeScript files. #### @@ -274,7 +274,7 @@ * **Command hooks** (`type: "command"`): run a shell command. Your script receives the event’s JSON input on stdin and communicates results back through exit codes and stdout. * **HTTP hooks** (`type: "http"`): send the event’s JSON input as an HTTP POST request to a URL. The endpoint communicates results back through the response body using the same JSON output format as command hooks. * **Prompt hooks** (`type: "prompt"`): send a prompt to a Claude model for single-turn evaluation. The model returns a yes/no decision as JSON. See Prompt-based hooks. - * **Agent hooks** (`type: "agent"`): spawn a subagent that can use tools like Read, Grep, and Glob to verify conditions before returning a decision. See Agent-based hooks. + * **Agent hooks** (`type: "agent"`): spawn a subagent that can use tools like Read, Grep, and Glob to verify conditions before returning a decision. Agent hooks are experimental and may change. See Agent-based hooks. #### @@ -287,10 +287,12 @@ Field| Required| Description ---|---|--- `type`| yes| `"command"`, `"http"`, `"prompt"`, or `"agent"` -`if`| no| Permission rule syntax to filter when this hook runs, such as `"Bash(git *)"` or `"Edit(*.ts)"`. The hook only spawns if the tool call matches the pattern. Only evaluated on tool events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, and `PermissionDenied`. On other events, a hook with `if` set never runs. Uses the same syntax as [permission rules](</docs/en/permissions>) +`if`| no| Permission rule syntax to filter when this hook runs, such as `"Bash(git *)"` or `"Edit(*.ts)"`. The hook only spawns if the tool call matches the pattern, or if a Bash command is too complex to parse. Only evaluated on tool events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, and `PermissionRequest`. On other events, a hook with `if` set never runs. Uses the same syntax as [permission rules](</docs/en/permissions>) `timeout`| no| Seconds before canceling. Defaults: 600 for command, 30 for prompt, 60 for agent `statusMessage`| no| Custom spinner message displayed while the hook runs `once`| no| If `true`, runs once per session then is removed. Only honored for hooks declared in skill frontmatter; ignored in settings files and agent frontmatter + +The `if` field holds exactly one permission rule. There is no `&&`, `||`, or list syntax for combining rules; to apply multiple conditions, define a separate hook handler for each. For Bash, the rule is matched against each subcommand of the tool input after leading `VAR=value` assignments are stripped, so `if: "Bash(git push *)"` matches both `FOO=bar git push` and `npm test && git push`. The hook runs if any subcommand matches, and always runs when the command is too complex to parse. #### @@ -2303,6 +2305,8 @@ Agent-based hooks +Agent hooks are experimental. Behavior and configuration may change in future releases. For production workflows, prefer command hooks. + Agent-based hooks (`type: "agent"`) are like prompt-based hooks but with multi-turn tool access. Instead of a single LLM call, an agent hook spawns a subagent that can read files, search code, and inspect the codebase to verify conditions. Agent hooks support the same events as prompt-based hooks. ###
modified Automate workflows with hooks View current →
--- a/hooks-guide.md +++ b/hooks-guide.md @@ -298,24 +298,34 @@ Reload environment when directory or files change -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`: - - { - "hooks": { +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. Pairing a `SessionStart` hook with a `CwdChanged` hook fixes this. `SessionStart` loads the variables for the directory you launch in, and `CwdChanged` reloads them each time Claude changes directory. Both write to `CLAUDE_ENV_FILE`, which Claude Code runs as a script preamble before each Bash command. Add this to `~/.claude/settings.json`: + + { + "hooks": { + "SessionStart": [ + { + "hooks": [ + { + "type": "command", + "command": "direnv export bash > \"$CLAUDE_ENV_FILE\"" + } + ] + } + ], "CwdChanged": [ { "hooks": [ { "type": "command", - "command": "direnv export bash >> \"$CLAUDE_ENV_FILE\"" - } - ] - } - ] - } - } - -To react to specific files instead of every directory change, use `FileChanged` with a `matcher` listing the filenames to watch, separated by `|`. To build the watch list, this value is split into literal filenames rather than evaluated as a regex. See [FileChanged](</docs/en/hooks#filechanged>) for how the same value also filters which hook groups run when a file changes. This example watches `.envrc` and `.env` in the working directory: + "command": "direnv export bash > \"$CLAUDE_ENV_FILE\"" + } + ] + } + ] + } + } + +Run `direnv allow` once in each directory that has an `.envrc` so direnv is permitted to load it. If you use devbox or nix instead of direnv, the same pattern works with `devbox shellenv` or `devbox global shellenv` in place of `direnv export bash`. To react to specific files instead of every directory change, use `FileChanged` with a `matcher` listing the filenames to watch, separated by `|`. To build the watch list, this value is split into literal filenames rather than evaluated as a regex. See [FileChanged](</docs/en/hooks#filechanged>) for how the same value also filters which hook groups run when a file changes. This example watches `.envrc` and `.env` in the working directory: { "hooks": { @@ -325,7 +335,7 @@ "hooks": [ { "type": "command", - "command": "direnv export bash >> \"$CLAUDE_ENV_FILE\"" + "command": "direnv export bash > \"$CLAUDE_ENV_FILE\"" } ] } @@ -420,7 +430,7 @@ * `"type": "http"`: POST event data to a URL. See HTTP hooks. * `"type": "prompt"`: single-turn LLM evaluation. See Prompt-based hooks. - * `"type": "agent"`: multi-turn verification with tool access. See Agent-based hooks. + * `"type": "agent"`: multi-turn verification with tool access. Agent hooks are experimental and may change. See Agent-based hooks. ### @@ -615,7 +625,7 @@ The `if` field requires Claude Code v2.1.85 or later. Earlier versions ignore it and run the hook on every matched call. -The `if` field uses [permission rule syntax](</docs/en/permissions>) to filter hooks by tool name and arguments together, so the hook process only spawns when the tool call matches. This goes beyond `matcher`, which filters at the group level by tool name only. For example, to run a hook only when Claude uses `git` commands rather than all Bash commands: +The `if` field uses [permission rule syntax](</docs/en/permissions>) to filter hooks by tool name and arguments together, so the hook process only spawns when the tool call matches, or when a Bash command is too complex to parse. This goes beyond `matcher`, which filters at the group level by tool name only. For example, to run a hook only when Claude uses `git` commands rather than all Bash commands: { "hooks": { @@ -634,7 +644,7 @@ } } -The hook process only spawns when the Bash command starts with `git`. Other Bash commands skip this handler entirely. The `if` field accepts the same patterns as permission rules: `"Bash(git *)"`, `"Edit(*.ts)"`, and so on. To match multiple tool names, use separate handlers each with its own `if` value, or match at the `matcher` level where pipe alternation is supported. `if` only works on tool events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, and `PermissionDenied`. Adding it to any other event prevents the hook from running. +The hook process only spawns when a subcommand of the Bash command matches `git *`, or when the command is too complex to parse into subcommands. For compound commands like `npm test && git push`, Claude Code evaluates each subcommand and fires the hook because `git push` matches. The `if` field accepts the same patterns as permission rules: `"Bash(git *)"`, `"Edit(*.ts)"`, and so on. To match multiple tool names, use separate handlers each with its own `if` value, or match at the `matcher` level where pipe alternation is supported. `if` only works on tool events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, and `PermissionRequest`. Adding it to any other event prevents the hook from running. ### @@ -691,6 +701,8 @@ Agent-based hooks +Agent hooks are experimental. Behavior and configuration may change in future releases. For production workflows, prefer [command hooks](</docs/en/hooks#command-hook-fields>). + 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: {
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -6,8 +6,8 @@ Keyboard shortcuts may vary by platform and terminal. Press `?` to see available shortcuts for your environment.**macOS users** : Option/Alt key shortcuts (`Alt+B`, `Alt+F`, `Alt+Y`, `Alt+M`, `Alt+P`, `Alt+T`) require configuring Option as Meta in your terminal: - * **iTerm2** : settings → Profiles → Keys → set Left/Right Option key to “Esc+” - * **Terminal.app** : settings → Profiles → Keyboard → check “Use Option as Meta Key” + * **iTerm2** : Settings → Profiles → Keys → General → set Left/Right Option key to “Esc+” + * **Apple Terminal** : Settings → Profiles → Keyboard → check “Use Option as Meta Key” * **VS Code** : set `"terminal.integrated.macOptionIsMeta": true` in VS Code settings See [Terminal configuration](</docs/en/terminal-config>) for details. @@ -75,12 +75,12 @@ Method| Shortcut| Context ---|---|--- Quick escape| `\` \+ `Enter`| Works in all terminals -macOS default| `Option+Enter`| Default on macOS -Shift+Enter| `Shift+Enter`| Works out of the box in iTerm2, WezTerm, Ghostty, Kitty -Control sequence| `Ctrl+J`| Line feed character for multiline +Option key| `Option+Enter`| After enabling [Option as Meta](</docs/en/terminal-config#enable-option-key-shortcuts-on-macos>) on macOS +Shift+Enter| `Shift+Enter`| Native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal +Control sequence| `Ctrl+J`| Works in any terminal without configuration Paste mode| Paste directly| For code blocks, logs -Shift+Enter works without configuration in iTerm2, WezTerm, Ghostty, and Kitty. For other terminals (VS Code, Alacritty, Zed, Warp), run `/terminal-setup` to install the binding. +Shift+Enter works without configuration in iTerm2, WezTerm, Ghostty, Kitty, Warp, and Apple Terminal. For VS Code, Cursor, Windsurf, Alacritty, and Zed, run `/terminal-setup` to install the binding. ### @@ -199,6 +199,7 @@ `>>`| Indent line `<<`| Dedent line `J`| Join lines +`u`| Undo `.`| Repeat last change ###
modified Claude Code settings View current →
--- a/settings.md +++ b/settings.md @@ -217,6 +217,7 @@ `spinnerTipsEnabled`| Show tips in the spinner while Claude is working. Set to `false` to disable tips (default: `true`)| `false` `spinnerTipsOverride`| Override spinner tips with custom strings. `tips`: array of tip strings. `excludeDefault`: if `true`, only show custom tips; if `false` or absent, custom tips are merged with built-in tips| `{ "excludeDefault": true, "tips": ["Use our internal tool X"] }` `spinnerVerbs`| Customize the action verbs shown in the spinner and turn duration messages. Set `mode` to `"replace"` to use only your verbs, or `"append"` to add them to the defaults| `{"mode": "append", "verbs": ["Pondering", "Crafting"]}` +`sshConfigs`| SSH connections to show in the [Desktop](</docs/en/desktop#pre-configure-ssh-connections-for-your-team>) environment dropdown. Each entry requires `id`, `name`, and `sshHost`; `sshPort`, `sshIdentityFile`, and `startDirectory` are optional. When set in managed settings, connections are read-only for users. Read from managed and user settings only| `[{"id": "dev-vm", "name": "Dev VM", "sshHost": "user@dev.example.com"}]` `statusLine`| Configure a custom status line to display context. See [`statusLine` documentation](</docs/en/statusline>)| `{"type": "command", "command": "~/.claude/statusline.sh"}` `strictKnownMarketplaces`| (Managed settings only) Allowlist of plugin marketplaces users can add. Undefined = no restrictions, empty array = lockdown. Applies to marketplace additions only. See [Managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>)| `[{ "source": "github", "repo": "acme-corp/plugins" }]` `tui`| Terminal UI renderer. Use `"fullscreen"` for the flicker-free [alt-screen renderer](</docs/en/fullscreen>) with virtualized scrollback. Use `"default"` for the classic main-screen renderer. Set via `/tui`| `"fullscreen"`
modified Create custom subagents View current →
--- a/sub-agents.md +++ b/sub-agents.md @@ -694,7 +694,7 @@ * You want to enforce specific tool restrictions or permissions * The work is self-contained and can return a summary -Consider [Skills](</docs/en/skills>) instead when you want reusable prompts or workflows that run in the main conversation context rather than isolated subagent context. For a quick question about something already in your conversation, use [`/btw`](</docs/en/interactive-mode#side-questions-with-btw>) instead of a subagent. It sees your full context but has no tool access, and the answer is discarded rather than added to history. +Consider [Skills](</docs/en/skills>) instead when you want reusable prompts or workflows that run in the main conversation context rather than isolated subagent context. For a quick question about something already in your conversation, use [`/btw`](</docs/en/interactive-mode#side-questions-with-%2Fbtw>) instead of a subagent. It sees your full context but has no tool access, and the answer is discarded rather than added to history. Subagents cannot spawn other subagents. If your workflow requires nested delegation, use [Skills](</docs/en/skills>) or chain subagents from the main conversation.
modified Configure your terminal for Claude Code View current →
Show diff (252 lines)
--- a/terminal-config.md +++ b/terminal-config.md @@ -1,137 +1,158 @@ -### +Claude Code works in any terminal without configuration. This page is for when something specific is not behaving the way you expect. Find your symptom below. If everything already feels right, you do not need this page. + + * Shift+Enter submits instead of inserting a newline + * Option-key shortcuts do nothing on macOS + * No sound or alert when Claude finishes + * You run Claude Code inside tmux + * Display flickers or scrollback jumps + * You want Vim keys in the prompt + +This page is about getting your terminal to send the right signals to Claude Code. To change which keys Claude Code itself responds to, see [keybindings](</docs/en/keybindings>) instead. + +## ​ -Themes and appearance +Enter multiline prompts -Claude cannot control the theme of your terminal. That’s handled by your terminal application. You can match Claude Code’s theme to your terminal via the `/theme` command. Select `auto` in the theme picker to have Claude Code follow your terminal’s dark or light mode automatically. For additional customization of the Claude Code interface itself, you can configure a [custom status line](</docs/en/statusline>) to display contextual information like the current model, working directory, or git branch at the bottom of your terminal. +Pressing Enter submits your message. To add a line break without submitting, press Ctrl+J, or type `\` and then press Enter. Both work in every terminal with no setup. In most terminals you can also press Shift+Enter, but support varies by terminal emulator: + +Terminal| Shift+Enter for newline +---|--- +Ghostty, Kitty, iTerm2, WezTerm, Warp, Apple Terminal| Works without setup +VS Code, Cursor, Windsurf, Alacritty, Zed| Run `/terminal-setup` once +Windows Terminal, gnome-terminal, JetBrains IDEs such as PyCharm and Android Studio| Not available; use Ctrl+J or `\` then Enter + +For VS Code, Cursor, Windsurf, Alacritty, and Zed, `/terminal-setup` writes Shift+Enter and other keybindings into the terminal’s configuration file. If it reports a conflict such as `Found existing VSCode terminal Shift+Enter key binding`, remove that entry from the terminal’s own keybindings file, for example VS Code’s `keybindings.json`, and run the command again. Run `/terminal-setup` directly in the host terminal rather than inside tmux or screen, since it needs to write to the host terminal’s configuration. If you are running inside tmux, Shift+Enter also requires the tmux configuration below even when the outer terminal supports it. To bind newline to a different key, or to swap behavior so Enter inserts a newline and Shift+Enter submits, map the `chat:newline` and `chat:submit` actions in your [keybindings file](</docs/en/keybindings>). + +## + +​ + +Enable Option key shortcuts on macOS + +Some Claude Code shortcuts use the Option key, such as Option+Enter for a newline or Option+P to switch models. On macOS, most terminals do not send Option as a modifier by default, so these shortcuts do nothing until you enable it. The terminal setting for this is usually labeled “Use Option as Meta Key”; Meta is the historical Unix name for the key now labeled Option or Alt. + + * Apple Terminal + + * iTerm2 + + * VS Code + +Open Settings → Profiles → Keyboard and check “Use Option as Meta Key”.If you accepted Claude Code’s first-run prompt that offered “Option+Enter for newlines and visual bell”, this is already done. That prompt runs `/terminal-setup` for you, which enables Option as Meta and switches the audio bell to a visual screen flash in your Apple Terminal profile. + +Open Settings → Profiles → Keys → General and set Left Option key and Right Option key to “Esc+”. + +Add `"terminal.integrated.macOptionIsMeta": true` to your VS Code settings. + +For Ghostty, Kitty, and other terminals, look for an Option-as-Alt or Option-as-Meta setting in the terminal’s configuration file. + +## + +​ + +Get a terminal bell or notification + +When Claude finishes a task or pauses for a permission prompt, it fires a notification event. Surfacing this as a terminal bell or desktop notification lets you switch to other work while a long task runs. Claude Code sends a desktop notification only in Ghostty, Kitty, and iTerm2; every other terminal needs a Notification hook instead. The notification also reaches your local machine over SSH, so a remote session can still alert you. Ghostty and Kitty forward it to your OS notification center without further setup. iTerm2 requires you to enable forwarding: + +1 + +Open iTerm2 notification settings + +Go to Settings → Profiles → Terminal. + +2 + +Enable alerts + +Check “Notification Center Alerts”, then click “Filter Alerts” and enable “Send escape sequence-generated alerts”. + +If notifications still do not appear, confirm that your terminal application has notification permission in your OS settings, and if you are running inside tmux, enable passthrough. ### ​ -Line breaks +Play a sound with a Notification hook -You have several options for entering line breaks into Claude Code: +In any terminal you can configure a [Notification hook](</docs/en/hooks-guide#get-notified-when-claude-needs-input>) to play a sound or run a custom command when Claude needs your attention. Hooks run alongside the desktop notification rather than replacing it. Terminals such as Warp or Apple Terminal rely on a hook alone since Claude Code does not send them a desktop notification. The example below plays a system sound on macOS. The linked guide has desktop notification commands for macOS, Linux, and Windows. - * **Quick escape** : Type `\` followed by Enter to create a newline - * **Ctrl+J** : Sends a line feed character, which works as a newline in any terminal without configuration - * **Shift+Enter** : Works out of the box in iTerm2, WezTerm, Ghostty, and Kitty - * **Keyboard shortcut** : Set up a keybinding to insert a newline in other terminals +~/.claude/settings.json -#### + { + "hooks": { + "Notification": [ + { + "hooks": [{ "type": "command", "command": "afplay /System/Library/Sounds/Glass.aiff" }] + } + ] + } + } + +## ​ -Set up Shift+Enter with /terminal-setup +Configure tmux -Run `/terminal-setup` within Claude Code to automatically configure Shift+Enter for VS Code, Alacritty, Zed, and Warp. +When Claude Code runs inside tmux, two things break by default: Shift+Enter submits instead of inserting a newline, and desktop notifications and the [progress bar](</docs/en/settings#global-config-settings>) never reach the outer terminal. Add these lines to `~/.tmux.conf`, then run `tmux source-file ~/.tmux.conf` to apply them to the running server: -The `/terminal-setup` command is only visible in terminals that require manual configuration. If you’re using iTerm2, WezTerm, Ghostty, or Kitty, you won’t see this command because Shift+Enter already works natively. +~/.tmux.conf -#### + set -g allow-passthrough on + set -s extended-keys on + set -as terminal-features 'xterm*:extkeys' + +The `allow-passthrough` line lets notifications and progress updates reach iTerm2, Ghostty, or Kitty instead of being swallowed by tmux. The `extended-keys` lines let tmux distinguish Shift+Enter from plain Enter so the newline shortcut works. + +## ​ -Set up Shift+Enter in tmux +Match the color theme -Inside tmux, `Shift+Enter` submits instead of inserting a newline unless extended key reporting is enabled. Add these lines to `~/.tmux.conf`, then run `tmux source-file ~/.tmux.conf` to reload your configuration: +Use the `/theme` command, or the theme picker in `/config`, to choose a Claude Code theme that matches your terminal. Selecting the auto option detects your terminal’s light or dark background, so the theme follows OS appearance changes whenever your terminal does. The available themes are built in; there is no custom theme file. Claude Code does not control the terminal’s own color scheme, which is set by the terminal application. To customize what appears at the bottom of the interface, configure a [custom status line](</docs/en/statusline>) that shows the current model, working directory, git branch, or other context. - set -s extended-keys on - set -as terminal-features 'xterm*:extkeys' - -Claude Code requests extended keys at startup, but tmux ignores the request unless `extended-keys` is set to `on`. The `terminal-features` line tells tmux that your outer terminal can send these sequences. - -#### +## ​ -Set up Option+Enter on macOS +Switch to fullscreen rendering -On macOS, you can use Option+Enter as the newline keybinding in Terminal.app, iTerm2, and the VS Code terminal after enabling the Option-as-Meta setting. +If the display flickers or the scroll position jumps while Claude is working, switch to [fullscreen rendering mode](</docs/en/fullscreen>). It draws to a separate screen the terminal reserves for full-screen apps instead of appending to your normal scrollback, which keeps memory usage flat and adds mouse support for scrolling and selection. In this mode you scroll with the mouse or PageUp inside Claude Code rather than with your terminal’s native scrollback; see the [fullscreen page](</docs/en/fullscreen#search-and-review-the-conversation>) for how to search and copy. Run `/tui fullscreen` to switch in the current session with your conversation intact. To make it the default, set the `CLAUDE_CODE_NO_FLICKER` environment variable before starting Claude Code: - * Terminal.app +Bash and Zsh - * iTerm2 +PowerShell - * VS Code +~/.claude/settings.json - 1. Open Settings → Profiles → Keyboard - 2. Check “Use Option as Meta Key” + CLAUDE_CODE_NO_FLICKER=1 claude - 1. Open Settings → Profiles → Keys - 2. Under General, set Left/Right Option key to “Esc+” - -Set `"terminal.integrated.macOptionIsMeta": true` in VS Code settings. - -### +## ​ -Notification setup +Paste large content -When Claude finishes working and is waiting for your input, it fires a notification event. You can surface this event as a desktop notification through your terminal or run custom logic with [notification hooks](</docs/en/hooks#notification>). +When you paste more than 10,000 characters into the prompt, Claude Code collapses the input to a `[Pasted text]` placeholder so the input box stays usable. The full content is still sent to Claude when you submit. The VS Code integrated terminal can drop characters from very large pastes before they reach Claude Code, so prefer file-based workflows there. For very large inputs such as entire files or long logs, write the content to a file and ask Claude to read it instead of pasting. This keeps the conversation transcript readable and lets Claude reference the file by path in later turns. -#### +## ​ -Terminal notifications +Edit prompts with Vim keybindings -Kitty and Ghostty support desktop notifications without additional configuration. iTerm 2 requires setup: +Claude Code includes a Vim-style editing mode for the prompt input. Enable it through `/config` → Editor mode, or by setting the [`editorMode`](</docs/en/settings#global-config-settings>) global config key to `"vim"` in `~/.claude.json`. Set Editor mode back to `normal` to turn it off. Vim mode supports a subset of NORMAL-mode motions and operators, such as `hjkl` navigation and `d`/`c`/`y` with text objects. See the [Vim editor mode reference](</docs/en/interactive-mode#vim-editor-mode>) for the full key table. Vim motions are not remappable through the keybindings file. Pressing Enter still submits your prompt in INSERT mode, unlike standard Vim. Use `o` or `O` in NORMAL mode, or Ctrl+J, to insert a newline instead. - 1. Open iTerm 2 Settings → Profiles → Terminal - 2. Enable “Notification Center Alerts” - 3. Click “Filter Alerts” and check “Send escape sequence-generated alerts” - -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: - - 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. - -#### +## ​ -Notification hooks +Related resources -To add custom behavior when notifications fire, such as playing a sound or sending a message, configure a [notification hook](</docs/en/hooks#notification>). Hooks run alongside terminal notifications, not as a replacement. - -### - -​ - -Reduce flicker and memory usage - -If you see flicker during long sessions, or your terminal scroll position jumps to the top while Claude is working, try [fullscreen rendering](</docs/en/fullscreen>). It uses an alternate rendering path that keeps memory flat and adds mouse support. Run `/tui fullscreen` to switch in your current conversation. - -### - -​ - -Handling large inputs - -When working with extensive code or long instructions: - - * **Avoid direct pasting** : Claude Code may struggle with very long pasted content - * **Use file-based workflows** : Write content to a file and ask Claude to read it - * **Be aware of VS Code limitations** : The VS Code terminal is particularly prone to truncating long pastes - -### - -​ - -Vim Mode - -Claude Code supports a subset of Vim keybindings that can be enabled via `/config` → Editor mode. To set the mode directly in your config file, set the [`editorMode`](</docs/en/settings#global-config-settings>) global config key to `"vim"` in `~/.claude.json`. The supported subset includes: - - * Mode switching: `Esc` (to NORMAL), `i`/`I`, `a`/`A`, `o`/`O` (to INSERT) - * Navigation: `h`/`j`/`k`/`l`, `w`/`e`/`b`, `0`/`$`/`^`, `gg`/`G`, `f`/`F`/`t`/`T` with `;`/`,` repeat - * Editing: `x`, `dw`/`de`/`db`/`dd`/`D`, `cw`/`ce`/`cb`/`cc`/`C`, `.` (repeat) - * Yank/paste: `yy`/`Y`, `yw`/`ye`/`yb`, `p`/`P` - * Text objects: `iw`/`aw`, `iW`/`aW`, `i"`/`a"`, `i'`/`a'`, `i(`/`a(`, `i[`/`a[`, `i{`/`a{` - * Indentation: `>>`/`<<` - * Line operations: `J` (join lines) - -See [Interactive mode](</docs/en/interactive-mode#vim-editor-mode>) for the complete reference. + * [Interactive mode](</docs/en/interactive-mode>): full keyboard shortcut reference and the Vim key table + * [Keybindings](</docs/en/keybindings>): remap any Claude Code shortcut, including Enter and Shift+Enter + * [Fullscreen rendering](</docs/en/fullscreen>): details on scrolling, search, and copy in fullscreen mode + * [Hooks guide](</docs/en/hooks-guide>): more Notification hook examples for Linux and Windows + * [Troubleshooting](</docs/en/troubleshooting>): fixes for issues outside terminal configuration
modified Agent SDK reference - TypeScript View current →
--- a/typescript.md +++ b/typescript.md @@ -925,6 +925,7 @@ | SDKTaskNotificationMessage | SDKTaskStartedMessage | SDKTaskProgressMessage + | SDKTaskUpdatedMessage | SDKFilesPersistedEvent | SDKToolUseSummaryMessage | SDKRateLimitEvent @@ -3036,6 +3037,30 @@ ​ +`SDKTaskUpdatedMessage` + +Emitted when a background task’s state changes, such as when it transitions from `running` to `completed`. Merge `patch` into your local task map keyed by `task_id`. The `end_time` field is a Unix epoch timestamp in milliseconds, comparable with `Date.now()`. + + type SDKTaskUpdatedMessage = { + type: "system"; + subtype: "task_updated"; + task_id: string; + patch: { + status?: "pending" | "running" | "completed" | "failed" | "killed"; + description?: string; + end_time?: number; + total_paused_ms?: number; + error?: string; + is_backgrounded?: boolean; + }; + uuid: UUID; + session_id: string; + }; + +### + +​ + `SDKFilesPersistedEvent` Emitted when file checkpoints are persisted to disk.
modified Find bugs with ultrareview View current →
--- a/ultrareview.md +++ b/ultrareview.md @@ -38,11 +38,11 @@ Plan| Included free runs| After free runs ---|---|--- -Pro| 3 free runs, one-time| billed as [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) -Max| 3 free runs, one-time| billed as [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) +Pro| 3 free runs through May 5, 2026| billed as [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) +Max| 3 free runs through May 5, 2026| billed as [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) Team and Enterprise| none| billed as [extra usage](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) -Pro and Max subscribers receive three free ultrareview runs to try the feature. These three runs are a one-time allotment per account and do not refresh. After you use them, each review is billed to extra usage and typically costs $5 to $20 depending on the size of the change. Because ultrareview always bills as extra usage outside the free runs, your account or organization must have extra usage enabled before you can launch a paid review. If extra usage is not enabled, Claude Code blocks the launch and links you to the billing settings where you can turn it on. You can also run `/extra-usage` to check or change your current setting. +Pro and Max subscribers receive three free ultrareview runs to try the feature. These three runs are a one-time allotment per account, do not refresh, and expire on May 5, 2026. After you use all three, or after the free run period ends, each review is billed to extra usage and typically costs $5 to $20 depending on the size of the change. Because ultrareview always bills as extra usage outside the free runs, your account or organization must have extra usage enabled before you can launch a paid review. If extra usage is not enabled, Claude Code blocks the launch and links you to the billing settings where you can turn it on. You can also run `/extra-usage` to check or change your current setting. ##
modified Use Claude Code in VS Code View current →
--- a/vs-code.md +++ b/vs-code.md @@ -85,7 +85,7 @@ * **Permission modes** : click the mode indicator at the bottom of the prompt box to switch modes. In normal mode, Claude asks permission before each action. In Plan mode, Claude describes what it will do and waits for approval before making changes. VS Code automatically opens the plan as a full markdown document where you can add inline comments to give feedback before Claude begins. In auto-accept mode, Claude makes edits without asking. Set the default in VS Code settings under `claudeCode.initialPermissionMode`. * **Command menu** : click `/` or type `/` to open the command menu. Options include attaching files, switching models, toggling extended thinking, viewing plan usage (`/usage`), and starting a [Remote Control](</docs/en/remote-control>) session (`/remote-control`). The Customize section provides access to MCP servers, hooks, memory, permissions, and plugins. Items with a terminal icon open in the integrated terminal. * **Context indicator** : the prompt box shows how much of Claude’s context window you’re using. Claude automatically compacts when needed, or you can run `/compact` manually. - * **Extended thinking** : lets Claude spend more time reasoning through complex problems. Toggle it on via the command menu (`/`). See [Extended thinking](</docs/en/common-workflows#use-extended-thinking-thinking-mode>) for details. + * **Extended thinking** : lets Claude spend more time reasoning through complex problems. Toggle it on via the command menu (`/`). Claude’s reasoning appears in the conversation as collapsed blocks: click a block to read it, or press `Ctrl+O` to expand or collapse every thinking block in the session. See [Extended thinking](</docs/en/common-workflows#use-extended-thinking-thinking-mode>) for details. * **Multi-line input** : press `Shift+Enter` to add a new line without sending. This also works in the “Other” free-text input of question dialogs. ###
modified Zero data retention View current →
--- a/zero-data-retention.md +++ b/zero-data-retention.md @@ -71,4 +71,4 @@ Request ZDR -To request ZDR for Claude Code on Claude for Enterprise, contact your Anthropic account team. Your account team will submit the request internally, and Anthropic will review and enable ZDR on your organization after confirming eligibility. All enablement actions are audit-logged. If you are currently using ZDR for Claude Code via pay-as-you-go API keys, you can transition to Claude for Enterprise to gain access to administrative features while maintaining ZDR for Claude Code. Contact your account team to coordinate the migration. +To request ZDR for Claude Code on Claude for Enterprise, [contact sales](<https://www.anthropic.com/contact-sales?utm_source=claude_code&utm_medium=docs&utm_content=zero_data_retention_request>) or your Anthropic account team. Your account team will submit the request internally, and Anthropic will review and enable ZDR on your organization after confirming eligibility. All enablement actions are audit-logged. If you are currently using ZDR for Claude Code via pay-as-you-go API keys, you can transition to Claude for Enterprise to gain access to administrative features while maintaining ZDR for Claude Code. Contact your account team to coordinate the migration.