One read of Claude Code CLIclaude-code-20261125T023702Z
21 pages moved out of 221 read.
Pages moved
21
significant first
Pages read
221
in this capture
Captured
02:37 UTC
Corpus hash
c10961c0a7ec
corpus-hash
What this read moved
1-21 of 21approvals-policy Changed · +15 / -10 lines
## Rules for the whole file
from line 72
7272* **Each policy file has its own `mode`**: while the root policy file observes, none of its rules count under a directory's enforcing policy file, the `nested: inherit` rules included
7373* **Some custom classifiers go only under `advisory`**: that's a classifier whose [`tools`](https://code.claude.com/docs/en/approvals-classifiers#tools) list `reviewers` or `labels`, or that has an [input](https://code.claude.com/docs/en/approvals-classifiers.md#inputs) with no `merge`. List it in an enforced rule with no `if`. If a rule reads its result, the check on pull requests under a directory's policy file can read **Cannot evaluate: classifier outside advisory**
7474
75## Top-level keys
75## Rules for the whole file
7676
77Approvals refuses a file that has an unknown key. Write keys, and fixed words such as `observe` and `approves`, in lower case. Put double quotes around every purpose, pattern, condition, and `"!"` item.
77Follow these rules in every part of the file:
7878
79Keep the file to one YAML document, quote each `!` item, and indent with spaces, or Approvals refuses the file. Anchors, aliases, and `!!` tags draw a warning.
79* **Keys and fixed values**: write keys, and fixed values such as `observe` and `approves`, in lower case. Approvals refuses a file that has an unknown key
80* **Purposes, patterns, and conditions**: put double quotes around every purpose, `paths` pattern, and condition
81* **`!` items**: put double quotes around each `"!"` item outside a condition. Inside a condition, a `!` item takes single quotes. Approvals refuses a file that has an unquoted `!` item
82* **YAML**: keep the file to one YAML document, or Approvals refuses the file. Indent with spaces. Anchors, aliases, and `!!` tags draw at least a warning
8083
84## Top-level keys
85
8186Write these keys at the top level of the file:
8287
8388| Key | Required | Values | Default | Description |
from line 124
119124| `*` | Any characters within one folder |
120125| `**` | Any number of folders, dot folders too. It has to be a whole segment, as in `**/*.go` |
121126| `{a,b}`, `[ab]`, `?` | Alternatives, one character of a set, and any one character |
122| `infra/**` | Every file in the folder. A bare `infra` matches no file in it |
127| `infra/**` | Every file in the folder. A bare `infra` matches no file in it, and `infra/` is refused |
123128| `*.md` | Markdown files beside the policy file's `.claude` folder. For any depth, write `**/*.md` |
124129| `"!docs/**"` | Takes the files out of this rule only. A rule needs at least one pattern with no `!` |
125130
from line 134
129134
130135* **Operators**: `=`, `!=`, `<`, `<=`, `>`, `>=`
131136* **Joining**: `AND` and `OR` in capitals. Use parentheses to mix the two.
132* **Lists**: write `ANY` or `ALL` before `pr/authors` and `pr/approved_by`. Where the condition leads to a lighter verdict, use `ALL`: with `ANY`, one listed author relaxes the rule for everyone else's commits. Where it leads to a stricter one, use `ANY`: with `ALL`, one unlisted author switches it off.
133* **Quotes**: single quotes around a login or a branch pattern, and none around a team, a `bot:` name, or a fact, as in `"ALL pr/authors = ['ana-acme', acme/payments]"`
137* **Lists**: write `ANY` or `ALL` before `pr/authors` and `pr/approved_by`. Where the condition leads to a lighter verdict, use `ALL`: with `ANY`, one listed author relaxes the rule for everyone else's commits. Where it leads to a stricter one, use `ANY`: with `ALL`, one unlisted author switches it off. To test for an empty list, write neither, as in `"pr/approved_by = empty"`.
138* **Quotes**: single quotes around a login, a branch pattern, or a whole `!` item in a [list of people](#people-lists), as in `"ANY pr/authors = [humans, '!acme/interns']"`. No quotes around a team, a `bot:` name, or a fact without a `!`, as in `"ALL pr/authors = ['ana-acme', acme/payments]"`
134139* **Classifiers**: `claude/code_review = pass`, `repo/change_risk <= medium`, and the other forms under [Read a classifier's answer from a rule](https://code.claude.com/docs/en/approvals-classifiers.md#read-a-classifier’s-answer-from-a-rule)
135140
136141A fact comes from the pull request itself:
from line 147
142147| `rule/files_changed`, `rule/files_added`, `rule/files_removed` | `"rule/files_changed = pr/files_changed"` | Counts among the files that this rule's `paths` match |
143148| `pr/authors` | `"ALL pr/authors = bot:dependabot"` | Accounts that wrote or pushed a commit, and the account that opened the pull request |
144149| `pr/opened_by` | `"pr/opened_by = acme/release"` | The account that opened the pull request. After someone else pushes to a bot's pull request, an override on `pr/opened_by = bot:dependabot` stops lowering what the rule asks for |
145| `pr/approved_by` | `"ANY pr/approved_by = acme/security"` | People with write access who approved the current diff. Authors and bots aren't among them. Also takes `= empty` and `!= empty` |
150| `pr/approved_by` | `"ANY pr/approved_by = acme/security"` | People with write access who approved the current diff. Authors and bots aren't among them. Also takes `= empty` and `!= empty`, with no `ANY` or `ALL` |
146151| `pr/base` | `"pr/base = 'release/**'"` | The branch that the pull request targets |
147152
148153### `verdict`
from line 176
171176| `acme/payments` | A team of the repository's GitHub organization |
172177| `bot:dependabot` | One bot, with no `[bot]` suffix. `bot:claude` means Claude's apps |
173178| `pr/authors`, `pr/opened_by` | The accounts that the fact holds |
174| `"!pr/authors"` | Takes accounts away. Quote it, and put it beside an item with no `!` |
179| `"!pr/authors"` | Takes accounts away. Quote it, with single quotes in a condition, and put it beside an item with no `!` |
175180
176181If a set's `from` admits Claude, for example through `bots`, `everyone`, or `bot:claude`, and every rule that applies says `approves`, Approvals counts a seat in that set as filled before Claude approves. The **Claude Approvals** check can then pass with no person's approval.
177182
from line 358
353358* **Git files**: `.gitmodules`, `.gitattributes`, symlinks, and submodule pointers
354359* **Code owners**: any file named `CODEOWNERS`
355360
356Don't rely on other files being protected. Write a rule for the ones that matter to you, such as `.github/`, `CLAUDE.md`, `AGENTS.md`, `.mcp.json`, and the rest of `.claude/`.
361Don't rely on other files being protected. Write a rule for the ones that matter to you, such as the `.github` folder, `CLAUDE.md`, `AGENTS.md`, `.mcp.json`, and the rest of the `.claude` folder.
357362
358363### Who has to approve a change to a protected file
359364
approvals-troubleshooting Changed · +5 / -1 lines
from line 80
8080| "no key of this name is read at this place" | Check the key's spelling and its level against [Top-level keys](https://code.claude.com/docs/en/approvals-policy.md#top-level-keys) and [Rule keys](https://code.claude.com/docs/en/approvals-policy.md#rule-keys) |
8181| "this names no fact and no usable classifier" | Check the name against the [facts](https://code.claude.com/docs/en/approvals-policy.md#if). For `repo/<name>`, check that `.claude/classifiers/<name>/def.yml` loads, beside the policy file or in a directory above it |
8282| "a condition has no NOT" | Write the opposite operator |
83| "a login goes in single quotes inside a condition" | If the word is a login, put it in single quotes, as in `"pr/opened_by = 'ana-acme'"`. For a bot, write `bot:` and its name with no quotes, as in `"pr/opened_by = bot:dependabot"` |
8384| "no local has this name" | Define the local in this file or a policy file above it. Write a login or a team with no `@` |
8485| "this is not YAML" | Look near the line that the message names for a quote or bracket that doesn't close, or a tab. Indent with spaces |
8586
8687## A classifier gave no answer or its definition is refused
8788
88To see each [classifier](https://code.claude.com/docs/en/approvals-classifiers.md) run's state and the reason for a missing answer, open **Classifier results** in Claude's comment on the pull request. If a run reached its budget, split the pull request, or raise a `time` or `cost` that is under its [maximum](https://code.claude.com/docs/en/approvals-classifiers.md#budget).
89To see each [classifier](https://code.claude.com/docs/en/approvals-classifiers.md) run's state and the reason for a missing answer, open **Classifier results** in Claude's comment on the pull request:
90
91* **A run reached its budget**: split the pull request, or raise a `time` or `cost` that is under its [maximum](https://code.claude.com/docs/en/approvals-classifiers.md#budget)
92* **A run had more to read than one run can handle**, for example a large diff: try a smaller pull request
8993
9094Then find the **Claude Approvals** check's title here:
9195
artifacts Changed · +3 / -5 lines
from line 150
150150
151151Claude Code can save the page's full source to a local file, which Claude can open.
152152
153Claude Code asks for your approval before Claude reads the artifact in these cases, in addition to any prompt your permission mode or rules call for:
153Claude Code can ask for your approval before the [Artifact tool](https://code.claude.com/docs/en/tools-reference.md) reads an artifact in these cases, in addition to any prompt your permission mode or rules call for:
154154
155155* **Cloud session without network access**: for a [cloud environment](https://code.claude.com/docs/en/cloud-environments.md#access-levels), that's the **None** level. In [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), the classifier can approve instead; in a [Cowork](https://claude.com/product/cowork) session, the approval is yours alone.
156* **Another organization's public artifact**: Claude Code asks you first, even in auto mode. Where Claude Code can't ask you, such as in `bypassPermissions` mode, Claude can't read the artifact. Claude can read these artifacts only while [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) is on.
156* **Another organization's public artifact**: the tool asks you first, even in auto mode. Where Claude Code can't ask you, such as in `bypassPermissions` mode, the tool can't read one you haven't approved in this conversation. The tool can read these artifacts only while [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) is on.
157157* **Unconfirmed owner or network setting**: when Claude Code can't confirm who made the artifact, or can't confirm a cloud session's network setting, it asks, and your approval covers that one request. In [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), the classifier can approve or block the read instead of asking you.
158158* **Plan mode**: in [plan mode](https://code.claude.com/docs/en/permission-modes.md#analyze-before-you-edit-with-plan-mode), Claude Code asks before the Artifact tool reads an artifact someone else in your organization made.
159159
from line 200
200200* **Stop the task in `/tasks`**: Claude stops replying on that artifact until you ask it to resume replies there. Publishing the artifact again doesn't start replies again, and the stop still applies when you resume the session later.
201201* **Press `Ctrl+X Ctrl+K` twice within 3 seconds**: the chord that [stops every running background subagent](https://code.claude.com/docs/en/interactive-mode.md#general-controls) also stops Claude from replying on every artifact for the rest of the session. Asking Claude to resume replies doesn't undo this stop.
202202
203A watch that Claude Code started on its own can end after the artifact goes several hours without activity. You see `Stopped watching Artifact: <name> (idle)`. If you see `(made room for a newer watch)` in place of `(idle)`, your session reached its limit of 25 watches. In either case, ask Claude to republish the artifact to restart the watch.
204
205If the service that delivers comments becomes unavailable or stops answering, Claude Code keeps trying to reconnect for a while, then stops watching each artifact your session was watching.
203If you see `Stopped watching Artifact: <name>` followed by `(idle)`, `(connection lost)`, or `(made room for a newer watch)`, ask Claude to republish the artifact to restart the watch. A watch that Claude Code started on its own can end after several hours without activity.
206204
207205## Pull live data with MCP connectors
208206
errors Changed · +27 / -0 lines
### Claude Code needs a recent sign-in
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 56
5656| `Sign in again to take your previous account or API key off the config file.` | [Authentication](#sign-in-again-to-take-your-previous-account-or-api-key-off-the-config-file) |
5757| `Your account or API key may still be in the config file. Run claude auth logout.` | [Authentication](#your-account-or-api-key-may-still-be-in-the-config-file) |
5858| `Authentication required · Sign in again to continue` | [Authentication](#not-logged-in) |
59| `Sign in again to continue` followed by `For security, Claude Code needs a recent sign-in.` | [Wrapper and IDE errors](#claude-code-needs-a-recent-sign-in) |
60| `Claude Code needs a recent sign-in. Signing in won’t stop sessions.` | [Wrapper and IDE errors](#claude-code-needs-a-recent-sign-in) |
5961| `Could not resolve authentication method` | [Authentication](#could-not-resolve-authentication-method) |
6062| `Invalid API key` | [Authentication](#invalid-api-key) |
6163| `Your apiKeyHelper script is failing` | [Authentication](#your-apikeyhelper-script-is-failing) |
from line 2382
23802382* Retry the action. Claude Code requests the list again each time
23812383* If the message keeps appearing, check [status.claude.com](https://status.claude.com) for active incidents
23822384
2383Before v2.1.236, Claude Code showed a raw JavaScript TypeError instead of these messages.
2384
2385### Failed to fetch session from Sessions API
2386
2387This message means Claude Code found the [cloud session you asked to pull into your terminal](https://code.claude.com/docs/en/claude-code-on-the-web.md#from-cloud-to-terminal) but couldn't
2385Before v2.1.236, Claude Cod
self-hosted-environments-configuration Changed · +11 / -17 lines
from line 779
779779# shellcheck disable=SC2086 # $base is either "" or "FETCH_HEAD", intentional word-split
780780unpushed=$(git -C "$d" rev-list HEAD --not $base --remotes=origin --count 2>/dev/null) || unpushed=0
781781if [ "$unpushed" -gt 0 ]; then
782 branch=$(git -C "$d" symbolic-ref --short -q HEAD)
783 if [ -n "$branch" ]; then
784 # $branch is attacker-influenced — git-check-ref-format(1) allows `"`
785 # in ref names. `\` is forbidden (rule 10) but escaped anyway as cheap
786 # defense-in-depth.
787 # Escape JSON metacharacters before interpolating into the hand-built
788 # payload so a branch like x","continue":false can't inject keys into
789 # the hook-output JSON the harness parses. $unpushed is safe — the
790 # -gt guard above rejects anything that isn't a plain integer.
791 branch_esc=$(printf '%s' "$branch" | sed 's/\\/\\\\/g; s/"/\\"/g')
792 printf '{"decision":"block","reason":"There are %s unpushed commit(s) on branch '\''%s'\''. Please push these changes to the remote repository."}' "$unpushed" "$branch_esc"
793 else
782 # The branch name is not trusted text, so the message leaves it out.
783 # $unpushed is a count from git rev-list, or 0.
784 # With -q, symbolic-ref exits 1 on a detached HEAD.
785 git -C "$d" symbolic-ref -q HEAD >/dev/null 2>&1
786 if [ $? -eq 1 ]; then
794787 printf '{"decision":"block","reason":"There are %s unpushed commit(s) on a detached HEAD. Please create a branch and push it to the remote repository."}' "$unpushed"
788 else
789 printf '{"decision":"block","reason":"There are %s unpushed commit(s) on the branch checked out in the project directory. Please push these changes to the remote repository."}' "$unpushed"
795790 fi
796791 exit 0
797792fi
from line 816
821816
822817### Replace an earlier copy of the Stop hook script
823818
824Search your copy of `stop-hook-nudge.sh` for `GIT_OPTIONAL_LOCKS`. If it's missing, you have an earlier copy. Replace it with the [current script](#prompt-sessions-to-push-their-work) wherever you installed it, then restart the runners. Keep your Stop hook settings, except to raise `timeout` on a large checkout.
819Search your copy of `stop-hook-nudge.sh` for the text `checked out in the project directory`. If it's missing, you have an earlier copy. Replace it now with the [current script](#prompt-sessions-to-push-their-work) wherever you installed it, then restart the runners. Keep your Stop hook settings, except to raise `timeout` on a large checkout.
825820
826* **When**: if your sessions run with the [Bash sandbox](https://code.claude.com/docs/en/sandboxing.md) on, replace it now. Otherwise, replace it at your next image build or runner restart.
827* **What changes**: uncommitted files in a submodule no longer prompt Claude. A new commit in a submodule that `.gitmodules` marks `ignore = all` now does.
821After you replace the script, the prompt about unpushed commits no longer includes the branch name. If your earlier copy prompted Claude about uncommitted files in a submodule, that prompt stops. For how the current script treats submodules, see [Submodules and the Stop hook](#submodules-and-the-stop-hook).
828822
829823> [!WARNING]
830824>
831> Hooks run outside the Bash sandbox, so the current script's git calls skip some git features that can start a program named in the checkout's git settings. They don't skip them all. Don't count on the sandbox alone, and isolate sessions as [Harden your deployment](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#harden-your-deployment) describes.
825> Hooks run outside the [Bash sandbox](https://code.claude.com/docs/en/sandboxing.md), so the current script's git calls skip some git features that can start a program named in the checkout's git settings. They don't skip them all. Don't count on the sandbox alone, and isolate sessions as [Harden your deployment](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#harden-your-deployment) describes.
832826
833827## Permissions and tool approval
834828
ship-command-troubleshooting Changed · +18 / -0 lines
### Keep a custom /ship or /steward without renaming
from line 235
235235
236236Leave a repository's `.claude/skills/steward/SKILL.md` as it is, because PR Steward and the watch read it as instructions. Neither message counts that file, so one that names `/steward` is about another skill or command.
237237
238### Keep a custom /ship or /steward without renaming
239
240If you've already created your own skill or command called `/ship` or `/steward` and don't want the built-in versions to override it, you can turn them off. To do that, use the `CLAUDE_CODE_DISABLE_SHIP` environment variable, which turns off both together and requires Claude Code v2.1.331 or later. Before you set it, [remove any `"off"` entry](#a-skilloverrides-entry-turns-off-%2Fship-or-%2Fsteward) for your command under `skillOverrides`.
241
242Add this [`env`](https://code.claude.com/docs/en/settings-reference#env) entry to your [user settings file](https://code.claude.com/docs/en/settings.md#settings-files-and-who-they-affect), or to a project's `.claude/settings.json` for everyone who starts sessions in its top folder, then restart Claude Code:
243
244```json theme={null}
245{
246 "env": {
247 "CLAUDE_CODE_DISABLE_SHIP": "1"
248 }
249}
250```
251
252To check that your command loaded, type `/` at the Claude Code prompt and look for its description or first line.
253
254If your command is named `steward` and the repository has a `.claude/skills/steward/SKILL.md` file, check [which one runs](https://code.claude.com/docs/en/skills.md#resolve-skills-that-share-a-name).
255
238256## Related resources
239257
240258* [`/ship` and `/steward`](https://code.claude.com/docs/en/ship-command): what the commands do, how to run them, and what limits Claude during a watch
vs-code Changed · +3 / -3 lines
from line 66
6666
6767* **Activity Bar**: click the Spark icon in the left sidebar to open the sessions list. Click any session to open it in your [preferred location](#extension-settings), or start a new one. This icon is always visible in the Activity Bar.
6868* **Command Palette**: `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux), type "Claude Code", and select an option like "Open in New Tab"
69* **Status Bar**: click **✻ Claude Code** in the bottom-right corner of the window. This works even when no file is open.
69* **Status Bar**: click **✻ Claude Code** in the bottom-right corner of the window. This works without an open file.
7070
7171You can drag the Claude panel to reposition it anywhere in VS Code. See [Customize your workflow](#customize-your-workflow) for details.
7272
from line 1008
10081008
10091009The Spark icon appears in the **Editor Toolbar** (top-right of editor) when you have a file open. If you don't see it:
10101010
10111. **Open a file**: The icon requires a file to be open. Having only a folder open isn't enough.
10111. **Open a file**: The icon requires a file to be open.
101210122. **Check VS Code version**: Requires 1.94.0 or later. Check under **Help > About**
101310133. **Restart VS Code**: Run "Developer: Reload Window" from the Command Palette
101410144. **Disable conflicting extensions**: Temporarily disable other AI extensions (Cline, Continue, etc.)
101510155. **Check workspace trust**: The extension doesn't work in Restricted Mode
10161016
1017Alternatively, click **✻ Claude Code** in the **Status Bar** at the bottom-right corner of the window. This works even without a file open. You can also use the **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) and type "Claude Code".
1017Alternatively, click **✻ Claude Code** in the **Status Bar** at the bottom-right corner of the window. This works without a file open. You can also use the **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) and type "Claude Code".
10181018
10191019### Cmd+Esc does nothing on macOS
10201020
best-practices Changed · +1 / -1 lines
from line 36
3636
3737Every instruction you give Claude Code is one of these:
3838
391. Non-deterministic: you write the instruction, and Claude (the model) reads it. This can be your prompt, `CLAUDE.md`, or a skill. The model then decides what to do with this information. It usually follows your commands, and current models are good at understanding your intent without much context, but there's no *guarantee* that it'll follow your instructions. It can still decide not to do things, or do other things.
391. Non-deterministic: you write the instruction, and Claude (the model) reads it. This can be your prompt, `CLAUDE.md`, or a skill. The model then decides what to do with this information. It usually follows your commands, and current models are good at understanding your intent without much context, but there's no *guarantee* that it'll follow your instructions.
40402. Deterministic: you configure the instruction, and Claude Code (the harness) *has* to execute this. This can be a hook, a deny rule, or a managed setting. Claude Code applies this every time, no matter what the model decided to do.
4141
4242Most things in Claude Code come in both forms:
champion-kit Changed · +1 / -1 lines
from line 126
126126
127127### Thirty-day playbook
128128
129If a loose plan is helpful, the sequence below reflects what tends to work across most teams. Adjust freely to fit your context.
129If a loose plan is helpful, the sequence below reflects what tends to work across most teams.
130130
131131**1. Week 1: Seed the channel**
132132
claude-projects Changed · +1 / -1 lines
from line 80
8080
8181### Start a new project from scratch
8282
83Starting a project from scratch means opening the **New project** dialog, naming the stream of work, and optionally giving it a goal and the repositories and files it works on. Only the name is required, so you can create the project first and fill in the rest as the work takes shape.
83Starting a project from scratch means opening the **New project** dialog, naming the stream of work, and optionally giving it a goal and the repositories and files it works on.
8484
8585**1. Open Projects**
8686
desktop Changed · +2 / -0 lines
from line 2373
23732373
23742374### 403 or authentication errors in the Code tab
23752375
2376For a card that says `For security, Claude Code needs a recent sign-in.`, see [Claude Code needs a recent sign-in](https://code.claude.com/docs/en/errors.md#claude-code-needs-a-recent-sign-in).
2377
23762378If you see `Error 403: Forbidden` or other authentication failures when using the Code tab:
23772379
237823801. Sign out and back in from the app menu. This is the most common fix.
features-overview Changed · +2 / -2 lines
from line 119
119119>
120120> **Use an output style** if it's about the response itself and you might want it off again: length, format, how much Claude explains, or a different role such as a writing assistant. Claude Code includes [built-in styles](https://code.claude.com/docs/en/output-styles.md#built-in-output-styles), and you can write your own.
121121>
122> **They combine.** CLAUDE.md stays loaded whichever style you pick. Claude follows both as instructions, so neither is enforced. For anything that has to happen every time, use a [hook](https://code.claude.com/docs/en/hooks-guide.md).
122> **They combine.** Claude follows both as instructions, so neither is enforced. For anything that has to happen every time, use a [hook](https://code.claude.com/docs/en/hooks-guide.md).
123123
124124> [tab] CLAUDE.md vs Rules vs Skills
125125>
from line 248
248248
249249> [tab] Skills
250250>
251> Skills are extra capabilities in Claude's toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code includes [bundled skills](https://code.claude.com/docs/en/commands.md) like `/code-review`, `/batch`, and `/debug` that work without setup. You can also create your own.
251> Skills are extra capabilities in Claude's toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code includes [bundled skills](https://code.claude.com/docs/en/commands.md) like `/code-review`, `/batch`, and `/debug`. You can also create your own.
252252>
253253> **When:** Depends on the skill's configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.
254254>
hooks Changed · +0 / -2 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 1225
12251225* `PostToolUse`: `updatedToolOutput` replaces the tool's result. See [PostToolUse decision control](#posttooluse-decision-control), including limits in a [Cowork](https://claude.com/docs/cowork/overview) cloud session
12261226* `UserPromptSubmit`: can't replace the prompt; it only injects `additionalContext` alongside it
12271227
1228For redaction or transformation use cases, intercept at `PreToolUse` for outbound tool inputs and `PostToolUse` for the results of successful calls. `PostToolUseFailure` can't rewrite a result, so it can't redact a failing command's output.
1229
12301228Here are examples of each pattern in action:
12311229
12321230> [tab] Top-level decision
from line 3705
37073705
37083706SessionEnd hooks have a default timeout of 1.5 seconds. It applies when you exit, run `/clear`, or switch sessions with interactive `/resume`. You can give a hook more time in two ways:
37093707
3710* **Per-hook `timeout`**: set `timeout` in that hook's configuration. The overall budget rises automatically to match the highest per-hook `timeout` in your settings files, up to 60 seconds. If you raise the budget this way, a hook without its own `timeout` still keeps
3708* **Per-hook `timeout`**: set `timeout` in that hook's configuration. The overall budget rises automatically to match the highest per-hook `timeout` in your settings files, up to 60 seconds. If you raise the budget this way, a hook without its own `timeout` still keeps the default. Timeouts set on plugin-provided hooks don't raise the budget.
3709* **`CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS`**: set this environment variable in milliseconds to override the budget explicitly. The value you set also becomes the ti
how-claude-code-works Changed · +2 / -2 lines
from line 14
1414
1515The loop adapts to what you ask. A question about your codebase might only need context gathering. A bug fix cycles through all three phases repeatedly. A refactor might involve extensive verification. Claude decides what each step requires based on what it learned from the previous step, chaining dozens of actions together and course-correcting along the way.
1616
17You're part of this loop too. You can interrupt at any point to steer Claude in a different direction, provide additional context, or ask it to try a different approach. Claude works autonomously but stays responsive to your input.
17You're part of this loop too. You can interrupt at any point to steer Claude in a different direction, provide additional context, or ask it to try a different approach.
1818
1919The agentic loop is powered by two components: [models](#models) that reason and [tools](#tools) that act. Claude Code is the layer around the model that provides the tools and manages the context the model sees. This surrounding layer is what the term agentic harness refers to.
2020
from line 127
127127
128128#### When context fills up
129129
130Claude Code manages context automatically as you approach the limit. It compacts the conversation into a summary. The summary keeps your requests and key code snippets, but detailed instructions from early in the conversation may be lost. Put persistent rules in CLAUDE.md rather than relying on conversation history.
130Claude Code manages context automatically as you approach the limit. It compacts the conversation into a summary. The summary keeps your requests and key code snippets, but detailed instructions from early in the conversation may be lost. Put persistent rules in CLAUDE.md.
131131
132132To control what's preserved during compaction, add a "Compact Instructions" section to CLAUDE.md or run `/compact` with a focus (like `/compact focus on the API changes`).
133133
large-codebases Changed · +1 / -1 lines
from line 31
3131
3232### The example monorepo
3333
34The examples throughout this page refer to a monorepo with three packages. The same patterns work in a large single-tree codebase: where an example uses `packages/api/`, substitute your own subsystem directory such as `src/backend/` or `lib/core/`.
34The examples throughout this page refer to a monorepo with three packages. Where an example uses `packages/api/`, substitute your own subsystem directory such as `src/backend/` or `lib/core/`.
3535
3636```text theme={null}
3737monorepo/
network-config Changed · +1 / -1 lines
from line 238
238238| `storage.googleapis.com` | Native installer and native auto-updater on versions prior to 2.1.116 |
239239| `registry.npmjs.org` | Plugin installs (fetching npm-source plugin packages and installing plugins' Node.js package dependencies), `npx`-launched MCP servers, and the package registry for npm and bun installs of Claude Code itself |
240240| `bridge.claudeusercontent.com` | [Claude in Chrome](https://code.claude.com/docs/en/chrome.md) extension WebSocket bridge |
241| `*.frame.claudeusercontent.com` | [Artifact](https://code.claude.com/docs/en/artifacts.md) content reads. The CLI fetches an artifact's files from this host when Claude opens one, and only when the Artifact tool is [available](https://code.claude.com/docs/en/artifacts.md#availability) for your account. To turn the tool off and drop this requirement, set [`"enableArtifact": false`](https://code.claude.com/docs/en/settings-reference#enableartifact) or [`CLAUDE_CODE_DISABLE_ARTIFACT=1`](https://code.claude.com/docs/en/env-vars) |
241| `*.frame.claudeusercontent.com` | [Artifact](https://code.claude.com/docs/en/artifacts.md) content reads. The CLI fetches an artifact's files from this host when Claude opens one. You need it only when the Artifact tool is [available](https://code.claude.com/docs/en/artifacts.md#availability) for your account. To turn the tool off and drop this requirement, set [`"enableArtifact": false`](https://code.claude.com/docs/en/settings-reference#enableartifact) or [`CLAUDE_CODE_DISABLE_ARTIFACT=1`](https://code.claude.com/docs/en/env-vars) |
242242| `github.com` | Cloning GitHub-hosted [plugin marketplaces](https://code.claude.com/docs/en/plugins/overview.md) and plugins, including the official Anthropic marketplace, over HTTPS or SSH. To clone GitHub `owner/repo` sources over HTTPS only, set [`CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`](https://code.claude.com/docs/en/env-vars) |
243243| `raw.githubusercontent.com` | Changelog feed for [`/release-notes`](https://code.claude.com/docs/en/commands). In interactive sessions, Claude Code also fetches it in the background at startup when its cached changelog doesn't yet cover the running version, such as the first start after an update; non-interactive and cloud sessions never fetch it |
244244| `*-review.googlesource.com` | Gerrit change lookup on `googlesource.com` checkouts. When a Claude Desktop Code tab session starts or resumes on a [trusted](https://code.claude.com/docs/en/permissions.md#project-allow-rules-and-workspace-trust) checkout whose `origin` is a `googlesource.com` host, Claude Code asks that host's `-review` server anonymously for the open change matching HEAD's `Change-Id`, once per start or resume. Other session types skip the lookup, and no other Gerrit host is contacted. Optional: disable with [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](https://code.claude.com/docs/en/env-vars) |
permission-modes Changed · +1 / -1 lines
from line 675
675675
676676`bypassPermissions` mode disables permission prompts and safety checks so tool calls execute immediately, including writes to [protected paths](#protected-paths).
677677
678Even in `bypassPermissions` mode, each of the [actions no mode auto-approves](#actions-no-mode-auto-approves) gets a prompt or a denial, though you can [turn off the prompt for dangerous `rm` commands](#turn-off-the-critical-path-removal-prompt-in-bypasspermissions-mode). Reading [another organization's public artifact](https://code.claude.com/docs/en/artifacts.md#read-an-artifact-shared-with-you) needs your approval, and this mode doesn't ask for it, so Claude can't read one. The [Remove-Item in PowerShell](#remove-item-in-powershell) denies also apply in this mode.
678Even in `bypassPermissions` mode, each of the [actions no mode auto-approves](#actions-no-mode-auto-approves) ends in a prompt or a denial, though you can [turn off the prompt for dangerous `rm` commands](#turn-off-the-critical-path-removal-prompt-in-bypasspermissions-mode). The Artifact tool can't read [another organization's public artifact](https://code.claude.com/docs/en/artifacts.md#read-an-artifact-shared-with-you) that you haven't approved in this conversation. The [Remove-Item in PowerShell](#remove-item-in-powershell) denies also apply in this mode.
679679
680680Two [cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md) safeguards still apply in this mode, and in interactive terminal plan-mode sessions where bypass permissions are available:
681681
permissions Changed · +1 / -1 lines
from line 570
570570| `WebFetch` | Claude fetches without prompting you. Doesn't change which hosts sandboxed commands can reach. | Claude Code removes the `WebFetch` tool, so Claude can't fetch at all. Doesn't change which hosts sandboxed commands can reach. |
571571| `WebFetch(domain:*)` | Claude fetches without prompting you, and sandboxed commands can reach any host. | Claude Code keeps the tool and refuses each fetch, and sandboxed commands can't reach any host. |
572572
573The two forms also differ on reads of [artifacts](https://code.claude.com/docs/en/artifacts.md), the pages the Artifact tool publishes on claude.ai. A bare `WebFetch` deny or ask rule doesn't apply to those reads. A `domain:` rule covering `claude.ai` or the `*.claudeusercontent.com` content host, such as `WebFetch(domain:claude.ai)` or `WebFetch(domain:*)`, denies each read or prompts before it. An [`Artifact` rule](https://code.claude.com/docs/en/artifacts#disable-artifacts) does the same.
573The two forms also differ on reads of [artifacts](https://code.claude.com/docs/en/artifacts.md), the pages the Artifact tool publishes on claude.ai. A bare `WebFetch` deny or ask rule doesn't apply to Artifact tool reads. A `domain:` rule covering `claude.ai` or the `*.claudeusercontent.com` content host, such as `WebFetch(domain:claude.ai)` or `WebFetch(domain:*)`, denies each read or prompts before it.
574574
575575When a rule blocks a read, the denial names the rule. Before v2.1.268, a bare `WebFetch` deny rule blocked every artifact read, and a bare ask rule prompted before each one.
576576
settings-reference Changed · +1 / -1 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 2523
25232523}
25242524```
25252525
2526In a `-p` run or an Agent SDK session, Claude Code ignores this key. The SDK turns checkpointing on with its `enableFileCheckpointing` option, and a bare `-p` run needs `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true`. See [File checkpointing in the Agent SDK](https://code.claude.com/docs/en/agent-sdk/file-checkpointing.md).
2526In a `-p` run or an Agent SDK session, Claude Code ignores this key unless your organization's [managed settings](https://code.claude.com/docs/en/managed-settings.md) set it to `false`, and then checkpointing stays off. That exception requires Claude Code v2.1.331 or later. Without that `false`, turn checkpointing on with the SDK's `enableFileCheckpointing` option, or with `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true` in a bare `-p` run. See [File checkpointing in the Agent SDK](https://code.claude.com/docs/en/agent-sdk/file-checkpointing.md).
25272527
25282528### `idleCompaction`
25292529
from line 3312
33123312 * `"default"`: the classic main-screen renderer
33133313 * `"fullscreen"`: the flicker-free alt-screen renderer with virtualized scrollback
33143314* **Default**: unset, so Claude Code [picks the renderer for you](https://code.claude.com/docs/en/fullscreen.md#fullscreen-by-default)
3315* **Per-session overrides**: [`CLAUDE_CODE_NO_FLICKER`](https://code.claude.com/docs/en/env-vars) and [`CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN`](https://code.claude.com/docs/en/env-vars) take precedence over this key for one session: `CLAUDE_CODE_NO_FLICKER=1` turns fullscreen on, and `CLAUDE_CODE_NO_FLICKER=0` or `CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1` turns it off; when both are set, Claude Code turns it off
3316
3317```json settings.json theme={null}
3318{
3319 "tui": "fullscreen"
3320}
3321```
3322
3323Under tmux `-CC` or over SSH to Windows, Claude Code keeps t
3315* **Per-session overrides**: [`CLAUDE_CODE_NO_FLICKER`](https://code.claude.com/docs/en/env-vars) and [`CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN`](https://code.claude.com/docs/en/env-vars) take precedence over this key for one session: `CLAUDE_CODE_NO_FLICKER=1` turns fullscreen on, and `CLAUDE_CODE_NO_FLICKER=0` or
share-sessions Changed · +1 / -1 lines
from line 88
8888If recipients can't open a link, check for these causes:
8989
9090* **Visibility**: the session is **Private**, or the recipient isn't signed in to claude.ai or is outside your organization on a **Team** link. Check [who can open the link](#share-a-session).
91* **Free plan**: the recipient is signed in on a Free account and lands on the upgrade page. Ask them to sign in with an account that has [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md).
9291* **Repository access**: the link [requires repository access](#share-a-session), and the recipient's GitHub account can't read the repository. Ask them to [connect an account](https://code.claude.com/docs/en/web-quickstart.md#connect-github) that can.
9392* **Uploaded or non-GitHub code**: the link requires repository access, and the code was [uploaded](https://code.claude.com/docs/en/claude-code-on-the-web.md#send-local-repositories-without-github) or is on a Git host such as GitLab or Bitbucket. Share from a session whose repository is on github.com and wasn't uploaded.
9493* **Invalid link**: the share link may not match the address in your browser, and a **Public** link changes when you stop sharing and share again. Copy the current link from **Share** and send it.
9594* **Organization setting**: [**Share cloud sessions** is off](#sharing-is-turned-off-for-your-organization) for the organization. Ask an Owner to turn it back on.
9695* **Upgraded plan**: you shared a **Public** link, then upgraded your plan to Team or Enterprise. The link follows the rules for [Enterprise and Team accounts](#share-from-an-enterprise-or-team-account).
96* **Downgraded plan**: you shared a **Public** link, then moved to the Free plan. [Upgrade](https://claude.ai/upgrade) to a Max, Ultra, or Pro plan, and the same link opens with no further step.
9797
9898You can't restore the link in these cases:
9999
web-quickstart Changed · +1 / -1 lines
from line 28
28283. **Work**: Claude analyzes code, makes changes, runs tests, and checks its work. You can watch and steer throughout, or step away and come back when it's done.
29294. **Push the branch**: when Claude reaches a stopping point, it pushes its branch to GitHub. You review the diff, leave inline comments, create a PR, or send another message to keep going.
3030
31The session doesn't close when the branch is pushed. PR creation and further edits all happen within the same conversation.
31PR creation and further edits all happen within the same conversation.
3232
3333## Compare ways to run Claude Code
3434