One read of Claude Code CLIclaude-code-20261129T000702Z
31 pages moved out of 221 read.
Pages moved
31
significant first
Pages read
221
in this capture
Captured
00:07 UTC
Corpus hash
d19d3ce77920
corpus-hash
What this read moved
1-25 of 31, page 1 of 2This capture is too large to show at once. Changes 1-25 of 31 are below, significant first; the rest are on the following screens.
agent-sdk/session-storage Changed · +8 / -1 lines
from line 202
202202import { S3Client } from "@aws-sdk/client-s3";
203203import { S3SessionStore } from "./S3SessionStore"; // copied from examples/session-stores/s3
204204
205const bucket = process.env.TRANSCRIPT_BUCKET;
206if (!bucket) {
207 throw new Error(
208 "Set the TRANSCRIPT_BUCKET environment variable to the name of an S3 bucket your AWS account owns"
209 );
210}
211
205212const store = new S3SessionStore({
206 bucket: "my-claude-sessions",
213 bucket,
207214 prefix: "transcripts",
208215 client: new S3Client({ region: "us-east-1" }),
209216});
agent-sdk/troubleshooting Changed · +5 / -1 lines
from line 161
161161Any change a tool already made stays in place, and the tool call whose message was too long may have made one. To pick up the work that stopped:
162162
1631631. If you hold a `ClaudeSDKClient` open, call `disconnect()`. The client receives no more messages after this error, but Claude Code keeps running and can still make changes.
1642. Start a new `query()` or `ClaudeSDKClient` with the larger limit and [`continue_conversation=True`](https://code.claude.com/docs/en/agent-sdk/sessions#continue-resume-and-fork), which picks the most recent session in the working directory. To pick a specific session, set `resume` to `data["session_id"]` from the init [`SystemMessage`](https://code.claude.com/docs/en/agent-sdk/python#systemmessage).
1642. Start a new `query()` or `ClaudeSDKClient` with the larger limit, and set `resume` to `data["session_id"]` from the init [`SystemMessage`](https://code.claude.com/docs/en/agent-sdk/python#systemmessage).
165
166 In an app that serves several users, keep each user's session ID and resume with it, and start a new session for a user whose ID you didn't keep.
167
168 If your app runs one conversation at a time and you didn't keep the ID, set [`continue_conversation=True`](https://code.claude.com/docs/en/agent-sdk/sessions#continue-resume-and-fork) instead to resume the most recent session in the working directory.
165169
166170## Streaming input
167171
code-review-customize Changed · +15 / -15 lines
from line 15
1515
1616## Use CLAUDE.md for project-wide rules
1717
18Code Review reads your repository's `CLAUDE.md` files as project context. A change that violates one of their rules becomes a finding at whichever [severity level](https://code.claude.com/docs/en/code-review-pull-requests.md#severity-levels) fits the issue.
18Put project-wide rules in your repository's `CLAUDE.md` files, which Code Review reads as project context. When a change clearly breaks one of their rules, Code Review can flag it at whichever [severity level](https://code.claude.com/docs/en/code-review-pull-requests.md#severity-levels) fits the issue.
1919
2020A review reads the `CLAUDE.md` at your repository root and the `CLAUDE.md` files in the parent directories of each changed file. A subdirectory's `CLAUDE.md` is read when the pull request changes a file under that path.
2121
from line 51
5151* **Generated code**: `generated`
5252* **Third-party code**: `vendor`, `third_party`, `third-party`, `thirdparty`, `node_modules`, `bower_components`, `external`, `extern`, `deps`, `godeps`, `pods`, `carthage`, `site-packages`, `contrib`
5353
54Put checks for those subdirectories in the root `REVIEW.md`, or in a parent subdirectory's `REVIEW.md` when neither that parent nor anything above it is on the list.
54Put checks for those subdirectories in the root `REVIEW.md`, or in a parent subdirectory's `REVIEW.md` that Code Review reads.
5555
56The remaining subdirectory `REVIEW.md` files on the paths a pull request changes share a limit of 150,000 bytes, not counting the root file. If the [check run](https://code.claude.com/docs/en/code-review-pull-requests.md#check-run-output) reports that some of them didn't fit, shorten the files to fit that limit.
56For the paths a pull request changes, keep the subdirectory `REVIEW.md` files within 150,000 bytes in total, apart from the root file. If the [check run](https://code.claude.com/docs/en/code-review-pull-requests.md#check-run-output) reports that some of them didn't fit, shorten the files.
5757
5858### Example REVIEW\.md
5959
from line 89
8989
9090### Choose what to write in REVIEW\.md
9191
92`REVIEW.md` is freeform Markdown that changes what a review finds and reports. It doesn't change the format of the review. Find the problem you're seeing, then add an instruction like the one shown. The [example](#example-review-md) uses the first four.
92Write `REVIEW.md` in freeform Markdown to change what a review finds and reports. It doesn't change the format of the review. Find the problem you're seeing, then add an instruction like the one shown. The [example](#example-review-md) uses the first four.
9393
9494* **The wrong things are marked Important**: redefine what 🔴 Important means for your repository. The default calibration targets production code, and a docs repository, a config repository, or a prototype might want a much narrower definition. State which classes of finding are Important and which are Nit at most. You can also escalate, for example treating any `CLAUDE.md` violation as Important.
9595* **Too many nits**: cap how many 🟡 Nit comments a single review posts. A cap like "report at most five nits" keeps reviews actionable.
9696* **Comments on generated files or on what CI already checks**: list paths and finding categories where Claude should skip findings. Common candidates are generated code, lockfiles, and vendored dependencies, along with anything your CI already enforces like linting or spellcheck. For paths that warrant some review but not full scrutiny, set a higher bar instead: "in `scripts/`, only report if near-certain and severe."
9797* **A team rule isn't being checked**: add rules you want flagged on every pull request, like "new API routes must have an integration test."
98* **Findings that turn out to be wrong**: require evidence before a class of finding is posted. For example, "behavior claims need a `file:line` citation in the source, not an inference from naming" cuts false positives that would otherwise cost the author a round trip.
98* **Findings that turn out to be wrong**: require evidence before a class of finding is posted. For example, write "behavior claims need a `file:line` citation in the source, not an inference from naming."
9999
100100Some of these instructions [need the root file on a protected default branch](#which-branch-review-md-is-read-from).
101101
from line 141
141141
142142### Include a skill file
143143
144To have reviews follow guidance you keep in a [skill](https://code.claude.com/docs/en/skills.md), include the skill's `SKILL.md` in your root `REVIEW.md`. Code Review doesn't run skills.
144To have reviews follow guidance you keep in a [skill](https://code.claude.com/docs/en/skills.md), include the skill's `SKILL.md` in your root `REVIEW.md`.
145145
146146Add `@` and the path to `SKILL.md`, in the form `.claude/skills/<folder>/SKILL.md`, on a line of its own:
147147
from line 161
161161
162162Use a folder name without spaces. A line with a space in its path stays in `REVIEW.md` as plain text, and the check run doesn't report it as a skipped include.
163163
164If the `@` line for a skill breaks one of the rules below, Code Review doesn't include the skill from that line:
164For Code Review to include the skill from an `@` line, follow these rules:
165165
166166* **Path**: write the path as `.claude/skills/<folder>/SKILL.md` from the repository root, with the skill's folder directly under `skills/`. Unlike a file name at the root, a path of this form that matches no file is skipped and counted.
167* **Source**: copy guidance from any other file under `.claude/`, or from a [bundled, personal, or plugin skill](https://code.claude.com/docs/en/skills.md#where-skills-live), into a file beside `REVIEW.md`. You can't include those directly.
168* **File**: commit `SKILL.md` as a regular text file. Code Review doesn't follow a symbolic link, whether the link is the file or a folder in its path.
167* **Source**: to use guidance from any other file under `.claude/`, or from a [bundled, personal, or plugin skill](https://code.claude.com/docs/en/skills.md#where-skills-live), copy it into a file beside `REVIEW.md`
168* **File**: commit `SKILL.md` as a regular text file. If the file or a folder in its path is a symbolic link, replace the link with a copy.
169169* **Size**: keep `SKILL.md` at 30,000 bytes or less, frontmatter included
170* **Count**: write at most eight skill lines. A repeated line counts again toward the eight.
170* **Count**: write at most eight skill lines. If you repeat a line, it counts again toward the eight.
171171* **Blocks in `REVIEW.md`**: keep the `@` line out of code fences. Close every HTML comment and every `<pre>`, `<script>`, `<style>`, or `<textarea>` block above it.
172172
173173When Code Review skips a skill line for breaking the File, Size, Count, or Blocks rule, the check run's [message about skipped include lines](https://code.claude.com/docs/en/code-review-troubleshooting.md#the-check-run-mentions-review-md) counts it. The message appears only when the review applies `REVIEW.md` from a protected branch.
from line 174
174174
175175#### Check what a review gets from a skill
176176
177When the skill is included, a review gets the body of `SKILL.md` and nothing else from the skill, so check the skill against the list below.
177Check your skill against the list below, because a review gets only the body of `SKILL.md` from an included skill.
178178
179179* **Frontmatter**: repeat in the body anything a review needs from the [frontmatter](https://code.claude.com/docs/en/skills.md#frontmatter-reference), for example the conditions that `description` gives for using the skill
180180* **Injected commands**: write out what a [`!` command](https://code.claude.com/docs/en/skills#inject-dynamic-context) would supply. Code Review doesn't run the command, and replaces the whole line or block that holds it with a placeholder.
181* **Substitutions**: replace `$ARGUMENTS` and other [substitutions](https://code.claude.com/docs/en/skills.md#available-string-substitutions) with fixed text, because a review passes no arguments and leaves them as written
182* **Supporting files**: copy what a review needs into `SKILL.md`, because Code Review doesn't load scripts, linked files, or `@file` references
181* **Substitutions**: replace `$ARGUMENTS` and other [substitutions](https://code.claude.com/docs/en/skills.md#available-string-substitutions) with fixed text, because a review leaves them as written
182* **Supporting files**: copy what a review needs from scripts, linked files, or `@file` references into `SKILL.md`
183183* **Exclusions and Nit caps**: write instructions that exclude findings or cap Nits in `REVIEW.md` or a file beside it, not in the skill. Code Review doesn't accept a skill's text as the reason for either.
184184* **Links to repository files**: state in words what a link or `@file` reference points to. The review sees the path as plain text or as a placeholder.
185185
from line 218
218218* **Default branch**: a classic branch protection rule or a ruleset
219219* **Any other branch**: a ruleset only
220220
221A ruleset counts when it restricts updates or requires pull requests with at least one approval. If it requires pull requests, it must also dismiss that approval on a new push or require the approval to come after the last push.
221For a ruleset to count, set it to restrict updates or to require pull requests with at least one approval. If you choose pull requests, also set it to dismiss that approval on a new push or require the approval to come after the last push.
222222
223223#### What a review reads for each branch setup
224224
hooks Changed · +3 / -3 lines
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
from line 511
511511
512512Error handling differs from command hooks; see [HTTP response handling](#http-response-handling).
513513
514This example sends `PreToolUse` events to a local validation service, authenticating with a token from the `MY_TOKEN` environment variable:
514This example sends each `PreToolUse` event for the Bash tool to a service that checks the command, authenticating with a token from the `MY_TOKEN` environment variable:
515515
516516```json theme={null}
517517{
from line 522
522522 "hooks": [
523523 {
524524 "type": "http",
525 "url": "http://localhost:8080/hooks/pre-tool-use",
525 "url": "https://hooks.example.com/pre-tool-use",
526526 "timeout": 30,
527527 "headers": {
528528 "Authorization": "Bearer $MY_TOKEN"
from line 816
816816
817817* **`WorktreeCreate`**: any non-zero exit code makes worktree creation fail, whatever your JSON says.
818818* **`WorktreeRemove`**: any non-zero exit code makes worktree removal fail if the directory still exists afterward.
819* **`Stop`, `SubagentStop`, `TaskCompleted`, and a plugin's `UserPromptSubmit` hook**: when your hook exits 2 with nothing on stdout and its stderr says a file is missing, such as `No such file or directory`, Claude Code treats the run as a non-blocking error.
819* **`Stop`, `SubagentStop`, `TaskCompleted`, `TeammateIdle`, and a plugin's `UserPromptSubmit` hook**: when stdout is blank and stderr contains `No such file` or `can't open` in any letter case, Claude Code assumes a missing script, so exit 2 is a non-blocking error. Correct the script path if it's wrong. Otherwise, print [`decision: "block"` JSON with a `reason`](#decision-control) on stdout and exit 0.
820820* **`Elicitation` and `ElicitationResult`**: Claude Code applies your `hookSpecificOutput` when your hook exits 0, and ignores it on any other exit code.
821821* **Events that discard hook output, such as `StopFailure`**: Claude Code ignores your JSON on any exit code, apart from side-effect fields like `terminalSequence`, which still fire.
822822
from line 3639
36393639| `context_tokens` | number | Tokens the next request re-sends as its prompt: the input, cache read, cache creation, and output tokens of the last response in the main conversation, combined. `0` before the first response |
36403640| `prompt_cache_warm` | boolean | Whether the current model's prompt cache is likely still warm, meaning the switch forfeits it |
36413641| `cache_ttl` | string | [Prompt cache lifetime](https://code.claude.com/docs/en/prompt-caching.md#cache-lifetime) of the main conversation at the time of this switch: `"5m"` or `"1h"` |
3642| `estimated_cache_write_usd` | number | Estimated cost in US dollars of writing `context_tokens` to the prompt cache on `to_model` at the `cache_ttl` rate, excluding the next response. The server may not need to re-cache the whole context, so treat it as an estimate |
3643| `pricing` | string | How Claude Code priced `estimated_cache_write_usd`: `"configured"` at you
3642| `estimated_cache_write_usd` | number | Estimated cost in US dollars of writing `context_tokens` to the prompt cache on `to_model` at the `cache_ttl` rate, excluding the next response. The se
hooks-guide Changed · +4 / -2 lines
from line 899
899899
900900Use `type: "http"` hooks to POST event data to an HTTP endpoint instead of running a shell command. The endpoint receives the same JSON that a command hook would receive on stdin, and returns results through the HTTP response body using the same JSON format.
901901
902HTTP hooks are useful when you want a web server, cloud function, or external service to handle hook logic, such as a team's shared audit service. The configuration below posts every successful tool call to a local logging service:
902HTTP hooks are useful when you want a web server, cloud function, or external service to handle hook logic, such as a team's shared audit service.
903903
904The configuration below sends [`PostToolUse`](https://code.claude.com/docs/en/hooks#posttooluse) events to an audit service, authenticating with a token from the `MY_TOKEN` environment variable:
905
904906```json theme={null}
905907{
906908 "hooks": {
from line 911
909911 "hooks": [
910912 {
911913 "type": "http",
912 "url": "http://localhost:8080/hooks/tool-use",
914 "url": "https://hooks.example.com/tool-use",
913915 "headers": {
914916 "Authorization": "Bearer $MY_TOKEN"
915917 },
model-config Changed · +6 / -6 lines
from line 136
136136
137137If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation's model](https://code.claude.com/docs/en/sub-agents.md#choose-a-model), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition.
138138
139If you set a model with `/model` in [non-interactive mode](https://code.claude.com/docs/en/headless.md), with the `-p` flag, your choice applies to the current session only and isn't saved as your default. `/model` in that mode requires Claude Code v2.1.205 or later.
139If you set a model with `/model` in [non-interactive mode](https://code.claude.com/docs/en/headless.md), with the `-p` flag, your choice applies to the current session only. `/model` in that mode requires Claude Code v2.1.205 or later.
140140
141141In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default.
142142
from line 277
277277
278278The substitution needs a permitted version to land on: when the allowlist permits no version of the alias's family, the alias follows the rejection and replacement behavior below like any other blocked value.
279279
280Claude Code handles any other blocked selection according to where the model was set:
280When a selection stays blocked, Claude Code handles it according to where the model was set:
281281
282282* **`/model`**: Claude Code rejects the switch with an error
283283* **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model
from line 295
295295Claude Code hides excluded models from the `/model` picker. Whether a model ID you list also gets a row of its own differs by provider:
296296
297297* **Anthropic API, [Claude Platform on AWS](https://code.claude.com/docs/en/claude-platform-on-aws.md), [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), or an [LLM gateway](https://code.claude.com/docs/en/llm-gateway) set through `ANTHROPIC_BASE_URL`**: an Anthropic model ID you list that has no built-in picker row appears as its own labeled row. Claude Code adds such a row for Opus, Sonnet, and Haiku versions, such as an older version that the list pins. If you set `replaceBuiltInOptions` in a [`modelPicker`](https://code.claude.com/docs/en/settings-reference#modelpicker) lineup, that row doesn't appear. Before v2.1.199, such an ID was selectable only by typing `/model <id>`.
298* **Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry**: unless a model ID you list starts with `anthropic.`, Claude Code doesn't add a row for it, whether it's an Anthropic model ID or a provider-specific one. [Mantle model IDs](#mantle-model-ids) carry that prefix. To show a listed version that has no built-in row, also add it to a [`modelPicker`](https://code.claude.com/docs/en/settings-reference#modelpicker) lineup, which accepts IDs in your provider's format.
298* **Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry**: unless a model ID you list starts with `anthropic.`, Claude Code doesn't add a row for it. [Mantle model IDs](#mantle-model-ids) carry that prefix. To show a listed version that has no built-in row, also add it to a [`modelPicker`](https://code.claude.com/docs/en/settings-reference#modelpicker) lineup, which accepts IDs in your provider's format.
299299
300Model changes that Claude Code makes on your behalf are checked the same way:
300When Claude Code changes models on your behalf, it avoids excluded models in most of these cases:
301301
302302* **[Fallback model chains](#fallback-model-chains)**: entries outside the allowlist are dropped
303303* **Plan-mode upgrades**: on the Anthropic API and Claude Platform on AWS, an upgrade such as [`opusplan`](#opusplan-model-setting) to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session's model
from line 1078
10781078* **Recognized**: the exact ID of a model Claude Code knows, such as its Anthropic API ID or your provider's or gateway's form of it, with or without the `[1m]` suffix. Pin `us.anthropic.claude-sonnet-4-5-20250929-v1:0` and the row reads `Sonnet 4.5`.
10791079* **Not recognized**: any other ID, such as an application inference profile ARN or a model version Claude Code doesn't know, unless a [`modelOverrides`](#override-model-ids-per-version) entry maps a model to that ID. On Microsoft Foundry, deployment names are user-defined, so Claude Code never recognizes a pinned ID there, mapped or not, and the row shows the deployment name by default.
10801080
1081When a row shows the model's name, its default description includes the pinned ID so you can still see which ID is pinned.
1081When a row shows the model's name, its default description includes the pinned ID.
10821082
10831083Claude Code may also not recognize which features a pinned model supports. You can set the display name and description yourself and declare capabilities with companion environment variables for each pinned model.
10841084
plugins/code-intelligence Changed · +11 / -11 lines
from line 25
2525| Language | Plugin | Binary |
2626| :- | :- | :- |
2727| C/C++ | [`clangd-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/clangd-lsp) | `clangd` |
28| C# | [`csharp-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/csharp-lsp) | `csharp-ls` |
29| Go | [`gopls-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp) | `gopls` |
30| Java | [`jdtls-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/jdtls-lsp) | `jdtls` |
31| Kotlin | [`kotlin-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/kotlin-lsp) | `kotlin-lsp` |
28| C# | [`csharp-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/csharp-lsp) | `csharp-ls`, a .NET tool |
29| Go | [`gopls-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp) | `gopls`, installed with `go install` |
30| Java | [`jdtls-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/jdtls-lsp) | `jdtls`, from Eclipse JDT.LS |
31| Kotlin | [`kotlin-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/kotlin-lsp) | `kotlin-lsp`, from JetBrains' Homebrew tap |
3232| Liquid | [`liquid-lsp`](https://github.com/Shopify/liquid-skills/tree/main/plugins/liquid-lsp) | `shopify`, from the Shopify CLI |
33| Lua | [`lua-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/lua-lsp) | `lua-language-server` |
34| PHP | [`php-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/php-lsp) | `intelephense` |
35| Python | [`pyright-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp) | `pyright-langserver` |
36| Ruby | [`ruby-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/ruby-lsp) | `ruby-lsp` |
37| Rust | [`rust-analyzer-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp) | `rust-analyzer` |
38| Swift | [`swift-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/swift-lsp) | `sourcekit-lsp` |
39| TypeScript and JavaScript | [`typescript-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp) | `typescript-language-server` |
33| Lua | [`lua-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/lua-lsp) | `lua-language-server`, from Homebrew, a Linux package manager or its releases page |
34| PHP | [`php-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/php-lsp) | `intelephense`, installed with npm |
35| Python | [`pyright-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp) | `pyright-langserver`, from the `pyright` package |
36| Ruby | [`ruby-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/ruby-lsp) | `ruby-lsp`, a gem |
37| Rust | [`rust-analyzer-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp) | `rust-analyzer`, a rustup component |
38| Swift | [`swift-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/swift-lsp) | `sourcekit-lsp`, included with the Swift toolchain |
39| TypeScript and JavaScript | [`typescript-lsp`](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp) | `typescript-language-server`, installed with npm |
4040
4141Anthropic maintains every plugin in the table except `liquid-lsp`, which Shopify maintains and the official marketplace lists.
4242
plugins/mods/interface Changed · +12 / -5 lines
### Handle missing `$.store` values in cloud sessions
from line 1164
11641164
11651165Each change follows the same render cycle as `hello-tabs`: the callback changes `notes`, calls `redraw`, and saves the list to `$.store`. If your hook draws the pane again while the user is typing a note, the field keeps their text as long as the hook passes the same `value` each time. To replace their text with your own, pass a different `value`.
11661166
1167The example saves the notes and doesn't load them. To bring them back in the next session, read them in a `session.start` hook, the way `hello-tabs` reads `count`.
1167The example saves the notes and doesn't load them. To bring them back in the next local session, read them in a `session.start` hook, the way `hello-tabs` reads `count`.
11681168
11691169These props make up the field's line, `Note: Type a note and press Enter ⏎ add`:
11701170
from line 1246
12461246| :- | :- | :- |
12471247| A module-level variable | The module reloads, which happens every time you save a file during development | Values you can lose, as `tab` is in `hello-tabs` |
12481248| `$.state` | The session ends, or the user runs `/clear`, `/resume`, or `/branch` | Values a drawing depends on that should survive a reload |
1249| `$.store` | Your mod deletes it, or no session reads or writes the store for [`cleanupPeriodDays`](https://code.claude.com/docs/en/settings-reference#cleanupperioddays). The store is a key-value store, saved as a JSON file of your plugin's own under `~/.claude/plugins/store/`. | Settings, history, anything the user expects to find next time |
1249| `$.store` | Your mod deletes it, or no session reads or writes the store for [`cleanupPeriodDays`](https://code.claude.com/docs/en/settings-reference#cleanupperioddays). In an Anthropic-hosted cloud session, [values can be missing sooner](#store-in-cloud-sessions). | Settings, history, anything the user expects to find next time |
12501250
1251`$.store.get(key)` resolves to the value or `undefined`, and `$.store.set(key, value)` takes any JSON value. Each new session a user starts in an Anthropic-hosted [cloud environment](https://code.claude.com/docs/en/cloud-environments.md) begins without the `$.store` values that earlier sessions saved, so give each value a default.
1251`$.store` is a key-value store, saved as a JSON file of your plugin's own under `~/.claude/plugins/store/`. `$.store.get(key)` resolves to the value or `undefined`, and `$.store.set(key, value)` takes any JSON value.
12521252
1253### Handle missing `$.store` values in cloud sessions
1254
1255In an Anthropic-hosted [cloud environment](https://code.claude.com/docs/en/cloud-environments.md), Claude Code saves `$.store` on the session's VM, so `$.store.get` resolves to `undefined` for a key your mod saved only on another machine or VM. Give each value a default, as in `(await $.store.get('count')) ?? 0`, to cover cases such as these:
1256
1257* **A user starts a new cloud session**: it begins without the values that earlier local or cloud sessions saved
1258* **A user reopens a session after its VM was [reclaimed](https://code.claude.com/docs/en/claude-code-on-the-web.md#environment-expired)**: it runs on a fresh VM, without the values it saved itself
1259
12531260### Keep a value in `$.state`
12541261
12551262`$.state` holds values for the length of a session, and it redraws for you. It's reactive state: a `ui.render` hook that reads a value subscribes to it, so Claude Code redraws that site each time you write the value, and you don't call `$.ui.invalidate`. A value in `$.state` also survives a reload of the module, which a variable doesn't.
from line 1363
13561363
13571364### Save from more than one session
13581365
1359Every session on your machine that runs your mod shares one `$.store`. A `get` followed by a `set` isn't atomic. When two sessions each read a value, change it, and write it back, they race, and the second write replaces the first.
1366Local sessions on your machine that run your mod share one `$.store`. A `get` followed by a `set` isn't atomic. When two sessions each read a value, change it, and write it back, they race, and the second write replaces the first.
13601367
13611368To make that less likely:
13621369
worktrees Changed · +5 / -5 lines
from line 64
6464
6565## Clean up worktrees
6666
67When you exit an interactive worktree session, Claude checks the worktree for work that removal would delete: changed or untracked files, uncommitted work inside checked-out submodules, and new commits. These rules apply to worktrees Claude created with git. For a worktree your [WorktreeCreate hook](https://code.claude.com/docs/en/hooks.md#worktreecreate) created, see [WorktreeRemove](https://code.claude.com/docs/en/hooks.md#worktreeremove) instead.
67When you exit an interactive session in a worktree Claude created with git, Claude checks for work: changed or untracked files, uncommitted work inside checked-out submodules, and new commits. Your gitignored files, such as `.env`, don't count, so you can lose them at exit. Copy out files you need before exiting. For a worktree your [WorktreeCreate hook](https://code.claude.com/docs/en/hooks.md#worktreecreate) created, see [WorktreeRemove](https://code.claude.com/docs/en/hooks.md#worktreeremove).
6868
6969* **Claude Code finds another session in the worktree**: the worktree and branch stay even if you choose removal. Follow the `Worktree kept at` message
7070* **The worktree is clean**: for an unnamed session, Claude removes the worktree and its branch automatically. A [named](https://code.claude.com/docs/en/sessions.md#name-your-sessions) session prompts you first so you can keep the worktree for later
from line 82
8282
8383### Resume without `--worktree`
8484
85When you resume a session that ended [isolated](#how-claude-code-enforces-isolation) in its worktree without [exiting it](#clean-up-worktrees), Claude Code returns the session there and keeps it isolated. This holds for interactive resumes, for `--continue` and `--resume` in [non-interactive mode](https://code.claude.com/docs/en/headless.md) with `-p`, and for the Agent SDK. Back inside the worktree, Claude can leave with the [`ExitWorktree`](https://code.claude.com/docs/en/tools-reference) tool [when the session has that tool](#claude-has-no-enterworktree-tool).
85When you resume a session that ended [isolated](#how-claude-code-enforces-isolation) in its worktree and that you didn't [exit](#clean-up-worktrees), Claude Code returns the session to that worktree and keeps it isolated. This holds for interactive resumes, for `--continue` and `--resume` in [non-interactive mode](https://code.claude.com/docs/en/headless.md) with `-p`, and for the Agent SDK. Back inside the worktree, Claude can leave with the [`ExitWorktree`](https://code.claude.com/docs/en/tools-reference) tool [when the session has that tool](#claude-has-no-enterworktree-tool).
8686
8787Before returning the session to its worktree, Claude Code verifies that the worktree is still a checkout separate from the main one, and declines to re-enter a worktree that fails the check. For a git worktree, the check reads its git metadata. A worktree without git metadata, such as one a [`WorktreeCreate` hook](#non-git-version-control) created, can pass the check; the cases Claude Code still refuses are listed with their recoveries under [Claude Code refuses to use a worktree](#claude-code-refuses-to-use-a-worktree). For the messages and how to recover from each, see [The session resumes outside its worktree](#the-session-resumes-outside-its-worktree).
8888
from line 152
152152
153153When you [background](https://code.claude.com/docs/en/agent-view.md#send-the-session-to-the-background) a `--worktree` session, its worktree becomes a background-session worktree that the sweep can remove. The sweep leaves a worktree in place in cases such as these:
154154
155* The worktree still holds work: changed or untracked files, or unpushed commits.
155* The worktree still holds work: changed or untracked files, or unpushed commits. Your gitignored files don't count, so copy out any you need.
156156* A checked-out submodule in the worktree holds changed or untracked files, or Claude Code can't inspect the worktree's submodules. This check requires Claude Code v2.1.274 or later.
157* One of the [four cases that also block worktree creation](#git-lfs-content-is-missing-from-a-worktree-claude-code-created) applies: Claude Code can't determine which filter drivers the repository config defines, or finds a setting there it can't switch off.
157* One of the [git config errors that block worktree creation](#git-lfs-content-is-missing-from-a-worktree-claude-code-created) applies.
158158* The worktree belongs to a `--worktree` session you haven't backgrounded, whatever its age.
159159* You created the worktree with `git worktree add` outside `.claude/worktrees/`.
160160
from line 362
362362
363363To get the real files, run `git lfs pull` inside the worktree.
364364
365In four rare cases, Claude Code creates no worktree at all: it can't tell which filter drivers the repository's config defines, or it finds a setting there it can't switch off. Match the error to its fix:
365If worktree creation fails with one of these errors, match the error to its fix:
366366
367367* **`Could not read the repository git config to neutralize filter drivers`**: Claude Code couldn't read the repository's `.git/config`, for example because of its permissions. Fix that and retry.
368368* **`The repository git config defines a filter driver whose name cannot be neutralized (contains "=" or a newline)`**: rename or remove that filter driver in `.git/config` and retry.
accessibility Changed · +1 / -1 lines
from line 24
2424
2525The startup line `Screen reader mode is off: project settings can't turn it on` means the project asked for screen reader mode and nothing else turns it on. Claude Code ignores both the `axScreenReader` key and a `CLAUDE_AX_SCREEN_READER` value under `env` in the project's `.claude/settings.json` and `.claude/settings.local.json`, whatever their value.
2626
27* **To turn the mode on**: start Claude Code with `--ax-screen-reader`, set `CLAUDE_AX_SCREEN_READER` to `1` in your shell, or add `"axScreenReader": true` to your user [settings file](https://code.claude.com/docs/en/settings.md) and restart Claude Code. You don't need to change the project's files. Once you turn the mode on, the [confirmation line](#turn-on-screen-reader-mode) appears at startup instead.
27* **To turn the mode on**: start Claude Code with `--ax-screen-reader`, set `CLAUDE_AX_SCREEN_READER` to `1` in your shell, or add `"axScreenReader": true` to your user [settings file](https://code.claude.com/docs/en/settings.md) and restart Claude Code. Once you turn the mode on, the [confirmation line](#turn-on-screen-reader-mode) appears at startup instead.
2828* **If you don't use a screen reader**: you don't need to do anything. To stop the line from appearing, add `"axScreenReader": false` to your user settings file, or remove the `axScreenReader` key and the `CLAUDE_AX_SCREEN_READER` variable from the project's settings files.
2929
3030## Turn off screen reader mode
amazon-bedrock Changed · +2 / -2 lines
from line 341
341341
342342### When your organization enforces a model allowlist
343343
344If you set [`enforceAvailableModels`](https://code.claude.com/docs/en/model-config#enforce-the-allowlist-for-the-default-model) in managed settings, the startup model checks use only models your `availableModels` list permits. This applies on the Amazon Bedrock Invoke API and requires Claude Code v2.1.287 or later. A list without `enforceAvailableModels` doesn't restrict these checks.
344To limit the startup model checks and their [fallback](#startup-model-checks) to models your `availableModels` list permits, set [`enforceAvailableModels`](https://code.claude.com/docs/en/model-config#enforce-the-allowlist-for-the-default-model) in managed settings. This applies on the Amazon Bedrock Invoke API and requires Claude Code v2.1.287 or later.
345345
346346The checks compare each entry with the inference profile ID they would send, including its [region prefix](#cross-region-inference-profile-prefixes), so write the list in those IDs.
347347
from line 619
619619
620620### Zero token counts in /context
621621
622The `/context` command counts tokens for each tool group by sending the tool schemas to the Amazon Bedrock count-tokens API. On Claude Code versions before v2.1.196, Amazon Bedrock rejected that request because the schemas carried fields its count-tokens API doesn't accept, so every tool group showed 0 tokens. Other rows in the breakdown, such as messages and memory files, aren't affected.
622The `/context` command counts tokens for each tool group by sending the tool schemas to the Amazon Bedrock count-tokens API. On Claude Code versions before v2.1.196, Amazon Bedrock rejected that request because the schemas carried fields its count-tokens API doesn't accept, so every tool group showed 0 tokens.
623623
624624Update to v2.1.196 or later.
625625
approvals-policy Changed · +1 / -1 lines
from line 315
315315| Case | What happens |
316316| :- | :- |
317317| No rule covers a changed file | Nobody is asked to review that file. A [protected file](#protected-files) can still need a person. Claude doesn't approve the pull request |
318| No rule covers any changed file | Normally no check appears. Where GitHub requires the check on the default branch, it normally ends neutral, with the title **Nothing ran, not blocking: no file is covered**. GitHub counts that as passing. With no root policy file, a pull request that changes no file under a directory's policy file can get no check, so a required check waits |
318| No rule covers any changed file | Normally no check appears. If GitHub requires the check on the default branch, it normally ends neutral, with the title **Nothing ran, not blocking: no file is covered**. GitHub counts that as passing |
319319| Rules cover a changed file, and none applies | The check fails, with a title that starts **No rule applies to** |
320320| A file moves between a path that rules cover and one that they don't | No check appears, and Claude comments that Approvals did not run. Where GitHub requires the check, the pull request waits |
321321
approvals-pull-requests Changed · +2 / -0 lines
from line 34
3434| **Changes requested** | Have the reviewer who requested changes approve, or have a person dismiss their review |
3535| **Claude's approval still stands; dismiss it** | [Dismiss Claude's review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/dismissing-a-pull-request-review), or ask someone who may dismiss reviews on the branch. GitHub didn't let Approvals dismiss it |
3636
37To see **Claude's approval still stands; dismiss it** less often, ask a repository admin to turn on [**Dismiss stale pull request approvals when new commits are pushed**](https://code.claude.com/docs/en/approvals-github-rules.md#required-reviews-and-codeowners). GitHub then dismisses everyone's earlier approvals on most pushes, so people may have to [approve again](https://code.claude.com/docs/en/approvals-policy.md#earlier-approvals-after-a-new-push).
38
3739### Approvals waits for Code Review or a classifier
3840
3941With these titles, Approvals needs an answer from [Code Review](https://code.claude.com/docs/en/code-review-pull-requests.md) or a [classifier](https://code.claude.com/docs/en/approvals-classifiers.md):
auto-mode-classifier-billing Changed · +1 / -1 lines
from line 21
2121
2222To stop using auto mode instead, switch permission modes with `Shift+Tab` after you answer.
2323
24Where the notice can't wait for an answer, Claude Code reports the same text and the session continues in auto mode, unless a gateway acknowledgment on this machine in the last 24 hours has dismissed it. In [non-interactive mode](https://code.claude.com/docs/en/headless.md) with `-p` it prints the text to stderr, and in `stream-json` output it emits a `system` warning message, which Agent SDK applications can read from the message stream.
24Your session continues in auto mode when the notice can't wait for an answer, as in [non-interactive mode](https://code.claude.com/docs/en/headless.md). With `-p`, look for the notice's text on stderr. In `stream-json` output, look instead for a `system` warning message, which Agent SDK applications can read from the message stream. After you acknowledge a notice naming a gateway, Claude Code can skip the notice's text on this machine for 24 hours.
2525
2626## Make the session eligible
2727
auto-mode-config Changed · +1 / -1 lines
from line 149
149149}
150150```
151151
152You don't need to fill everything in at once. A reasonable rollout: start with the defaults and add your source control org and key internal services, which resolves the most common false positives like pushing to your own repos. Add trusted domains and cloud buckets next. Fill the rest as blocks come up.
152A reasonable rollout: start with the defaults and add your source control org and key internal services, which resolves the most common false positives like pushing to your own repos. Add trusted domains and cloud buckets next. Fill the rest as blocks come up.
153153
154154## Generate environment entries with `/auto-mode-setup`
155155
best-practices Changed · +1 / -1 lines
from line 591
591591
592592You rarely have to clean any of this up yourself:
593593
594* When you exit an unnamed worktree session, Claude Code [removes a worktree it created with git](https://code.claude.com/docs/en/worktrees.md#clean-up-worktrees) if there's nothing in it. For a named session, or one with changes, it asks what to do.
594* When you exit an unnamed worktree session, Claude Code [can remove a worktree it created with git](https://code.claude.com/docs/en/worktrees.md#clean-up-worktrees) if `git status` is clean and there are no new commits. Otherwise, or if you named the session with [`-n` or `/rename`](https://code.claude.com/docs/en/sessions#name-your-sessions), Claude Code asks first.
595595* Subagent and background-session worktrees that get left behind [can be removed automatically](https://code.claude.com/docs/en/worktrees.md#clean-up-subagent-and-background-session-worktrees) once they're older than `cleanupPeriodDays` and hold no work.
596596
597597> [!NOTE]
chrome Changed · +1 / -1 lines
from line 97
9797
9898### Enable Chrome by default
9999
100To connect Chrome without passing `--chrome` each time, run `/chrome` in a CLI session and select the option that turns Chrome on by default. In the [VS Code extension](https://code.claude.com/docs/en/vs-code.md#automate-browser-tasks-with-chrome), type `/chrome` in the prompt box and turn on the **Enabled by default** switch. The CLI and VS Code share one setting, so turning it on in either place turns it on for both.
100To connect Chrome without passing `--chrome` each time, run `/chrome` in a CLI session and select the option that turns Chrome on by default. In the [VS Code extension](https://code.claude.com/docs/en/vs-code.md#automate-browser-tasks-with-chrome), type `/chrome` in the prompt box and turn on the **Enabled by default** switch. The CLI and VS Code share one setting.
101101
102102With the setting on and Claude Code v2.1.287 or later, each VS Code session connects to your browser as it starts, so Claude can use it before you type `@browser`. On earlier versions, or with the setting off, a VS Code session connects when you type `@browser`.
103103
computer-use Changed · +1 / -1 lines
from line 46
4646
4747**2. Enable the server**
4848
49Select `computer-use` and choose **Enable**. The setting persists per project, so you only do this once for each project where you want computer use.
49Select `computer-use` and choose **Enable**. The setting persists per project.
5050
5151**3. Grant macOS permissions**
5252
desktop-scheduled-tasks Changed · +2 / -2 lines
from line 153
153153* **Current layout**: open the [**Group and sort** menu](https://code.claude.com/docs/en/desktop.md#organize-and-find-sessions), select **Show**, then select **Scheduled**. The group starts collapsed, so click its heading to expand it.
154154* **Earlier layout**: the group is in the session list with nothing to turn on
155155
156In a run's session, whichever way you reached it, you can see what Claude did, review changes, and respond to permission prompts. Claude can edit files, run commands, create commits, and open pull requests, the same as in a session you start yourself.
156In a run's session, you can see what Claude did, review changes, and respond to permission prompts.
157157
158158## Missed runs
159159
from line 174
174174In the **Code** tab, click **Scheduled** in the sidebar, then click a task in the list to open its detail page. From here you can:
175175
176176* **Run now**: start the task immediately without waiting for the next scheduled time
177* **Status**: toggle between Active and Paused to pause or resume scheduled runs without deleting the task
177* **Status**: toggle between Active and Paused to pause or resume scheduled runs
178178* **Edit**: change the instructions, schedule, folder, or other settings
179179* **Review history**: see every past run, including skipped runs. Hover a skipped entry to see why: your computer was asleep, the previous run was still in progress, or other scheduled tasks were already running. Click **Show more** to load older entries.
180180* **Review allowed permissions**: see and revoke saved tool approvals for this task from the **Always allowed** panel
fullscreen Changed · +0 / -4 lines
from line 10
1010
1111The 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.
1212
13> [!NOTE]
14>
15> The term fullscreen describes how Claude Code takes over the terminal's drawing surface, the way `vim` does. It has nothing to do with maximizing your terminal window, and works at any window size.
16
1713## Enable fullscreen rendering
1814
1915Run `/tui fullscreen` inside any Claude Code conversation. The CLI saves the [`tui` setting](https://code.claude.com/docs/en/settings-reference#tui) and relaunches into fullscreen. Run `/tui default` to switch back to the classic renderer, or `/tui` with no argument to print which renderer is active.
gitlab-ci-cd Changed · +0 / -2 lines
from line 32
3232 * Amazon Bedrock (IAM-based access, cross-region options)
3333 * Google Cloud's Agent Platform (GCP-native, Workload Identity Federation)
3434
353. **Sandboxed execution**: Each interaction runs in a container with strict network and filesystem rules. Claude Code enforces workspace-scoped permissions to constrain writes. Every change flows through an MR so reviewers see the diff and approvals still apply.
36
3735Pick regional endpoints to reduce latency and meet data-sovereignty requirements while using existing cloud agreements.
3836
3937## What can Claude do?
google-vertex-ai Changed · +1 / -1 lines
from line 224
224224
225225### When your organization enforces a model allowlist
226226
227If you set [`enforceAvailableModels`](https://code.claude.com/docs/en/model-config#enforce-the-allowlist-for-the-default-model) in managed settings, the startup model checks use only models your `availableModels` list permits. This requires Claude Code v2.1.287 or later. A list without `enforceAvailableModels` doesn't restrict these checks.
227To limit the startup model checks and their [fallback](#startup-model-checks) to models your `availableModels` list permits, set [`enforceAvailableModels`](https://code.claude.com/docs/en/model-config#enforce-the-allowlist-for-the-default-model) in managed settings. This requires Claude Code v2.1.287 or later.
228228
229229The checks compare each entry with the model ID they would send to Agent Platform, so write the list in those IDs.
230230
keybindings Changed · +1 / -1 lines
from line 689
689689* In vim NORMAL mode, `?` shows the help menu (vim behavior)
690690* In vim NORMAL mode, `/` opens history search, the same as Ctrl+R in standard mode
691691
692In the `Other` row of a question Claude asks, Escape doesn't cancel the question right away in vim mode. Except in [screen reader mode](https://code.claude.com/docs/en/accessibility.md), the row starts in INSERT mode each time you focus it. When you press Escape in the `Other` row, the row switches to NORMAL mode or drops a half-typed vim command, and the question stays open. Press Escape again in NORMAL mode to cancel the question.
692In the `Other` row of a question Claude asks, Escape doesn't cancel the question right away in vim mode. Except in [screen reader mode](https://code.claude.com/docs/en/accessibility.md), the row starts in INSERT mode each time you focus it. When you press Escape in the `Other` row, the row switches to NORMAL mode or drops a half-typed vim command. Press Escape again in NORMAL mode to cancel the question.
693693
694694### Cancel a question with one key press
695695
permissions Changed · +1 / -1 lines
from line 788
788788
789789## Settings precedence
790790
791Permission rules follow the same [settings precedence](https://code.claude.com/docs/en/settings.md#settings-precedence) as all other Claude Code settings, with managed settings highest: no other level, including command line arguments, can override a managed permission rule.
791By default, Claude Code [combines the permission rules](https://code.claude.com/docs/en/settings.md#lists-merge-instead-of-overriding) from every settings level and from command line arguments, apart from [allow rules that wait for workspace trust](#project-allow-rules-and-workspace-trust). To see which rule decides, check the [evaluation order](#manage-permissions).
792792
793793If a tool is denied at any level, no other level can allow it. For example, a managed settings deny can't be overridden by `--allowedTools`, and `--disallowedTools` can add restrictions beyond what managed settings define.
794794
routines Changed · +1 / -1 lines
from line 483
483483
484484* **App**: in some accounts the sidebar entry and page title read **Routines**, the button reads **New routine**, and other labels say routine. To create a task there, see [Full-page form](#full-page-form).
485485* **Web address**: `claude.ai/code/routines`
486* **CLI**: the `/routines` alias for `/schedule`, the command's description, and Claude's replies while it sets up a task
486* **CLI**: the `/routines` alias for `/schedule`
487487* **API**: the `/fire` endpoint path, its beta header, its response `type`, the `<routine-fire-payload>` tag, and the [Trigger a routine through the API](https://platform.claude.com/docs/en/api/claude-code/routines-fire) reference page
488488* **Organization settings**: the **Scheduled tasks (Was Routines)** or **Routines** toggle
489489