SpyBara
Go Premium

Documentation 2026-11-22 22:59 UTC to 2026-11-23 23:59 UTC

105 files changed +3,110 −273. View all changes and history on the product overview
2026
Wed 25 11:59 Tue 24 22:59 Mon 23 23:59 Sun 22 22:59 Sat 21 22:57 Fri 20 23:57 Thu 19 23:00 Wed 18 23:59 Tue 17 23:01 Mon 16 23:59 Sat 14 23:57 Fri 13 23:02 Thu 12 23:02 Wed 11 22:59 Tue 10 21:57 Mon 9 23:02 Sun 8 22:58 Sat 7 23:58 Fri 6 23:01 Thu 5 23:03 Wed 4 23:59 Tue 3 23:58 Mon 2 23:57 Sun 1 23:57
Details

174| `ElicitationResult` | No | Yes | A user responds to an MCP elicitation | Modify or block the response before it returns to the server |174| `ElicitationResult` | No | Yes | A user responds to an MCP elicitation | Modify or block the response before it returns to the server |

175| `ConfigChange` | No | Yes | Configuration file changes | Reload settings dynamically |175| `ConfigChange` | No | Yes | Configuration file changes | Reload settings dynamically |

176| `InstructionsLoaded` | No | Yes | A `CLAUDE.md` or rules file is loaded into context | Audit which instruction files load |176| `InstructionsLoaded` | No | Yes | A `CLAUDE.md` or rules file is loaded into context | Audit which instruction files load |

177| `WorktreeCreate` | No | Yes | Git worktree created | Track isolated workspaces |177| `WorktreeCreate` | No | Yes | Claude Code needs a worktree, and the hook creates it instead of git | Create the worktree and return its path in [`hookSpecificOutput.worktreePath`](https://code.claude.com/docs/en/hooks#worktreecreate-output) |

178| `WorktreeRemove` | No | Yes | A worktree created by a `WorktreeCreate` hook is being removed | Clean up workspace resources |178| `WorktreeRemove` | No | Yes | A worktree created by a `WorktreeCreate` hook is being removed | Clean up workspace resources |

179| `CwdChanged` | No | Yes | The working directory changes during a session | Reload environment variables per directory |179| `CwdChanged` | No | Yes | The working directory changes during a session | Reload environment variables per directory |

180| `FileChanged` | No | Yes | A watched file is modified, created, or deleted | Reload configuration when project files change |180| `FileChanged` | No | Yes | A watched file is modified, created, or deleted | Reload configuration when project files change |


312 312 

313To test it, make the callback raise an error and ask Claude to run a Bash command. The tool result includes `failed; blocking because onFailure is "block"`, and Claude doesn't see your error text.313To test it, make the callback raise an error and ask Claude to run a Bash command. The tool result includes `failed; blocking because onFailure is "block"`, and Claude doesn't see your error text.

314 314 

315Return `{}` when the callback has no opinion. With `"block"` set, a path with no `return` blocks the action. A callback that catches its own error and returns `{}` isn't failing, so let the error propagate from a guard.315Return `{}` when the callback has no opinion. With `"block"` set, a path with no `return` blocks the action. A callback that catches its own error and returns `{}` isn't failing, so let the error propagate from a guard. A `WorktreeCreate` callback must return `hookSpecificOutput.worktreePath`.

316 316 

317#### Events that behave differently317#### Events that behave differently

318 318 


322* **`PermissionRequest`**: the block counts only if it arrives before your `canUseTool` callback answers.322* **`PermissionRequest`**: the block counts only if it arrives before your `canUseTool` callback answers.

323* **`PostToolUse`**: the tool has already run, so Claude receives the failure as feedback.323* **`PostToolUse`**: the tool has already run, so Claude receives the failure as feedback.

324 324 

325A callback that exceeds its timeout follows [Hook timeout](#hook-timeout). With `"block"` set, a timeout also blocks `PreCompact`, `Elicitation`, and `WorktreeCreate`.325A callback that exceeds its timeout follows [Hook timeout](#hook-timeout). With `"block"` set, a timeout also blocks `PreCompact` and `Elicitation`.

326 326 

327#### Startup errors for `onFailure`327#### Startup errors for `onFailure`

328 328 


827* `Stop` and `SubagentStop`: the timed-out callback counts as returning no decision. The agent or subagent stops as if that callback had allowed it, and a decision from your other hooks on the event still applies. Before Claude Code v2.1.273, a timed-out `Stop` or `SubagentStop` callback counted as a failed hook run, and Claude Code discarded the decisions of your other hooks on the event.827* `Stop` and `SubagentStop`: the timed-out callback counts as returning no decision. The agent or subagent stops as if that callback had allowed it, and a decision from your other hooks on the event still applies. Before Claude Code v2.1.273, a timed-out `Stop` or `SubagentStop` callback counted as a failed hook run, and Claude Code discarded the decisions of your other hooks on the event.

828* `SessionStart`: the timed-out callback counts as returning no output, and the session continues with the output of your other `SessionStart` hooks.828* `SessionStart`: the timed-out callback counts as returning no output, and the session continues with the output of your other `SessionStart` hooks.

829* `PreModelSwitch`: Claude Code blocks the model switch. A hook that doesn't answer hasn't approved the switch.829* `PreModelSwitch`: Claude Code blocks the model switch. A hook that doesn't answer hasn't approved the switch.

830* Other events, such as `Notification`, `PreCompact`, and `PostModelSwitch`: Claude Code logs the failure and continues. With [`onFailure: "block"`](#block-the-action-when-a-callback-fails), a timeout on `PreCompact`, `Elicitation`, or `WorktreeCreate` blocks the action.830* `WorktreeCreate`: worktree creation fails with an error.

831* Other events, such as `Notification`, `PreCompact`, and `PostModelSwitch`: Claude Code logs the failure and continues. With [`onFailure: "block"`](#block-the-action-when-a-callback-fails), a timeout on `PreCompact` or `Elicitation` blocks the action.

831 832 

832The first time a `Stop` or `SessionStart` callback times out in the main session, Claude Code also adds an [`SDKInformationalMessage`](https://code.claude.com/docs/en/agent-sdk/typescript#sdkinformationalmessage) to the message stream saying the app driving the session didn't respond. Later timeouts don't repeat that message while your app stays unresponsive.833The first time a `Stop` or `SessionStart` callback times out in the main session, Claude Code also adds an [`SDKInformationalMessage`](https://code.claude.com/docs/en/agent-sdk/typescript#sdkinformationalmessage) to the message stream saying the app driving the session didn't respond. Later timeouts don't repeat that message while your app stays unresponsive.

833 834 

Details

2672 "resolvedModel": str | None, # Model in use at the backgrounding transition2672 "resolvedModel": str | None, # Model in use at the backgrounding transition

2673 "modelsUsed": list[str] | None, # Models used before backgrounding, in order, with consecutive repeats collapsed2673 "modelsUsed": list[str] | None, # Models used before backgrounding, in order, with consecutive repeats collapsed

2674 "prompt": str, # The prompt the agent runs2674 "prompt": str, # The prompt the agent runs

2675 "outputFile": str, # File path where the agent's output is written2675 "outputFile": str, # Path to the task output file

2676 "canReadOutputFile": bool | None, # Whether the output file can be read directly2676 "canReadOutputFile": bool | None, # Whether the output file can be read directly

2677}2677}

2678```2678```

Details

253 253 

254> [tab] Approve with changes254> [tab] Approve with changes

255>255>

256> The user approves but wants to modify the request first. You can change the input before the tool executes. Claude sees the result but isn't told you changed anything. Useful for sanitizing parameters, adding constraints, or scoping access.256> The user approves but wants to modify the request first. You can change the input before the tool executes. Useful for sanitizing parameters, adding constraints, or scoping access.

257>257>

258> ```python Python theme={null}258> ```python Python theme={null}

259> async def can_use_tool(tool_name, input_data, context):259> async def can_use_tool(tool_name, input_data, context):

agent-teams.md +2 −2

Details

95 95 

96Agent teams support two display modes:96Agent teams support two display modes:

97 97 

98* **In-process**: all teammates run inside your main terminal. Use the up and down arrow keys in the agent panel to select a teammate, then press Enter to view it and type to message it directly. Works in any terminal, no extra setup required.98* **In-process**: all teammates run inside your main terminal. Use the up and down arrow keys in the agent panel to select a teammate, then press Enter to view it and type to message it directly. Works in any terminal.

99* **Split panes**: each teammate gets its own pane. You can see everyone's output at once and click into a pane to interact directly. Requires tmux, or iTerm2.99* **Split panes**: each teammate gets its own pane. You can see everyone's output at once and click into a pane to interact directly. Requires tmux, or iTerm2.

100 100 

101> [!NOTE]101> [!NOTE]


339 339 

340**How teammates share information:**340**How teammates share information:**

341 341 

342* **Automatic message delivery**: when teammates send messages, they're delivered automatically to recipients. The lead doesn't need to poll for updates.342* **Automatic message delivery**: when teammates send messages, they're delivered automatically to recipients.

343* **Idle notifications**: when a teammate finishes and stops, it automatically notifies the lead and includes its final answer in the notification. A teammate whose turn ends on an API error notifies the lead that it failed and includes the error text.343* **Idle notifications**: when a teammate finishes and stops, it automatically notifies the lead and includes its final answer in the notification. A teammate whose turn ends on an API error notifies the lead that it failed and includes the error text.

344* **Shared task list**: [agents that have the Task tools](https://code.claude.com/docs/en/tools-reference.md#task-tool-availability) can see task status and claim available work.344* **Shared task list**: [agents that have the Task tools](https://code.claude.com/docs/en/tools-reference.md#task-tool-availability) can see task status and claim available work.

345* **Teammate messaging**: send a message to one specific teammate by name. To reach everyone, send one message per recipient.345* **Teammate messaging**: send a message to one specific teammate by name. To reach everyone, send one message per recipient.

agent-view.md +4 −4

Details

60 60 

61In a regular `claude` session, pressing `←` on an empty prompt opens agent view, and a `←` hint in the footer reports on your background sessions:61In a regular `claude` session, pressing `←` on an empty prompt opens agent view, and a `←` hint in the footer reports on your background sessions:

62 62 

63* **Hint**: the footer shows `← for agents` for ten seconds after the session opens. Pressing `←` still works after the hint disappears63* **Hint**: the footer shows `← for agents` for ten seconds after the session opens

64* **Waiting count**: while background sessions wait on your input, the same spot counts them, such as `← 2 agents`, or `← 99+ agents` when more than 99 wait. The count refreshes about every ten seconds while the terminal is focused and immediately when focus returns64* **Waiting count**: while background sessions wait on your input, the same spot counts them, such as `← 2 agents`, or `← 99+ agents` when more than 99 wait. The count refreshes about every ten seconds while the terminal is focused and immediately when focus returns

65* **Finished count**: when background sessions finish successfully while none wait on your input, the footer briefly shows how many finished, such as `← 2 done` for two65* **Finished count**: when background sessions finish successfully while none wait on your input, the footer briefly shows how many finished, such as `← 2 done` for two

66 66 


839 839 

840### The supervisor process840### The supervisor process

841 841 

842The supervisor is a background service that runs your background sessions so they keep working after you close agent view or your terminal. Claude Code starts it the first time you background a session or open agent view, and you don't need to manage it yourself.842The supervisor is a background service that runs your background sessions so they keep working after you close agent view or your terminal. Claude Code starts it the first time you background a session or open agent view.

843 843 

844Each session is its own Claude Code process under the supervisor, and what happens to that process depends on the session's state:844Each session is its own Claude Code process under the supervisor, and what happens to that process depends on the session's state:

845 845 


912 912 

913This notice names a background [subagent](https://code.claude.com/docs/en/sub-agents.md) that isn't running in this session.913This notice names a background [subagent](https://code.claude.com/docs/en/sub-agents.md) that isn't running in this session.

914 914 

915Claude sees the notice and replies on its own, so you don't need to prompt it. If you still need that subagent's work after reading Claude's reply, ask Claude for it.915Claude sees the notice and replies on its own. If you still need that subagent's work after reading Claude's reply, ask Claude for it.

916 916 

917### Prompt rejected as too short917### Prompt rejected as too short

918 918 


929 929 

930When [transcript cleanup](https://code.claude.com/docs/en/settings-reference.md#cleanupperioddays) has removed a stopped session's saved conversation, Claude Code refuses to open the row: the message says there is nothing to resume. `claude rm <id>` deletes the row, unless [Claude Code refuses](#what-deleting-a-session-removes), and `claude respawn <id>` runs its original prompt again. See [This session's saved conversation is no longer on disk](https://code.claude.com/docs/en/errors.md#this-sessions-saved-conversation-is-no-longer-on-disk).930When [transcript cleanup](https://code.claude.com/docs/en/settings-reference.md#cleanupperioddays) has removed a stopped session's saved conversation, Claude Code refuses to open the row: the message says there is nothing to resume. `claude rm <id>` deletes the row, unless [Claude Code refuses](#what-deleting-a-session-removes), and `claude respawn <id>` runs its original prompt again. See [This session's saved conversation is no longer on disk](https://code.claude.com/docs/en/errors.md#this-sessions-saved-conversation-is-no-longer-on-disk).

931 931 

932Sleep alone doesn't stop sessions. Sessions are preserved across sleep and the supervisor reconnects to them on wake.932Sessions are preserved across sleep and the supervisor reconnects to them on wake.

933 933 

934### Opening a session says the conversation is already open934### Opening a session says the conversation is already open

935 935 

analytics.md +0 −4

Details

118 118 

119Before comparison, lines are normalized: whitespace is trimmed, multiple spaces are collapsed, quotes are standardized, and text is converted to lowercase.119Before comparison, lines are normalized: whitespace is trimmed, multiple spaces are collapsed, quotes are standardized, and text is converted to lowercase.

120 120 

121Merged pull requests containing Claude Code-assisted lines are labeled as `claude-code-assisted` in GitHub.

122 

123#### Time window121#### Time window

124 122 

125Sessions from 21 days before to 2 days after the PR merge date are considered for attribution matching.123Sessions from 21 days before to 2 days after the PR merge date are considered for attribution matching.


174 172 

175On the Enterprise plan, the [Claude Enterprise Analytics API](https://platform.claude.com/docs/en/api/admin/analytics) returns per-user engagement, usage, and cost reports for your organization across Claude surfaces, including Claude Code. A Primary Owner creates a key with the `read:analytics` scope at [claude.ai/analytics/api-keys](https://claude.ai/analytics/api-keys). The API is not available on the Teams plan.173On the Enterprise plan, the [Claude Enterprise Analytics API](https://platform.claude.com/docs/en/api/admin/analytics) returns per-user engagement, usage, and cost reports for your organization across Claude surfaces, including Claude Code. A Primary Owner creates a key with the `read:analytics` scope at [claude.ai/analytics/api-keys](https://claude.ai/analytics/api-keys). The API is not available on the Teams plan.

176 174 

177To query contribution data through GitHub instead, search for PRs labeled with `claude-code-assisted`.

178 

179## Access analytics for API customers175## Access analytics for API customers

180 176 

181API customers using the Claude Console can access analytics at [platform.claude.com/claude-code](https://platform.claude.com/claude-code). You need the UsageView permission to access the dashboard. The Developer, Billing, Admin, Owner, and Primary Owner roles have this permission. To pull daily per-user metrics programmatically, use the [Claude Code Analytics API](https://platform.claude.com/docs/en/build-with-claude/claude-code-analytics-api) with an Admin API key.177API customers using the Claude Console can access analytics at [platform.claude.com/claude-code](https://platform.claude.com/claude-code). You need the UsageView permission to access the dashboard. The Developer, Billing, Admin, Owner, and Primary Owner roles have this permission. To pull daily per-user metrics programmatically, use the [Claude Code Analytics API](https://platform.claude.com/docs/en/build-with-claude/claude-code-analytics-api) with an Admin API key.

approvals.md +110 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Claude Approvals

6 

7> Set how many people a path in your GitHub repository needs, and where Claude may approve, with a policy file and a pull request check

8 

9Claude Approvals is a check on GitHub pull requests that reports who still has to approve. It follows a [policy](https://code.claude.com/docs/en/approvals-policy.md), a file in your repository that can set how many people have to approve a change to a path and where Claude may approve.

10 

11> [!TIP]

12>

13> To turn on Claude Approvals in a repository, follow [Set up Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md).

14 

15To evaluate a pull request, Approvals reads the policy, finds the rules that apply, and counts approvals:

16 

17![Diagram of how Claude Approvals evaluates a pull request. Approvals reads the policy on the default branch, finds the rules that apply and takes the strictest, and counts approvals. A check and a comment appear on the pull request. If the policy allows, an approving review appears too.](https://mintcdn.com/claude-code/sMH7RDpTvyWlAkrg/images/approvals-flow.svg?fit=max\&auto=format\&n=sMH7RDpTvyWlAkrg\&q=85\&s=29bc7cd0a0a49c1986cab5afdf57ca3b)

18 

19Use Approvals to set how many people have to approve a change, with more on risky changes and fewer on routine ones. For example, billing code can need two people, and test fixtures can need one person once [Code Review](https://code.claude.com/docs/en/code-review.md) passes.

20 

21> [!NOTE]

22>

23> For permission prompts in a Claude Code session, see [Configure permissions](https://code.claude.com/docs/en/permissions.md).

24 

25## Find Claude Approvals on a pull request

26 

27Approvals adds a check named **Claude Approvals** to the pull requests that it evaluates. The check's title says what's still needed, such as **Waiting on human review from any person (1/2)**. A title that starts with **(observe mode)** means that the policy wasn't enforced when the check ran. In [observe mode](#set-up-claude-approvals), the check shows what your policy would decide.

28 

29Claude also posts a comment with the reasons. Where the policy allows it, Claude can post an approving review. For the common titles and what to do about each, see [Find your approval status and what to do next](https://code.claude.com/docs/en/approvals-pull-requests.md#find-your-approval-status-and-what-to-do-next). If a pull request has no check, see [No Claude Approvals check appeared](https://code.claude.com/docs/en/approvals-troubleshooting.md#no-claude-approvals-check-appeared).

30 

31## Example policy

32 

33You write a policy as a list of rules in `.claude/approvals.yml`.

34 

35This policy has one rule, which asks for two people on every change:

36 

37```yaml theme={null}

38# .claude/approvals.yml

39version: 1

40mode: observe

41rules:

42 - purpose: "A change takes two people, and Claude doesn't approve."

43 paths: ["**"]

44 verdict: { claude: comments, seats: 2 }

45 advisory: [claude/code_review]

46```

47 

48Each part of the policy sets one thing:

49 

50* **`mode: observe`**: starts the policy in [observe mode](#set-up-claude-approvals)

51* **`purpose`**: says why the rule exists

52* **`paths`**: names the files that the rule matches, which here is every file

53* **`seats: 2`**: asks for two people, one of whom [can be the author](https://code.claude.com/docs/en/approvals-policy.md#whether-a-pull-request’s-author-counts)

54* **`claude: comments`**: means that Claude doesn't approve

55* **`advisory`**: [keeps automatic Code Reviews](#keep-automatic-code-reviews)

56 

57You can also give a rule a condition, which can read facts about the pull request and classifiers' answers:

58 

59* **[Facts](https://code.claude.com/docs/en/approvals-policy.md#if) about the pull request**: such as how many lines changed, who opened it, and which branch it targets

60* **A [classifier's](https://code.claude.com/docs/en/approvals-classifiers.md) answer**: a model's judgment on a question such as how risky the change is

61 

62A condition can't read CI results, so keep CI as its own required check in GitHub.

63 

64## Before you turn on Approvals

65 

66Before you add a policy file to a repository, check that your organization qualifies and who can turn Approvals on or off. Then see what Approvals changes for merges, Code Review, and billing.

67 

68### Availability

69 

70Approvals is in public beta for Claude organizations on [Team and Enterprise](https://code.claude.com/docs/en/feature-availability.md#features-that-require-a-claude-subscription) plans, as part of [Claude Ship](https://code.claude.com/docs/en/claude-ship.md). It works on github.com, including GitHub Enterprise Cloud. Compliance settings limit who can use it:

71 

72* **Not available**: with [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md) enabled, the [HIPAA configuration](https://code.claude.com/docs/en/hipaa-setup.md) applied, or customer-managed encryption keys (CMEK)

73* **Can't start Approvals**: with FERPA or Access Transparency settings

74 

75### Who can turn Approvals on or off

76 

77Once the [prerequisites](https://code.claude.com/docs/en/approvals-setup.md#prerequisites) are met, anyone who can merge a policy file into the default branch can turn Approvals on. An Owner of the Claude organization can [turn Approvals off](https://code.claude.com/docs/en/approvals-setup.md#turn-off-approvals) for the whole organization, and it then stays off when a policy file merges.

78 

79### Merges without human review

80 

81A pull request can merge when nobody but its author has looked at it. Check your policy and your GitHub rules for cases such as these:

82 

83* **The check isn't required**: the **Claude Approvals** check blocks a merge only where you make it a required check in GitHub, and normally not in observe mode

84* **The policy asks for nobody else**: the author can fill a seat, so with `seats: 1` nobody else has to look. With `seats: 0`, a pull request that a bot wrote can merge when no person has looked at it

85* **GitHub counts Claude's approval**: where a GitHub branch rule requires one approval, Claude's approving review can be that approval

86* **Claude approves with no review**: a rule with `claude: approves` starts no Code Review by itself, so Claude can approve a change that nothing has reviewed. To get a review first, [let Claude approve only when Code Review passes](https://code.claude.com/docs/en/approvals-setup.md#let-claude-approve-when-code-review-passes)

87 

88For the other cases, and a rule that asks for a person who isn't an author, see [Merges without human review](https://code.claude.com/docs/en/approvals-github-rules.md#merges-without-human-review).

89 

90### Keep automatic Code Reviews

91 

92[Code Review](https://code.claude.com/docs/en/code-review.md), another Claude Ship agent, can review each pull request automatically. Adding a policy file can stop those reviews. Where every file that a pull request changes lies under a policy file, automatic reviews normally stop, unless a rule for those files names `claude/code_review`. That holds in [observe mode](#set-up-claude-approvals) and when the policy is enforced.

93 

94To keep automatic reviews, [list `claude/code_review` in a rule](https://code.claude.com/docs/en/approvals-policy#advisory), as the [example policy](#example-policy) does under `advisory`.

95 

96### Billing for Approvals

97 

98Approvals bills your organization's [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans), by tokens, for the Code Reviews and classifier runs that a policy starts. See [what starts a charge](https://code.claude.com/docs/en/approvals-setup.md#what-approvals-costs).

99 

100## Set up Claude Approvals

101 

102To set up Approvals, start your policy in observe mode, where the **Claude Approvals** check shows what your policy would decide. Reviews and classifier runs are billed in observe mode. For starter policies and the steps, see [Set up Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md).

103 

104## Related resources

105 

106* [Work with Claude Approvals on a pull request](https://code.claude.com/docs/en/approvals-pull-requests.md): check titles and comment commands

107* [Approvals and your GitHub rules](https://code.claude.com/docs/en/approvals-github-rules.md): required reviews, CODEOWNERS, and merge queues

108* [Policy file reference](https://code.claude.com/docs/en/approvals-policy.md): keys and an example policy

109* [Troubleshoot Claude Approvals](https://code.claude.com/docs/en/approvals-troubleshooting.md): when no check appears or a policy file is refused

110* [Configure permissions](https://code.claude.com/docs/en/permissions.md): permission prompts in Claude Code

approvals-classifiers.md +291 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Claude Approvals classifiers

6 

7> Let a Claude Approvals rule depend on Code Review's answer or on a question you define. Add a classifier, read its answer, and limit what a run costs.

8 

9In [Claude Approvals](https://code.claude.com/docs/en/approvals.md), the rules in your [policy file](https://code.claude.com/docs/en/approvals-policy.md) decide who has to approve a pull request. A classifier lets a rule depend on a judgment about the change, such as whether Code Review passed or how risky the change is. For example, a rule can ask for two people, and for only one when a classifier rates the change as low risk.

10 

11A rule can decide from paths, facts, and classifiers:

12 

13* **Paths**: which files the pull request changes

14* **[Facts](https://code.claude.com/docs/en/approvals-policy.md#if)**: details of the pull request itself, such as how many lines changed or who opened it

15* **Classifiers**: the answer to a question about the change. Use one for what paths and facts can't express

16 

17Claude Approvals is in [public beta](https://code.claude.com/docs/en/approvals.md#availability) for organizations on Team and Enterprise plans.

18 

19## How a classifier works

20 

21A classifier has a name, a question, and the answers that it can give. Its answer reaches a rule in these steps:

22 

231. **Choose or define a classifier**: `claude/code_review` and `claude/diff` [come with Claude Approvals](#classifiers-anthropic-provides). A custom classifier is a folder in your repository, `.claude/classifiers/<name>/`, on the default branch

242. **Name it in a rule**: write the classifier's name in a rule's condition in your policy file, `.claude/approvals.yml`. For a custom classifier in the folder `change_risk`, the name is `repo/change_risk`, as in `"repo/change_risk = low"`

253. **Approvals runs it on a pull request**: for example, when a pull request opens ready for review and changes a file that the rule matches. See [When a classifier runs](#when-a-classifier-runs). Each run that calls a model is [billed](#what-a-classifier-run-costs) to your organization's usage credits

264. **The rule uses the answer**: the answer helps decide who has to approve. It shows under **Classifier results** in Claude's comment on the pull request, unless a [`reuse`](https://code.claude.com/docs/en/approvals-policy#reuse) condition reads it

27 

28## Example classifier definition

29 

30You define a custom classifier in a file named `def.yml`. The file holds the question for the model, in `prompt`, and the answers that the model can pick, in `outputs`.

31 

32This example defines a classifier named `change_risk`. Its `prompt` asks the model to rate how risky a change is, and its `outputs` lets the model answer `low`, `medium`, or `high`:

33 

34```yaml theme={null}

35# .claude/classifiers/change_risk/def.yml

36version: 1

37description: "How risky is this change to ship?"

38model: opus

39prompt: |

40 Rate how risky this change is to ship.

41 high: it touches sign-in, billing or a data migration.

42 medium: it changes behavior a user can see.

43 low: anything else.

44 When two ratings fit, pick the higher.

45outputs:

46 risk: { type: ordinal, values: [low, medium, high] }

47```

48 

49Each key in the example does one job:

50 

51| Key | In this example |

52| :- | :- |

53| `version` | The format's version, `1` |

54| `description` | One line that says what the classifier asks |

55| `model` | The Claude model that answers, here the newest Opus model |

56| `prompt` | The question. It says what each rating means, and which one to pick when two fit |

57| `outputs` | The answers that the model picks from. This classifier has one output, `risk`, and its `values` run from least to most |

58 

59A definition can also set `inputs`, `tools`, and `budget`. See [Classifier definition file keys](#classifier-definition-file-keys).

60 

61### Use the example's rating in a rule

62 

63A classifier takes its name from its folder. The example is saved at `.claude/classifiers/change_risk/def.yml`, so you write `repo/change_risk` in your policy file's rules.

64 

65To use the rating, compare it with a value in a rule's condition. For example, `if: "repo/change_risk = low"` is true when the model answered `low`. For a rule that asks for fewer people under that condition, see [Read a classifier's answer from a rule](#read-a-classifier’s-answer-from-a-rule).

66 

67## Classifiers Anthropic provides

68 

69Claude Approvals comes with prebuilt classifiers, `claude/code_review` and `claude/diff`. To use one, write its name in a condition in one of your rules.

70 

71### `claude/code_review`

72 

73`claude/code_review` tells a rule whether [Code Review](https://code.claude.com/docs/en/code-review.md) passed. For example, `if: "claude/code_review = pass"` is true while its answer is `pass`.

74 

75`claude/code_review` gives one of these answers:

76 

77| Answer | When |

78| :- | :- |

79| `pass` | A review finished with no [Important finding](https://code.claude.com/docs/en/code-review-pull-requests.md#severity-levels) open |

80| `fail` | A review finished with an Important finding open |

81 

82You can read it in any condition, or list it under [`advisory`](https://code.claude.com/docs/en/approvals-policy#advisory).

83 

84* **To read the severity of its open findings**: write `claude/code_review.severity`, which is `none`, `minimal`, or `high`

85* **To let people turn `fail` into `pass`**: name them in your policy's [`findings`](https://code.claude.com/docs/en/approvals-policy#findings) lists. They do it by closing the Important findings

86 

87### `claude/diff`

88 

89`claude/diff` tells a rule how much a pull request changed since an approval or an earlier answer. It answers `trivial`, `same_intent`, or `different`.

90 

91Read it in a condition under [`reuse`](https://code.claude.com/docs/en/approvals-policy#reuse), which says what continues to count after a push.

92 

93## Add a custom classifier

94 

95With a custom classifier, you write a question about a pull request, and a Claude model answers it. You define the classifier in a file in your repository, then name it in a rule:

96 

971. **Define the classifier**: create a folder under `.claude/classifiers/`, named in lower-case letters, digits, and `_`. In it, save a [`def.yml`](#classifier-definition-file-keys) that holds the question and the answers to pick from. In a rule, you write the folder `change_risk` as `repo/change_risk`.

982. **Name it under `advisory`**: in the root `.claude/approvals.yml`, pick a rule that has a `verdict` and whose `paths` match the files that you want judged, and list the classifier under that rule's [`advisory`](https://code.claude.com/docs/en/approvals-policy#advisory). Under `advisory`, the classifier runs and [is billed](#what-a-classifier-run-costs), and decides nothing.

993. **Merge both files**: open one pull request with both, and Claude comments on the pull request. If the rule that you edited is enforced, expect a warning that says "rules still hold on these files", which doesn't block the merge. Merge the pull request once the **Policy files in this change** section of that comment reports no refusal.

1004. **Read its answers**: open a pull request that changes those files, and [look for the answer](#when-a-classifier’s-answer-appears) in Claude's comment.

1015. **Let a rule depend on it**: once you trust the answers, [read them from a rule](#read-a-classifier’s-answer-from-a-rule).

102 

103### When a classifier's answer appears

104 

105After you merge a classifier's definition and the rule that names it, wait five minutes. Then open a pull request that isn't a draft and that changes a file that rule's `paths` match. Look for the classifier's line in one of these places:

106 

107* **Claude's comment**: under **Classifier results**

108* **The Claude Approvals check's summary**: under **Advisory classifiers (not counted toward this verdict)**

109 

110At first, the line reads "no result recorded yet". A run can take up to 10 minutes, or longer where the classifier's `def.yml` sets a longer [time limit](#budget). Under an enforced rule, the line stays as it is when the run ends.

111 

112The answer shows the next time Approvals evaluates the pull request, for example when someone approves it or requests changes. The line then reads, for example, "`repo/change_risk`: reported `low` (advisory)".

113 

114* **The line still shows no result**: wait until the run's time limit is up, then have someone approve the pull request or request changes

115* **Your classifier has no line**: check that the rule that names the classifier has a `verdict`, and that its `paths` match the file you changed

116 

117## Read a classifier's answer from a rule

118 

119To make a rule depend on a classifier's answer, write the classifier's name in a condition: the rule's own `if`, or the `if` of an [`override`](https://code.claude.com/docs/en/approvals-policy#override). Once `repo/change_risk` answers well under `advisory`, move its name into an override's `if`.

120 

121Keep the strict verdict on the rule itself, because the rule's verdict applies [when a run gives no answer](#what-a-rule-sees-when-a-classifier-run-gives-no-answer).

122 

123This rule asks for two people, and for one while `repo/change_risk` answers `low`:

124 

125```yaml theme={null}

126# .claude/approvals.yml

127version: 1

128rules:

129 - purpose: "Two people. One is enough when the risk is low."

130 paths: ["**"]

131 verdict: { claude: comments, seats: 2 }

132 override:

133 - { if: "repo/change_risk = low", verdict: { claude: comments, seats: 1 } }

134```

135 

136### Ways to read a classifier in a condition

137 

138A condition can read a classifier in these forms:

139 

140| Form | Example | Reads |

141| :- | :- | :- |

142| Name alone | `"repo/change_risk <= medium"` | The only output |

143| `.output` | `"repo/api_review.breaking = yes"` | One output by name. Required when the classifier's definition has several |

144| `.severity` | `"repo/api_review.severity >= high"` | The worst open finding, from `none`, `minimal`, `low`, `medium`, `high`, or `critical`. Needs `findings` in `tools` |

145| `(input=value)` | `"claude/code_review(level=deep) = pass"` | A run with that input. Code Review's `level` is `quick`, `standard`, or `deep` |

146| `= error`, `= incomplete` | `"repo/change_risk = error"` | How a run ended with no answer |

147 

148## Classifier definition file keys

149 

150Write a classifier's definition in `def.yml`, which can be up to 64 KiB. For a whole file, see [Example classifier definition](#example-classifier-definition).

151 

152You can write these keys in `def.yml`:

153 

154| Key | Required | Values |

155| :- | :- | :- |

156| `version` | Yes | `1`, as a bare number |

157| `description` | Yes | One line, up to 1,000 characters |

158| `model` | Yes | A model family in lower case, such as `opus` or `sonnet`, or the exact Claude API ID of a generally available model from the [models overview](https://platform.claude.com/docs/en/about-claude/models/overview). The model has to [support auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) |

159| `prompt` | This or `prompt.md` | The question. For a long one, save `prompt.md` beside `def.yml`, up to 512 KiB |

160| [`outputs`](#outputs) | No | A map of output names to their types and values |

161| [`inputs`](#inputs) | No | A map of input names that a rule can set |

162| [`tools`](#tools) | No | A list |

163| [`budget`](#budget) | No | `{ time, cost }` |

164 

165If you name a model family, the classifier uses that family's newest model, so cost and answers can change with no pull request. If you name an exact ID, the classifier stops loading when that model is retired. Your organization's list of allowed models applies to these runs.

166 

167### `outputs`

168 

169Give each output a `type`, and write names and values in lower-case letters, digits, and `_`. Don't name an output `severity`, and don't use `true`, `false`, `error`, `incomplete`, or `complete` as a value. Put quotes around `"yes"` and `"no"`.

170 

171| `type` | Also needs | [Operators](https://code.claude.com/docs/en/approvals-policy.md#if) in a condition |

172| :- | :- | :- |

173| `criteria` | `values`, a list of words | `=`, `!=` |

174| `ordinal` | `values`, least first | All six |

175| `numeric` | `min` and `max`, whole numbers | All six |

176 

177### `inputs`

178 

179An input is a value that a rule can set for a run. Define each input under `inputs` in `def.yml`, then set it from a rule in parentheses after the classifier's name, as in `repo/change_risk(rigor=thorough)`. Give each input a `default`, and either `values` or `min` and `max`, as in `rigor: { values: [quick, thorough], merge: right, default: quick }`. Say in your prompt what each value changes.

180 

181An input's `merge` says what happens when rules ask for different values on one pull request:

182 

183| `merge` | What runs |

184| :- | :- |

185| `left`, `right` | One run, with the word that stands earlier or later in `values` |

186| `min`, `max` | One run, with the smaller or larger number |

187| `list` | One run, with every word asked for |

188| Omitted | A separate billed run for each value |

189 

190### `tools`

191 

192List an entry under `tools` to let a run do more:

193 

194| Entry | Lets a run | Limit |

195| :- | :- | :- |

196| `findings` | Read parts of the pull request's review threads, report findings as new ones, and resolve or reopen its own | 16 open threads |

197| `comment` | Post one comment | 5,000 characters |

198| `code` | Read files beyond the diff | Read-only |

199| `labels` | Add labels that the repository already has, and remove the ones it added | 8 labels. None whose name starts with `approvals:` or `claude-` |

200| `reviewers` | Add reviewers, and remove the ones it added | 8 reviewers |

201 

202Approvals holds back some of a run's `tools` in observe mode and on some pull requests:

203 

204* **In observe mode**: a run keeps only `findings` and `code` from its `tools`. Approvals can list the findings in its own comment, and opens no new review threads. That holds while your policy file, or every rule that names the classifier and matches a changed file, says [`mode: observe`](https://code.claude.com/docs/en/approvals-policy#rule-keys).

205* **On some pull requests**: a run adds no comment, label, review thread, or GitHub review request. Examples are a pull request from a fork, and one where an author lacks write access

206 

207#### `labels`

208 

209Don't grant `labels` where a label gates a merge, a deploy, or a workflow. A label that a run adds is a real label on the pull request, and anything that reads labels can act on it.

210 

211#### `reviewers`

212 

213Say in your prompt whom to add, by login. Where a rule that [applies](https://code.claude.com/docs/en/approvals-policy.md#how-rules-combine-into-one-verdict) [reads the classifier's answer](#read-a-classifier’s-answer-from-a-rule), the **Claude Approvals** check can wait for their approval, on top of [`seats`](https://code.claude.com/docs/en/approvals-policy#verdict). Name people who have write access. With a policy file in a subdirectory, [list the classifier only under `advisory`](https://code.claude.com/docs/en/approvals-policy#policy-files-in-subdirectories).

214 

215To drop a reviewer who can't approve, first merge a change to the prompt if it names that person, and allow five minutes. Then comment [`@claude approvals rerun`](https://code.claude.com/docs/en/approvals-pull-requests#comment-commands-for-approvals) on the pull request.

216 

217### `budget`

218 

219Set `time`, `cost`, or both under `budget`, as in `budget: { time: 300, cost: 5 }`. A run that reaches either limit stops, and a condition then reads `incomplete`. If you ask for more than the maximum, the run gets the maximum and Approvals warns you.

220 

221| Key | Unit | Default | Maximum |

222| :- | :- | :- | :- |

223| `time` | Whole seconds | `600` | `3600` |

224| `cost` | Whole US dollars | `10` | `10` |

225 

226Approvals stops a run when its estimated spend reaches `cost`, and the bill can be higher. Under \$5, a run on a large pull request can stop before it answers.

227 

228## How a classifier run behaves

229 

230A rule's result can turn on when its classifier runs, what the run can read, and what happens when it gives no answer.

231 

232### When a classifier runs

233 

234A `repo/` classifier runs on a pull request only if you name it in a matching rule: in an `if`, an override's `if`, a `reuse` condition, or `advisory`. On a [pull request from a fork](https://code.claude.com/docs/en/approvals-pull-requests.md#pull-requests-from-forks-and-outside-contributors), `repo/` classifiers don't start before a maintainer vouches for the commit. For `claude/code_review`, see [when Approvals starts a review](https://code.claude.com/docs/en/approvals-setup.md#what-approvals-costs).

235 

236* **What can start a run**: a pull request opens ready for review, is marked ready, or is reopened. A push that changes the diff, a change of base branch, and a [rerun of the Claude Approvals check](https://code.claude.com/docs/en/approvals-pull-requests.md#comment-commands-for-approvals) can also start one. After [your policy stops observing](https://code.claude.com/docs/en/approvals-setup.md#enforce-your-policy-and-require-claude-approvals), Approvals evaluates some open pull requests by itself, which can start a run.

237* **Which definition runs**: the default branch's copy of the definition and prompt. A pull request's own copy doesn't run. The folder's files are [protected files](https://code.claude.com/docs/en/approvals-policy.md#protected-files).

238* **A changed definition ends earlier answers**: an edit to `def.yml` or `prompt.md` counts once it's on the default branch. An open pull request keeps its check until its next evaluation, such as a push or a rerun. That evaluation drops the earlier answer, and the classifier can run again.

239* **After a push that changes the diff**: an earlier answer can count where [`reuse`](https://code.claude.com/docs/en/approvals-policy#reuse) keeps it, or where the push changes only covered files whose rules don't name the classifier

240* **Order**: with `run: sequential`, the default, an override's classifiers normally wait for the overrides above it. With `run: parallel`, they can all start at once, which can bill runs that no verdict needed.

241 

242### What a classifier run can read and change

243 

244A `repo/` classifier's run is a Claude Code cloud session on Anthropic's infrastructure. If your organization requires self-hosted compute, a condition reads `error` in place of that run's answer.

245 

246Check what the session can read and what it can change:

247 

248* **What it can read**: the pull request's title, description, labels, author, changed files, diff, approvals, and required reviewers, the classifier's earlier runs, your policy files, and the files under `.claude/classifiers/`. With `findings` in `tools`, it reads parts of the review threads

249* **What `code` adds**: read-only copies of files at the pull request's head and on the default branch, without some files, such as `CLAUDE.md`, `AGENTS.md`, `.claude/`, `.mcp.json`, and files whose names end in `.pdf`

250* **What it can change**: the session's GitHub access is read-only. Where [`tools`](#tools) lists an entry that writes, the run records what it asks for, and Approvals can carry it out after the run.

251 

252A run reads text that the pull request's author wrote, and that text can try to steer the classifier's answer. On paths that matter, [ask for a person](https://code.claude.com/docs/en/approvals-github-rules.md#ask-for-a-person-who-isn’t-an-author) in a rule that reads no classifier.

253 

254### What a rule sees when a classifier run gives no answer

255 

256When a run ends with no answer, a condition normally reads one of these values:

257 

258| A condition reads | When |

259| :- | :- |

260| `incomplete` | The run began and ended with no answer |

261| `error` | The run couldn't start, was broken off, or outlasted the check's wait |

262 

263In both cases, an override that needs the answer leaves the rule's own `verdict` in place. A rule's own `if` that needs the answer fails the **Claude Approvals** check, with the title **A classifier had no result**.

264 

265To choose another verdict, put [an override](https://code.claude.com/docs/en/approvals-policy.md#override) on `= error` or `= incomplete` above the overrides that read the answer. An override can't choose another verdict for a missing answer in a rule's own `if`. Move the comparison that reads the classifier from the rule's `if` into an override.

266 

267## What a classifier run costs

268 

269A run that calls a model is billed to your organization's usage credits, by tokens:

270 

271| Classifier | What's billed |

272| :- | :- |

273| A custom classifier, `repo/<name>` | Each run. That includes runs in observe mode, runs under `advisory`, and runs that end with no answer. After an error, Approvals can start the run again by itself, more than once, and each of those runs is billed |

274| `claude/diff` | Each answer that calls a model |

275| `claude/code_review` | Billed as [Code Review](https://code.claude.com/docs/en/code-review-costs.md) |

276 

277### Limit what a custom classifier costs

278 

279You can cap one run, cap the month, pick a lower-cost model, or start fewer runs:

280 

281* **Cap one run**: in the classifier's `def.yml`, add `budget: { cost: 5 }`. Approvals stops a run when its estimated spend reaches that many US dollars, and the bill can be higher. With no [`budget`](#budget), the cap is \$10

282* **Cap the month**: set a [spend limit for classifier runs](https://code.claude.com/docs/en/approvals-setup.md#limit-what-a-policy-costs) at [**Organization settings > Usage**](https://claude.ai/admin-settings/usage), which takes an Owner role

283* **Pick a lower-cost model**: in `def.yml`, change `model`, for example from `opus` to `sonnet`

284* **Start fewer runs**: make your edits to `def.yml` and `prompt.md` in one pull request. After each merged edit, the classifier runs again at each open pull request's next evaluation

285 

286## Related resources

287 

288* [Claude Approvals policy file reference](https://code.claude.com/docs/en/approvals-policy.md): conditions, overrides, `reuse`, and `findings`

289* [Set up Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md): observe mode, enforcement, and spend limits

290* [Troubleshoot Claude Approvals](https://code.claude.com/docs/en/approvals-troubleshooting.md): when a classifier gives no answer

291* [Data usage](https://code.claude.com/docs/en/data-usage.md): how Anthropic handles data from Claude Code

approvals-github-rules.md +106 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Claude Approvals and your GitHub rules

6 

7> See how the Claude Approvals check works with required reviews, CODEOWNERS, and merge queues, what can merge with no person, and who can change a policy

8 

9[Claude Approvals](https://code.claude.com/docs/en/approvals.md) adds a check to the GitHub pull requests that it evaluates. The check reports who has to approve a pull request, following a [policy](https://code.claude.com/docs/en/approvals-policy.md), a file in your repository. The check blocks a merge only where you make it a required check in GitHub, and your branch rules decide what merges.

10 

11If you administer a repository or review its security, check how your policy and your GitHub settings work together before you [enforce the policy](https://code.claude.com/docs/en/approvals-setup.md#enforce-your-policy-and-require-claude-approvals):

12 

13* **[Merges without human review](#merges-without-human-review)**: settings that let a pull request merge with no review but its author's, and a rule that asks for a person who isn't an author

14* **[Required reviews and CODEOWNERS](#required-reviews-and-codeowners)**: how GitHub's own review rules count Claude's approving review, and what to set

15* **[Auto-merge and merge queues](#auto-merge-and-merge-queues)**: what can merge without anyone acting

16* **[Who can change or loosen a policy](#who-can-change-or-loosen-a-policy)**: who can edit the policy file, stop requiring the check, or steer a classifier's answer

17 

18## Merges without human review

19 

20With Approvals on, a pull request can merge with no person but its author looking at it, or with no person at all if a bot wrote it. That can happen if GitHub doesn't require the **Claude Approvals** check. It can also happen if the check passes with no person besides the author, for example with:

21 

22* `seats: 0`

23* `seats: 1`, which the author can fill

24* A [`from` list](https://code.claude.com/docs/en/approvals-policy#people-lists) that admits bots

25* A machine user, a user account that a script or an agent drives, which [can count as a person](https://code.claude.com/docs/en/approvals-policy.md#whether-a-pull-request’s-author-counts)

26* A [`reuse`](https://code.claude.com/docs/en/approvals-policy#reuse) that keeps seats after a push

27* Files that no rule covers, where GitHub counts the neutral result as passing

28* A condition that reads a [classifier's](https://code.claude.com/docs/en/approvals-classifiers.md) answer, in a rule's `if`, an override's `if`, or a `reuse`. That answer is one that [a pull request's text can steer](#classifier-answers-that-a-pull-request-can-steer)

29 

30A push directly to the default branch gets no check. Require pull requests there in GitHub.

31 

32Claude's [approving review](https://code.claude.com/docs/en/approvals.md#find-claude-approvals-on-a-pull-request) can meet a GitHub branch rule that requires one approval.

33 

34### Ask for a person who isn't an author

35 

36To have the **Claude Approvals** check ask for one person who isn't an author on every path, add this file's rule to a root [policy file](https://code.claude.com/docs/en/approvals-policy.md) that you [enforce](https://code.claude.com/docs/en/approvals-setup.md#enforce-your-policy-and-require-claude-approvals):

37 

38```yaml theme={null}

39# .claude/approvals.yml

40version: 1

41rules:

42 - purpose: "A change takes one person who isn't an author."

43 paths: ["**"]

44 nested: inherit

45 verdict:

46 claude: comments

47 seats: [{ count: 1, from: [humans, "!pr/authors"] }]

48 advisory: [claude/code_review]

49```

50 

51Each part of that rule does a job:

52 

53| Part of the rule | What it does |

54| :- | :- |

55| No `if` or `override` | No classifier's answer changes the rule |

56| `claude: comments` | Approvals doesn't post Claude's approval |

57| `nested: inherit` | The rule also applies under [policy files in subdirectories](https://code.claude.com/docs/en/approvals-policy.md#policy-files-in-subdirectories) |

58| `humans` | A [machine user](https://code.claude.com/docs/en/approvals-policy.md#whether-a-pull-request’s-author-counts), a user account that a script or an agent drives, can fill this seat. To keep one out, add its login, as in `[humans, "!pr/authors", "!acme-ci"]` |

59| `"!pr/authors"` | Excludes the pull request's authors. On a [fork's pull request](https://code.claude.com/docs/en/approvals-pull-requests.md#pull-requests-from-forks-and-outside-contributors), no approval counts toward this seat |

60| `advisory` | [Keeps automatic Code Reviews](https://code.claude.com/docs/en/approvals.md#keep-automatic-code-reviews) |

61 

62For paths that need more people, copy the rule, narrow `paths`, and raise `count`.

63 

64## Required reviews and CODEOWNERS

65 

66Check how each GitHub setting works beside your policy, and what to set:

67 

68| GitHub setting | How it works with Approvals | What to do |

69| :- | :- | :- |

70| Required approvals | GitHub can count Claude's approving review as one approval. GitHub doesn't count an author who fills a seat, or an [`@claude approve`](https://code.claude.com/docs/en/approvals-pull-requests#comment-commands-for-approvals) comment | Where you require the **Claude Approvals** check, require no more than one approval in GitHub, and ask for more people in `seats`. Otherwise a pull request can stay blocked after the **Claude Approvals** check passes |

71| CODEOWNERS | A branch rule can require a Code Owner's review | To name owners in your policy, use a [people list](https://code.claude.com/docs/en/approvals-policy.md#people-lists) in `seats` on their paths |

72| Stale approvals | Claude posts its approving review on one commit, and GitHub can continue to count that review until it's dismissed. Approvals normally asks GitHub to dismiss the review when Approvals evaluates the next push, and GitHub can [refuse](https://code.claude.com/docs/en/approvals-pull-requests.md#approvals-waits-for-people) | Where GitHub requires approvals, turn on **Dismiss stale pull request approvals when new commits are pushed** or **Require approval of the most recent reviewable push** |

73 

74## Auto-merge and merge queues

75 

76If you use GitHub auto-merge or a merge queue with a policy that doesn't require a person's approval, a change can merge without anyone acting. To have the check ask for a person who isn't an author on every path, [add this rule](#ask-for-a-person-who-isn’t-an-author), and require the **Claude Approvals** check.

77 

78Approvals doesn't evaluate the commits that a merge queue creates:

79 

80* **The queue's commits**: Approvals normally marks them as passed, with the title **Stamped for merge queue**, except for a pull request that was evaluated only in [observe mode](https://code.claude.com/docs/en/approvals-pull-requests.md#approvals-in-observe-mode)

81* **Entry to the queue**: GitHub's own rule decides it, normally after the pull request's required checks pass. A pull request can also enter while the check is still running. If the check doesn't pass after that, remove the pull request from the queue

82* **Pull requests that were only observed**: after you start enforcing the policy, [rerun the check](https://code.claude.com/docs/en/approvals-setup.md#enforce-your-policy-and-require-claude-approvals) on each open pull request before you queue it. Until its latest commit passes under the policy, its commit in the queue normally gets no check, and where the check is required, it can wait there

83* **The app's permission**: ask an owner of your GitHub organization to accept the Claude GitHub App's [**Merge queues** permission](https://code.claude.com/docs/en/github-actions.md#github-app-permissions). Without it, the queue's commits get no check, so where GitHub requires the check, entries wait

84 

85## Who can change or loosen a policy

86 

87A policy is a file in your repository, so your GitHub permissions decide who can change it.

88 

89| Who | What they can do |

90| :- | :- |

91| Anyone who can merge into the default branch | Change a policy file. A policy file is a [protected file](https://code.claude.com/docs/en/approvals-policy.md#protected-files): a pull request that changes it can need a person with write access, who can be the pull request's author. A [machine user](https://code.claude.com/docs/en/approvals-policy.md#whether-a-pull-request’s-author-counts) counts as a person |

92| A GitHub repository admin | Stop requiring the **Claude Approvals** check in the repository's own branch rules |

93| Anyone who can bypass every rule that requires the check | Merge past the check |

94| An [Owner role](https://code.claude.com/docs/en/server-managed-settings.md#access-control) in the Claude organization | [Turn off Approvals](https://code.claude.com/docs/en/approvals-setup.md#turn-off-approvals) for a GitHub organization, a repository whose **Edit** dialog shows **Claude Approvals**, or the whole Claude organization |

95 

96### Classifier answers that a pull request can steer

97 

98Approvals applies the policy files and your classifier definitions from the default branch. A pull request's [author's text](https://code.claude.com/docs/en/approvals-classifiers.md#what-a-classifier-run-can-read-and-change) can steer a classifier's answer.

99 

100Where a rule's `if`, an override's `if`, or a `reuse` condition reads an answer, a steered answer can lower what the pull request needs. To ask for one person who isn't an author on every path, [add this rule](#ask-for-a-person-who-isn’t-an-author).

101 

102## Related resources

103 

104* [Set up Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md): enforce a policy and require the **Claude Approvals** check

105* [Claude Approvals policy file reference](https://code.claude.com/docs/en/approvals-policy.md): seats, people lists, and protected files

106* [Claude Approvals classifiers](https://code.claude.com/docs/en/approvals-classifiers.md): what a classifier's run can read and change

approvals-policy.md +408 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Claude Approvals policy file reference

6 

7> Reference for the Claude Approvals policy file, `.claude/approvals.yml`: its keys, how rules combine, how approvals count, and an example policy.

8 

9A policy file, `.claude/approvals.yml`, tells [Claude Approvals](https://code.claude.com/docs/en/approvals.md) who has to approve a pull request and when Claude may approve it. Look up its keys here, how its rules combine, and how approvals are counted.

10 

11> [!TIP]

12>

13> To set up Approvals and require the **Claude Approvals** check, see [Set up Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md). To find out what a check's title means, see [Work with Claude Approvals on a pull request](https://code.claude.com/docs/en/approvals-pull-requests.md). For a file that the check refuses, see [Fix a policy file that Approvals refuses](https://code.claude.com/docs/en/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses). To define a `repo/<name>` classifier, see [Claude Approvals classifiers](https://code.claude.com/docs/en/approvals-classifiers.md).

14 

15## How a policy file works

16 

17A policy file is a list of rules. Each rule names the files that it's about, in `paths`, and says what a pull request that changes them needs:

18 

19* **`seats`**: how many people have to approve

20* **`claude`**: whether Claude `approves`, `comments`, or `blocks`

21* **`override`**: another verdict, which replaces the rule's own while its `if` is true

22 

23This policy file is the one that [Set up Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md#let-claude-approve-when-code-review-passes) starts from. It asks for two people to approve a change, or one person when Claude's review passes. In both cases, the pull request's author can count as one person:

24 

25```yaml theme={null}

26# .claude/approvals.yml

27version: 1

28mode: observe

29rules:

30 - purpose: "A change takes two people. When Claude's review passes, one is enough and Claude approves."

31 paths: ["**"]

32 verdict: { claude: comments, seats: 2 }

33 override:

34 - { if: "claude/code_review = pass", verdict: { claude: approves, seats: 1 } }

35 - purpose: "A change to the review rules takes two people."

36 paths: ["**/.claude/**"]

37 nested: inherit

38 verdict: { claude: comments, seats: 2 }

39```

40 

41Each line of that file does one job:

42 

43| Line | What it does |

44| :- | :- |

45| [`mode: observe`](#top-level-keys) | The **Claude Approvals** check shows what the rules would decide. Delete the line to enforce them |

46| `purpose` | Says why the rule exists |

47| [`paths: ["**"]`](#paths) | The first rule matches every file |

48| [`verdict`](#verdict) | Two people have to approve, and [the author can count as one](#whether-a-pull-request’s-author-counts). Claude comments and doesn't approve |

49| [`override`](#override) | While [`claude/code_review`](https://code.claude.com/docs/en/approvals-classifiers#classifiers-anthropic-provides) reads `pass`, one person, who can be the author, is enough and Claude can approve |

50| `paths: ["**/.claude/**"]` | The second rule matches the files under any `.claude/` directory, which include the policy file |

51| [`nested: inherit`](#policy-files-in-subdirectories) | Once you enforce the policy, keeps the second rule in force in subdirectories that have their own policy file |

52 

53A file under `.claude/` matches both rules. Approvals [takes the strictest of the verdicts that apply](#how-rules-combine-into-one-verdict), so once you enforce the policy, a change to that file needs two people, because the second rule has no `override`.

54 

55## Where to put a policy file

56 

57Save the policy file as `.claude/approvals.yml` in your repository's root, and merge it into the default branch. Approvals reads policy files from the default branch, so the file's rules apply once it's merged.

58 

59You can also name the file `.claude/approvals.yaml`, which Approvals reads where the `.yml` file is absent. To give a directory rules of its own, add [a policy file there](#policy-files-in-subdirectories).

60 

61### When a change to a policy file takes effect

62 

63While a change to a policy file is in an open pull request, Approvals can check the changed file for errors, and applies none of its rules. The rules on the default branch decide for that pull request.

64 

65Once the change merges, new pull requests get the new rules, and open ones get them from their next evaluation. Approvals can read the earlier copy for a few minutes more. To evaluate an open pull request now, comment [`@claude approvals rerun`](https://code.claude.com/docs/en/approvals-pull-requests#comment-commands-for-approvals).

66 

67### Policy files in subdirectories

68 

69To give a directory its own rules beside the root policy file, add a `.claude/approvals.yml` inside it, such as `services/billing/.claude/approvals.yml`.

70 

71For each changed file, Approvals walks up from that file's directory. The first enforcing policy file that covers the changed file, and in which a rule with a `verdict` [applies](#how-rules-combine-into-one-verdict), decides for it. A `nested: inherit` rule in a policy file higher up counts as one of the deciding policy file's rules.

72 

73* **The nearest policy file decides**: it can ask for less than the root policy file. Above it, only rules marked `nested: inherit` still count.

74* **`paths` start at the directory**: in `services/billing/.claude/approvals.yml`, write `api/**` to match the files under `services/billing/api/`

75* **`locals` reach down**: in a policy file, you can use the locals of the policy files above it

76* **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

77* **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**

78 

79## Top-level keys

80 

81Approvals 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.

82 

83Keep 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.

84 

85Write these keys at the top level of the file:

86 

87| Key | Required | Values | Default | Description |

88| :- | :- | :- | :- | :- |

89| `version` | Yes | `1` | | The schema version, as a bare number |

90| `rules` | Yes | List of [rules](#rule-keys) | | Rule order doesn't matter |

91| `mode` | No | `enforce`, `observe` | `enforce` | `observe` shows what the rules would decide and holds for every rule in the file. For the checks that still aren't neutral, and for pull requests into other branches, see [Approvals in observe mode](https://code.claude.com/docs/en/approvals-pull-requests.md#approvals-in-observe-mode) |

92| `nested` | No | `overwrite`, `inherit` | `overwrite` | The default for this file's rules. See [Policy files in subdirectories](#policy-files-in-subdirectories) |

93| `run` | No | `sequential`, `parallel` | `sequential` | The default for this file's rules. See [When a classifier runs](https://code.claude.com/docs/en/approvals-classifiers.md#when-a-classifier-runs) |

94| `locals` | No | Map of names to values | | Values to reuse. See [`locals` and `use`](#locals-and-use) |

95 

96## Rule keys

97 

98Give each rule a `purpose`, `paths`, and at least one of `verdict`, `advisory`, `findings`, and `reuse`. If `reuse` is the only one of the four that a rule has, the value of `reuse` has to be `false` or name a classifier. A rule with no `verdict` asks nobody and [covers](#how-rules-combine-into-one-verdict) no file.

99 

100You can write these keys on a rule:

101 

102| Key | Type | Default | Description |

103| :- | :- | :- | :- |

104| `purpose` | One line of text | Required | Why the rule exists |

105| [`paths`](#paths) | List of patterns | Required | The changed files that the rule matches |

106| [`verdict`](#verdict) | Map | | What Claude does and who has to approve |

107| [`if`](#if) | Condition | `true` | The rule applies only while the condition is true |

108| [`override`](#override) | List | | Other verdicts, each under a condition |

109| [`advisory`](#advisory) | List of classifiers | | Classifiers that run and decide nothing |

110| [`reuse`](#reuse) | Condition or map | Keep nothing | What still counts after a push that changes the diff |

111| [`findings`](#findings) | Map | No list | Who may close a classifier's finding |

112| [`use`](#locals-and-use) | List of `"@name"` | | Locals whose keys are copied into the rule |

113| `mode` | `enforce`, `observe` | The file's | A rule that observes neither [applies nor covers](#how-rules-combine-into-one-verdict) a file |

114| `nested` | `overwrite`, `inherit` | The file's | `inherit` keeps the rule in force under the policy files below |

115| `run` | `sequential`, `parallel` | The file's | Whether the rule's own classifiers start in turn or together |

116 

117### `paths`

118 

119Write each pattern as a path from the directory that holds the `.claude` folder. A moved file counts at its old path and its new one.

120 

121| Pattern | Matches |

122| :- | :- |

123| `*` | Any characters within one folder |

124| `**` | Any number of folders, dot folders too. It has to be a whole segment, as in `**/*.go` |

125| `{a,b}`, `[ab]`, `?` | Alternatives, one character of a set, and any one character |

126| `infra/**` | Every file in the folder. A bare `infra` matches no file in it |

127| `*.md` | Markdown files beside the policy file's `.claude` folder. For any depth, write `**/*.md` |

128| `"!docs/**"` | Takes the files out of this rule only. A rule needs at least one pattern with no `!` |

129 

130### `if`

131 

132Write a condition as `true`, `false`, or one double-quoted string with a fact's or a classifier's name on the left, such as `"pr/files_changed > 50"`. When you give a rule an `if`, keep another rule with no `if` on the same paths. While the `if` is false, the rule that has it doesn't apply. Where rules cover a file and none applies, [the Claude Approvals check fails](#how-rules-combine-into-one-verdict).

133 

134* **Operators**: `=`, `!=`, `<`, `<=`, `>`, `>=`

135* **Joining**: `AND` and `OR` in capitals. Use parentheses to mix the two.

136* **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.

137* **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]"`

138* **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)

139 

140A fact comes from the pull request itself:

141 

142| Fact | Example | Holds |

143| :- | :- | :- |

144| `pr/files_changed`, `pr/files_added`, `pr/files_removed` | `"pr/files_changed > 50"` | Counts over the whole pull request |

145| `pr/diff_lines` | `"pr/diff_lines <= 20"` | Changed lines in the whole pull request |

146| `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 |

147| `pr/authors` | `"ALL pr/authors = bot:dependabot"` | Accounts that wrote or pushed a commit, and the account that opened the pull request |

148| `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 |

149| `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/base` | `"pr/base = 'release/**'"` | The branch that the pull request targets |

151 

152### `verdict`

153 

154A `verdict` says what Claude does and who has to approve. In a rule's `verdict`, write `claude`, and write `seats` unless `claude` is `blocks`.

155 

156| Field | Values | Description |

157| :- | :- | :- |

158| `claude` | `approves`, `comments`, `blocks` | `approves`: Claude can post an approving review once the **Claude Approvals** check passes, if [every rule that applies says so and every changed file is covered](#how-rules-combine-into-one-verdict). The field starts no review, so where the rule reads no classifier, Claude can approve a change that no review has read. `comments`: Claude doesn't approve. `blocks`: the check fails, whoever approves |

159| `seats` | `0` to `16`, or a list of up to eight sets | How many [people](#how-people’s-approvals-are-counted) have to approve. A number `N` is short for `[{ count: N, from: humans }]`. Refused beside `blocks` |

160| `max_age` | A whole number and `s`, `m`, `h`, or `d`, from `1m` to `83d` | How long an evaluation's results count. After that, the check fails with the title **Results are older than the policy allows** |

161 

162Give each set in `seats` a `count`, from `1` to `16`, and a `from`, which is a [people list](#people-lists). Every set has to be filled, and one person can fill a seat in several sets.

163 

164### People lists

165 

166A people list names accounts. Write one as a set's `from` under [`seats`](#verdict), or under [`findings`](#findings), as one item or as a list in brackets. Only accounts with write access to the repository count.

167 

168| Item | Means |

169| :- | :- |

170| `humans` | Every person, authors included. A machine user, which is a user account that a script or an agent drives, counts as a person. The `claude` user account, which Claude's cloud sessions commit as, doesn't |

171| `bots` | Every bot and GitHub App, Claude's apps and `github-actions` included |

172| `everyone` | `humans` and `bots` together. Write it alone, with no brackets |

173| `nobody` | Nobody. Write it alone, under `findings` only |

174| `ana-acme` | One login. In a condition, put it in single quotes |

175| `acme/payments` | A team of the repository's GitHub organization |

176| `bot:dependabot` | One bot, with no `[bot]` suffix. `bot:claude` means Claude's apps |

177| `pr/authors`, `pr/opened_by` | The accounts that the fact holds |

178| `"!pr/authors"` | Takes accounts away. Quote it, and put it beside an item with no `!` |

179 

180If 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.

181 

182### `override`

183 

184An override changes its rule's verdict while the override's own `if` is true. Approvals reads the `override` list from the top, and the first true override applies.

185 

186| Key | Required | Description |

187| :- | :- | :- |

188| `if` | Yes | A [condition](#if) |

189| `verdict` | At least one of these three | Each field that it writes replaces the rule's. `seats` is replaced as a whole |

190| `reuse`, `findings` | At least one of these three | Replaces the rule's whole value |

191| `purpose`, `use` | No | As on a rule. Here `use` can copy `verdict` and `findings` |

192 

193When an override's `if` reads a classifier, the **Claude Approvals** check waits for the classifier's run:

194 

195* **The run is still going**: the check stays in progress. It can finish early when the approvals already meet every verdict that the rule could still pick, unless the classifier's `tools` list [`reviewers`](https://code.claude.com/docs/en/approvals-classifiers#reviewers). With a policy file in a subdirectory, [list such a classifier only under `advisory`](#policy-files-in-subdirectories)

196* **The run ended with no answer**: reading stops at that override, and the rule's own `verdict` applies. Put the strict verdict on the rule for this reason.

197* **You want to catch a missing answer**: put an override on `= error` or `= incomplete` above the ones that read the answer

198 

199In a rule's own `if`, a comparison with no answer fails the check, whoever approves, unless another part of the condition settles it.

200 

201### `advisory`

202 

203Under `advisory`, list classifier names or calls, such as `[claude/code_review, repo/change_risk]`. A `repo/` classifier listed here [can run](https://code.claude.com/docs/en/approvals-classifiers.md#when-a-classifier-runs), and each run is billed. List it in a rule that has a `verdict`.

204 

205To keep Code Review's automatic reviews, list `claude/code_review` here, or read it in an `if`, in a rule that has a `verdict` and matches the files you want reviewed.

206 

207### `reuse`

208 

209`reuse` says which earlier approvals and classifier answers continue to count after a push that changes the diff, under a condition that usually reads [`claude/diff`](https://code.claude.com/docs/en/approvals-classifiers#classifiers-anthropic-provides).

210 

211When `claude/diff`'s answer is at most `same_intent` and Claude's review of the new commit passes, this example can keep people's approvals:

212 

213```yaml theme={null}

214# in .claude/approvals.yml, on a rule

215 reuse:

216 seats: "claude/diff <= same_intent AND claude/code_review = pass"

217```

218 

219Write `reuse` in one of these forms:

220 

221| Form | Can keep |

222| :- | :- |

223| `seats: <condition>` | People's approvals |

224| `<classifier>: <condition>` | That classifier's earlier answer |

225| `reuse: <condition>` | Both: the seats and the classifiers that the rule reads |

226| `false` | Nothing. `unset`, in an override, removes the rule's value |

227 

228Before you rely on `reuse`, check these cases:

229 

230* **Every rule that matches the files**: write `reuse` on each of them

231* **When `claude/diff` gives no answer**: a condition that reads it keeps nothing

232* **After a dismissal or a force-push**: the example keeps no approval that GitHub dismissed, and normally none given before a force-push. `reuse` can keep them under a `seats` condition that reads `claude/diff` and no other classifier, such as `"claude/diff <= same_intent"`.

233* **Earlier authors count too**: where `reuse` keeps `seats`, people who held the [author's seat](#whether-a-pull-request’s-author-counts) at an earlier commit can continue to count. Two of them can fill `seats: 2` with nobody approving. To prevent that, exclude authors from the set with `"!pr/authors"`.

234* **Files that a push left alone**: in a policy file that writes `reuse`, an approval can outlast a push to other files only. Those can be files that no rule covers, or whose rules couldn't count that person. An approval that GitHub dismissed normally doesn't

235 

236### `findings`

237 

238A classifier can report findings as review threads, and a condition can read their severity as `.severity`. Use `findings` to say who may close a finding, by resolving its thread or with [`@claude approvals resolve`](https://code.claude.com/docs/en/approvals-pull-requests#comment-commands-for-approvals).

239 

240Until a rule's `findings` lists who may close findings, a person's resolve alone doesn't lower `.severity`. A classifier needs no list to close its own finding, as Code Review can when a later review finds it fixed.

241 

242This example lets the `acme/leads` team, less the pull request's authors, close Code Review's findings:

243 

244```yaml theme={null}

245# in .claude/approvals.yml, on a rule with no if, beside verdict

246 findings:

247 resolution:

248 claude/code_review: [acme/leads, "!pr/authors"]

249```

250 

251Under `findings`, write `resolution` with one of these values:

252 

253| Value | Meaning |

254| :- | :- |

255| A [people list](#people-lists) | One list for every classifier's findings. `resolution: humans` lets people with write access close them, the author included |

256| A map of classifier names to lists | A list for each classifier |

257| A list of sets, each `{ if, from }` | Each `if` can read `finding/severity`, as in `{ if: "finding/severity >= high", from: acme/leads }`. Where each `if` reads `finding/severity` alone, the first set whose `if` is true decides. End with a set that has no `if` |

258| `nobody` | No person's resolve alone closes a finding. A classifier can close its own findings |

259 

260To let people close findings, put a list on a rule that has no `if` and covers the finding's file. Put that rule in the [policy file that decides](#policy-files-in-subdirectories) for the file. For a resolve alone to count, every list that applies to that file has to admit the person who resolves.

261 

262A failed `claude/code_review` is one answer for the whole pull request. Check every changed file under a rule that compares that answer, as in `claude/code_review = pass`:

263 

264* **Every file's lists admit the person who resolves**: once every Important finding of the review is closed, it can read `pass`, with no new review

265* **One file's lists don't admit the person who resolves, or that file has `nobody` or no list**: that person's resolve leaves the review `fail`. Write a list for that file that admits the person.

266 

267Closing a finding changes no code, so people can lower `.severity` and pass a failed review with nothing fixed. Keep the lists short.

268 

269### `locals` and `use`

270 

271To reuse a value, name it under `locals` at the top of the policy file. Then write `"@name"` where the value belongs, or copy a whole map into a rule with `use`.

272 

273In this example, `payments_owner` names one set of people, and `strict` names a whole verdict that the first rule copies with `use`:

274 

275```yaml theme={null}

276# .claude/approvals.yml

277version: 1

278locals:

279 payments_owner: { count: 1, from: [acme/payments, "!pr/authors"] }

280 strict:

281 verdict: { claude: comments, seats: [{ count: 2, from: humans }, "@payments_owner"] }

282rules:

283 - purpose: "The payments API takes two people, one of them a payments owner."

284 paths: ["services/payments/api/**"]

285 use: ["@strict"]

286 - purpose: "Everything else takes two people."

287 paths: ["**"]

288 verdict: { claude: comments, seats: 2 }

289```

290 

291Check what a local can hold and where you can use it:

292 

293* **What a local holds**: text, a number, `true` or `false`, a list, or one map

294* **Where `"@name"` can stand**: for the whole of `paths`, a people list, `seats`, `verdict`, or `override`, and for one item of `paths`, a people list, or `seats`. Inside a condition it takes no quotes of its own, as in `"pr/files_changed > @many"`.

295* **What `use` copies**: `verdict`, `override`, `if`, `paths`, `reuse`, `advisory`, and `findings`. What the rule writes itself wins: key by key inside `verdict`, `findings`, and a `reuse` map, and whole for any other key.

296 

297## How rules combine into one verdict

298 

299Approvals takes the strictest of the verdicts that apply: `blocks` outranks `comments`, which outranks `approves`, and every rule's seats have to be filled. Which verdicts apply turns on whether a rule matches, applies to, or covers a changed file:

300 

301* **Matches**: a rule matches a changed file when its `paths` include the file and no `"!"` item takes it out

302* **Applies**: a rule applies to a changed file when it matches, its [`mode`](#rule-keys) is `enforce`, and its `if` is true or absent

303* **Covers**: a rule covers a changed file when it matches, its `mode` is `enforce`, and it has a `verdict`, whatever its `if` says

304 

305Approvals picks a policy file, then rules, then verdicts:

306 

3071. **The policy file**: for each changed file, the [nearest enforcing one](#policy-files-in-subdirectories) that covers it and in which a rule with a `verdict` applies. `nested: inherit` rules in policy files higher up count as its rules.

3082. **The rules**: the ones that apply to each changed file.

3093. **Each rule's verdict**: its own, or its first true [`override`](#override).

3104. **One verdict for the pull request**: the strictest across all changed files. One person can fill a seat in several rules, and the shortest `max_age` applies.

311 

312Under an enforced policy, these cases end another way:

313 

314| Case | What happens |

315| :- | :- |

316| 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 |

317| 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| Rules cover a changed file, and none applies | The check fails, with a title that starts **No rule applies to** |

319| 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 |

320 

321To avoid these, cover every path with root rules that have no `if`, as the first rule of the [starter policy](#how-a-policy-file-works) does.

322 

323## How people's approvals are counted

324 

325An approval can count when an account with write access gives it in a GitHub review or an [`@claude approve`](https://code.claude.com/docs/en/approvals-pull-requests#comment-commands-for-approvals) comment. It has to be on the latest commit, or on an earlier one that [still counts](#earlier-approvals-after-a-new-push).

326 

327While a person with write access requests changes on a pull request that has a covered file, the **Claude Approvals** check normally reads **Changes requested** once nothing else holds it.

328 

329### Whether a pull request's author counts

330 

331On a pull request that a person with write access opened, the author can fill one seat without approving, in a set that admits them. Except on [a fork's or an outside contributor's pull request](https://code.claude.com/docs/en/approvals-pull-requests.md#pull-requests-from-forks-and-outside-contributors), the author alone can meet `seats: 1`. `seats: 2` can be the author and one more person.

332 

333* **Who holds the author's seat**: at the commit that the pull request was opened with, the person who opened it. After a later push, normally the person who both wrote and pushed the latest commit.

334* **When nobody holds it**: for example, after a push of a commit that one person wrote and another pushed. The **Claude Approvals** check's summary gives the reason, and if you opened the pull request, you can then comment [`@claude approve`](https://code.claude.com/docs/en/approvals-pull-requests#comment-commands-for-approvals).

335* **To exclude authors**: write `seats: [{ count: 1, from: [humans, "!pr/authors"] }]`. In a set of named people, name at least one more than `count`, or an author's own pull request can wait. On a [fork's pull request](https://code.claude.com/docs/en/approvals-pull-requests.md#pull-requests-from-forks-and-outside-contributors), no approval counts toward a set that excludes `pr/authors`.

336* **What `"!pr/authors"` goes by**: the accounts that GitHub names as having written or pushed a commit or opened the pull request. It doesn't read `Co-authored-by` lines, and an agent's commits under another account don't make a person an author.

337* **Bots**: a bot fills the seat only in a set that admits it, on a pull request that it opened and whose latest commit it pushed

338* **Machine users**: an agent that works under a user account other than `claude` holds the seat as a person does, and can be the one person that a [protected file](#protected-files) needs. To keep it out, take its login out of the rule's set with `"!"`, as in `[humans, "!acme-ci"]`. For protected files, put that set in a rule whose `paths` name them, marked `nested: inherit`.

339 

340### Earlier approvals after a new push

341 

342After a push, an earlier approval counts or stops counting by what the push changed:

343 

344* **The diff's text stays identical**: an earlier approval that GitHub hasn't dismissed can count.

345* **The diff's text changes**: earlier approvals normally stop counting. Where the policy writes [`reuse`](#reuse), some can continue to count

346 

347Approvals normally [asks GitHub to dismiss](https://code.claude.com/docs/en/approvals-github-rules.md#required-reviews-and-codeowners) Claude's own approval when it evaluates the push, and Claude approves the new commit only if the **Claude Approvals** check passes again.

348 

349## Protected files

350 

351A protected file is Approvals' term for a file that controls how pull requests are reviewed, such as the policy file itself. An edit to one can weaken the review of later pull requests. For example, an edit to the policy file can lower the number of people that they need.

352 

353Where a rule covers a changed file, Approvals normally [asks for a person](#who-has-to-approve-a-change-to-a-protected-file) on a change to a protected file. The list of protected files is built in:

354 

355* **Policy and classifier files**: every policy file, and everything under `.claude/classifiers/`

356* **Review instructions**: `REVIEW.md` at the repository's root

357* **Git files**: `.gitmodules`, `.gitattributes`, symlinks, and submodule pointers

358* **Code owners**: any file named `CODEOWNERS`

359 

360Don'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/`.

361 

362### Who has to approve a change to a protected file

363 

364The person that Approvals asks for can be the pull request's author:

365 

366| Pull request | Who has to approve |

367| :- | :- |

368| A rule covers a changed file | Normally at least one person with write access. That person can be the pull request's author, and isn't a bot |

369| No rule covers any changed file | Can need one person, who can be the author, or nobody |

370| It changes a policy or classifier file in [observe mode](https://code.claude.com/docs/en/approvals-pull-requests.md#approvals-in-observe-mode) | Can need one person, who can be the author |

371 

372### When Claude approves a change to a protected file

373 

374Claude approves a pull request that changes a protected file only if a rule applies to that file and every rule that applies says `approves`. A rule on `"**"` can count. Claude doesn't approve a pull request that changes a `.gitattributes` file, a symlink, or a submodule pointer, whatever the rules say.

375 

376## Policy file size and count limits

377 

378Keep each file within these limits, or Approvals refuses it:

379 

380| What | Limit |

381| :- | :- |

382| One policy file | 448 KiB |

383| Policy files in a repository | 1,024 files, 8 MiB together. Past either, Approvals reads none of them |

384| Rules in a file | 512 |

385| Locals in a file | 512 |

386| Patterns in a rule, not counting `"!"` items | 256 |

387| Overrides | 16 in a rule, 128 in a file |

388| Entries in any list | 1,024 |

389| `purpose` | 1,000 characters |

390| A condition | 4,096 characters, eight levels of parentheses |

391| `seats` as a number, or a set's `count` | 16 |

392| Sets in one `seats` | 8 |

393| Sets under `resolution` | 16 |

394| Teams in one list, or in all the sets of one `seats` | 10 |

395| Names under one `use` | 8 |

396| Custom classifiers that a file names | 16 |

397| Different classifier runs that a file asks for | 32 |

398 

399A pull request has limits too. Past them, GitHub lists the **Claude Approvals** check as **Action required**:

400 

401* **Changed files**: 2,000 or more. The check's title reads **Change too large to evaluate**. Split the pull request.

402* **Commits**: more than 250, where a set excludes authors with `"!pr/authors"`. The title reads **Too many commits to tell who wrote it**. Have an author squash it to 250 commits or fewer and force-push.

403 

404## Related resources

405 

406* [Set up Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md): turn on observe mode, enforce the policy, and require the **Claude Approvals** check

407* [Troubleshoot Claude Approvals](https://code.claude.com/docs/en/approvals-troubleshooting.md): fix a policy file that the check refuses

408* [Claude Approvals classifiers](https://code.claude.com/docs/en/approvals-classifiers.md): the classifiers that a condition can read, and how to define your own

approvals-pull-requests.md +134 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Work with Claude Approvals on a pull request

6 

7> Find what a Claude Approvals check title means and what to do next, use the comment commands, and handle pull requests from Claude and from forks

8 

9Where [Claude Approvals](https://code.claude.com/docs/en/approvals.md) is on, it adds a check named **Claude Approvals** to the pull requests that it evaluates. The check reports who still has to approve the pull request, following a [policy file](https://code.claude.com/docs/en/approvals-policy.md) in the repository. Where your repository requires the check, GitHub can block the merge until it passes. If your pull request has no check, for example because it's a draft, see [No Claude Approvals check appeared](https://code.claude.com/docs/en/approvals-troubleshooting.md#no-claude-approvals-check-appeared).

10 

11## Get your pull request through Claude Approvals

12 

13Approvals evaluates your pull request after events such as a push or an approval. It reports the result in two places on the pull request:

14 

15* **The Claude Approvals check**: in the list of checks at the bottom of the **Conversation** tab. The text beside its name, called its title, gives the approval status, such as **Waiting on human review from any person (1/2)**

16* **Claude's comment**: in the conversation, with the reasons for the result. Approvals edits the same comment as the result changes, so it stays where it first appeared

17 

18To get to a passing check:

19 

201. **Read the approval status**: the check's title says where your pull request stands, for example who still has to approve

212. **Do what the status calls for**: [find the title](#find-your-approval-status-and-what-to-do-next) to see what that is. For example, ask someone with write access to approve, fix the findings that Code Review posted, or wait for a review to finish

223. **Read the status again**: the title can change at the next evaluation, such as when someone approves or you push. After a push that changes the diff, [earlier approvals can stop counting](https://code.claude.com/docs/en/approvals-policy.md#earlier-approvals-after-a-new-push)

234. **Merge**: once the check passes, merge as your repository's GitHub rules allow. Where the policy allows it, Claude can also post an approving review

24 

25## Find your approval status and what to do next

26 

27The **Claude Approvals** check gives your pull request's approval status in its title, the text beside its name in the list of checks. Find your check's title in these tables to see what it means and what to do next.

28 

29For a title that isn't here, open the **Claude Approvals** check's summary, which gives the cause and the next step. To find who maintains the policy file, `.claude/approvals.yml`, see who last changed it on the default branch.

30 

31### Approvals waits for people

32 

33With these titles, Approvals is waiting for a person. Outside observe mode, GitHub lists the **Claude Approvals** check among its pending checks, marked **Action required**.

34 

35| Title | What to do |

36| :- | :- |

37| **Waiting on human review from any person (1/2)** | Ask someone with write access to approve. The numbers are the approvals counted so far and the approvals that the policy asks for, and the author usually [counts as one](https://code.claude.com/docs/en/approvals-policy.md#whether-a-pull-request’s-author-counts) already. In place of "any person", the title can name the people or the team that a rule asks for, or name nobody |

38| **Changes requested** | Have the reviewer who requested changes approve, or have a person dismiss their review |

39| **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 |

40 

41### Approvals waits for Code Review or a classifier

42 

43With these titles, Approvals is waiting for 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), or didn't get one:

44 

45| Title | What to do |

46| :- | :- |

47| **Waiting for Code Review**, **Waiting for repo/change\_risk**, **Waiting for classifiers** | Nothing yet |

48| **A classifier had no result**, **A classifier has not run**, or a name in place of "A classifier", as in **repo/change\_risk has not run** | [Rerun the Claude Approvals check](#comment-commands-for-approvals). See [when a run gives no answer](https://code.claude.com/docs/en/approvals-classifiers.md#what-a-rule-sees-when-a-classifier-run-gives-no-answer) |

49 

50### A rule or a policy file keeps Approvals from passing

51 

52With these titles, a rule holds the pull request, no rule applies to a changed file, or a policy file can't be used:

53 

54| Title | What to do |

55| :- | :- |

56| **Held by Code Review's findings** | Fix the findings that Code Review posted on the pull request, then push. If the policy's [`findings`](https://code.claude.com/docs/en/approvals-policy#findings) list names you, you can resolve the findings' threads. If the **Claude Approvals** check doesn't pass after you resolve them, push a fix |

57| **Held by** and a rule's purpose in quotes, **Held by a policy rule** | Ask whoever maintains the policy file what the rule in the check's summary needs, then push a fix |

58| **No rule applies to** and a file's name in quotes, **No rule applies to a changed file** | Ask whoever maintains the policy file for a rule with no `if` that covers the file. Rerun the check once that rule merges |

59| **This change breaks a policy file**, **Default branch policy file cannot be used** | [Fix the policy file](https://code.claude.com/docs/en/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses) |

60 

61A failed Code Review from an earlier commit can still hold the check after you push a fix. If no new review starts, post a new comment with only [`@claude review`](https://code.claude.com/docs/en/code-review-pull-requests#comment-commands), which takes write access.

62 

63### Approvals passed or nothing ran

64 

65With these titles, Approvals passed or didn't evaluate the pull request:

66 

67| Title | What to do |

68| :- | :- |

69| **Passed; no approval from Claude** | If GitHub requires an approval, ask a person |

70| **Nothing ran, not blocking: no file is covered** | Nothing. If someone should review the files that the pull request changes, ask whoever maintains the [policy file](https://code.claude.com/docs/en/approvals-policy.md) to cover them |

71| **Observe mode ended: not evaluated yet** | Push a commit or [rerun the Claude Approvals check](#comment-commands-for-approvals). If it passes, a pull request with auto-merge on or in a merge queue can merge at once |

72 

73Under **Passed; no approval from Claude**, Claude posts no approval in cases such as these:

74 

75* A rule says `claude: comments`

76* A changed file has no rule, or is a [symlink, submodule pointer, or `.gitattributes` file](https://code.claude.com/docs/en/approvals-policy#protected-files)

77* `claude[bot]` opened the pull request, unless the [Claude Approvals GitHub App](#pull-requests-that-claude-opens) is installed and linked

78 

79## Approvals in observe mode

80 

81In observe mode, the **Claude Approvals** check ends neutral, which GitHub counts as passing, with a title that starts **(observe mode)**.

82 

83The check isn't neutral in cases such as these:

84 

85| Case | What the check does |

86| :- | :- |

87| The pull request changes a policy or classifier file | It can wait for one person, who can be the author. It fails if the change breaks one of those files |

88| The default branch's policy file can't be used | It fails until you [fix the policy file](https://code.claude.com/docs/en/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses) |

89| The title says Withheld | Approvals holds back a passing check, for example because another open pull request has the same latest commit. The check's summary says what clears it |

90| The pull request targets another branch than the default | No check appears, unless the pull request changes a policy or classifier file |

91 

92## Comment commands for Approvals

93 

94To use a command, post it as a new comment on the pull request. You need write access to the repository. A 😕 reaction on your comment means that the command wasn't carried out in full.

95 

96| Command | What it does |

97| :- | :- |

98| `@claude approvals rerun` | Evaluates the latest commit again. Classifiers can run again, and are billed. Put it alone on the comment's first line. On a fork's pull request, [read the change first, then add the latest commit's full SHA and make that the comment's only text](#pull-requests-from-forks-and-outside-contributors) |

99| `@claude approve` | Can count as your approval of the latest commit, for the **Claude Approvals** check. To name a commit, add its full SHA, which a pull request from a fork requires. Make it the comment's only text |

100| `@claude approvals resolve <ids>` | Can close the findings with those IDs, if the policy's [`findings`](https://code.claude.com/docs/en/approvals-policy#findings) list names you. Put it alone on the first line, with one to eight finding IDs such as `f-1a2b3c4d` |

101 

102Approvals can also act on `@claude approvals rerun` from a GitHub App's bot account. That comment starts an evaluation, where classifiers can run and are billed, and doesn't vouch for a [fork's commit](#pull-requests-from-forks-and-outside-contributors).

103 

104Comment `@claude approve` on your own pull request when the check's summary says that you [don't count as an approval](https://code.claude.com/docs/en/approvals-policy.md#whether-a-pull-request’s-author-counts). To withdraw that approval, edit or delete each of your `@claude approve` comments. Approvals doesn't count an edited comment as an approval, so to approve again, post a new comment.

105 

106## Pull requests from Claude, forks, and outside contributors

107 

108A pull request that `claude[bot]` opened needs a second GitHub App before Claude can approve it. A pull request from a fork, or from a person without write access, can need a maintainer.

109 

110### Pull requests that Claude opens

111 

112GitHub doesn't let the account that opened a pull request approve it. Without a second app, Claude gives no approval on a pull request that `claude[bot]` opened, and the **Claude Approvals** check can pass with the title **Passed; no approval from Claude**.

113 

114To get Claude's approval on those pull requests, add a second app:

115 

1161. **Install it**: ask an owner of your GitHub organization to install the [Claude Approvals GitHub App](https://github.com/apps/claude-approvals/installations/new) on the repository.

1172. **Link it**: [link the app to your Claude organization](https://claude.ai/settings/claude-approvals/github/finish). That takes someone who is an owner of the GitHub organization and an Owner or Primary Owner of the Claude organization. If nobody is both, contact [Anthropic support](https://support.claude.com).

118 

119Then [rerun the check](#comment-commands-for-approvals) on an open pull request that `claude[bot]` opened. Leave the required check's source as it is, because the [Claude GitHub App](https://github.com/apps/claude) still reports the check.

120 

121### Pull requests from forks and outside contributors

122 

123Approvals can't confirm that someone with write access pushed a fork's commits. On a fork's pull request, Approvals can wait for a maintainer, meaning someone with write access:

124 

125* **Until a maintainer vouches for a commit**: no classifier's answer counts, Code Review's included. Where a rule depends on one, the **Claude Approvals** check's title can read **No classifier result counts on this commit**.

126* **To vouch for a commit**: outside observe mode, if you have write access, read the change. Then comment `@claude approvals rerun` followed by the latest commit's full SHA, as the comment's only text. Classifiers can then run for that commit. With no SHA, the command can cover the commit that was latest when you commented.

127* **A pass waits for a maintainer**: outside observe mode, where a rule covers a changed file, the check also needs approval from someone with write access who didn't open the pull request. That applies to a fork's pull request, and to one that a person without write access opened. Until then, Claude doesn't approve

128* **A rule with `"!pr/authors"`**: no approval counts toward it on a fork's pull request, and once someone approves, the check's title can read **Cannot tell who wrote this change**. The check's summary says what whoever maintains the policy file can change

129 

130## Related resources

131 

132* [Claude Approvals](https://code.claude.com/docs/en/approvals.md): what a policy is and what it affects

133* [Troubleshoot Claude Approvals](https://code.claude.com/docs/en/approvals-troubleshooting.md): when no check appears, or the check doesn't pass

134* [Claude Approvals policy file reference](https://code.claude.com/docs/en/approvals-policy.md): the keys that a check's summary names

approvals-setup.md +198 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Set up Claude Approvals

6 

7> Turn on Claude Approvals in a GitHub repository: start in observe mode, enforce the policy, require the check, limit what it spends, and turn it off

8 

9[Claude Approvals](https://code.claude.com/docs/en/approvals.md) is a check on GitHub pull requests that reports who still has to approve. To turn it on in a repository, commit a [policy file](https://code.claude.com/docs/en/approvals-policy.md) at `.claude/approvals.yml` in the repository's root, on its default branch. Once the file is on the default branch, Approvals can start [billing](#what-approvals-costs).

10 

11## Prerequisites

12 

13Setting up and enforcing Approvals takes each of these:

14 

15* A Claude organization that [qualifies](https://code.claude.com/docs/en/approvals.md#availability), with [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) to pay for the model runs that a policy starts

16* The [Claude GitHub App](https://github.com/apps/claude), installed on the repository and [linked to your Claude organization](https://code.claude.com/docs/en/admin-setup.md#connected-github-accounts)

17* Permission to merge into the default branch

18* Admin access to the repository on GitHub, to require the **Claude Approvals** check. A private repository also needs a [paid GitHub plan](https://docs.github.com/en/get-started/learning-about-github/githubs-plans)

19* Two people with write access, before you enforce either policy on this page. With only one, the check can't pass on a change under `.claude/`, or where Claude's review fails or gives no result. Under the policy that [keeps two people on each change](#keep-two-people-on-each-change), it can't pass on any change

20 

21## Plan your first policy

22 

23A [policy file](https://code.claude.com/docs/en/approvals-policy.md) tells Approvals who has to approve a pull request. For your first one, decide whether Claude can approve, then copy the starter policy that matches:

24 

25* **[Let Claude approve when Code Review passes](#let-claude-approve-when-code-review-passes)**: a pull request that passes Claude's review usually needs no approval from another person

26* **[Keep two people on each change](#keep-two-people-on-each-change)**: a pull request usually needs one person besides the author, and Claude doesn't approve

27 

28Both policies start in observe mode, where the **Claude Approvals** check shows what the policy would decide, Claude doesn't approve, and the check [normally counts as passing](https://code.claude.com/docs/en/approvals-pull-requests.md#approvals-in-observe-mode).

29 

30Both also name `claude/code_review`. Keep it in your policy file. Once the file is on the default branch, in observe mode or enforced, automatic Code Reviews normally stop where no matching rule names it.

31 

32### Let Claude approve when Code Review passes

33 

34Once this starter policy is enforced, a pull request that passes Claude's review usually needs no approval from another person, except for changes under `.claude/`. Other pull requests usually need one person [besides the author](https://code.claude.com/docs/en/approvals-policy.md#whether-a-pull-request’s-author-counts).

35 

36In this policy, the first rule asks for two people on a change. Its `override` lowers that to one and lets Claude approve when `claude/code_review` reads `pass`. The second rule asks for two people on a change under `.claude/`:

37 

38```yaml theme={null}

39# .claude/approvals.yml

40version: 1

41mode: observe

42rules:

43 - purpose: "A change takes two people. When Claude's review passes, one is enough and Claude approves."

44 paths: ["**"]

45 verdict: { claude: comments, seats: 2 }

46 override:

47 - { if: "claude/code_review = pass", verdict: { claude: approves, seats: 1 } }

48 - purpose: "A change to the review rules takes two people."

49 paths: ["**/.claude/**"]

50 nested: inherit

51 verdict: { claude: comments, seats: 2 }

52```

53 

54This policy can start a billed Code Review at each push, and observe mode is billed. If your [Code Review settings](https://code.claude.com/docs/en/code-review-setup.md#set-when-reviews-run) ask for fewer reviews, the policy adds to them.

55 

56### Keep two people on each change

57 

58This starter policy asks for two people on each change. Once the policy is enforced, a pull request usually needs one person besides the author, and Claude doesn't approve.

59 

60In this policy, both rules ask for two people. The first rule lists `claude/code_review` under [`advisory`](https://code.claude.com/docs/en/approvals-policy#advisory), so reviews follow your Code Review settings:

61 

62```yaml theme={null}

63# .claude/approvals.yml

64version: 1

65mode: observe

66rules:

67 - purpose: "A change takes two people."

68 paths: ["**"]

69 verdict: { claude: comments, seats: 2 }

70 advisory: [claude/code_review]

71 - purpose: "A change to the review rules takes two people."

72 paths: ["**/.claude/**"]

73 nested: inherit

74 verdict: { claude: comments, seats: 2 }

75```

76 

77## Turn on Approvals in observe mode

78 

79Add your policy file in a pull request of its own, then open a second pull request to see the **Claude Approvals** check:

80 

81**1. Add the policy file**

82 

83In a pull request of its own, from a branch in the repository, add the policy at `.claude/approvals.yml` in the repository's root.

84 

85**2. Merge the pull request**

86 

87Merge when Claude comments that it "found the policy file in this change valid". If the file is invalid, a failed check titled **This change breaks a policy file** appears. [Fix it](https://code.claude.com/docs/en/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses) in this pull request.

88 

89**3. Open another pull request**

90 

91Open one into the default branch that isn't a draft. A **Claude Approvals** check appears with a title that starts **(observe mode)**.

92 

93If nothing appears, see [No Claude Approvals check appeared](https://code.claude.com/docs/en/approvals-troubleshooting.md#no-claude-approvals-check-appeared).

94 

95## Enforce your policy and require Claude Approvals

96 

97Enforce the policy once the **Claude Approvals** check titles that you see in observe mode match what your reviewers decide. From then on, the check can block a merge, and [Claude can approve](https://code.claude.com/docs/en/approvals-github-rules.md#merges-without-human-review) where the policy allows it.

98 

99### Decide which files and branches to protect

100 

101Before you [switch your policy from observe mode to enforcement](#switch-from-observe-mode-to-enforcement), decide which files need a person, which branches the check gates, and when to change GitHub's required approvals:

102 

103* **Files**: decide which ones need a person's approval whatever Claude finds, then copy [this rule](https://code.claude.com/docs/en/approvals-github-rules.md#ask-for-a-person-who-isn’t-an-author) and narrow its `paths`

104* **Branches**: an enforced policy also covers pull requests into branches other than the default branch, so list each branch whose merges the **Claude Approvals** check should gate. On those branches, a pull request with no covered file gets no check, so a required check waits

105* **GitHub's required approvals**: [change the number of approvals that GitHub requires](https://code.claude.com/docs/en/approvals-github-rules.md#required-reviews-and-codeowners) only after the last step of the switch

106 

107### Switch from observe mode to enforcement

108 

109A policy file's [`mode`](https://code.claude.com/docs/en/approvals-policy#top-level-keys) is one of these:

110 

111* **`observe`**: the **Claude Approvals** check shows what the policy would decide, Claude doesn't approve, and the check [normally counts as passing](https://code.claude.com/docs/en/approvals-pull-requests.md#approvals-in-observe-mode)

112* **`enforce`**: the check can block a merge, and Claude can approve where the policy allows it. This is the default, so a policy file with no `mode` line is enforced

113 

114To enforce your policy, follow these steps. After the first step, an open pull request can keep a check that GitHub counts as passing until you rerun Approvals on it. Keep open pull requests out of the merge queue until you have rerun Approvals on them in step 2.

115 

116**1. Delete the mode: observe line**

117 

118Delete `mode: observe` and merge that change.

119 

120**2. Rerun Approvals on open pull requests**

121 

122Five minutes after the merge, comment `@claude approvals rerun` on each one whose check title starts with **(observe mode)** or **Observe mode ended**. On a pull request from a fork, [read the change first and add the latest commit's full SHA](https://code.claude.com/docs/en/approvals-pull-requests.md#pull-requests-from-forks-and-outside-contributors).

123 

124**3. Require Claude Approvals in GitHub**

125 

126For the default branch and each branch you listed, [require status checks to pass](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-status-checks-before-merging) and add **Claude Approvals**. As its source, select the Claude app that reported it.

127 

128**4. Confirm that Approvals blocks a merge**

129 

130Open a pull request that changes a file under `.claude/`. When the check finishes, the title reads **Waiting on human review from any person (1/2)**, and GitHub's merge box lists the check as required.

131 

132Approvals later evaluates some of the pull requests that you didn't rerun, which can start [billed runs](#what-approvals-costs).

133 

134### Set the source that GitHub accepts for Claude Approvals

135 

136Set the required check's source to the Claude app. With **any source**, GitHub accepts a check named **Claude Approvals** from elsewhere. To set the source through GitHub's API, put the Claude app's ID, `1236702`, in `integration_id` in a ruleset or `app_id` in a branch protection rule.

137 

138## Control what Approvals spends

139 

140Approvals bills your organization's usage credits for the model runs that a policy starts, and observe mode is billed. Billing can start, and [continues, while usage credits are turned off](https://code.claude.com/docs/en/claude-ship.md#how-each-claude-ship-agent-is-billed). To keep any policy file from starting billing, an Owner can [turn off Approvals](#turn-off-approvals) for the whole organization.

141 

142### What Approvals costs

143 

144A policy with `claude/code_review` in an `if` condition can start a [billed Code Review](https://code.claude.com/docs/en/code-review-costs.md) when a pull request opens and at each push. To stop those reviews, move it from the conditions to `advisory`. When `claude/code_review` is only under `advisory`, with no [`level`](https://code.claude.com/docs/en/approvals-classifiers#read-a-classifier’s-answer-from-a-rule), reviews follow your Code Review settings.

145 

146A rule can also read other [classifiers](https://code.claude.com/docs/en/approvals-classifiers.md). For `claude/diff` and custom classifiers, each [run that calls a model](https://code.claude.com/docs/en/approvals-classifiers.md#what-a-classifier-run-costs) is billed. To limit each run of a custom classifier, set its [`budget`](https://code.claude.com/docs/en/approvals-classifiers#budget).

147 

148### Limit what a policy costs

149 

150To cap what your organization pays for the Code Reviews and classifier runs that a policy starts, set a spend limit. Set any of these limits at [**Organization settings > Usage**](https://claude.ai/admin-settings/usage), which takes an Owner role:

151 

152* **Your organization's spend limit for usage credits**: covers Approvals

153* **Code Review's spend limit**: covers a policy's reviews together with Code Review's other reviews. Under **Services**, open the **Claude Code Review** row's menu and select **Edit spend limit**

154* **Classifier runs' spend limit**: under **Services**, open the Approvals row's menu and select **Edit spend limit**. The row has no limit when it appears

155 

156On that page, the **Claude Code Review** row under **Services** can start without a limit:

157 

158* **The row shows a dash where the limit goes**: a monthly limit is set for you when a policy's first billed review starts. Change it once the amount shows

159* **Code Review was turned on before your policy**: the row has no limit until you set one

160 

161If a reseller bills your organization, ask your reseller for a limit.

162 

163At Code Review's limit, a check that needs Claude's review can stop passing. Raise the limit or wait for the [next billing period](https://code.claude.com/docs/en/code-review-costs.md#limit-your-spend).

164 

165## Turn off Approvals

166 

167You can turn off Approvals for one repository, for a GitHub organization, or for your whole Claude organization.

168 

169> [!WARNING]

170>

171> Suspend or uninstall the Claude GitHub App, or unlink your GitHub organization, only after you turn off Approvals. If you do it first, new commits get no check, so a required check can block merges. GitHub can also continue to count Claude's approving reviews that are left on open pull requests.

172 

173Follow this order:

174 

1751. **Check how GitHub treats stale approvals**: where GitHub requires approvals, 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). Otherwise, GitHub can continue to count Claude's approving review after a new push, until you dismiss the review in the last step.

1762. **Stop requiring the check**: in GitHub, remove **Claude Approvals** from the required checks of each branch protection rule and ruleset.

1773. **Turn Approvals off**: [choose how](#ways-to-turn-off-approvals), by the scope that you want.

1784. **Dismiss Claude's reviews**: on open pull requests that Claude approved, dismiss that review in GitHub.

179 

180To stop the check from blocking without turning Approvals off, first stop requiring it on branches other than the default branch. Then put `mode: observe` in every policy file. The check then normally stops blocking, and classifiers still run and bill. Pull requests into those other branches get no check unless they change a policy or classifier file.

181 

182### Ways to turn off Approvals

183 

184To turn off Approvals, find the scope that you want in this table:

185 

186| Scope | How to turn off Approvals |

187| :- | :- |

188| One repository, without an Owner | Delete every policy file from the default branch |

189| A GitHub organization, or a repository whose **Edit** dialog shows **Claude Approvals** | With an [Owner role](https://code.claude.com/docs/en/server-managed-settings.md#access-control), go to [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship), click **Edit** on its row, and turn off **Claude Approvals** |

190| The whole Claude organization | With an Owner role, go to [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship) and click **Block globally** in the **Approve** row. To turn it back on, click **Allow policy files** in the same row |

191 

192What you turn off for the whole Claude organization stays off when a policy file merges later. If you're turning off Code Review too, turn off Approvals first, because a policy can start billed reviews where Code Review is off.

193 

194## Related resources

195 

196* [Claude Approvals policy file reference](https://code.claude.com/docs/en/approvals-policy.md): keys and an example policy

197* [Approvals and your GitHub rules](https://code.claude.com/docs/en/approvals-github-rules.md): what can merge without a person, and who can change the policy

198* [Troubleshoot Claude Approvals](https://code.claude.com/docs/en/approvals-troubleshooting.md): when no check appears, or the check refuses a policy file

approvals-troubleshooting.md +102 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Troubleshoot Claude Approvals

6 

7> Fix a Claude Approvals check that didn't appear or doesn't pass, a policy file that Approvals refuses, and a classifier that gives no answer

8 

9[Claude Approvals](https://code.claude.com/docs/en/approvals.md) is a check on GitHub pull requests that reports who still has to approve. Start here when the check didn't appear or doesn't pass, when Approvals refuses a policy file, or when a classifier gives no answer.

10 

11If the **Claude Approvals** check on your pull request has a title that isn't covered here, see [Find your approval status and what to do next](https://code.claude.com/docs/en/approvals-pull-requests.md#find-your-approval-status-and-what-to-do-next).

12 

13## No Claude Approvals check appeared

14 

15When [Claude Approvals](https://code.claude.com/docs/en/approvals.md) can't run, it can post nothing at all.

16 

17### Check your pull request and policy file

18 

19Start with the causes that you can check yourself:

20 

21| Cause | What to do |

22| :- | :- |

23| The pull request is a draft | Mark it ready for review |

24| The [policy file](https://code.claude.com/docs/en/approvals-policy.md#where-to-put-a-policy-file) isn't where Approvals looks | Put it at `.claude/approvals.yml` in the repository's root, on the default branch, with `version: 1` |

25| Nothing has happened since the file merged | Push a commit to the pull request |

26| The policy is in observe mode, and the pull request targets a branch other than the default branch | Expect no check, unless the pull request changes a policy or classifier file |

27| The policy is enforced, and no rule covers any file that the pull request changes | See [what happens when no rule covers a file](https://code.claude.com/docs/en/approvals-policy.md#how-rules-combine-into-one-verdict) |

28 

29### Claude left a comment and no Approvals check

30 

31Find the words of Claude's comment, then take the step beside them:

32 

33| Comment says | What to do |

34| :- | :- |

35| Approvals "did not run on this change" | Do what the comment says. One cause is a pull request that moves a file into or out of the paths that the policy's rules cover. Make that move in two pull requests, one that adds the file under its new name and one that removes the old one |

36| "More than one Claude organization is connected to this GitHub account" | Ask an Owner of the Claude organization that should run Approvals to click **Connect** next to the repository's GitHub organization on [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship). Then push a commit |

37| "Claude Approvals can't start in this repository yet" | Tell an Owner that the organization has no usage credits available |

38 

39### Ask an Owner to check your Claude organization

40 

41Ask an Owner to check each of these for your Claude organization:

42 

43| What to check | Where |

44| :- | :- |

45| Whether the organization qualifies | [Availability](https://code.claude.com/docs/en/approvals.md#availability) |

46| Whether the [Claude GitHub App](https://github.com/apps/claude) can access the repository and is linked | [**Organization settings > Git providers**](https://claude.ai/admin-settings/source-control) |

47| Whether Approvals is turned off here | The **Approvals** column and the **Approve** row on [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship) |

48 

49## Approvals doesn't pass after you resolve a review thread

50 

51Check whether your policy's [`findings`](https://code.claude.com/docs/en/approvals-policy#findings) list names you.

52 

53If your resolve doesn't count, push a fix, or ask someone on the list to resolve the thread.

54 

55## Approvals passed and GitHub still blocks merging

56 

57Read the rule that GitHub's merge box names. If it asks for a review, GitHub's branch rules require one that the policy doesn't, so have someone other than the author approve in a GitHub review. For what GitHub counts, see [Required reviews and CODEOWNERS](https://code.claude.com/docs/en/approvals-github-rules.md#required-reviews-and-codeowners).

58 

59## Fix a policy file that Approvals refuses

60 

61Find the **Claude Approvals** check's title in this table:

62 

63| Title | Copy at fault | Messages | What to do |

64| :- | :- | :- | :- |

65| **This change breaks a policy file** | The pull request's own | **Policy files in this change**, in the check's summary | Fix it in this pull request |

66| **Default branch policy file cannot be used**, **Default branch policy file must be version 1**, **Default branch policy file is too large** | The root policy file on the default branch | The check's summary | Fix it in a new pull request from a branch of this repository. Its **Policy files in this change** shows whether the new copy loads. That pull request's check fails, as every pull request's check does, in observe mode or enforced. Where the branch requires the check, ask someone who can bypass the branch rules to merge it |

67| **A policy file cannot be used** | A directory's policy file on the default branch | The check's summary | Fix it as you would the root policy file |

68 

69After the fix merges, allow five minutes, then comment [`@claude approvals rerun`](https://code.claude.com/docs/en/approvals-pull-requests#comment-commands-for-approvals) on each open pull request whose check hasn't updated. On one from a fork, [read the change first and add the latest commit's full SHA](https://code.claude.com/docs/en/approvals-pull-requests.md#pull-requests-from-forks-and-outside-contributors).

70 

71### Policy file refusal messages

72 

73One refusal makes the whole policy file unusable, and a warning fails nothing.

74 

75Find the beginning of your message here:

76 

77| Message | Fix |

78| :- | :- |

79| "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) |

80| "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 |

81| "a condition has no NOT" | Write the opposite operator |

82| "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 `@` |

83| "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 |

84 

85## A classifier gave no answer or its definition is refused

86 

87To 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).

88 

89Then find the **Claude Approvals** check's title here:

90 

91| Title | What to do |

92| :- | :- |

93| **A classifier definition is not valid**, or **This change breaks a policy file** where a policy file names the classifier | Fix the definition in this pull request. The refusal messages are under **Policy files in this change** |

94| **A classifier's definition cannot be used** | Fix the definition on the default branch. A pull request that changes it shows why it's refused |

95| **Cannot evaluate: classifier outside advisory** | With a policy file in a subdirectory, some custom classifiers [belong only under `advisory`](https://code.claude.com/docs/en/approvals-policy#policy-files-in-subdirectories). Move the classifier there |

96| **repo/change\_risk reached its run limit**, with your classifier's name, or **A classifier reached its run limit** | Push a change to the diff. Or comment `@claude approvals rerun` for one more run, which can drop every classifier's result, passing ones too |

97 

98## Related resources

99 

100* [Work with Claude Approvals on a pull request](https://code.claude.com/docs/en/approvals-pull-requests.md): check titles and comment commands

101* [Set up Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md): requirements, the starter policy, and the required check

102* [Claude Approvals policy file reference](https://code.claude.com/docs/en/approvals-policy.md): the policy file's keys

artifacts.md +0 −2

Details

81Add a per-region breakdown below the summary chart and republish.81Add a per-region breakdown below the summary chart and republish.

82```82```

83 83 

84Anyone with the page open sees the update in place. Each publish becomes a version, and from the **Share** control in the page header you can choose which version viewers see.

85 

86To update an artifact from a different session, give Claude its URL, or attach it with [`/artifacts`](#find-an-artifact-again). Without either, a new session creates a new artifact instead of updating one.84To update an artifact from a different session, give Claude its URL, or attach it with [`/artifacts`](#find-an-artifact-again). Without either, a new session creates a new artifact instead of updating one.

87 85 

88```text wrap theme={null}86```text wrap theme={null}

Details

6 6 

7> Tell the auto mode classifier which repos, buckets, and domains your organization trusts, set your own block and allow rules, and inspect your config.7> Tell the auto mode classifier which repos, buckets, and domains your organization trusts, set your own block and allow rules, and inspect your config.

8 8 

9[Auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations.9[Auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks what it judges irreversible, destructive, or aimed outside your environment. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations.

10 10 

11> [!NOTE]11> [!NOTE]

12>12>


55| :- | :- | :- |55| :- | :- | :- |

56| Prompt before the action | `permissions.ask` | By default, prompts for a command that matches a content-scoped rule like the recipe above. The classifier cannot auto-approve a matching action. |56| Prompt before the action | `permissions.ask` | By default, prompts for a command that matches a content-scoped rule like the recipe above. The classifier cannot auto-approve a matching action. |

57| Never run the action | `permissions.deny` | Blocks before the classifier is consulted. Neither the classifier nor user intent can override it. |57| Never run the action | `permissions.deny` | Blocks before the classifier is consulted. Neither the classifier nor user intent can override it. |

58| One-off boundary for this session | State it in conversation, like "don't push until I review" | The classifier blocks matching actions, but the boundary can be lost if [context compaction](https://code.claude.com/docs/en/costs.md#reduce-token-usage) removes the message that stated it. Use an ask or deny rule for a durable guarantee. |58| One-off boundary for this session | State it in conversation, like "don't push until I review" | The classifier blocks matching actions it reviews, but the boundary can be lost if [context compaction](https://code.claude.com/docs/en/costs.md#reduce-token-usage) removes the message that stated it. To keep the boundary from being lost, use an ask or deny rule instead. |

59 59 

60## Where the classifier reads configuration60## Where the classifier reads configuration

61 61 

champion-kit.md +1 −1

Details

123| - | - | - |123| - | - | - |

124| A dedicated channel | Create a `#claude-code` channel (or a recurring thread in an existing one), pin the [Quickstart](https://code.claude.com/docs/en/quickstart.md) link and one strong example, and answer questions publicly so each answer benefits everyone watching. | About five minutes to set up, then ambient |124| A dedicated channel | Create a `#claude-code` channel (or a recurring thread in an existing one), pin the [Quickstart](https://code.claude.com/docs/en/quickstart.md) link and one strong example, and answer questions publicly so each answer benefits everyone watching. | About five minutes to set up, then ambient |

125| A weekly show-and-tell thread | Each Friday, post "What did Claude help you with this week?" No preparation, slides, or meeting are required; screenshots and short descriptions are sufficient. | About two minutes per week |125| A weekly show-and-tell thread | Each Friday, post "What did Claude help you with this week?" No preparation, slides, or meeting are required; screenshots and short descriptions are sufficient. | About two minutes per week |

126| Share a custom skill | Post your most useful `.claude/skills/<name>/SKILL.md` file, for example a `/ship` skill that runs tests and lint before committing, with a one-line description. Because skills are plain Markdown, colleagues can adopt them immediately. | About five minutes per skill |126| Share a custom skill | Post your most useful `.claude/skills/<name>/SKILL.md` file, for example a `/precommit` skill that runs tests and lint before committing, with a one-line description. Because skills are plain Markdown, colleagues can adopt them immediately. | About five minutes per skill |

127| Generate a setup guide from your own usage | Run `/team-onboarding` in a project you have spent real time in. Claude scans your recent sessions, commands, and MCP servers, then produces a guide a new teammate can paste as their first message to replay your setup. Pin it in the channel. | About two minutes |127| Generate a setup guide from your own usage | Run `/team-onboarding` in a project you have spent real time in. Claude scans your recent sessions, commands, and MCP servers, then produces a guide a new teammate can paste as their first message to replay your setup. Pin it in the channel. | About two minutes |

128| Pair on a first task | Offer a single fifteen-minute pairing session to anyone getting started. One successful outcome on their own code is more persuasive than any presentation. | About fifteen minutes per person |128| Pair on a first task | Offer a single fifteen-minute pairing session to anyone getting started. One successful outcome on their own code is more persuasive than any presentation. | About fifteen minutes per person |

129| Identify the next champion | The colleague who asks you the most questions is usually ready to take on this role. Forward them this page and divide the channel responsibilities between you. | Negligible |129| Identify the next champion | The colleague who asks you the most questions is usually ready to take on this role. Forward them this page and divide the channel responsibilities between you. | Negligible |

Details

38 38 

39## What you need39## What you need

40 40 

41The only hard requirement is the [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk) package and a Node.js-compatible runtime. [Bun](https://bun.sh), [Node](https://nodejs.org), and [Deno](https://deno.com) all work. The pre-built plugins in the research preview use Bun, but your channel doesn't have to.41The only hard requirement is the [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk) package and a Node.js-compatible runtime. [Bun](https://bun.sh), [Node](https://nodejs.org), and [Deno](https://deno.com) all work.

42 42 

43Your server needs to:43Your server needs to:

44 44 


255 255 

256## Expose a reply tool256## Expose a reply tool

257 257 

258If your channel is two-way, like a chat bridge rather than an alert forwarder, expose a standard [MCP tool](https://modelcontextprotocol.io/docs/concepts/tools) that Claude can call to send messages back. Nothing about the tool registration is channel-specific. A reply tool has three components:258If your channel is two-way, like a chat bridge rather than an alert forwarder, expose a standard [MCP tool](https://modelcontextprotocol.io/docs/concepts/tools) that Claude can call to send messages back. A reply tool has three components:

259 259 

2601. A `tools: {}` entry in your `Server` constructor capabilities so Claude Code discovers the tool2601. A `tools: {}` entry in your `Server` constructor capabilities so Claude Code discovers the tool

2612. Tool handlers that define the tool's schema and implement the send logic2612. Tool handlers that define the tool's schema and implement the send logic

chrome.md +3 −1

Details

111>111>

112> Enabling Chrome by default increases context usage since the browser tools and their instructions are always loaded. If you notice increased context consumption, turn the setting off and connect only when needed, with `--chrome` in the CLI or by typing [`@browser`](https://code.claude.com/docs/en/vs-code#automate-browser-tasks-with-chrome) in the VS Code prompt box.112> Enabling Chrome by default increases context usage since the browser tools and their instructions are always loaded. If you notice increased context consumption, turn the setting off and connect only when needed, with `--chrome` in the CLI or by typing [`@browser`](https://code.claude.com/docs/en/vs-code#automate-browser-tasks-with-chrome) in the VS Code prompt box.

113 113 

114To start one CLI session without Chrome and leave the setting on, run [`claude --no-chrome`](https://code.claude.com/docs/en/cli-reference#cli-flags) in your terminal.

115 

114### Answer the startup dialog116### Answer the startup dialog

115 117 

116If the "Claude in Chrome extension detected" dialog appears when you start `claude`, your answer changes the [**Enabled by default** setting](#enable-chrome-by-default):118If the "Claude in Chrome extension detected" dialog appears when you start `claude`, your answer changes the [**Enabled by default** setting](#enable-chrome-by-default):


126 128 

127### Permission prompts in VS Code sessions129### Permission prompts in VS Code sessions

128 130 

129In a VS Code session, when Claude Code asks before a browser action, the prompt appears as a card in the chat panel. When the action targets a site you haven't allowed, the card also offers to allow that site.131In a VS Code session, when Claude Code asks before a browser action, the prompt appears as a card in the chat panel.

130 132 

131In a session that connected to your browser at start because [Enabled by default](#enable-chrome-by-default) is on, Claude Code asks you before browser actions on a site you haven't allowed, in Manual, Edit automatically, Auto, and Bypass permissions modes. In Auto and Bypass permissions modes, this applies until you type `@browser` in that session.133In a session that connected to your browser at start because [Enabled by default](#enable-chrome-by-default) is on, Claude Code asks you before browser actions on a site you haven't allowed, in Manual, Edit automatically, Auto, and Bypass permissions modes. In Auto and Bypass permissions modes, this applies until you type `@browser` in that session.

132 134 

Details

69 69 

70| You need | Details |70| You need | Details |

71| - | - |71| - | - |

72| Claude Code v2.1.195 or later | The `claude gateway` subcommand and the gateway sign-in flow ship in v2.1.195. Earlier public builds don't include them. Both the machine running the gateway server and each developer's machine must be on v2.1.195 or later; run `claude update` to get the latest release. The [Claude Platform on AWS upstream](https://code.claude.com/docs/en/claude-apps-gateway-config.md#claude-platform-on-aws) requires Claude Code v2.1.198 or later on the gateway server. |72| Claude Code v2.1.195 or later | The `claude gateway` subcommand and the gateway sign-in flow ship in v2.1.195. Both the machine running the gateway server and each developer's machine must be on v2.1.195 or later; run `claude update` to get the latest release. The [Claude Platform on AWS upstream](https://code.claude.com/docs/en/claude-apps-gateway-config.md#claude-platform-on-aws) requires Claude Code v2.1.198 or later on the gateway server. |

73| OpenID Connect (OIDC) identity provider | Okta, Microsoft Entra ID, Google Workspace, Keycloak, or Dex, or any other OIDC-compliant IdP such as PingFederate. The gateway runs standard OIDC discovery and the authorization-code flow against it. SAML and LDAP aren't supported. |73| OpenID Connect (OIDC) identity provider | Okta, Microsoft Entra ID, Google Workspace, Keycloak, or Dex, or any other OIDC-compliant IdP such as PingFederate. The gateway runs standard OIDC discovery and the authorization-code flow against it. SAML and LDAP aren't supported. |

74| PostgreSQL 11 or later | Backs the device sign-in flow and rate-limit counters. A managed PostgreSQL service works, including the smallest tier; see [which databases are supported](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#postgres). With [spend limits](https://code.claude.com/docs/en/claude-apps-gateway-spend-limits.md), it also holds durable spend, audit, and identity tables that should be backed up. TLS via `?sslmode=require` is recommended. PostgreSQL 11, 12, and 13 require Claude Code v2.1.290 or later on the gateway server. The PostgreSQL project no longer maintains those versions, so use a newer one where you can. |74| PostgreSQL 11 or later | Backs the device sign-in flow and rate-limit counters. A managed PostgreSQL service works, including the smallest tier; see [which databases are supported](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#postgres). With [spend limits](https://code.claude.com/docs/en/claude-apps-gateway-spend-limits.md), it also holds durable spend, audit, and identity tables that should be backed up. TLS via `?sslmode=require` is recommended. PostgreSQL 11, 12, and 13 require Claude Code v2.1.290 or later on the gateway server. The PostgreSQL project no longer maintains those versions, so use a newer one where you can. |

75| Model upstream | Amazon Bedrock credentials, Claude Platform on AWS credentials, Google Cloud credentials, a Microsoft Foundry resource, or an Anthropic API key. Multiple upstreams are supported with failover. |75| Model upstream | Amazon Bedrock credentials, Claude Platform on AWS credentials, Google Cloud credentials, a Microsoft Foundry resource, or an Anthropic API key. Multiple upstreams are supported with failover. |


138 138 

139**4. Run it**139**4. Run it**

140 140 

141Build a container image around the `claude` binary that meets the [image requirements](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#container-image), then run it alongside Postgres. The Compose file references the image as `registry.example.com/claude-gateway:2.1.198`; substitute your own registry and image tag:141Build a container image around the `claude` binary that meets the [image requirements](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#container-image), then run it alongside Postgres. The Compose file references the image as `registry.example.com/claude-gateway:<version>`; substitute your own registry and image tag:

142 142 

143```yaml docker-compose.yaml theme={null}143```yaml docker-compose.yaml theme={null}

144services:144services:

145 gateway:145 gateway:

146 image: registry.example.com/claude-gateway:2.1.198146 image: registry.example.com/claude-gateway:<version>

147 ports: ["8080:8080"]147 ports: ["8080:8080"]

148 volumes: ["./gateway.yaml:/etc/claude/gateway.yaml:ro"]148 volumes: ["./gateway.yaml:/etc/claude/gateway.yaml:ro"]

149 environment:149 environment:


185[gateway] 2026-06-10T17:03:21.512Z info claude gateway listening on http://0.0.0.0:8080185[gateway] 2026-06-10T17:03:21.512Z info claude gateway listening on http://0.0.0.0:8080

186```186```

187 187 

188The gateway also logs a warning that `access_control.allow_cidrs` is empty. That's expected here, because nothing limits which client addresses the gateway serves until you set an allow list. The [`access_control` reference](https://code.claude.com/docs/en/claude-apps-gateway-config#http-tuning) has the recommended ranges.188The startup banner reminds you each time to keep the gateway on your private network. With this config, the gateway serves any client address. To limit which addresses it serves, set `access_control`; the [`access_control` reference](https://code.claude.com/docs/en/claude-apps-gateway-config#http-tuning) has the recommended ranges.

189 189 

190If boot exits before the `claude gateway listening on` line, the last line of stderr names the problem:190If boot exits before the `claude gateway listening on` line, the last line of stderr names the problem:

191 191 

Details

1472 1472 

1473To change what the picker offers, use one of these:1473To change what the picker offers, use one of these:

1474 1474 

1475* **Start users on the 1M option**: set `modelPrefer1mContext: true` in the policy's `desktop` block. Users who haven't yet chosen a model start on the 1M option when the first listed model has one. Users who already chose a model keep their choice.1475* **Show only the 1M option**: set [`modelPrefer1mContext`](https://claude.com/docs/third-party/claude-desktop/configuration#modelprefer1mcontext) to `true` in the policy's `desktop` block. You need Claude Desktop 2.31226.0 or later on members' machines.

1476* **Offer the option by hand**: do this if your gateway server runs a version older than v2.1.284, or an entry names no Claude model. List the model twice in `models`, once with its plain ID and once with `[1m]` appended, both with the same `upstream_model` map. Claude Desktop shows the pair as one model with a 1M option. The gateway serves a `[1m]` entry without checking it, so add one only for a model your upstreams serve at 1M.1476* **Offer the option by hand**: do this if your gateway server runs a version older than v2.1.284, or an entry names no Claude model. List the model twice in `models`, once with its plain ID and once with `[1m]` appended, both with the same `upstream_model` map. Claude Desktop shows the pair as one model with a 1M option. The gateway serves a `[1m]` entry without checking it, so add one only for a model your upstreams serve at 1M.

1477 1477 

1478This example offers the option by hand for a custom alias routed to an application inference profile, and starts new users on it:1478This example lists a custom alias and its `[1m]` variant, both routed to an application inference profile, and sets `modelPrefer1mContext`:

1479 1479 

1480```yaml theme={null}1480```yaml theme={null}

1481models:1481models:


1697 1697 

1698If you leave both `access_control` lists empty, which is the default, the gateway serves any client address, so only your network restricts who can reach it. That matters because a gateway can push [managed settings](#managed) that run commands on developer machines.1698If you leave both `access_control` lists empty, which is the default, the gateway serves any client address, so only your network restricts who can reach it. That matters because a gateway can push [managed settings](#managed) that run commands on developer machines.

1699 1699 

1700While `allow_cidrs` is empty, the gateway warns in two places, without changing how it answers any request:1700To refuse clients from outside your network, set `allow_cidrs` to these private ranges, plus any other internal ranges your developers connect from:

1701 1701 

1702* **At boot**: a warning in the operational log recommends allowing only the private ranges `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `100.64.0.0/10`, `127.0.0.0/8`, `::1/128`, and `fc00::/7`, plus any other internal ranges your developers connect from. If you bind the gateway to a loopback address and set neither `trusted_proxies` nor `public_url`, as in local development, the warning doesn't appear.1702* **IPv4**: `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `100.64.0.0/10`, and `127.0.0.0/8`

1703* **At runtime**: the first time a request arrives from an address outside those private ranges, the gateway logs a warning and emits an [`access.public_client` audit event](https://code.claude.com/docs/en/claude-apps-gateway-deploy#logs) carrying the client IP. Both fire once per process. Link-local addresses, `169.254.0.0/16` and `fe80::/10`, don't count as public. The gateway answers `/healthz` and `/readyz` before this check runs, so health probes from public ranges don't trigger it.1703* **IPv6**: `::1/128` and `fc00::/7`

1704 

1705While `allow_cidrs` is empty, the gateway watches for requests from outside the private ranges above, without changing how it answers them:

1706 

1707* **Once per process**: when it serves such a request, the gateway logs a warning and emits an [`access.public_client` audit event](https://code.claude.com/docs/en/claude-apps-gateway-deploy#logs) carrying the client IP.

1708* **Not counted as public**: link-local addresses, `169.254.0.0/16` and `fe80::/10`.

1709* **Not checked**: health probes to `/healthz` and `/readyz`, which the gateway answers before this check runs.

1704 1710 

1705Both signals use the client address as the gateway resolves it. If a load balancer, port-forward, or tunnel relays traffic and isn't listed in `listen.trusted_proxies`, the gateway sees the relay's address, which is usually private, so neither the runtime warning nor a private allow list catches traffic relayed through it.1711Both signals use the client address as the gateway resolves it. If a load balancer, port-forward, or tunnel relays traffic and isn't listed in `listen.trusted_proxies`, the gateway sees the relay's address, which is usually private, so neither the runtime warning nor a private allow list catches traffic relayed through it.

1706 1712 

Details

185 185 

186`severity` is the log level in capitals, with `warn` written as `WARNING`. A failed start is an `ERROR` line.186`severity` is the log level in capitals, with `warn` written as `WARNING`. A failed start is an `ERROR` line.

187 187 

188On every start, the gateway also writes one `WARNING` line reminding you to keep it off the public internet, whatever your network setup. To hide it, set `CLAUDE_GATEWAY_LOG_LEVEL=error` in the gateway's environment; your collector then gets only the operational log's `ERROR` lines.

189 

188Audit events, which also go to stderr, don't change. They carry `ts` and `evt`, and no `severity`.190Audit events, which also go to stderr, don't change. They carry `ts` and `evt`, and no `severity`.

189 191 

190### Health192### Health


442| Every Amazon Bedrock request returns 502; log shows `Could not load credentials from any providers` | On EC2, IMDSv2's default hop limit of 1 blocks the instance-metadata request from inside the container. Boot and `/readyz` pass anyway because the AWS SDK resolves instance credentials on the first request, not at client construction | Raise the hop limit with `aws ec2 modify-instance-metadata-options --instance-id <id> --http-put-response-hop-limit 2`, or set it in the launch template. The change applies to every container on the instance. Prefer ECS task roles where available, which read credentials from the ECS container-credentials endpoint and avoid the change entirely, or apply the change on a dedicated gateway instance to limit the exposure. |444| Every Amazon Bedrock request returns 502; log shows `Could not load credentials from any providers` | On EC2, IMDSv2's default hop limit of 1 blocks the instance-metadata request from inside the container. Boot and `/readyz` pass anyway because the AWS SDK resolves instance credentials on the first request, not at client construction | Raise the hop limit with `aws ec2 modify-instance-metadata-options --instance-id <id> --http-put-response-hop-limit 2`, or set it in the launch template. The change applies to every container on the instance. Prefer ECS task roles where available, which read credentials from the ECS container-credentials endpoint and avoid the change entirely, or apply the change on a dedicated gateway instance to limit the exposure. |

443| Log: a warning that contains `upstream <name>: Google issued an access token that expires in <N>s`, on an upstream whose Google credentials file has type `external_account` | Requests succeed until that access token expires, then fail unless the token `credential_source` points to was renewed first. | If a process writes that token to a file, have it write a new one more than five minutes before the old one expires |445| Log: a warning that contains `upstream <name>: Google issued an access token that expires in <N>s`, on an upstream whose Google credentials file has type `external_account` | Requests succeed until that access token expires, then fail unless the token `credential_source` points to was renewed first. | If a process writes that token to a file, have it write a new one more than five minutes before the old one expires |

444| At peak load, responses are slow to start or appear to hang, or fail with a 502 `all upstreams failed` while the upstream is healthy | A replica has more requests open than it sends upstream at once, so the extra requests wait inside the gateway. On a `provider: anthropic` upstream, a request that waits longer than `timeouts.upstream_ttfb_ms` gives up on that upstream, which produces the 502 when no later upstream serves it. The log shows a warning that contains `client requests are open`. | Add replicas, or raise the limit on each replica. See [Concurrent upstream requests](#concurrent-upstream-requests). |446| At peak load, responses are slow to start or appear to hang, or fail with a 502 `all upstreams failed` while the upstream is healthy | A replica has more requests open than it sends upstream at once, so the extra requests wait inside the gateway. On a `provider: anthropic` upstream, a request that waits longer than `timeouts.upstream_ttfb_ms` gives up on that upstream, which produces the 502 when no later upstream serves it. The log shows a warning that contains `client requests are open`. | Add replicas, or raise the limit on each replica. See [Concurrent upstream requests](#concurrent-upstream-requests). |

445| On an upstream other than `provider: anthropic`, a turn with a long thinking pause fails. The proxy in front of the gateway logs one request that stays open for about 12.5 minutes, then a run of `504` errors | Claude Code ended a stream that had delivered its first response event and then carried only keepalive pings. It re-sent the request without streaming, and each reply takes longer than the proxy's timeout. | Raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for your developers. See [Long thinking ends in proxy timeouts](#long-thinking-ends-in-proxy-timeouts). |447| On an upstream other than `provider: anthropic`, a turn with a long thinking pause fails. The proxy in front of the gateway logs one or two requests, each open for about 12.5 minutes, then a run of `504` errors | Claude Code ended a stream that had delivered its first response event and then carried only keepalive pings. It re-sent the request without streaming, and each reply takes longer than the proxy's timeout. | Raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for your developers. See [Long thinking ends in proxy timeouts](#long-thinking-ends-in-proxy-timeouts). |

446| On `provider: anthropic`, a turn with a long thinking pause fails. The proxy logs one request open for about 20 minutes, then `502` or `504` errors | Claude Code ended a stream that had delivered its first response event and then carried only keepalive pings. It re-sent the request without streaming, and each reply takes longer than the gateway's wait on the upstream, `timeouts.upstream_ttfb_ms`, or the proxy's timeout. | Raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for your developers. See [Long thinking on an Anthropic API upstream](#long-thinking-on-an-anthropic-api-upstream). |448| On `provider: anthropic`, a turn with a long thinking pause fails. The proxy logs one or two requests, each open for about 20 minutes, then `502` or `504` errors | Claude Code ended a stream that had delivered its first response event and then carried only keepalive pings. It re-sent the request without streaming. Each reply takes longer than the gateway's `timeouts.upstream_ttfb_ms` wait or the proxy's timeout. | Raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for your developers. See [Long thinking on an Anthropic API upstream](#long-thinking-on-an-anthropic-api-upstream). |

447| A developer's requests fail with `API Error: 400 you aren't in a group that can use this gateway. Ask your administrator to add you to one` | Every upstream has a [`groups` list](https://code.claude.com/docs/en/claude-apps-gateway-config#what-happens-when-a-developer-is-in-no-listed-group), and the developer's session carries none of the listed groups. | Add the developer to a listed group in your IdP, or list an upstream with no `groups` last to serve everyone else. The gateway reads groups again at the developer's next token refresh. If the IdP left groups out and its userinfo endpoint returns them, set [`oidc.userinfo_fallback: true`](https://code.claude.com/docs/en/claude-apps-gateway-config#oidc). |449| A developer's requests fail with `API Error: 400 you aren't in a group that can use this gateway. Ask your administrator to add you to one` | Every upstream has a [`groups` list](https://code.claude.com/docs/en/claude-apps-gateway-config#what-happens-when-a-developer-is-in-no-listed-group), and the developer's session carries none of the listed groups. | Add the developer to a listed group in your IdP, or list an upstream with no `groups` last to serve everyone else. The gateway reads groups again at the developer's next token refresh. If the IdP left groups out and its userinfo endpoint returns them, set [`oidc.userinfo_fallback: true`](https://code.claude.com/docs/en/claude-apps-gateway-config#oidc). |

448| IdP error: unknown or unsupported scope | The IdP rejects scopes it doesn't recognize | Set `oidc.scopes` to exactly the list your IdP accepts; it must include `openid`. The default is `openid profile email offline_access`. |450| IdP error: unknown or unsupported scope | The IdP rejects scopes it doesn't recognize | Set `oidc.scopes` to exactly the list your IdP accepts; it must include `openid`. The default is `openid profile email offline_access`. |

449| Sessions don't silently renew after setting `oidc.scopes` | `offline_access` was dropped from the override | Add `offline_access` back if your IdP supports it. Without a refresh token, developers re-run the browser login every `session.ttl_hours`. |451| Sessions don't silently renew after setting `oidc.scopes` | `offline_access` was dropped from the override | Add `offline_access` back if your IdP supports it. Without a refresh token, developers re-run the browser login every `session.ttl_hours`. |


484 486 

485If your upstream is `provider: anthropic`, use [Long thinking on an Anthropic API upstream](#long-thinking-on-an-anthropic-api-upstream) instead: you raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` there too, but the times and errors differ.487If your upstream is `provider: anthropic`, use [Long thinking on an Anthropic API upstream](#long-thinking-on-an-anthropic-api-upstream) instead: you raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` there too, but the times and errors differ.

486 488 

487If turns fail after long thinking and your proxy logs one request open for about 12.5 minutes, then a run of `504` errors, raise [`CLAUDE_STREAM_IDLE_TIMEOUT_MS`](https://code.claude.com/docs/en/env-vars) in a gateway policy. For example, with a 240-second idle timeout on the proxy, the run is 10 requests, each cut at 240 seconds.489If turns fail after long thinking and your proxy logs one or two roughly 12.5-minute requests followed by a run of `504` errors, raise [`CLAUDE_STREAM_IDLE_TIMEOUT_MS`](https://code.claude.com/docs/en/env-vars) in a gateway policy.

488 490 

489* **The first request**: a stream that delivers its first response event, `message_start`, and then only pings while Claude thinks. With default settings, Claude Code ends that stream after about 12.5 minutes.491* **Each long request**: a stream that delivers its first response event, `message_start`, and then only pings while Claude thinks. With default settings, Claude Code ends that stream after about 12.5 minutes.

490* **The other 10**: the same request, sent [without streaming](https://code.claude.com/docs/en/errors.md#streaming-response-ended-before-any-complete-data-was-received) and then retried, 10 sends in all by default. They get no pings, so a slow reply hits the proxy's timeout.492* **The `504` errors**: Claude Code re-sends the request [without streaming](https://code.claude.com/docs/en/errors.md#streaming-response-ended-before-any-complete-data-was-received), then retries. Those requests get no pings, so a slow reply hits the proxy's timeout. For example, with a 240-second idle timeout on the proxy, each one ends at 240 seconds.

491 493 

492You don't need a longer proxy timeout for this fix. If you raise only the proxy's timeout, requests without streaming still fail once a reply takes longer than Claude Code's own wait, 300 seconds by default.494You don't need a longer proxy timeout for this fix. If you raise only the proxy's timeout, requests without streaming still fail once a reply takes longer than Claude Code's own wait, 300 seconds by default.

493 495 


511| `900000` | About 22.5 minutes |513| `900000` | About 22.5 minutes |

512| `1800000` | About 37.5 minutes |514| `1800000` | About 37.5 minutes |

513 515 

514If an upstream hangs while the gateway keeps sending pings, your developers also wait that long before Claude Code gives up on the stream.516If an upstream hangs while the gateway keeps sending pings, plan for up to two streams of that length before Claude Code gives up on streaming.

515 517 

516#### Deliver the value in a policy518#### Deliver the value in a policy

517 519 


532 534 

533### Long thinking on an Anthropic API upstream535### Long thinking on an Anthropic API upstream

534 536 

535If `provider: anthropic` is the model's only upstream and your proxy logs one request open for about 20 minutes, then `502` or `504` errors, raise [`CLAUDE_STREAM_IDLE_TIMEOUT_MS`](https://code.claude.com/docs/en/env-vars) in a gateway policy.537If `provider: anthropic` is the model's only upstream and your proxy logs one or two roughly 20-minute requests followed by `502` or `504` errors, raise [`CLAUDE_STREAM_IDLE_TIMEOUT_MS`](https://code.claude.com/docs/en/env-vars) in a gateway policy.

536 538 

537* **The long request**: a stream that delivers `message_start` and then only pings while Claude thinks. Claude Code ends it after about 20 minutes with default settings, and later once you raise the variable.539* **Each long request**: a stream that delivers `message_start` and then only pings while Claude thinks. Claude Code ends it after about 20 minutes with default settings, and later once you raise the variable.

538* **The errors**: requests that Claude Code then sends [without streaming](https://code.claude.com/docs/en/errors.md#streaming-response-ended-before-any-complete-data-was-received). Each one fails with a `502` from the gateway, or with your proxy's `504` if the proxy's timeout is shorter than the gateway's wait. That wait is [`timeouts.upstream_ttfb_ms`](https://code.claude.com/docs/en/claude-apps-gateway-config#http-tuning), which you don't need to raise for this fix.540* **The errors**: requests that Claude Code then sends [without streaming](https://code.claude.com/docs/en/errors.md#streaming-response-ended-before-any-complete-data-was-received). Each one fails with a `502` from the gateway, or with your proxy's `504` if the proxy's timeout is shorter than the gateway's wait. That wait is [`timeouts.upstream_ttfb_ms`](https://code.claude.com/docs/en/claude-apps-gateway-config#http-tuning), which you don't need to raise for this fix.

539 541 

540To confirm the cause, see [Confirm the cause](#confirm-the-cause).542To confirm the cause, see [Confirm the cause](#confirm-the-cause).

Details

118 --ranges="google-managed-services-${VPC}" --network="$VPC"118 --ranges="google-managed-services-${VPC}" --network="$VPC"

119 119 

120gcloud sql instances create claude-gateway-db \120gcloud sql instances create claude-gateway-db \

121 --database-version=POSTGRES_16 --tier=db-g1-small --region="$REGION" \121 --database-version=POSTGRES_16 --edition=enterprise --tier=db-g1-small --region="$REGION" \

122 --network="projects/${PROJECT_ID}/global/networks/${VPC}" --no-assign-ip122 --network="projects/${PROJECT_ID}/global/networks/${VPC}" --no-assign-ip

123gcloud sql databases create claude_gateway --instance=claude-gateway-db123gcloud sql databases create claude_gateway --instance=claude-gateway-db

124PGPASS="$(openssl rand -hex 24)"124PGPASS="$(openssl rand -hex 24)"


271> iam.gke.io/gcp-service-account="claude-gateway@${PROJECT_ID}.iam.gserviceaccount.com"271> iam.gke.io/gcp-service-account="claude-gateway@${PROJECT_ID}.iam.gserviceaccount.com"

272> ```272> ```

273>273>

274> An internal Ingress needs a proxy-only subnet in `$REGION` on the VPC, and a firewall rule that allows traffic from that subnet to port `8080` on the gateway pods. Create both as Google's [internal Ingress guide](https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balance-ingress) describes.

275>

274> Deploy the gateway as a standard Deployment plus a Service and an internal Ingress, class `gce-internal`, as described in [Kubernetes deployment](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#kubernetes), with:276> Deploy the gateway as a standard Deployment plus a Service and an internal Ingress, class `gce-internal`, as described in [Kubernetes deployment](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#kubernetes), with:

275>277>

276> * `serviceAccountName: gateway`278> * `serviceAccountName: gateway`

Details

281 281 

282### Manage context282### Manage context

283 283 

284Cloud sessions support [built-in commands](https://code.claude.com/docs/en/commands.md) that produce text output. Commands that only run in the terminal interface, such as `/plugin` or `/resume`, aren't available. Commands that open a picker or panel in the terminal behave differently in cloud sessions:284Cloud sessions support [built-in commands](https://code.claude.com/docs/en/commands.md) that produce text output. Commands that only run in the terminal interface, such as `/resume`, aren't available. Commands that open a picker or panel in the terminal behave differently in cloud sessions:

285 285 

286* **`/model`, `/effort`, `/color`, and `/rename`**: pass the value as an argument, for example `/model sonnet`, instead of opening the terminal picker or slider. The argument forms follow each command's [availability notes](https://code.claude.com/docs/en/commands.md#all-commands).286* **`/model`, `/effort`, `/color`, and `/rename`**: pass the value as an argument, for example `/model sonnet`, instead of opening the terminal picker or slider. The argument forms follow each command's [availability notes](https://code.claude.com/docs/en/commands.md#all-commands).

287* **`/fast`**: toggles [fast mode](https://code.claude.com/docs/en/fast-mode.md#use-fast-mode-in-cloud-sessions) for the session when fast mode is [available on your account](https://code.claude.com/docs/en/fast-mode.md#requirements). Requires Claude Code v2.1.271 or later in the session's environment.287* **`/fast`**: toggles [fast mode](https://code.claude.com/docs/en/fast-mode.md#use-fast-mode-in-cloud-sessions) for the session when fast mode is [available on your account](https://code.claude.com/docs/en/fast-mode.md#requirements). Requires Claude Code v2.1.271 or later in the session's environment.


335 335 

336### Share sessions336### Share sessions

337 337 

338To share a session, toggle its visibility according to the account types below. After that, share the session link as-is. Recipients see the latest state when they open the link, but their view doesn't update in real time.338See [Share a cloud or Remote Control session](https://code.claude.com/docs/en/share-sessions.md) for how to share a session by link, what recipients can read, and how to stop sharing.

339 

340#### Share from an Enterprise or Team account

341 

342Sharing works as follows for Enterprise and Team accounts:

343 

344* **Visibility options**: **Private** and **Team**. Team visibility makes the session visible to other members of your claude.ai organization

345* **Repository access**: verification is enabled by default, based on the GitHub account connected to the recipient's account

346* **Your name**: your account's display name is visible to all recipients with access

347* **Slack sessions**: [Claude in Slack](https://code.claude.com/docs/en/slack.md) sessions are automatically shared with Team visibility

348 

349#### Share from a Max, Ultra, or Pro account

350 

351* **Visibility options**: **Private** and **Public**. Public visibility makes the session visible to any user logged into claude.ai

352* **Repository access**: verification isn't enabled by default

353* **Sensitive content**: check your session before sharing. Sessions may contain code and credentials from private GitHub repositories

354 

355To require recipients to have repository access, or to hide your name from shared sessions, open Settings on claude.ai, then:

356 

357* **If the Settings menu shows Code instead of Claude Code**: go to [**Privacy**](https://claude.ai/settings/data-privacy-controls), which has these settings

358* **Otherwise**: go to [**Claude Code > Sharing settings**](https://claude.ai/settings/claude-code)

359 339 

360### Archive sessions340### Archive sessions

361 341 


392 372 

393To stop monitoring, turn off **Auto-fix** in the pull request's **⋮** menu in the session's [**Changes** card](#review-changes), or tell Claude to stop watching the PR.373To stop monitoring, turn off **Auto-fix** in the pull request's **⋮** menu in the session's [**Changes** card](#review-changes), or tell Claude to stop watching the PR.

394 374 

375In a repository where PR Steward works on your pull requests, the **Auto-fix** toggle is unavailable. A request to auto-fix a pull request that PR Steward is watching fails. See [Auto-fix is unavailable](https://code.claude.com/docs/en/pr-steward-troubleshooting.md#auto-fix-is-unavailable).

376 

395### How Claude responds to PR activity377### How Claude responds to PR activity

396 378 

397When auto-fix is active, Claude receives GitHub events for the PR including new review comments and CI check failures. For each event, Claude investigates and decides how to proceed:379When auto-fix is active, Claude receives GitHub events for the PR including new review comments and CI check failures. For each event, Claude investigates and decides how to proceed:

Details

321| `feedback-bundles/` | Redacted transcript archives written by `/feedback` on third-party providers or when no Anthropic credentials are configured, for sending to your Anthropic account team |321| `feedback-bundles/` | Redacted transcript archives written by `/feedback` on third-party providers or when no Anthropic credentials are configured, for sending to your Anthropic account team |

322| `feedback/drafts/` | Queued [Claude-drafted feedback](https://code.claude.com/docs/en/tools-reference.md#sendfeedback-tool-behavior) awaiting your review in `/feedback`. Swept after `cleanupPeriodDays` or 30 days, whichever is shorter. When the queue is at its 10-draft limit, Claude Code deletes the oldest draft to make room. |322| `feedback/drafts/` | Queued [Claude-drafted feedback](https://code.claude.com/docs/en/tools-reference.md#sendfeedback-tool-behavior) awaiting your review in `/feedback`. Swept after `cleanupPeriodDays` or 30 days, whichever is shorter. When the queue is at its 10-draft limit, Claude Code deletes the oldest draft to make room. |

323| `usage-data/` | `report.html` and timestamped report copies written by [`/insights`](https://code.claude.com/docs/en/costs#analyze-your-usage-patterns), plus cached per-session analysis data used to build them |323| `usage-data/` | `report.html` and timestamped report copies written by [`/insights`](https://code.claude.com/docs/en/costs#analyze-your-usage-patterns), plus cached per-session analysis data used to build them |

324| `skills/.trash/`, `plugins/.trash/` | [Skills](https://code.claude.com/docs/en/skills.md#how-synced-skills-behave) and [plugins](https://code.claude.com/docs/en/plugins/loading.md#synced-plugins) that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing. The files stay here so you can recover them until the sweep deletes them |324| `skills/.trash/`, `plugins/.trash/` | [Skills](https://code.claude.com/docs/en/skills.md#how-synced-skills-behave) and [plugins](https://code.claude.com/docs/en/plugins/loading.md#synced-plugins) that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing. Recover them here. Claude Code can delete a folder before the age cutoff when it's over 7 days old and has three newer copies, or when `.trash/` holds over 1,024 folders |

325| `plugins/installed_plugins.set-aside.<date>.<hash>.json`, `plugins/installed_plugins.unreadable.<date>.<hash>.kept` | Dated copies Claude Code makes before rewriting [`installed_plugins.json`](https://code.claude.com/docs/en/plugins/loading#find-plugins-on-disk): install records it dropped, and the contents of a file it couldn't read. |325| `plugins/installed_plugins.set-aside.<date>.<hash>.json`, `plugins/installed_plugins.unreadable.<date>.<hash>.kept` | Dated copies Claude Code makes before rewriting [`installed_plugins.json`](https://code.claude.com/docs/en/plugins/loading#find-plugins-on-disk): install records it dropped, and the contents of a file it couldn't read. |

326| `plugins/data/.set-aside/` | Data directories of plugins from a marketplace that your organization replaced with one of the same name. Their age counts from the day Claude Code moved them, and a shorter `cleanupPeriodDays` in project settings doesn't apply. To keep one, move it somewhere else before the sweep deletes it. |326| `plugins/data/.set-aside/` | Data directories of plugins from a marketplace that your organization replaced with one of the same name. Their age counts from the day Claude Code moved them, and a shorter `cleanupPeriodDays` in project settings doesn't apply. To keep one, move it somewhere else before the sweep deletes it. |

327| `plugins/mcpb/` | The files Claude Code extracted from the [MCP bundles](https://code.claude.com/docs/en/plugins/components.md#include-a-packaged-mcpb-server) that plugins declare. A bundle's age counts from the last session that used it. |327| `plugins/mcpb/` | The files Claude Code extracted from the [MCP bundles](https://code.claude.com/docs/en/plugins/components.md#include-a-packaged-mcpb-server) that plugins declare. A bundle's age counts from the last session that used it. |

claude-projects.md +41 −41

Details

31* **One goal across many repositories**: "Bring every service up to the new lint config." Claude can run a thread per repository, each with its own pull request, and the [Overview pane](#see-what-needs-you-in-overview) shows which ones are ready for review.31* **One goal across many repositories**: "Bring every service up to the new lint config." Claude can run a thread per repository, each with its own pull request, and the [Overview pane](#see-what-needs-you-in-overview) shows which ones are ready for review.

32* **An area you keep feeding**: the bugs, stack traces, and review requests for one service, pasted into the conversation as they reach you. A pitfall you tell Claude to remember after one fix is in [project memory](#give-a-project-standing-context) for the next.32* **An area you keep feeding**: the bugs, stack traces, and review requests for one service, pasted into the conversation as they reach you. A pitfall you tell Claude to remember after one fix is in [project memory](#give-a-project-standing-context) for the next.

33* **A build or migration bigger than a session**: "Build what `docs/spec.md` describes" or "Move the app off the deprecated ORM." The work splits into threads that each take a part, decisions you ask Claude to remember early on reach the later cloud threads, and the spec changes and bugs you find during the build go into the same conversation.33* **A build or migration bigger than a session**: "Build what `docs/spec.md` describes" or "Move the app off the deprecated ORM." The work splits into threads that each take a part, decisions you ask Claude to remember early on reach the later cloud threads, and the spec changes and bugs you find during the build go into the same conversation.

34* **Work that isn't code**: a folder of contracts or a support-ticket export you keep coming back to with new questions, such as "find the ten most common integration mistakes in these tickets." Upload the documents instead of adding a repository, and threads deliver each write-up as a file in the project's [**Library**](#see-what-needs-you-in-overview).34* **Work that isn't code**: a folder of contracts or a support-ticket export you keep coming back to with new questions, such as "find the ten most common integration mistakes in these tickets." Upload the documents instead of adding a repository, and threads deliver each write-up as a file in the project's [**Context** tab](#see-what-needs-you-in-overview).

35 35 

36In any of them you can send a batch of tasks, tell Claude to start without asking you to confirm, and walk away. When you're back, you can find the threads that need you under [**Waiting on you**](#see-what-needs-you-in-overview). You can also ask Claude to put part of the work on a schedule as a [cloud scheduled task](https://code.claude.com/docs/en/routines.md). If one of these is your situation, [create a project](#create-a-project).36In any of them you can send a batch of tasks, tell Claude to start without asking you to confirm, and walk away. When you're back, you can find the threads that need you under [**Waiting on you**](#see-what-needs-you-in-overview). You can also ask Claude to put part of the work on a schedule as a [cloud scheduled task](https://code.claude.com/docs/en/routines.md). If one of these is your situation, [create a project](#create-a-project).

37 37 


44* **One task that repeats on a schedule with no conversation around it**: "Post a dependency report every Monday." Create a [cloud scheduled task](https://code.claude.com/docs/en/routines.md) on its own.44* **One task that repeats on a schedule with no conversation around it**: "Post a dependency report every Monday." Create a [cloud scheduled task](https://code.claude.com/docs/en/routines.md) on its own.

45* **Several people giving Claude work and steering it together in a Slack channel**: see [Claude Tag](https://claude.com/docs/claude-tag/overview).45* **Several people giving Claude work and steering it together in a Slack channel**: see [Claude Tag](https://claude.com/docs/claude-tag/overview).

46 46 

47A project draws on the same plan limits as your other Claude Code sessions and uses them faster. [Usage and cost](#usage-and-cost) covers what draws on your plan and how to keep it down.47A project uses your plan faster than a single session does. [Usage and cost](#usage-and-cost) covers what draws on your plan and how to keep it down.

48 48 

49## How a project is organized49## How a project is organized

50 50 


78 78 

79Before you create a project, check your plan, your GitHub setup, and what the work needs to reach:79Before you create a project, check your plan, your GitHub setup, and what the work needs to reach:

80 80 

81* **Plan**: you're on Pro, Max, or Ultra, and **Projects** shows in your sidebar, directly or under **More**. Select **Projects** and check that it offers **New project** or **Get started**.81* **Plan**: you're on Pro, Max, or Ultra, and **Projects** shows in your sidebar, directly or under **More**. Select **Projects** and check that it offers **New project**.

82* **GitHub, if the project will work on code**: your code is on github.com rather than GitHub Enterprise Server, GitLab, or Bitbucket, your connected GitHub account has push access to it, and the Claude GitHub App is installed on it. If you connected GitHub with [`/web-setup`](https://code.claude.com/docs/en/web-quickstart#connect-from-your-terminal), that token lets your other cloud sessions reach a repository but isn't enough for a project's cloud threads, which need the Claude GitHub App. [Set up GitHub access](#set-up-github-access) has the steps.82* **GitHub, if the project will work on code**: your code is on github.com rather than GitHub Enterprise Server, GitLab, or Bitbucket, your connected GitHub account has push access to it, and the Claude GitHub App is installed on it. If you connected GitHub with [`/web-setup`](https://code.claude.com/docs/en/web-quickstart#connect-from-your-terminal), that token lets your other cloud sessions reach a repository but isn't enough for a project's cloud threads, which need the Claude GitHub App. [Set up GitHub access](#set-up-github-access) has the steps.

83* **Network access, secrets, and tools**: for cloud threads, these come from the project's [cloud environment](#choose-an-environment-for-threads). The default environment already reaches [common package registries](https://code.claude.com/docs/en/cloud-environments.md#default-allowed-domains), so check this only if the work needs other domains, a secret, or a tool that isn't preinstalled. If the work needs an MCP server, check that it shows as connected in your [claude.ai connectors](https://claude.ai/customize/connectors).83* **Network access, secrets, and tools**: for cloud threads, these come from the project's [cloud environment](#choose-an-environment-for-threads). The default environment already reaches [common package registries](https://code.claude.com/docs/en/cloud-environments.md#default-allowed-domains), so check this only if the work needs other domains, a secret, or a tool that isn't preinstalled. If the work needs an MCP server, check that it shows as connected in your [claude.ai connectors](https://claude.ai/customize/connectors).

84 84 


88 88 

89**1. Open Projects**89**1. Open Projects**

90 90 

91At [claude.ai/code](https://claude.ai/code) or in the Code tab of the desktop app, select **Projects** in the left sidebar, or under **More** there. In a browser you can also go straight to [claude.ai/code/projects/browse](https://claude.ai/code/projects/browse). Then select **New project**. If the button reads **Get started** instead, select it and first upgrade or archive the existing claude.ai projects it lists.91At [claude.ai/code](https://claude.ai/code) or in the Code tab of the desktop app, select **Projects** in the left sidebar, or under **More** there. In a browser you can also go straight to [claude.ai/code/projects/browse](https://claude.ai/code/projects/browse). Then select **New project**.

92 92 

93**2. Fill in the New project dialog**93**2. Fill in the New project dialog**

94 94 


155 155 

1561. [Write project instructions](#write-project-instructions): the brief every thread starts from, such as which branch to target, how a thread checks its work, and what needs your go-ahead.1561. [Write project instructions](#write-project-instructions): the brief every thread starts from, such as which branch to target, how a thread checks its work, and what needs your go-ahead.

1572. Send one small piece of the real work, or start one of the threads Claude suggested if it offered any, and open the thread when it finishes to see how it reports back and what it did on its branch. If it assumed something wrong or couldn't reach what it needed, [Threads guessed or stalled instead of asking](#threads-guessed-or-stalled-instead-of-asking) covers where to fix that.1572. Send one small piece of the real work, or start one of the threads Claude suggested if it offered any, and open the thread when it finishes to see how it reports back and what it did on its branch. If it assumed something wrong or couldn't reach what it needed, [Threads guessed or stalled instead of asking](#threads-guessed-or-stalled-instead-of-asking) covers where to fix that.

1583. Check **Thread model** and **Thread effort** in **Project settings > General**. A new project runs every thread on Opus at high effort, which draws on your plan fastest; [Choose models and let Claude manage context](#choose-models-and-let-claude-manage-context) covers the alternatives.1583. Check **Threads** in **Project settings > General**, which sets the model and effort for new threads. A new project runs every thread on Opus at medium effort; [Choose models and let Claude manage context](#choose-models-and-let-claude-manage-context) covers the alternatives.

1594. Ask Claude to [propose threads before starting them and to run a few at a time](#tune-how-claude-runs-a-project), and drop those limits once a few threads come back the way you want.1594. Ask Claude to [propose threads before starting them and to run a few at a time](#tune-how-claude-runs-a-project), and drop those limits once a few threads come back the way you want.

160 160 

161### Send work and read results161### Send work and read results


168 168 

169If Claude routes something differently than you wanted, say so. [Tune how Claude runs a project](#tune-how-claude-runs-a-project) lists things you can tell it, such as reusing an existing thread for follow-ups or answering in place instead of starting a thread.169If Claude routes something differently than you wanted, say so. [Tune how Claude runs a project](#tune-how-claude-runs-a-project) lists things you can tell it, such as reusing an existing thread for follow-ups or answering in place instead of starting a thread.

170 170 

171A thread's full results stay in the thread, so open the thread to read them. Files a thread produced are also in the project's [**Library**](#see-what-needs-you-in-overview).171A thread's full results stay in the thread, so open the thread to read them. Files a thread produced are also in the project's [**Context** tab](#see-what-needs-you-in-overview).

172 172 

173Sometimes Claude proposes threads instead of starting them, in a **Suggested threads** list. Click the arrow on a suggestion to start that thread. When several are listed, a button under the list starts all of them.173Sometimes Claude proposes threads instead of starting them, in a **Suggested threads** list. Click the arrow on a suggestion to start that thread. When several are listed, a button under the list starts all of them.

174 174 


184 184 

185### See what needs you in Overview185### See what needs you in Overview

186 186 

187The Overview pane beside the conversation tracks the project's threads. It's already open the first time you open a new project. To reopen it after you close it, click the **Threads** button in the project header. The button shows a dot when a thread is waiting on you.187The Overview pane beside the conversation tracks the project's threads. It's already open the first time you open a new project. To reopen it after you close it, click the side panel button at the top right of the project. While the pane is closed, the button shows a dot when a thread is waiting on you.

188 188 

189In the desktop app, a notification appears by default when Claude posts in the conversation, a thread hits an error, or a thread needs your input. None appears while you're viewing the project. To also get one each time a thread finishes a turn, or to turn them off for a project, choose **Notifications** in the project's sidebar menu. In a browser, check the dot on the **Threads** button.189In the desktop app, a notification appears by default when Claude posts in the conversation, a thread hits an error, or a thread needs your input. None appears while you're viewing the project. To also get one each time a thread finishes a turn, or to turn them off for a project, choose **Notifications** in the project's sidebar menu. In a browser, check the dot on that side panel button.

190 190 

191The pane's **Threads** view groups threads by state:191The pane's **Threads** tab groups threads by state:

192 192 

193| Group | What's in it |193| Group | What's in it |

194| :- | :- |194| :- | :- |


199| **Idle** | Threads that finished and aren't waiting on anything |199| **Idle** | Threads that finished and aren't waiting on anything |

200| **Resolved** | Threads marked done: by you from the thread's menu, by Claude once you've taken the last step, such as merging its pull request, or automatically after a week with no activity. You can reopen one from the same menu |200| **Resolved** | Threads marked done: by you from the thread's menu, by Claude once you've taken the last step, such as merging its pull request, or automatically after a week with no activity. You can reopen one from the same menu |

201 201 

202Open the project's files and scheduled tasks in the pane from the project header:202Open the project's files and scheduled tasks in the pane:

203 203 

204* **Library**: the files and folders you added and the files that threads produced. Click the **Library** button beside **Threads**.204* **Context**: the files and folders you added and the files that threads produced. Click the **Context** tab beside **Threads**.

205* **Scheduled tasks**: the [cloud scheduled tasks](https://code.claude.com/docs/en/routines.md) Claude set up from this project. Select it in the header's **⋯** menu.205* **Scheduled tasks**: the [cloud scheduled tasks](https://code.claude.com/docs/en/routines.md) Claude set up from this project. Select it from the **+** after the tabs.

206 206 

207### Open a thread when you need control207### Open a thread when you need control

208 208 

209Click a thread in the conversation or its row in Overview to open the thread in the Overview pane. From there you can:209Click a thread in the conversation or its row in the **Threads** tab to open the thread in the Overview pane. From there you can:

210 210 

211* Read Claude's messages and see what the thread is working on now.211* Read Claude's messages and see what the thread is working on now.

212* Steer the task by writing in the thread's own message box. A message there goes straight to that thread, while a follow-up in the project conversation reaches it only when Claude matches the follow-up to that thread.212* Steer the task by writing in the thread's own message box. A message there goes straight to that thread, while a follow-up in the project conversation reaches it only when Claude matches the follow-up to that thread.


215 215 

216### Choose models and let Claude manage context216### Choose models and let Claude manage context

217 217 

218Set models and effort in **Project settings > General**. A new project runs Opus everywhere, with high [effort](https://code.claude.com/docs/en/model-config.md#adjust-effort-level) for threads and low effort for the conversation:218Set models and thread effort in **Project settings > General**. A new project runs Opus everywhere, with medium [effort](https://code.claude.com/docs/en/model-config.md#adjust-effort-level) for threads and low effort for the conversation:

219 219 

220* **Thread model** and **Thread effort** apply to threads. To use a different model for one task, ask for it in the task; for a thread already running, use that thread's model picker.220* **Threads** sets the model and effort for new threads. To use a different model for one task, ask for it in the task; for a thread already running, use that thread's model picker.

221* **Coordinator model** and **Coordinator effort** apply to Claude in the project conversation.221* **Coordinator** sets the model for Claude in the project conversation.

222 222 

223You don't manage context windows in a project. Threads compact automatically, and the conversation works from recent messages, recent threads, and project memory rather than its full history, so it keeps going for as long as the project runs. Put anything that must never be dropped in [project memory](#give-a-project-standing-context). If one thread outgrows its context, it shows [Claude ran out of context on this turn](#context-limit).223You don't manage context windows in a project. Threads compact automatically, and the conversation works from recent messages, recent threads, and project memory rather than its full history, so it keeps going for as long as the project runs. Put anything that must never be dropped in [project memory](#give-a-project-standing-context). If one thread outgrows its context, it shows [Claude ran out of context on this turn](#context-limit).

224 224 


285| :- | :- | :- |285| :- | :- | :- |

286| Project memory | Notes Claude keeps about the project, such as requirements, decisions, and pitfalls, stored as files. Every cloud thread reads the index file `MEMORY.md` when it starts and opens the other files when it needs them | Ask Claude in the project conversation or any cloud thread to remember a requirement, a decision, or a pitfall, or to forget one. Read, edit, and delete the files in **Project settings > Memory** |286| Project memory | Notes Claude keeps about the project, such as requirements, decisions, and pitfalls, stored as files. Every cloud thread reads the index file `MEMORY.md` when it starts and opens the other files when it needs them | Ask Claude in the project conversation or any cloud thread to remember a requirement, a decision, or a pitfall, or to forget one. Read, edit, and delete the files in **Project settings > Memory** |

287| Project instructions | Text sent to each new thread and to Claude in the project conversation, up to 16,000 characters. [Write project instructions](#write-project-instructions) covers what to put in it | **Project settings > Memory > Project instructions**, or ask Claude to change the instructions |287| Project instructions | Text sent to each new thread and to Claude in the project conversation, up to 16,000 characters. [Write project instructions](#write-project-instructions) covers what to put in it | **Project settings > Memory > Project instructions**, or ask Claude to change the instructions |

288| Repositories, files, and environment | The repositories every cloud thread clones, the folders and files it can read under `/mnt/project-files`, and the cloud environment it runs in | Repositories and environment in **Project settings > Environment**, or ask Claude in the conversation to add a repository to the project. [Files and folders](#add-files-and-folders) from **Add** in the project's [**Library**](#see-what-needs-you-in-overview) |288| Repositories, files, and environment | The repositories every cloud thread clones, the folders and files it can read under `/mnt/project-files`, and the cloud environment it runs in | Repositories and environment in **Project settings > Environment**, or ask Claude in the conversation to add a repository to the project. [Files and folders](#add-files-and-folders) from **Add context** in the project's [**Context** tab](#see-what-needs-you-in-overview) |

289 289 

290**Project settings > Memory** lists these files under **Auto memory**, because Claude writes them itself as it works in the project. They're separate from the [auto memory](https://code.claude.com/docs/en/memory.md) Claude Code keeps on your machine, even though both use a `MEMORY.md` index. Project memory is also separate from the `CLAUDE.md` files in the project's repositories. Each cloud thread still reads those `CLAUDE.md` files from its clone when it starts, so put instructions about a repository in its `CLAUDE.md` and notes about the project in project memory.290**Project settings > Memory** lists these files under **Auto memory**, because Claude writes them itself as it works in the project. They're separate from the [auto memory](https://code.claude.com/docs/en/memory.md) Claude Code keeps on your machine, even though both use a `MEMORY.md` index. Project memory is also separate from the `CLAUDE.md` files in the project's repositories. Each cloud thread still reads those `CLAUDE.md` files from its clone when it starts, so put instructions about a repository in its `CLAUDE.md` and notes about the project in project memory.

291 291 

292If memory is off in your [claude.ai settings](https://claude.ai/settings/capabilities?highlight=memory), Claude can't read or save project memory. Turn it on there, then [restart Claude](#claude-hasnt-responded) and start a new thread.

293 

292### Write project instructions294### Write project instructions

293 295 

294Project instructions are the brief every new thread starts from. Select **Settings** in the **⋯** menu in the project header to open **Project settings**, then go to **Memory > Project instructions**. A useful brief covers:296Project instructions are the brief every new thread starts from. Click the gear in the project header to open **Project settings**, then go to **Memory > Project instructions**. A useful brief covers:

295 297 

296* What the project is for298* What the project is for

297* Where the work happens: which repositories, which branch to start from, how to name pull requests299* Where the work happens: which repositories, which branch to start from, how to name pull requests


319* **Add it to the project**, in the **New project** dialog, in **Project settings > Environment**, or by asking Claude in the conversation to add it to the project. Every cloud thread from then on clones it and starts with its `CLAUDE.md` loaded, whether or not the task touches it.321* **Add it to the project**, in the **New project** dialog, in **Project settings > Environment**, or by asking Claude in the conversation to add it to the project. Every cloud thread from then on clones it and starts with its `CLAUDE.md` loaded, whether or not the task touches it.

320* **Leave it off and let threads add it when needed.** A cloud thread whose task needs a repository the project doesn't have can add it to itself, and a note in the thread says it was added to this thread only. The clone happens partway through the task, so that repository's `CLAUDE.md` wasn't there when the thread started. The next thread starts without it. A repository added this way needs the same [prerequisites](#check-the-prerequisites) as a project repository: the Claude GitHub App installed on it and push access from your GitHub account.322* **Leave it off and let threads add it when needed.** A cloud thread whose task needs a repository the project doesn't have can add it to itself, and a note in the thread says it was added to this thread only. The clone happens partway through the task, so that repository's `CLAUDE.md` wasn't there when the thread started. The next thread starts without it. A repository added this way needs the same [prerequisites](#check-the-prerequisites) as a project repository: the Claude GitHub App installed on it and push access from your GitHub account.

321 323 

322A project doesn't need a repository at all. Its cloud threads can still research, write documents, and write and run code in their own sandbox. They deliver files to the project's **Library**. Any of its cloud threads can still add a repository to itself when a task calls for one.324A project doesn't need a repository at all. Its cloud threads can still research, write documents, and write and run code in their own sandbox. They deliver files to the project's **Context** tab. Any of its cloud threads can still add a repository to itself when a task calls for one.

323 325 

324Once the project has repositories, Claude can only add repositories from a GitHub owner the project already uses, whether it adds one to the project or a thread adds one to itself. To bring in a repository from a different owner, add it to the project yourself in **Project settings > Environment**.326Once the project has repositories, Claude can only add repositories from a GitHub owner the project already uses, whether it adds one to the project or a thread adds one to itself. To bring in a repository from a different owner, add it to the project yourself in **Project settings > Environment**.

325 327 


327 329 

328### Add files and folders330### Add files and folders

329 331 

330Add the files and folders you want threads to read in the **New project** dialog's **Context** field, or afterward with **Add** in the project's [**Library**](#see-what-needs-you-in-overview). These limits apply to what you add:332Add the files and folders you want threads to read in the **New project** dialog's **Context** field, or afterward with **Add context** in the project's [**Context** tab](#see-what-needs-you-in-overview). These limits apply to what you add:

331 333 

332* **Files you upload at claude.ai/code or in the desktop app**: up to 1,000 files and 2 GB at a time, with a single file up to 480 MB.334* **Files you upload at claude.ai/code or in the desktop app**: up to 1,000 files and 2 GB at a time, with a single file up to 480 MB.

333* **Folders you upload**: hidden files and `node_modules` aren't added. A project holds up to 10 folders and Google Drive folders combined, and single files don't count toward that limit.335* **Folders you upload**: hidden files and `node_modules` aren't added. A project holds up to 10 folders and Google Drive folders combined, and single files don't count toward that limit.


365Cloud threads don't have the skills, MCP servers, plugins, and tools installed only on your machine. A thread that Claude runs on your machine through [Remote Control](https://code.claude.com/docs/en/remote-control.md) uses what's installed there. To make each of these available to cloud threads:367Cloud threads don't have the skills, MCP servers, plugins, and tools installed only on your machine. A thread that Claude runs on your machine through [Remote Control](https://code.claude.com/docs/en/remote-control.md) uses what's installed there. To make each of these available to cloud threads:

366 368 

367* Skills: enable them for your claude.ai account, and cloud threads load the [skills you enable there](https://code.claude.com/docs/en/skills.md#skills-in-cowork-and-cloud-sessions), apart from [some threads in a self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments-configuration.md#how-each-session’s-config-is-assembled). For skills committed to a repository, see [What threads pick up from your repositories](#what-threads-pick-up-from-your-repositories).369* Skills: enable them for your claude.ai account, and cloud threads load the [skills you enable there](https://code.claude.com/docs/en/skills.md#skills-in-cowork-and-cloud-sessions), apart from [some threads in a self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments-configuration.md#how-each-session’s-config-is-assembled). For skills committed to a repository, see [What threads pick up from your repositories](#what-threads-pick-up-from-your-repositories).

368* Plugins: add them in **Project settings > Plugins**; they load into each new cloud thread.370* Plugins: enable them for your claude.ai account at [claude.ai/customize/plugins](https://claude.ai/customize/plugins), and the cloud threads that Claude starts load them.

369* MCP servers: cloud threads get their MCP tools from the connectors on your claude.ai account, which are MCP servers you connect once at [claude.ai/customize/connectors](https://claude.ai/customize/connectors). Every cloud thread can use all of them with no per-project setup. The project conversation itself has no connectors, so send work that needs one as a task for a cloud thread. [How connectors reach Claude Code](https://code.claude.com/docs/en/mcp.md#how-connectors-reach-claude-code) lists the rules for cloud sessions and the settings that turn connectors off.371* MCP servers: cloud threads get their MCP tools from the connectors on your claude.ai account, which are MCP servers you connect once at [claude.ai/customize/connectors](https://claude.ai/customize/connectors). Every cloud thread can use all of them with no per-project setup. The project conversation itself has no connectors, so send work that needs one as a task for a cloud thread. [How connectors reach Claude Code](https://code.claude.com/docs/en/mcp.md#how-connectors-reach-claude-code) lists the rules for cloud sessions and the settings that turn connectors off.

370* Command-line tools and packages: install them in the environment's [setup script](https://code.claude.com/docs/en/cloud-environments.md#setup-scripts).372* Command-line tools and packages: install them in the environment's [setup script](https://code.claude.com/docs/en/cloud-environments.md#setup-scripts).

371 373 


373 375 

374## Project settings reference376## Project settings reference

375 377 

376You change project settings at claude.ai/code or in the desktop app, not in `settings.json`. Open **Project settings** from **Settings** in the project's sidebar menu or in the project header's **⋯** menu.378You change project settings at claude.ai/code or in the desktop app, not in `settings.json`. Open **Project settings** from **Settings** in the project's sidebar menu or from the gear in the project header.

377 379 

378Settings save as you change them; a text field you're editing, such as the goal or instructions, shows **Save changes** and **Discard** until you leave it. Changes to instructions, repositories, plugins, and environment in **Project settings** reach new threads, not threads already running.380Settings save as you change them; a text field you're editing, such as the goal or instructions, shows **Save changes** and **Discard** until you leave it. Changes to instructions, repositories, and environment in **Project settings** reach new threads, not threads already running.

379 381 

380| Setting | Section | What it controls |382| Setting | Section | What it controls |

381| :- | :- | :- |383| :- | :- | :- |

382| Name, icon, and goal | General | The project's name and icon in the sidebar, and its one-line goal |384| Name, icon, and goal | General | The project's name and icon in the sidebar, and its one-line goal |

383| Coordinator model and effort | General | The model and [effort level](https://code.claude.com/docs/en/model-config.md#adjust-effort-level) for Claude in the project conversation |385| Coordinator | General | The model for Claude in the project conversation |

384| Thread model and effort | General | The model and effort level for threads |386| Threads | General | The model and [effort level](https://code.claude.com/docs/en/model-config.md#adjust-effort-level) for new threads |

385| Project instructions | Memory | [Standing rules](#give-a-project-standing-context) every new thread receives |387| Project instructions | Memory | [Standing rules](#give-a-project-standing-context) every new thread receives |

386| Project repositories | Environment | The repositories new cloud threads clone |388| Project repositories | Environment | The repositories new cloud threads clone |

387| Cloud environment | Environment | The [cloud environment](#choose-an-environment-for-threads) new cloud threads run in |389| Cloud environment | Environment | The [cloud environment](#choose-an-environment-for-threads) new cloud threads run in |

388| Plugins | Plugins | The plugins that load into each new cloud thread |390| Usage | Usage | [Token use](#usage-and-cost) by thread |

389| Usage | Usage | [Token use](#usage-and-cost) by thread and by model |

390| Memory | Memory | The project's [memory files](#give-a-project-standing-context) |391| Memory | Memory | The project's [memory files](#give-a-project-standing-context) |

391| Auto-continue when usage limits reset | General | Whether a thread or the project conversation that [stops at a usage limit](#usage-limit-reached) continues on its own when the limit resets. On by default. |392| Continue threads automatically when usage limits reset | General | Whether a thread or the project conversation that [stops at a usage limit](#usage-limit-reached) continues on its own when the limit resets. On by default. |

392| Restart Claude | General | Restarts the project conversation when [Claude stops responding there](#claude-hasnt-responded) |393| Restart Claude | Advanced | Restarts the project conversation when [Claude stops responding there](#claude-hasnt-responded) |

393| Pause, Archive, Delete | General | Stops, hides, or removes the project; see [Pause, archive, or delete a project](#pause-archive-or-delete-a-project) |394| Pause | Advanced | Pauses the project; see [Pause, archive, or delete a project](#pause-archive-or-delete-a-project) |

395| Archive, Delete | General | Hides or removes the project; see [Pause, archive, or delete a project](#pause-archive-or-delete-a-project) |

394 396 

395### Pause, archive, or delete a project397### Pause, archive, or delete a project

396 398 

397All three controls are at the bottom of **Project settings > General**:399**Pause** is in **Project settings > Advanced**. **Archive** and **Delete** are at the bottom of **General**:

398 400 

399* **Pause**: stops everything at once. Every running thread and the conversation are interrupted, no new threads start, scheduled tasks don't run, and the project doesn't accept messages until you resume it. Click **Resume** in the same place or on the banner above the project's message box; a paused thread continues when you send it a message after that.401* **Pause**: stops everything at once. Every running thread and the conversation are interrupted, no new threads start, scheduled tasks don't run, and the project doesn't accept messages until you resume it. Click **Resume** in the same place or on the banner above the project's message box; a paused thread continues when you send it a message after that.

400* **Archive**: hides the project from the sidebar and archives its threads, which stops any thread that was running or watching a pull request. Scheduled tasks in the project don't run while it's archived. To bring the project back, open it from the Projects page and click **Unarchive**. Its threads stay archived until you unarchive them individually from the session list.402* **Archive**: hides the project from the sidebar and archives its threads, which stops any thread that was running or watching a pull request. Scheduled tasks in the project don't run while it's archived. To bring the project back, open it from the Projects page and click **Unarchive**. Its threads stay archived until you unarchive them individually from the session list.


402 404 

403## Usage and cost405## Usage and cost

404 406 

405Project usage counts against the same [plan limits](https://code.claude.com/docs/en/errors.md#youve-hit-your-session-limit) as your other Claude Code sessions, and a project can't spend past those limits on its own.

406 

407A thread that stops at your plan's limit waits and by default continues on its own when the limit resets. Its work then counts against your next usage window. To keep threads from continuing, see [A thread hit the usage limit](#usage-limit-reached).407A thread that stops at your plan's limit waits and by default continues on its own when the limit resets. Its work then counts against your next usage window. To keep threads from continuing, see [A thread hit the usage limit](#usage-limit-reached).

408 408 

409Work goes past your plan's limits only if you have turned on [usage credits](https://code.claude.com/docs/en/costs.md#add-usage-credits-to-your-subscription) for your account. A thread can't turn them on for you.409Work goes past your plan's limits only if you have turned on [usage credits](https://code.claude.com/docs/en/costs.md#add-usage-credits-to-your-subscription) for your account.

410 410 

411### What draws on your plan411### What draws on your plan

412 412 


420 420 

421### See and reduce a project's usage421### See and reduce a project's usage

422 422 

423Open **Usage** in **Project settings** to see token use by thread and by model, and how much went to the project conversation. To bring it down:423Open **Usage** in **Project settings** to see token use by thread and how much went to the project conversation. To bring it down:

424 424 

425* On Pro, Max, and Ultra within your plan's limits, the [cache lifetime](https://code.claude.com/docs/en/prompt-caching.md#cache-lifetime) is an hour. A thread that has been idle longer than that re-reads its whole conversation before doing anything when a follow-up reaches it. For new work, ask Claude to start a fresh thread, which can use less than reviving a large old one.425* On Pro, Max, and Ultra within your plan's limits, the [cache lifetime](https://code.claude.com/docs/en/prompt-caching.md#cache-lifetime) is an hour. A thread that has been idle longer than that re-reads its whole conversation before doing anything when a follow-up reaches it. For new work, ask Claude to start a fresh thread, which can use less than reviving a large old one.

426* For work that doesn't need the largest model, [choose a smaller model or a lower effort level](#choose-models-and-let-claude-manage-context) for threads, the conversation, or both.426* For work that doesn't need the largest model, [choose a smaller model](#choose-models-and-let-claude-manage-context), or a lower effort level for threads.

427* Ask Claude in the project conversation to run fewer threads at a time, or to answer small questions itself instead of starting a thread.427* Ask Claude in the project conversation to run fewer threads at a time, or to answer small questions itself instead of starting a thread.

428 428 

429## How projects relate to other Claude Code features429## How projects relate to other Claude Code features


450* Project threads are [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md), or sessions on your own machine through [Remote Control](https://code.claude.com/docs/en/remote-control.md), with Anthropic as the model provider in both cases. [Security](https://code.claude.com/docs/en/security.md) and [Data usage](https://code.claude.com/docs/en/data-usage.md) cover how cloud sessions are isolated and what's retained, and [Connection and security](https://code.claude.com/docs/en/remote-control.md#connection-and-security) covers how a thread on your machine connects and what's stored.450* Project threads are [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md), or sessions on your own machine through [Remote Control](https://code.claude.com/docs/en/remote-control.md), with Anthropic as the model provider in both cases. [Security](https://code.claude.com/docs/en/security.md) and [Data usage](https://code.claude.com/docs/en/data-usage.md) cover how cloud sessions are isolated and what's retained, and [Connection and security](https://code.claude.com/docs/en/remote-control.md#connection-and-security) covers how a thread on your machine connects and what's stored.

451* You can't add a session you started yourself on your machine to a project, though you can [bring its work into one](#start-from-an-existing-cloud-session). A project reaches your machine by [running a thread there through Remote Control](#run-a-thread-on-your-own-computer), and that section lists what it needs.451* You can't add a session you started yourself on your machine to a project, though you can [bring its work into one](#start-from-an-existing-cloud-session). A project reaches your machine by [running a thread there through Remote Control](#run-a-thread-on-your-own-computer), and that section lists what it needs.

452* A cloud thread's sandbox pauses between turns and resumes when the thread continues. If the sandbox can't be resumed, the thread continues from a fresh clone, so uncommitted changes can be lost. On long tasks, ask Claude to commit and push work in progress.452* A cloud thread's sandbox pauses between turns and resumes when the thread continues. If the sandbox can't be resumed, the thread continues from a fresh clone, so uncommitted changes can be lost. On long tasks, ask Claude to commit and push work in progress.

453* A project belongs to one user. You can't share a project or its threads with another user, and thread transcripts don't have the share option other cloud sessions have. There are no organization-level controls for projects during the beta.453* A project belongs to one user. You can't share a project with another user. There are no organization-level controls for projects during the beta.

454* A thread belongs to the one project that started it. You can't move or copy a thread to another project, or move it out to stand alone. [**Continue in project**](#start-from-an-existing-cloud-session) goes the other way only: it brings a cloud session's work into a project. You can't merge two projects into one.454* A thread belongs to the one project that started it. You can't move or copy a thread to another project, or move it out to stand alone. [**Continue in project**](#start-from-an-existing-cloud-session) goes the other way only: it brings a cloud session's work into a project. You can't merge two projects into one.

455 455 

456## Troubleshooting456## Troubleshooting


466When several threads come back having assumed something wrong, worked around missing access, or stopped with "blocked", the cause is usually the same gap in the project's setup rather than a problem with each task. Sort out which threads are sound before you fix anything:466When several threads come back having assumed something wrong, worked around missing access, or stopped with "blocked", the cause is usually the same gap in the project's setup rather than a problem with each task. Sort out which threads are sound before you fix anything:

467 467 

4681. Ask Claude in the conversation: "For every open thread, list what you asked it to do, what it assumed or couldn't reach, and what it's waiting on." Claude reads each thread and answers in the conversation.4681. Ask Claude in the conversation: "For every open thread, list what you asked it to do, what it assumed or couldn't reach, and what it's waiting on." Claude reads each thread and answers in the conversation.

4692. For threads that started from a wrong assumption, open the thread from Overview and mark it resolved from its menu, or tell it what to do instead. Its branch and any pull request stay on GitHub until you delete them.4692. For threads that started from a wrong assumption, open the thread from the **Threads** tab and mark it resolved from its menu, or tell it what to do instead. Its branch and any pull request stay on GitHub until you delete them.

4703. Fix the gap once, in [project instructions](#give-a-project-standing-context) or the [environment](#choose-an-environment-for-threads), then send one thread before sending the rest of the work again as new threads.4703. Fix the gap once, in [project instructions](#give-a-project-standing-context) or the [environment](#choose-an-environment-for-threads), then send one thread before sending the rest of the work again as new threads.

471 471 

472### Claude hasn't responded472### Claude's replies aren't getting through

473 473 

474The project conversation shows a "Claude hasn't responded" banner when Claude is running but its replies aren't reaching the project. Click **Restart Claude** on the banner, or go to **Project settings > General** and click **Restart** in the **Restart Claude** row. Claude reconnects to the conversation; any reply it was in the middle of writing is lost, and threads aren't affected.474If the project conversation shows a "Claude's replies aren't getting through" banner, click **Restart Claude** on it. You can also go to **Project settings > Advanced** and click **Restart** in the **Restart Claude** row. Claude reconnects to the conversation; any reply it was in the middle of writing is lost, and threads aren't affected.

475 475 

476### Repository access errors476### Repository access errors

477 477 


487 487 

488When a thread or the project conversation stops at your plan's five-hour or weekly limit, it waits and by default continues on its own when the limit resets.488When a thread or the project conversation stops at your plan's five-hour or weekly limit, it waits and by default continues on its own when the limit resets.

489 489 

490To keep a thread or conversation from continuing at the reset time its message shows, turn off **Auto-continue when usage limits reset** in [**Project settings > General**](#project-settings-reference) before then. The setting is for the whole project, not only the thread you're looking at. To continue with the setting off, send the thread or conversation a message after the reset. [Usage limit errors](https://code.claude.com/docs/en/errors.md#youve-hit-your-session-limit) explain the limits and when they reset.490To keep a thread or conversation from continuing, turn off **Continue threads automatically when usage limits reset** in [**Project settings > General**](#project-settings-reference) before the reset. The setting is for the whole project. To continue with the setting off, send the thread or conversation a message after the reset. [Usage limit errors](https://code.claude.com/docs/en/errors.md#youve-hit-your-session-limit) explain the limits and when they reset.

491 491 

492### Additional usage credits are required492### Additional usage credits are required

493 493 

claude-ship.md +104 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Claude Ship

6 

7> Meet the Claude Ship agents for GitHub pull requests: Code Review, PR Steward, and Claude Approvals

8 

9Claude Ship is a set of agents that help get your team's GitHub pull requests ready to merge:

10 

11* [Code Review](https://code.claude.com/docs/en/code-review.md): looks for issues such as logic errors, security vulnerabilities, and broken edge cases

12* [PR Steward](https://code.claude.com/docs/en/pr-steward.md): works on review feedback and failing checks

13* [Claude Approvals](https://code.claude.com/docs/en/approvals.md): checks pull requests against an approval policy that you write

14 

15Together, they can take a pull request through review, fixes, and an approval decision, so your team doesn't have to manage each step manually. Your settings and GitHub branch rules determine what merges. Claude Ship is available on [Team and Enterprise plans](#who-can-use-claude-ship).

16 

17To turn on the agents, go to [Set up Claude Ship](#set-up-claude-ship).

18 

19> [!NOTE]

20>

21> To get a review and fixes locally, on one of your own pull requests, run [`/ship`](https://code.claude.com/docs/en/ship-command) in Claude Code.

22 

23## Claude Ship agents

24 

25This diagram shows each agent's part in a pull request, and the parts that stay with you and GitHub:

26 

27![Diagram of a pull request with all three Claude Ship agents on: Code Review finds problems, PR Steward pushes fixes, and a fix can start another review. Claude Approvals applies your policy, and the merge follows your branch rules.](https://mintcdn.com/claude-code/sMH7RDpTvyWlAkrg/images/claude-ship-overview.svg?fit=max\&auto=format\&n=sMH7RDpTvyWlAkrg\&q=85\&s=6c972cdcb9dfc1c7a9a54e421bcf35a5)

28 

29> [!NOTE]

30>

31> Claude Ship uses AI and may miss bugs, security vulnerabilities, or other issues.

32 

33### Code Review finds problems

34 

35[Code Review](https://code.claude.com/docs/en/code-review.md) reads a change alongside the surrounding code. Findings arrive as inline comments on the lines concerned, ranked by severity.

36 

37### PR Steward pushes fixes

38 

39[PR Steward](https://code.claude.com/docs/en/pr-steward.md) works on failing checks, merge conflicts, and review comments from people and from review bots such as Code Review. It pushes commits with its fixes.

40 

41Steward is designed not to approve or merge pull requests. Use branch protection to require the approvals you want before anything merges. See [Limits on approvals and merges](https://code.claude.com/docs/en/pr-steward-security.md#limits-on-approvals-and-merges).

42 

43### Claude Approvals applies your policy

44 

45[Claude Approvals](https://code.claude.com/docs/en/approvals.md) is a check that reports who still has to approve. You write its policy file, which can set how many people have to approve changes to a path, and where Claude can post an approving review. The check blocks a merge only where you [make it a required check in GitHub](https://code.claude.com/docs/en/approvals-setup.md#enforce-your-policy-and-require-claude-approvals), and normally not in observe mode.

46 

47> [!WARNING]

48>

49> If you use GitHub auto-merge or a merge queue with a policy that doesn't require a person's approval, a change can merge without anyone acting. See [Merges without human review](https://code.claude.com/docs/en/approvals-github-rules.md#merges-without-human-review).

50 

51## Set up Claude Ship

52 

53Go to [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship) for Claude Ship's settings. You need an [Owner role](https://code.claude.com/docs/en/server-managed-settings.md#access-control).

54 

55Turn on one agent at a time in one repository, in this order:

56 

571. [Set up Code Review](https://code.claude.com/docs/en/code-review-setup.md)

582. [Set up PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md). For the setting that chooses when PR Steward starts, begin with [**Manual (@claude steward)**](https://code.claude.com/docs/en/pr-steward-setup.md#choose-when-pr-steward-starts-in-each-repository). PR Steward has no spend limit of its own until you set one.

593. [Set up Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md). A policy file in the repository starts it, so see [who can turn it on](https://code.claude.com/docs/en/approvals.md#who-can-turn-approvals-on-or-off). Start in observe mode, where the **Claude Approvals** check reports what your policy would decide. Observe mode is billed. See [what Approvals costs](https://code.claude.com/docs/en/approvals-setup.md#what-approvals-costs).

60 

61### If you already use Code Review

62 

63Code Review's settings moved to [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship).

64 

65A Claude Approvals policy file, `.claude/approvals.yml`, changes which pull requests Code Review reviews automatically. Once the file is on the default branch, in observe mode or enforced, automatic reviews normally stop where no matching rule names `claude/code_review`. To keep them, [add `claude/code_review` to a rule](https://code.claude.com/docs/en/approvals-policy#advisory).

66 

67## Plans and billing

68 

69Claude Ship is for organizations on Team and Enterprise plans.

70 

71### Who can use Claude Ship

72 

73Code Review is generally available. PR Steward and Claude Approvals are in public beta. The agents aren't available to organizations with [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md) enabled, the [HIPAA configuration](https://code.claude.com/docs/en/hipaa-setup.md) applied, or customer-managed encryption keys. Approvals has [more limits](https://code.claude.com/docs/en/approvals.md#availability).

74 

75### How each Claude Ship agent is billed

76 

77Each agent is billed on token usage through your organization's [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans), separately from your plan's included usage. Approvals bills for [classifier](https://code.claude.com/docs/en/approvals-classifiers.md) runs and the Code Reviews that a policy asks for.

78 

79> [!NOTE]

80>

81> Eligible Enterprise organizations can claim promotional Claude Ship credits. For who qualifies, the amount, and the dates, see the [credit terms](https://support.claude.com/en/articles/17603594-free-code-review-promotional-credits-for-claude-enterprise).

82 

83If you turn off usage credits in [**Organization settings > Usage**](https://claude.ai/admin-settings/usage), an agent that's on keeps running and billing your organization. To stop its charges, follow [Turn off Claude Ship](#turn-off-claude-ship).

84 

85See each agent's costs:

86 

87* [Code Review](https://code.claude.com/docs/en/code-review-costs.md)

88* [PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md#set-pr-steward’s-spend-limits)

89* [Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md#what-approvals-costs)

90 

91## Turn off Claude Ship

92 

93Turn off Approvals before Code Review, because a policy can start billed reviews where Code Review is off:

94 

951. [Turn off Approvals](https://code.claude.com/docs/en/approvals-setup.md#turn-off-approvals)

962. [Turn off PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md#turn-off-pr-steward)

973. [Turn off Code Review](https://code.claude.com/docs/en/code-review-setup.md#turn-off-code-review-or-remove-a-repository)

98 

99These steps leave the `/ship` and `/steward` commands on. See [how to turn them off](https://code.claude.com/docs/en/ship-command.md#turn-off-%2Fship-and-%2Fsteward-for-your-organization).

100 

101## Related resources

102 

103* [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) and [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md): run Claude Code in your own CI

104* [Review code locally](https://code.claude.com/docs/en/code-review-local.md): get a review in your terminal before you push

Details

4 4 

5# CLI reference5# CLI reference

6 6 

7> Complete reference for Claude Code command-line interface, including commands and flags.7> Reference for the Claude Code command-line interface, including commands and flags.

8 8 

9## CLI commands9## CLI commands

10 10 

Details

281> [!NOTE]281> [!NOTE]

282>282>

283> A cloud thread in a [project](https://code.claude.com/docs/en/claude-projects.md) loads less of the repository configuration in this table. It starts without `.mcp.json` servers or `.claude/settings.json` hooks and permission rules, and it can skip skills, agents, and commands. See [What threads pick up from your repositories](https://code.claude.com/docs/en/claude-projects.md#what-threads-pick-up-from-your-repositories).283> A cloud thread in a [project](https://code.claude.com/docs/en/claude-projects.md) loads less of the repository configuration in this table. It starts without `.mcp.json` servers or `.claude/settings.json` hooks and permission rules, and it can skip skills, agents, and commands. See [What threads pick up from your repositories](https://code.claude.com/docs/en/claude-projects.md#what-threads-pick-up-from-your-repositories).

284>

285> [PR Steward](https://code.claude.com/docs/en/pr-steward-pull-requests.md#save-pr-steward-instructions-for-everyone-in-a-repository) sessions and [Approvals classifier runs](https://code.claude.com/docs/en/approvals-classifiers.md#what-a-classifier-run-can-read-and-change) load less of it too.

284 286 

285Cloud sessions start from a fresh clone of your repository. Anything you commit to the repo is available. Anything you've installed or configured only on your own machine isn't available in the session. Your organization's policy arrives separately through [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md).287Cloud sessions start from a fresh clone of your repository. Anything you commit to the repo is available. Anything you've installed or configured only on your own machine isn't available in the session. Your organization's policy arrives separately through [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md).

286 288 


295| Your organization's [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) | Yes, except in [Claude Tag](https://claude.com/docs/claude-tag/overview) sessions | Fetched from Anthropic's servers when the session starts. See [Surface coverage](https://code.claude.com/docs/en/model-config.md#surface-coverage) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don't apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](https://code.claude.com/docs/en/managed-settings.md#how-claude-code-combines-managed-sources) |297| Your organization's [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) | Yes, except in [Claude Tag](https://claude.com/docs/claude-tag/overview) sessions | Fetched from Anthropic's servers when the session starts. See [Surface coverage](https://code.claude.com/docs/en/model-config.md#surface-coverage) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don't apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](https://code.claude.com/docs/en/managed-settings.md#how-claude-code-combines-managed-sources) |

296| Your user `~/.claude/CLAUDE.md` | No | Lives on your machine, not in the repo. See [Add personal preferences without committing to the repo](#add-personal-preferences-without-committing-to-the-repo) |298| Your user `~/.claude/CLAUDE.md` | No | Lives on your machine, not in the repo. See [Add personal preferences without committing to the repo](#add-personal-preferences-without-committing-to-the-repo) |

297| Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/` | No | Live on your machine, not in the repo. Commit them to the repo's `.claude/` directory instead. Cloud sessions automatically load [skills you enable on claude.ai](https://code.claude.com/docs/en/skills.md#skills-in-cowork-and-cloud-sessions) |299| Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/` | No | Live on your machine, not in the repo. Commit them to the repo's `.claude/` directory instead. Cloud sessions automatically load [skills you enable on claude.ai](https://code.claude.com/docs/en/skills.md#skills-in-cowork-and-cloud-sessions) |

298| Plugins enabled only in your user settings | No | User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine |300| Plugins enabled only in your user settings | No | User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine. To use one, see the **Cloud session** tab under [Install a plugin](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin) |

299| MCP servers you added with `claude mcp add` at the default local scope or the user scope | No | At those scopes, the command writes to `~/.claude.json` on your machine. Run `claude mcp add --scope project` from the repository root to write the repo's [`.mcp.json`](https://code.claude.com/docs/en/mcp#project-scope), and commit that file. A session with one repository loads it |301| MCP servers you added with `claude mcp add` at the default local scope or the user scope | No | At those scopes, the command writes to `~/.claude.json` on your machine. Run `claude mcp add --scope project` from the repository root to write the repo's [`.mcp.json`](https://code.claude.com/docs/en/mcp#project-scope), and commit that file. A session with one repository loads it |

300| Transport variables in your repo's `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](https://code.claude.com/docs/en/network-config.md#mtls-authentication) | No | The hosting environment manages the session's API connection, so Claude Code ignores these keys and notes each ignored key in the session's debug log |302| Transport variables in your repo's `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](https://code.claude.com/docs/en/network-config.md#mtls-authentication) | No | The hosting environment manages the session's API connection, so Claude Code ignores these keys and notes each ignored key in the session's debug log |

301| API keys and tokens for services Claude calls | In an Anthropic-hosted environment, as [network secrets](#add-network-secrets) | You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy [can't attach](#requests-that-never-get-the-credential) stays in an environment variable |303| API keys and tokens for services Claude calls | In an Anthropic-hosted environment, as [network secrets](#add-network-secrets) | You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy [can't attach](#requests-that-never-get-the-credential) stays in an environment variable |

code-mode.md +15 −4

Details

54* **Model**: Claude Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.254* **Model**: Claude Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2

55* **Surface**: an interactive `claude` session in a terminal. Code Mode doesn't work with the VS Code panel, the Desktop app, or cloud sessions55* **Surface**: an interactive `claude` session in a terminal. Code Mode doesn't work with the VS Code panel, the Desktop app, or cloud sessions

56* **Agent teams**: to use Code Mode with [agent teams](https://code.claude.com/docs/en/agent-teams.md) on, you need v2.1.326 or later. Teammates run in Code Mode in the default [in-process display mode](https://code.claude.com/docs/en/agent-teams.md#choose-a-display-mode), and start without it in split panes56* **Agent teams**: to use Code Mode with [agent teams](https://code.claude.com/docs/en/agent-teams.md) on, you need v2.1.326 or later. Teammates run in Code Mode in the default [in-process display mode](https://code.claude.com/docs/en/agent-teams.md#choose-a-display-mode), and start without it in split panes

57* **Telemetry settings**: to use Code Mode with [feature-flag fetching off](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) or [OpenTelemetry](https://code.claude.com/docs/en/monitoring-usage.md) events and metrics on, you need v2.1.329 or later. Keep [tracing](https://code.claude.com/docs/en/monitoring-usage.md#traces-beta) off on any version

57* **Installation**: the [native build](https://code.claude.com/docs/en/setup.md) of Claude Code58* **Installation**: the [native build](https://code.claude.com/docs/en/setup.md) of Claude Code

58* **Windows**: [Git for Windows](https://git-scm.com/downloads/win) is installed59* **Windows**: [Git for Windows](https://git-scm.com/downloads/win) is installed

59 60 

60You also can't start Code Mode with some settings on, such as an API key helper, OpenTelemetry export, or `DISABLE_TELEMETRY`. For the fix for each, see [Code Mode doesn't start](#code-mode-doesnt-start).61You also can't start Code Mode with some settings on, such as an API key helper. For the fix for each, see [Code Mode doesn't start](#code-mode-doesnt-start).

61 62 

62## Try Code Mode63## Try Code Mode

63 64 


142 143 

143Users who are in a Code Mode session stay in it until they exit or restart Claude Code. After that, your users start without Code Mode and can't resume their Code Mode sessions while the `0` is in place. You can't turn on Code Mode for your users from managed settings.144Users who are in a Code Mode session stay in it until they exit or restart Claude Code. After that, your users start without Code Mode and can't resume their Code Mode sessions while the `0` is in place. You can't turn on Code Mode for your users from managed settings.

144 145 

146### Monitor Code Mode with OpenTelemetry

147 

148If you collect [OpenTelemetry events](https://code.claude.com/docs/en/monitoring-usage.md#events), your backend receives `tool_decision` and `tool_result` events for the tool calls in the code that Claude writes, under each tool's usual name, such as `Bash`. Update your queries and settings for these calls:

149 

150* **Find calls from code**: filter on `tool_use_id` values that start with `repl_` or `toolu_cc_`. The `REPL` tool, which runs the code, has events of its own without either prefix

151* **Read classifier verdicts**: in auto mode, a call that the classifier's [review of the code](#permission-checks) covers has no `classifier_verdict`. Look for the verdict on the `REPL` tool's `tool_decision` events that have that call's `request_id`. If you find more than one, the events don't show which piece of code made the call

152* **Keep secrets out of your backend**: code can read a value, such as a token in a file, and pass it to another call. Leave `OTEL_LOG_TOOL_DETAILS` unset if your backend shouldn't receive those values

153 

145## Permissions and long-running code154## Permissions and long-running code

146 155 

147Your permission mode decides how the code that Claude writes is checked and whether you can talk to Claude while the code runs.156Your permission mode decides how the code that Claude writes is checked and whether you can talk to Claude while the code runs.


228 237 

229### Check code output with a hook238### Check code output with a hook

230 239 

231To check or redact what the code returns before Claude reads it, write a [`PostToolUse` hook](https://code.claude.com/docs/en/hooks#posttooluse) that matches `REPL`, the tool that runs the code. The same hook runs when [background code](#long-running-code) finishes and when code throws an error.240To check or redact what the code returns, write a [`PostToolUse` hook](https://code.claude.com/docs/en/hooks#posttooluse) that matches `REPL`, the tool that runs the code. The same hook runs when [background code](#long-running-code) finishes and when code throws an error.

232 241 

233#### Read code output in the hook242#### Read code output in the hook

234 243 


295| Reason includes | What to do |304| Reason includes | What to do |

296| :- | :- |305| :- | :- |

297| `it isn't open to your account in this version` or `it isn't open to your account yet` | If your version is older than v2.1.323, [update](#try-code-mode). Otherwise, check your network connection and start again. If the reason stays, try again another day |306| `it isn't open to your account in this version` or `it isn't open to your account yet` | If your version is older than v2.1.323, [update](#try-code-mode). Otherwise, check your network connection and start again. If the reason stays, try again another day |

307| `Anthropic has turned it off for now` | [Update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code), or start again later |

298| `it only works directly with the Anthropic API` or `it only works with the Anthropic API` | Remove the settings that route requests through a cloud provider, a gateway, or a custom `ANTHROPIC_BASE_URL` |308| `it only works directly with the Anthropic API` or `it only works with the Anthropic API` | Remove the settings that route requests through a cloud provider, a gateway, or a custom `ANTHROPIC_BASE_URL` |

299| `it doesn't work with an API key helper` | Remove `apiKeyHelper`, `ANTHROPIC_AUTH_TOKEN`, and any `Authorization` or `X-Api-Key` header in `ANTHROPIC_CUSTOM_HEADERS`. Then sign in or set `ANTHROPIC_API_KEY` |309| `it doesn't work with an API key helper` | Remove `apiKeyHelper`, `ANTHROPIC_AUTH_TOKEN`, and any `Authorization` or `X-Api-Key` header in `ANTHROPIC_CUSTOM_HEADERS`. Then sign in or set `ANTHROPIC_API_KEY` |

300| `it only works with Opus 5.5, Sonnet 5.5 and later models` | Start with a [supported model](#requirements), for example with `--model opus`. Haiku 5.5 and Fable 5.2 also work |310| `it only works with Opus 5.5, Sonnet 5.5 and later models` | Start with a [supported model](#requirements), for example with `--model opus`. Haiku 5.5 and Fable 5.2 also work |

301| `it doesn't work in background jobs` | Start in the foreground, without `--remote-control`. If the reason shows in a teammate's split pane, use the [in-process display mode](https://code.claude.com/docs/en/agent-teams.md#choose-a-display-mode) to run teammates in Code Mode |311| `it doesn't work in background jobs` | Start in the foreground, without `--remote-control`. If the reason shows in a teammate's split pane, use the [in-process display mode](https://code.claude.com/docs/en/agent-teams.md#choose-a-display-mode) to run teammates in Code Mode |

302| `it needs settings that Claude Code downloads from Anthropic` | Unset the variable that [turns off feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), such as `DISABLE_TELEMETRY` |312| `it needs settings that Claude Code downloads from Anthropic` | [Update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) to meet the [telemetry settings requirement](#requirements). To stay on your version, unset the variable that [turns off feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), such as `DISABLE_TELEMETRY` |

303| `OpenTelemetry is on` | Unset `CLAUDE_CODE_ENABLE_TELEMETRY` and `ENABLE_BETA_TRACING_DETAILED` if you can work without [OpenTelemetry export](https://code.claude.com/docs/en/monitoring-usage.md) |313| `OpenTelemetry tracing is on` | Unset `CLAUDE_CODE_ENHANCED_TELEMETRY_BETA`, `ENABLE_ENHANCED_TELEMETRY_BETA`, and `ENABLE_BETA_TRACING_DETAILED` if you can work without [traces](https://code.claude.com/docs/en/monitoring-usage.md#traces-beta) |

314| `OpenTelemetry is on` | To keep events and metrics on, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) and meet the [telemetry settings requirement](#requirements). To stay on your version, unset `CLAUDE_CODE_ENABLE_TELEMETRY` and `ENABLE_BETA_TRACING_DETAILED` if you can work without [OpenTelemetry export](https://code.claude.com/docs/en/monitoring-usage.md) |

304| `it doesn't yet work with the plugin` | In a session, run `/plugin` and disable each plugin that the reason names. If your organization turned one on, ask your administrator to turn it off |315| `it doesn't yet work with the plugin` | In a session, run `/plugin` and disable each plugin that the reason names. If your organization turned one on, ask your administrator to turn it off |

305| `it doesn't yet work with an installed mod` | Turn off the [mod](https://code.claude.com/docs/en/plugins/mods/overview.md) that checks tool calls |316| `it doesn't yet work with an installed mod` | Turn off the [mod](https://code.claude.com/docs/en/plugins/mods/overview.md) that checks tool calls |

306| `it can't be used together with agent teams yet` | To keep agent teams on, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) to v2.1.326 or later. To stay on your version, unset `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` |317| `it can't be used together with agent teams yet` | To keep agent teams on, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) to v2.1.326 or later. To stay on your version, unset `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` |

code-review.md +1 −1

Details

8 8 

9With Code Review, Claude reviews the pull requests in your GitHub repositories. Several agents read each change alongside the surrounding code, looking for issues such as logic errors, security vulnerabilities, or broken edge cases. A verification step checks findings against the code before they're reported.9With Code Review, Claude reviews the pull requests in your GitHub repositories. Several agents read each change alongside the surrounding code, looking for issues such as logic errors, security vulnerabilities, or broken edge cases. A verification step checks findings against the code before they're reported.

10 10 

11Findings arrive as inline comments on the lines concerned, ranked by [severity](https://code.claude.com/docs/en/code-review-pull-requests.md#severity-levels), with a summary and a check run on the pull request. A review never approves or blocks the pull request, so the decision to merge stays with your team.11Findings arrive as inline comments on the lines concerned, ranked by [severity](https://code.claude.com/docs/en/code-review-pull-requests.md#severity-levels), with a summary and a check run on the pull request. By itself, a review doesn't approve or block the pull request. Its result counts toward approvals in a repository whose [Claude Approvals](https://code.claude.com/docs/en/approvals.md) policy file uses it.

12 12 

13![Diagram of a review in four stages. A pull request on GitHub goes to several agents that search in parallel on Anthropic infrastructure. A verification step drops false positives, the remaining findings are deduplicated and ranked by severity, and the review posts inline comments, a summary, and a check run back on GitHub.](https://mintcdn.com/claude-code/gLJVaPQEgKC8ZyUD/images/code-review-pipeline.svg?fit=max\&auto=format\&n=gLJVaPQEgKC8ZyUD\&q=85\&s=0351c96df9efa3105172eb00a672f130)13![Diagram of a review in four stages. A pull request on GitHub goes to several agents that search in parallel on Anthropic infrastructure. A verification step drops false positives, the remaining findings are deduplicated and ranked by severity, and the review posts inline comments, a summary, and a check run back on GitHub.](https://mintcdn.com/claude-code/gLJVaPQEgKC8ZyUD/images/code-review-pipeline.svg?fit=max\&auto=format\&n=gLJVaPQEgKC8ZyUD\&q=85\&s=0351c96df9efa3105172eb00a672f130)

14 14 

Details

30* **`@claude review`**: runs a single review without subscribing to future pushes30* **`@claude review`**: runs a single review without subscribing to future pushes

31* **Drafts and pull requests from forks**: [automatic reviews skip both](https://code.claude.com/docs/en/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks), so pushes to them don't add reviews31* **Drafts and pull requests from forks**: [automatic reviews skip both](https://code.claude.com/docs/en/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks), so pushes to them don't add reviews

32 32 

33In a repository with a [Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md#what-approvals-costs) policy file, reviews can start that the **Review runs** setting wouldn't start, and [automatic ones can stop](https://code.claude.com/docs/en/approvals-policy.md#advisory).

34 

33## Estimate your spend35## Estimate your spend

34 36 

35Before a wide rollout, run a small pilot to estimate monthly spend from your own pull requests.37Before a wide rollout, run a small pilot to estimate monthly spend from your own pull requests.

36 38 

371. Set a [monthly spend limit](#limit-your-spend) for the pilot.391. Set a [monthly spend limit](#limit-your-spend) for the pilot.

382. Turn on Code Review for a few representative repositories with **Review runs** set to **Once after PR creation** or **Manual (@claude review)**.402. Turn on Code Review for a few representative repositories with **Review runs** set to **Once after PR creation** or **Manual (@claude review)**.

393. After several reviews have run, read each repository's average cost per review in the **Average cost** column of the **Repositories** table, in the **Code review** section of [**Admin settings > Claude Code**](https://claude.ai/admin-settings/claude-code#code-review).413. After several reviews have run, go to [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-code#code-review) and click **Edit** on each repository's row in the **Repositories** table. Read its average cost per review under **Cost**.

404. Multiply that average by the number of pull requests the repository opens in a month. For **After every push**, multiply again by the typical number of pushes per pull request.424. Multiply that average by the number of pull requests the repository opens in a month. For **After every push**, multiply again by the typical number of pushes per pull request.

41 43 

42A repository's average moves with the size of its pull requests and with the review level you choose.44A repository's average moves with the size of its pull requests and with the review level you choose.

Details

6 6 

7> Read Code Review findings on your GitHub pull request, respond to or dismiss them, and request a review with `@claude review`.7> Read Code Review findings on your GitHub pull request, respond to or dismiss them, and request a review with `@claude review`.

8 8 

9Code Review is a managed service that an Owner in your Claude organization turns on for a set of GitHub repositories. Once it's on, Claude reviews pull requests in those repositories and posts its findings as inline comments, a summary in the review body, and a check run named **Claude Code Review**. A review never approves or blocks your pull request, and the check run never concludes as a failure.9Code Review is a managed service that an Owner in your Claude organization turns on for a set of GitHub repositories. Once it's on, Claude reviews pull requests in those repositories. It posts its findings as inline comments, a summary in the review body, and a check run named **Claude Code Review**. An Owner controls [when reviews run](https://code.claude.com/docs/en/code-review-setup.md#set-when-reviews-run) and [how thorough they are](https://code.claude.com/docs/en/code-review-setup.md#set-the-default-review-level) for each repository.

10 10 

11An Owner controls [when reviews run](https://code.claude.com/docs/en/code-review-setup.md#set-when-reviews-run) and [how thorough they are](https://code.claude.com/docs/en/code-review-setup.md#set-the-default-review-level) for each repository.11By itself, a review doesn't approve or block your pull request, and the check run doesn't conclude as a failure. Where a repository has a [Claude Approvals](https://code.claude.com/docs/en/approvals.md#keep-automatic-code-reviews) policy file, the policy can use a review's result to decide who has to approve. It can also change which pull requests get an automatic review.

12 12 

13> [!NOTE]13> [!NOTE]

14>14>


34 34 

35To clear a finding, resolve its thread or push a fix.35To clear a finding, resolve its thread or push a fix.

36 36 

37* **Dismiss it without a code change**: resolve the thread yourself on GitHub. Replying alone doesn't dismiss a finding.37* **Dismiss it without a code change**: resolve the thread yourself on GitHub. Replying alone doesn't dismiss a finding. If your pull request has a **Claude Approvals** check, that check [may not count your resolve](https://code.claude.com/docs/en/approvals-troubleshooting.md#approvals-doesn’t-pass-after-you-resolve-a-review-thread).

38* **Fix the issue**: change the code and push. The next review of the pull request resolves its earlier thread when it judges the issue fixed, whether that review runs automatically on your push or you request it.38* **Fix the issue**: change the code and push. The next review of the pull request resolves its earlier thread when it judges the issue fixed, whether that review runs automatically on your push or you request it. Where [PR Steward](https://code.claude.com/docs/en/pr-steward.md#what-pr-steward-fixes) works on the pull request, it can push its own fix for an Important finding, so pull the branch before you start.

39* **Explain or disagree**: reply to the comment. Claude doesn't respond right away, and a reply doesn't start a review. The next review of the pull request reads the replies on its earlier findings, and can resolve the thread or post one follow-up reply. If the same kind of finding keeps coming back, ask a maintainer to add a rule to [`REVIEW.md`](https://code.claude.com/docs/en/code-review-customize#choose-what-to-write-in-review-md).39* **Explain or disagree**: reply to the comment. Claude doesn't respond right away, and a reply doesn't start a review. The next review of the pull request reads the replies on its earlier findings, and can resolve the thread or post one follow-up reply. If the same kind of finding keeps coming back, ask a maintainer to add a rule to [`REVIEW.md`](https://code.claude.com/docs/en/code-review-customize#choose-what-to-write-in-review-md).

40 40 

41To get that next review without pushing, comment `@claude review` as a [top-level pull request comment](#comment-commands).41To get that next review without pushing, comment `@claude review` as a [top-level pull request comment](#comment-commands).


58If the check run has one of these titles after you push, Code Review kept the result of an earlier review instead of starting a new one:58If the check run has one of these titles after you push, Code Review kept the result of an earlier review instead of starting a new one:

59 59 

60* **Code review skipped — no new changes**: no [Important](#severity-levels) finding from the earlier review is still open, so you don't need a new review60* **Code review skipped — no new changes**: no [Important](#severity-levels) finding from the earlier review is still open, so you don't need a new review

61* **Code review not repeated — earlier findings still open**: to start a new review, push a fix for an open Important finding, or [resolve its thread](#respond-to-findings) and push again61* **Code review not repeated — earlier findings still open**: to start a new review, push a fix for an open Important finding, or [resolve its thread](#respond-to-findings) and push again. If Claude Approvals reopens the thread, the title stays after your next push. Push a fix, or ask someone [whose resolve counts](https://code.claude.com/docs/en/approvals-policy.md#findings) to resolve it, then push again.

62 62 

63On github.com, Code Review can keep a result when both of these hold:63On github.com, Code Review can keep a result when both of these hold:

64 64 

Details

6 6 

7> Turn on Code Review for your Claude organization: connect GitHub, install the Claude GitHub App, choose repositories, and set when reviews run7> Turn on Code Review for your Claude organization: connect GitHub, install the Claude GitHub App, choose repositories, and set when reviews run

8 8 

9As an Owner of your Claude organization, you turn on Code Review in [**Admin settings > Claude Code**](https://claude.ai/admin-settings/claude-code#code-review) on claude.ai. Reviews run on Anthropic infrastructure, so you don't add workflow files to your repositories.9An Owner of your Claude organization turns on Code Review in [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-code#code-review) on claude.ai. Reviews run on Anthropic infrastructure, so you don't add workflow files to your repositories.

10 10 

11After setup, you choose how thorough reviews are and when they run in each repository. You spend more at a higher review level and when reviews run more often. See [Code Review costs](https://code.claude.com/docs/en/code-review-costs.md#pricing).11After setup, an Owner chooses how thorough reviews are and when they run in each repository. You spend more at a higher review level and when reviews run more often. See [Code Review costs](https://code.claude.com/docs/en/code-review-costs.md#pricing).

12 12 

13## What you need to turn on Code Review13## What you need to turn on Code Review

14 14 


22 22 

23## Turn on Code Review23## Turn on Code Review

24 24 

25**1. Click the Allow code review switch**25**1. Turn on the switch under Review**

26 26 

27Go to the **Code review** section of [**Admin settings > Claude Code**](https://claude.ai/admin-settings/claude-code#code-review) and click the **Allow code review** switch.27Go to [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-code#code-review) and turn on the switch under **Review**. In the **Turn on Code review** dialog, click **Turn on**.

28 28 

29If Code Review turns on right away with no dialog, your organization already has the Claude GitHub App linked or repositories added. Go to [Add more repositories](#add-more-repositories), then come back for the last step.29If your organization already has the Claude GitHub App linked or repositories added, no other dialog follows and Code Review is on. Go to [Add more repositories](#add-more-repositories), then come back for the last step.

30 30 

31**2. Connect your GitHub account**31**2. Connect your GitHub account**

32 32 


49 49 

50Select the repositories you want reviewed, then click the button that adds them, which reads **Add 2 repositories** when you've selected two. Adding a repository needs write access to it from the GitHub account you connected. You can [add more repositories](#add-more-repositories) later.50Select the repositories you want reviewed, then click the button that adds them, which reads **Add 2 repositories** when you've selected two. Adding a repository needs write access to it from the GitHub account you connected. You can [add more repositories](#add-more-repositories) later.

51 51 

52**5. Click Finish**52**5. Click Turn on**

53 53 

54A **Code review is set up** dialog follows. Click **Finish** to turn Code Review on. If you close the dialog any other way, your repositories stay added but **Allow code review** stays off, and you turn it on from the switch.54In the **Choose what Claude does on these repositories** dialog, leave **Code review** selected. If **Steward** is selected and you can change it, clear it unless you also want [PR Steward](https://code.claude.com/docs/en/pr-steward.md) on these repositories. Then click **Turn on**, which is the click that turns Code Review on.

55 

56If you close the dialog any other way, your repositories stay added and nothing is turned on. To turn Code Review on then, use the switch under **Review** again.

55 57 

56Each repository starts set to review after every push, which runs the most reviews. To run fewer, [set when reviews run](#set-when-reviews-run).58Each repository starts set to review after every push, which runs the most reviews. To run fewer, [set when reviews run](#set-when-reviews-run).

57 59 


65 67 

66## Set defaults for your organization68## Set defaults for your organization

67 69 

68As an Owner, you decide how thorough reviews are and how often they run. Both are in the **Code review** section of [**Admin settings > Claude Code**](https://claude.ai/admin-settings/claude-code#code-review).70An Owner decides how thorough reviews are and how often they run. Set both in [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-code#code-review): the default review level for your Claude organization, and when reviews run for each repository or for [a whole GitHub organization](#cover-a-whole-github-organization).

69 71 

70### Set the default review level72### Set the default review level

71 73 


92 94 

93Manual is useful for high-traffic repositories where you want to opt specific pull requests into review, or to start reviewing pull requests only once they're ready. To compare what each option does to spend, see [How often reviews run](https://code.claude.com/docs/en/code-review-costs.md#how-often-reviews-run).95Manual is useful for high-traffic repositories where you want to opt specific pull requests into review, or to start reviewing pull requests only once they're ready. To compare what each option does to spend, see [How often reviews run](https://code.claude.com/docs/en/code-review-costs.md#how-often-reviews-run).

94 96 

95To change the setting, click **Edit** on the repository's row in the **Repositories** table and select a **Review runs** option. The choice saves as soon as you select it, and the table's **Review runs** column shows it shortened to Once per PR, Every push, or Manual.97To change the setting on the [**Claude Ship**](https://claude.ai/admin-settings/claude-code#code-review) page, click **Edit** on the repository's row in the **Repositories** table and select a **Review runs** option:

98 

99![A repository's Edit dialog with the Review runs menu open, listing Once after PR creation, After every push, which is selected, and Manual (@claude review).](https://mintcdn.com/claude-code/cMjxXVBUSLLh9iVu/images/code-review-setup-review-runs-light.png?fit=max\&auto=format\&n=cMjxXVBUSLLh9iVu\&q=85\&s=fe7c63cddcc105ddf7bab4e10e104ba7)

100 

101Your choice saves as soon as you select it. The **Repositories** table's **Code review** column shows it shortened to Once per PR, Every push, or Manual.

96 102 

97* **Drafts and pull requests from forks**: whichever option you choose, [automatic reviews skip both](https://code.claude.com/docs/en/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks)103* **Drafts and pull requests from forks**: whichever option you choose, [automatic reviews skip both](https://code.claude.com/docs/en/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks)

98* **New repositories**: a repository you add from the **Add a repository** dialog starts at **After every push**. If its GitHub organization is [covered as a whole](#cover-a-whole-github-organization), it takes that organization row's setting instead.104* **New repositories**: a repository you add from the **Add a repository** dialog starts at **After every push**. If its GitHub organization is [covered as a whole](#cover-a-whole-github-organization), it takes that organization row's setting instead.

105* **A [Claude Approvals](https://code.claude.com/docs/en/approvals.md) policy file**: in a repository that has one, [reviews can start](https://code.claude.com/docs/en/approvals-setup.md#what-approvals-costs) that this setting wouldn't start, and [automatic ones can stop](https://code.claude.com/docs/en/approvals-policy.md#advisory)

99 106 

100### Turn tip comments on or off107### Turn tip comments on or off

101 108 


124 131 

125### Add more repositories132### Add more repositories

126 133 

127To add repositories after setup, click **Add** above the **Repositories** table in the **Code review** section. The **Add a repository** dialog opens. Select repositories and click the button that adds them, which reads **Add 2 repositories** when you've selected two.134To add repositories after setup, click **Add** above the **Repositories** table in [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-code#code-review). The **Add a repository** dialog opens. Select repositories and click the button that adds them, which reads **Add 2 repositories** when you've selected two.

128 135 

136* **A Connect GitHub dialog opens first**: follow the step [Connect your GitHub account](#turn-on-code-review), which ends with **Add a repository** open

129* **A repository isn't listed**: see [A repository isn't listed in Add a repository](https://code.claude.com/docs/en/code-review-troubleshooting.md#a-repository-isn’t-listed-in-add-a-repository).137* **A repository isn't listed**: see [A repository isn't listed in Add a repository](https://code.claude.com/docs/en/code-review-troubleshooting.md#a-repository-isn’t-listed-in-add-a-repository).

130* **You want every repository in a GitHub organization**: [cover the organization](#cover-a-whole-github-organization) instead of selecting repositories one at a time138* **You want every repository in a GitHub organization**: [cover the organization](#cover-a-whole-github-organization) instead of selecting repositories one at a time

139* **These are your organization's first repositories**: the **Choose what Claude does on these repositories** dialog follows. Set its checkboxes as in the step [Click Turn on](#turn-on-code-review), then click its button, which reads **Turn on** or **Done**. Either way, Code Review is on afterward.

131 140 

132### Cover a whole GitHub organization141### Cover a whole GitHub organization

133 142 


148 157 

149### Turn off Code Review or remove a repository158### Turn off Code Review or remove a repository

150 159 

151In the **Code review** section of [**Admin settings > Claude Code**](https://claude.ai/admin-settings/claude-code#code-review), pick the control that matches what you want to stop:160In [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-code#code-review), pick the control that matches what you want to stop:

152 161 

153* **One repository, keeping it in the list**: click **Edit** on its row and turn off **Code review**. The table shows the repository as Off.162* **One repository, keeping it in the list**: click **Edit** on its row and turn off **Code review**. The table shows the repository as Off.

154* **One repository, removing it**: click **Edit** on its row, then **Remove repository** at the bottom of the dialog. Reviews stop there, and another Claude organization can then set that repository up. While the repository's GitHub organization is covered as a whole, you can't remove it; turn off its **Code review** switch instead.163* **One repository, removing it**: click **Edit** on its row, then **Remove repository** at the bottom of the dialog. Another Claude organization can then set that repository up. While the repository's GitHub organization is covered as a whole, you can't remove it; turn off its **Code review** switch instead.

155* **A whole GitHub organization**: click **Edit** on the organization's row and select **Off**. This also turns off repositories in that organization that you added one at a time.164* **A whole GitHub organization**: click **Edit** on the organization's row and select **Off**. This also turns off repositories in that organization that you added one at a time.

156* **Everything**: turn off **Allow code review**. No new reviews start in any repository, and your repository list stays so you can turn it back on later.165* **Everything**: turn off the switch under **Review**. Your repository list stays so you can turn the switch back on later.

166 

167With a repository's **Code review** switch off, or with the switch under **Review** off, a [Claude Approvals](https://code.claude.com/docs/en/approvals-setup.md#what-approvals-costs) policy can start billed reviews. To stop those, change the policy or [turn off Approvals](https://code.claude.com/docs/en/approvals-setup.md#turn-off-approvals). Code Review's spend limit applies to them.

157 168 

158## Related resources169## Related resources

159 170 

Details

20| **Code review skipped — no new changes** | An automatic review didn't run on your latest push | To get a review anyway, comment `@claude review` |20| **Code review skipped — no new changes** | An automatic review didn't run on your latest push | To get a review anyway, comment `@claude review` |

21| **Code review not repeated — earlier findings still open** | An automatic review didn't run on your latest push, and Important findings from the earlier review are still open | Push a fix, or to get a review anyway, comment `@claude review`. See [When a push keeps the earlier result](https://code.claude.com/docs/en/code-review-pull-requests.md#when-a-push-keeps-the-earlier-result) |21| **Code review not repeated — earlier findings still open** | An automatic review didn't run on your latest push, and Important findings from the earlier review are still open | Push a fix, or to get a review anyway, comment `@claude review`. See [When a push keeps the earlier result](https://code.claude.com/docs/en/code-review-pull-requests.md#when-a-push-keeps-the-earlier-result) |

22| **Code review failed** or **Code review timed out** | The review didn't finish | To run it again, see [Retrigger a failed or timed-out review](#retrigger-a-failed-or-timed-out-review) |22| **Code review failed** or **Code review timed out** | The review didn't finish | To run it again, see [Retrigger a failed or timed-out review](#retrigger-a-failed-or-timed-out-review) |

23| **Code review not run: no policy rule uses it** | An automatic review didn't run, because of the repository's Claude Approvals policy | See [Code review not run: no policy rule uses it](#code-review-not-run-no-policy-rule-uses-it) |

23| **Code review declined** | The review didn't run | Read the check run's summary. If it names a budget or a spend limit, see [Review didn't run and the PR shows a budget message](#review-didn’t-run-and-the-pr-shows-a-budget-message) |24| **Code review declined** | The review didn't run | Read the check run's summary. If it names a budget or a spend limit, see [Review didn't run and the PR shows a budget message](#review-didn’t-run-and-the-pr-shows-a-budget-message) |

24| No check run | No review started | Comment `@claude review`. If no check run appears after that, see [A comment command didn't start a review](#a-comment-command-didn’t-start-a-review) |25| No check run | No review started | Comment `@claude review`. If no check run appears after that, see [A comment command didn't start a review](#a-comment-command-didn’t-start-a-review) |

25 26 

26## A review didn't start27## A review didn't start

27 28 

28Check these cases when no **Claude Code Review** check run appears, or when Claude posts a comment saying the review was skipped.29Check these cases when no **Claude Code Review** check run appears, or when Claude posts a comment saying the review was skipped. One case covers a check run whose title says that no review ran.

29 30 

30### A comment command didn't start a review31### A comment command didn't start a review

31 32 

32After you comment `@claude review`, look for a **Claude Code Review** check run titled **Code review queued...** or **Code review in progress...** on the pull request. An 👀 reaction on your comment doesn't confirm a review is coming. If no check run appears, check for each of these causes:33After you comment `@claude review`, look for a **Claude Code Review** check run titled **Code review queued...** or **Code review in progress...** on the pull request. An 👀 reaction on your comment doesn't confirm a review is coming. If no check run appears, check for each of these causes:

33 34 

34* **Code Review isn't on for this repository**: Claude posts no comment and no check run in response to the command. Ask an Owner to [add the repository](https://code.claude.com/docs/en/code-review-setup.md#add-more-repositories).35* **Code Review isn't on for this repository**: Claude posts no comment and no check run in response to the command. Ask an Owner to [add the repository](https://code.claude.com/docs/en/code-review-setup.md#add-more-repositories). Where a [Claude Approvals](https://code.claude.com/docs/en/approvals.md) policy reads Claude's review, a new comment with only `@claude review` can still start one.

35* **The comment doesn't meet a condition**: it was an inline comment or a review body rather than a new top-level comment, or the command wasn't at the start of the comment. Editing an earlier comment instead of posting a new one doesn't count either, and the pull request has to be open. See the [conditions for comment commands](https://code.claude.com/docs/en/code-review-pull-requests.md#comment-commands) and post a new comment that meets them.36* **The comment doesn't meet a condition**: it was an inline comment or a review body rather than a new top-level comment, or the command wasn't at the start of the comment. Editing an earlier comment instead of posting a new one doesn't count either, and the pull request has to be open. See the [conditions for comment commands](https://code.claude.com/docs/en/code-review-pull-requests.md#comment-commands) and post a new comment that meets them.

36* **You don't have write access**: you need write, maintain, or admin permission on the repository. On a pull request from a fork, the permission that counts is on the base repository. Unless the pull request is yours, Claude can reply with a [tip](https://code.claude.com/docs/en/code-review-setup.md#turn-tip-comments-on-or-off): "No review was started: manual reviews can only be requested by someone with write access to this repository." Ask someone with write access to comment instead.37* **You don't have write access**: you need write, maintain, or admin permission on the repository. On a pull request from a fork, the permission that counts is on the base repository. Unless the pull request is yours, Claude can reply with a [tip](https://code.claude.com/docs/en/code-review-setup.md#turn-tip-comments-on-or-off): "No review was started: manual reviews can only be requested by someone with write access to this repository." Ask someone with write access to comment instead.

37* **The budget ran out**: Claude posts a comment that begins with "⚠️ Code review skipped". See [Review didn't run and the PR shows a budget message](#review-didn’t-run-and-the-pr-shows-a-budget-message).38* **The budget ran out**: Claude posts a comment that begins with "⚠️ Code review skipped". See [Review didn't run and the PR shows a budget message](#review-didn’t-run-and-the-pr-shows-a-budget-message).

38 39 

40### Code review not run: no policy rule uses it

41 

42This title on the **Claude Code Review** check means that the repository has a [Claude Approvals](https://code.claude.com/docs/en/approvals.md) policy file, and the policy asks for no review on this pull request. To get a review anyway, comment `@claude review` on the pull request. To bring automatic reviews back, [name Code Review in a rule that has a `verdict` and matches the changed files](https://code.claude.com/docs/en/approvals-policy#advisory).

43 

39### Review didn't run and the PR shows a budget message44### Review didn't run and the PR shows a budget message

40 45 

41When your organization's budget can't cover a review, Code Review skips the review and Claude posts a comment on the pull request that begins with "⚠️ Code review skipped". In some of these cases a check run titled **Code review declined** also appears.46When your organization's budget can't cover a review, Code Review skips the review and Claude posts a comment on the pull request that begins with "⚠️ Code review skipped". In some of these cases a check run titled **Code review declined** also appears.


88 93 

89### No check run appears on the test pull request94### No check run appears on the test pull request

90 95 

91Confirm that **Allow code review** is on, that the repository is listed under **Repositories** in the **Code review** section, and that the Claude GitHub App has access to it. Automatic reviews skip draft pull requests, and a repository set to **Manual (@claude review)** needs an `@claude review` comment to start the first review.96In [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-code#code-review), confirm that the switch under **Review** is on and that the repository is listed under **Repositories**. Also confirm that the Claude GitHub App has access to it. Automatic reviews skip draft pull requests, and a repository set to **Manual (@claude review)** needs an `@claude review` comment to start the first review.

92 97 

93## Related resources98## Related resources

94 99 

commands.md +4 −1

Details

4 4 

5# Commands5# Commands

6 6 

7> Complete reference for commands available in Claude Code, including built-in commands and bundled skills.7> Reference for commands available in Claude Code, including built-in commands and bundled skills.

8 8 

9Commands control Claude Code from inside a session. They provide a quick way to switch models, manage permissions, clear context, run a workflow, and more.9Commands control Claude Code from inside a session. They provide a quick way to switch models, manage permissions, clear context, run a workflow, and more.

10 10 


140| `/security-review` | Analyze the changes on your current branch for security vulnerabilities. Reviews the diff between your branch and origin's default branch, identifying risks like injection, auth issues, and data exposure. Needs an `origin` remote; if the review fails with an `ambiguous argument` error, see the [error reference](https://code.claude.com/docs/en/errors.md#security-review-fails-without-origin-head) |140| `/security-review` | Analyze the changes on your current branch for security vulnerabilities. Reviews the diff between your branch and origin's default branch, identifying risks like injection, auth issues, and data exposure. Needs an `origin` remote; if the review fails with an `ambiguous argument` error, see the [error reference](https://code.claude.com/docs/en/errors.md#security-review-fails-without-origin-head) |

141| `/setup-bedrock` | Configure [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md) authentication, region, and model pins through an interactive wizard. [Hidden from the command menu](#how-the-command-menu-matches-what-you-type) until `CLAUDE_CODE_USE_BEDROCK=1` is set; type it in full. First-time Amazon Bedrock users can also access this wizard from the login screen |141| `/setup-bedrock` | Configure [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md) authentication, region, and model pins through an interactive wizard. [Hidden from the command menu](#how-the-command-menu-matches-what-you-type) until `CLAUDE_CODE_USE_BEDROCK=1` is set; type it in full. First-time Amazon Bedrock users can also access this wizard from the login screen |

142| `/setup-vertex` | Configure [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md) authentication, project, region, and model pins through an interactive wizard. [Hidden from the command menu](#how-the-command-menu-matches-what-you-type) until `CLAUDE_CODE_USE_VERTEX=1` is set; type it in full. First-time Google Cloud's Agent Platform users can also access this wizard from the login screen |142| `/setup-vertex` | Configure [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md) authentication, project, region, and model pins through an interactive wizard. [Hidden from the command menu](#how-the-command-menu-matches-what-you-type) until `CLAUDE_CODE_USE_VERTEX=1` is set; type it in full. First-time Google Cloud's Agent Platform users can also access this wizard from the login screen |

143| `/ship [level] [pr] [+bot]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Commit and push your work and open a GitHub pull request, if your branch has none. Then review the change. Claude then watches the pull request in this session and pushes fixes for review feedback and failing checks. `/ship stop` ends the watch. See [Get a pull request ready with `/ship`](https://code.claude.com/docs/en/ship-command). If the command is missing, see [Troubleshooting](https://code.claude.com/docs/en/ship-command-troubleshooting.md) |

144| `/ship:review` | Alias for [`/code-review`](https://code.claude.com/docs/en/code-review-local) |

143| `/simplify [target]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Review the changed code for cleanup opportunities and apply the fixes. Four review [agents](https://code.claude.com/docs/en/sub-agents.md) run in parallel, covering reuse of existing helpers, simplification, efficiency, and whether the change is at the right level of abstraction. The review doesn't look for correctness bugs. Use `/code-review` to find bugs. Pass a path or PR reference to review a specific target |145| `/simplify [target]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Review the changed code for cleanup opportunities and apply the fixes. Four review [agents](https://code.claude.com/docs/en/sub-agents.md) run in parallel, covering reuse of existing helpers, simplification, efficiency, and whether the change is at the right level of abstraction. The review doesn't look for correctness bugs. Use `/code-review` to find bugs. Pass a path or PR reference to review a specific target |

144| `/skill-doctor` | Show what each of your [skills](https://code.claude.com/docs/en/skills.md) costs in context and how often it gets used, so you can [find skills to turn off](https://code.claude.com/docs/en/skills.md#find-unused-skills). Requires Claude Code v2.1.252 or later and [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) |146| `/skill-doctor` | Show what each of your [skills](https://code.claude.com/docs/en/skills.md) costs in context and how often it gets used, so you can [find skills to turn off](https://code.claude.com/docs/en/skills.md#find-unused-skills). Requires Claude Code v2.1.252 or later and [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) |

145| `/skills` | List available [skills](https://code.claude.com/docs/en/skills.md). Type to filter the list by name, description, or source. Press `t` to sort by token count, `Space` or `Enter` to [cycle a skill's visibility to Claude and the `/` menu](https://code.claude.com/docs/en/skills#override-skill-visibility-from-settings), and `Esc` to save and close. You can't cycle plugin skills, skills whose frontmatter sets `disable-model-invocation: true`, or skills with a `skillOverrides` entry in managed settings or the `--settings` flag |147| `/skills` | List available [skills](https://code.claude.com/docs/en/skills.md). Type to filter the list by name, description, or source. Press `t` to sort by token count, `Space` or `Enter` to [cycle a skill's visibility to Claude and the `/` menu](https://code.claude.com/docs/en/skills#override-skill-visibility-from-settings), and `Esc` to save and close. You can't cycle plugin skills, skills whose frontmatter sets `disable-model-invocation: true`, or skills with a `skillOverrides` entry in managed settings or the `--settings` flag |


147| `/stats` | Alias for `/usage`. Opens on the Stats tab |149| `/stats` | Alias for `/usage`. Opens on the Stats tab |

148| `/status` | Open the Settings interface on the Status tab, showing version, model, account, and connectivity. A `Session kind` row reads `background job · attached` or `background job · unattended` in a [background session](https://code.claude.com/docs/en/agent-view.md), depending on whether a terminal is attached, and `interactive` in any other session. Works while Claude is responding |150| `/status` | Open the Settings interface on the Status tab, showing version, model, account, and connectivity. A `Session kind` row reads `background job · attached` or `background job · unattended` in a [background session](https://code.claude.com/docs/en/agent-view.md), depending on whether a terminal is attached, and `interactive` in any other session. Works while Claude is responding |

149| `/statusline` | Configure Claude Code's [status line](https://code.claude.com/docs/en/statusline.md). Describe what you want, or run without arguments to auto-configure from your shell prompt |151| `/statusline` | Configure Claude Code's [status line](https://code.claude.com/docs/en/statusline.md). Describe what you want, or run without arguments to auto-configure from your shell prompt |

152| `/steward [pr] [+bot]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Watch your open GitHub pull request in this session and push fixes for review feedback and failing checks, without the review that [`/ship`](https://code.claude.com/docs/en/ship-command) runs first. `/steward stop` ends the watch. See [Watch without a review using `/steward`](https://code.claude.com/docs/en/ship-command#start-a-watch-with-%2Fsteward). If the command is missing, see [Troubleshooting](https://code.claude.com/docs/en/ship-command-troubleshooting.md). Alias: `/ship:steward` |

150| `/stickers` | Check Claude Code sticker availability |153| `/stickers` | Check Claude Code sticker availability |

151| `/stop` | Stop the [background session](https://code.claude.com/docs/en/agent-view.md) you're attached to, or the one you send it to as a [peek reply](https://code.claude.com/docs/en/agent-view.md#peek-and-reply); the transcript and any worktree are kept. To detach without stopping, use `/exit` or press `←` |154| `/stop` | Stop the [background session](https://code.claude.com/docs/en/agent-view.md) you're attached to, or the one you send it to as a [peek reply](https://code.claude.com/docs/en/agent-view.md#peek-and-reply); the transcript and any worktree are kept. To detach without stopping, use `/exit` or press `←` |

152| `/subtask <task>` | Spawn a [forked subagent](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation): a background subagent that inherits the full conversation and works on the task while you keep working. Its result returns to this conversation when it finishes. To copy the conversation into a separate background session instead, use `/fork`. When [agent view is turned off](https://code.claude.com/docs/en/agent-view.md#turn-off-agent-view), `/subtask` isn't available and `/fork` spawns the forked subagent instead |155| `/subtask <task>` | Spawn a [forked subagent](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation): a background subagent that inherits the full conversation and works on the task while you keep working. Its result returns to this conversation when it finishes. To copy the conversation into a separate background session instead, use `/fork`. When [agent view is turned off](https://code.claude.com/docs/en/agent-view.md#turn-off-agent-view), `/subtask` isn't available and `/fork` spawns the forked subagent instead |

Details

517| Write tests | "write tests for \[file] that cover the edge cases around \[scenario]" |517| Write tests | "write tests for \[file] that cover the edge cases around \[scenario]" |

518| Review before commit | "look at my working diff and tell me what looks risky" |518| Review before commit | "look at my working diff and tell me what looks risky" |

519| Open a PR | "fix \[issue], write a conventional commit, and open a PR with a summary" |519| Open a PR | "fix \[issue], write a conventional commit, and open a PR with a summary" |

520| Make a skill | "make me a /ship skill that runs tests and lint before commit" |520| Make a skill | "make me a /precommit skill that runs tests and lint before commit" |

521| Debug a stack trace | "here's the stack trace, find the root cause, don't just paper over it" |521| Debug a stack trace | "here's the stack trace, find the root cause, don't just paper over it" |

522 522 

523> [!TIP]523> [!TIP]

costs.md +1 −1

Details

183* **Cap spend**: the seat allowance is the default ceiling. To let members continue past it, turn on [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) and set spend limits at the organization, group, or individual member level.183* **Cap spend**: the seat allowance is the default ceiling. To let members continue past it, turn on [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) and set spend limits at the organization, group, or individual member level.

184* **Pull per-user numbers**: on the Enterprise plan, the [Enterprise Analytics API](https://platform.claude.com/docs/en/api/admin/analytics) returns per-user usage and cost reports across Claude surfaces, including Claude Code. A Primary Owner creates a key with the `read:analytics` scope at [claude.ai/analytics/api-keys](https://claude.ai/analytics/api-keys). On the Teams plan, export the [spend report CSV](https://support.claude.com/en/articles/12883420-view-usage-analytics-for-team-and-enterprise-plans), which lists token usage and estimated spend per user and per model.184* **Pull per-user numbers**: on the Enterprise plan, the [Enterprise Analytics API](https://platform.claude.com/docs/en/api/admin/analytics) returns per-user usage and cost reports across Claude surfaces, including Claude Code. A Primary Owner creates a key with the `read:analytics` scope at [claude.ai/analytics/api-keys](https://claude.ai/analytics/api-keys). On the Teams plan, export the [spend report CSV](https://support.claude.com/en/articles/12883420-view-usage-analytics-for-team-and-enterprise-plans), which lists token usage and estimated spend per user and per model.

185 185 

186The [Claude Enterprise consumption guide](https://support.claude.com/en/articles/14782391-claude-enterprise-consumption-guide) is the planning reference for admins. It explains how consumption differs across Claude chat, Claude Code, and Cowork, and gives per-user dollar starting points for budgeting. Budget more for a coding seat than a chat seat: each Claude Code turn carries file contents, tool calls, and multi-step reasoning, so one debugging session can consume more than a day of chat.186The [Claude Enterprise consumption guide](https://support.claude.com/en/articles/14782391-claude-enterprise-consumption-guide) is the planning reference for admins. It explains how consumption differs across Claude chat, Claude Code, and Cowork. Budget more for a coding seat than a chat seat: each Claude Code turn carries file contents, tool calls, and multi-step reasoning, so one debugging session can consume more than a day of chat.

187 187 

188### Claude Console188### Claude Console

189 189 

desktop.md +8 −6

Details

176 176 

177The Browser pane is a tabbed browser, so you can open documentation, issue trackers, or any other site next to your running app. To open the Browser, press **Cmd+Shift+B** on macOS or **Ctrl+Shift+B** on Windows, or [select **Browser**](#arrange-your-workspace). You can sign in to sites in the pane, including popup sign-in flows such as Google OAuth.177The Browser pane is a tabbed browser, so you can open documentation, issue trackers, or any other site next to your running app. To open the Browser, press **Cmd+Shift+B** on macOS or **Ctrl+Shift+B** on Windows, or [select **Browser**](#arrange-your-workspace). You can sign in to sites in the pane, including popup sign-in flows such as Google OAuth.

178 178 

179The first time you click an external link in the chat, a dialog asks whether links open in the Browser pane or in your default browser. To change your choice later, use **Open links in built-in browser** in the Browser pane's **⋮** menu. **Cmd**-click on macOS or **Ctrl**-click on Windows opens a link in your default browser directly.179The first time you click an external link in the chat, a dialog asks whether links open in the Browser pane or in your default browser. To change your choice later, use **Open links in built-in browser** in the Browser pane's **⋮** menu. If it isn't there, open **More settings** in that menu. **Cmd**-click on macOS or **Ctrl**-click on Windows opens a link in your default browser directly.

180 180 

181Claude can read and interact with external pages using the same tools it uses to [verify your app](#preview-your-app), with two additional safety checks:181Claude can read and interact with external pages using the same tools it uses to [verify your app](#preview-your-app), with two additional safety checks:

182 182 


216 216 

217In local, [SSH](#ssh-sessions), and [WSL](https://code.claude.com/docs/en/desktop-wsl.md) sessions, the findings appear as a **Code review** card, grouped by file. Use the card to act on them:217In local, [SSH](#ssh-sessions), and [WSL](https://code.claude.com/docs/en/desktop-wsl.md) sessions, the findings appear as a **Code review** card, grouped by file. Use the card to act on them:

218 218 

219* Click **Walk through in Changes** to open the diff view and step through the findings one at a time. A finding in the current diff appears at its line, where you can click **Fix this one** or dismiss it.219* Click **Walk through in changes** to open the diff view and step through the findings one at a time. A finding in the current diff appears at its line, where you can click **Fix this one** or dismiss it.

220* Click **Apply fixes** to ask Claude to fix the findings that are still open.220* Click **Apply fixes** to ask Claude to fix the findings that are still open.

221 221 

222In any session, you can also ask Claude in the prompt box to fix what the review found. For what `/code-review` looks for and the arguments it takes, see [Review locally with `/code-review`](https://code.claude.com/docs/en/code-review-local).222In any session, you can also ask Claude in the prompt box to fix what the review found. For what `/code-review` looks for and the arguments it takes, see [Review locally with `/code-review`](https://code.claude.com/docs/en/code-review-local).


264 264 

265To hide or show the panel, click **Hide session rail** or **Show session rail** in the session's title bar, or in the bar's **⋮** menu. If you see neither name, click **Activity panel** in the title bar. If you still don't see the panel, [check which Code tab layout you have](#check-which-layout-you-have).265To hide or show the panel, click **Hide session rail** or **Show session rail** in the session's title bar, or in the bar's **⋮** menu. If you see neither name, click **Activity panel** in the title bar. If you still don't see the panel, [check which Code tab layout you have](#check-which-layout-you-have).

266 266 

267If the panel disappears when a mod's [backdrop](https://code.claude.com/docs/en/plugins/mods/interface.md#put-a-backdrop-behind-the-conversation) shows, click **Show session rail** or **Activity panel** to bring it back.

268 

267### Minimize a pane269### Minimize a pane

268 270 

269To keep the Terminal, Browser, [iOS Simulator](https://code.claude.com/docs/en/desktop-ios-simulator.md), or a [side chat](#ask-a-side-question-without-derailing-the-session) in view at a small size, click **Minimize** in the pane's header. The button requires Claude Desktop v4.0.0 or later. With a [third-party provider](https://code.claude.com/docs/en/third-party-integrations.md) it requires v5.11492.0 or later, so [check your version](#check-your-version). The Browser pane has the button only in local sessions.271To keep the Terminal, Browser, [iOS Simulator](https://code.claude.com/docs/en/desktop-ios-simulator.md), or a [side chat](#ask-a-side-question-without-derailing-the-session) in view at a small size, click **Minimize** in the pane's header. The button requires Claude Desktop v4.0.0 or later. With a [third-party provider](https://code.claude.com/docs/en/third-party-integrations.md) it requires v5.11492.0 or later, so [check your version](#check-your-version). The Browser pane has the button only in local sessions.


628 630 

629Connect external services, add reusable workflows, customize Claude's behavior, and configure preview servers. To manage connectors, skills, and plugins in one place, click **Customize** or **Plugins** in the sidebar. [Cowork](https://claude.com/product/cowork) in the Desktop app sources its skills, plugins, and connectors from this configuration, which syncs through your claude.ai account, not from the CLI's `~/.claude` directory.631Connect external services, add reusable workflows, customize Claude's behavior, and configure preview servers. To manage connectors, skills, and plugins in one place, click **Customize** or **Plugins** in the sidebar. [Cowork](https://claude.com/product/cowork) in the Desktop app sources its skills, plugins, and connectors from this configuration, which syncs through your claude.ai account, not from the CLI's `~/.claude` directory.

630 632 

631Claude Code also loads the skills and plugins enabled for your claude.ai account in terminal sessions where you sign in with the same account. See [Skills synced from claude.ai](https://code.claude.com/docs/en/skills.md#how-synced-skills-behave) and [Plugins synced from claude.ai](https://code.claude.com/docs/en/plugins/loading.md#synced-plugins).633To find out where else the skills and plugins enabled for your claude.ai account load, see [Skills synced from claude.ai](https://code.claude.com/docs/en/skills.md#how-synced-skills-behave) and [Plugins synced from claude.ai](https://code.claude.com/docs/en/plugins/loading.md#synced-plugins).

632 634 

633### Connect external tools635### Connect external tools

634 636 


676 678 

677> [!NOTE]679> [!NOTE]

678>680>

679> The plugin browser is not available in cloud sessions, and plugins you install from the desktop app for your user account or as local-only aren't available there. See [What carries over from your setup](https://code.claude.com/docs/en/cloud-environments.md#what-carries-over-from-your-setup). Plugins aren't available in WSL sessions.681> Plugins you install on your computer at user or local scope aren't available in cloud sessions. To use one there, see the **Cloud session** tab under [Install a plugin](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin). Plugins aren't available in WSL sessions.

680 682 

681For the full plugin reference including creating your own plugins, see [plugins](https://code.claude.com/docs/en/plugins/overview.md).683For the full plugin reference including creating your own plugins, see [plugins](https://code.claude.com/docs/en/plugins/overview.md).

682 684 


706 708 

707When `autoVerify` is enabled, Claude automatically verifies code changes after editing files. It takes screenshots, checks for errors, and confirms changes work before completing its response.709When `autoVerify` is enabled, Claude automatically verifies code changes after editing files. It takes screenshots, checks for errors, and confirms changes work before completing its response.

708 710 

709Auto-verify is on by default. Disable it per-project by adding `"autoVerify": false` to `.claude/launch.json`, or turn off **Auto-verify changes** in the Browser pane's **⋮** menu.711Auto-verify is on by default. Disable it per-project by adding `"autoVerify": false` to `.claude/launch.json`, or turn off **Auto-verify changes** in the Browser pane's **⋮** menu. If it isn't there, open **More settings** in that menu.

710 712 

711```json theme={null}713```json theme={null}

712{714{


2093 2095 

2094In local and SSH sessions, the desktop app delivers each user's connected claude.ai connectors to Claude Code directly. No MCP setting or `managed-mcp.json` reaches those connectors, whichever settings source or file location you use. To block a connector's tools in these sessions, use your organization's [connector tool controls](https://code.claude.com/docs/en/mcp.md#organization-controls-on-connector-tools). [How connectors reach Claude Code](https://code.claude.com/docs/en/mcp.md#how-connectors-reach-claude-code) shows which settings govern connectors in each kind of session.2096In local and SSH sessions, the desktop app delivers each user's connected claude.ai connectors to Claude Code directly. No MCP setting or `managed-mcp.json` reaches those connectors, whichever settings source or file location you use. To block a connector's tools in these sessions, use your organization's [connector tool controls](https://code.claude.com/docs/en/mcp.md#organization-controls-on-connector-tools). [How connectors reach Claude Code](https://code.claude.com/docs/en/mcp.md#how-connectors-reach-claude-code) shows which settings govern connectors in each kind of session.

2095 2097 

2096`permissions.disableBypassPermissionsMode` and `disableAutoMode` also work in user and project settings, but placing them in managed settings prevents users from overriding them.2098To keep users from overriding `permissions.disableBypassPermissionsMode` or `disableAutoMode`, set it in managed settings.

2097 2099 

2098For the permission, plugin, and delivery keys only a managed source can set, see [Keys only managed settings can set](https://code.claude.com/docs/en/managed-settings.md#managed-only-settings).2100For the permission, plugin, and delivery keys only a managed source can set, see [Keys only managed settings can set](https://code.claude.com/docs/en/managed-settings.md#managed-only-settings).

2099 2101 

Details

10>10>

11> Linux support for the Claude desktop app is in beta.11> Linux support for the Claude desktop app is in beta.

12 12 

13The desktop app on Linux gives you the same Chat, Cowork, and Claude Code experience as on macOS and Windows: parallel sessions, visual diff review, an integrated terminal and editor, and live app preview. See [Use Claude Code Desktop](https://code.claude.com/docs/en/desktop.md) for the feature reference.13The desktop app on Linux gives you Chat, [Cowork](#cowork-requirements), and Claude Code. In the desktop app, Claude Code has parallel sessions, visual diff review, an integrated terminal and editor, and live app preview. See [Use Claude Code Desktop](https://code.claude.com/docs/en/desktop.md) for the feature reference.

14 14 

15## Requirements15## Requirements

16 16 


165* **Computer Use**: [app and screen control](https://code.claude.com/docs/en/desktop.md#let-claude-use-your-computer) isn't available on Linux.165* **Computer Use**: [app and screen control](https://code.claude.com/docs/en/desktop.md#let-claude-use-your-computer) isn't available on Linux.

166* **Dictation**: voice input isn't available in the Linux desktop app. Use [voice dictation](https://code.claude.com/docs/en/voice-dictation.md) in the CLI instead.166* **Dictation**: voice input isn't available in the Linux desktop app. Use [voice dictation](https://code.claude.com/docs/en/voice-dictation.md) in the CLI instead.

167* **Quick Entry global hotkey**: works on X11. On native Wayland it requires your desktop environment's GlobalShortcuts portal.167* **Quick Entry global hotkey**: works on X11. On native Wayland it requires your desktop environment's GlobalShortcuts portal.

168* **Fedora and RHEL**: only Debian-based distributions are supported today. Support for additional distributions is coming in the future.168* **Fedora and RHEL**: only Debian-based distributions are supported today.

169 169 

170For anything not yet available in the desktop app, the [CLI](https://code.claude.com/docs/en/quickstart.md) runs the same Claude Code engine and supports a wider range of Linux distributions; see the [system requirements](https://code.claude.com/docs/en/setup.md#system-requirements).170For anything not yet available in the desktop app, the [CLI](https://code.claude.com/docs/en/quickstart.md) runs the same Claude Code engine and supports a wider range of Linux distributions; see the [system requirements](https://code.claude.com/docs/en/setup.md#system-requirements).

Details

100 100 

101You've made your first edit. For the full reference on everything Desktop can do, see [Use Claude Code Desktop](https://code.claude.com/docs/en/desktop.md). Here are some things to try next.101You've made your first edit. For the full reference on everything Desktop can do, see [Use Claude Code Desktop](https://code.claude.com/docs/en/desktop.md). Here are some things to try next.

102 102 

103**Interrupt and steer.** You can redirect Claude at any point. Click the stop button to interrupt immediately, or type a correction and press **Enter** to send it without stopping the running action. Either way, you don't have to wait for it to finish or start over.103**Interrupt and steer.** You can redirect Claude at any point. Click the stop button to interrupt immediately, or type a correction and press **Enter** to send it without stopping the running action.

104 104 

105**Give Claude more context.** Type `@filename` in the prompt box to pull a specific file into the conversation. The more context Claude has, the better the results. See [Add files and context](https://code.claude.com/docs/en/desktop.md#add-files-and-context-to-prompts).105**Give Claude more context.** Type `@filename` in the prompt box to pull a specific file into the conversation. The more context Claude has, the better the results. See [Add files and context](https://code.claude.com/docs/en/desktop.md#add-files-and-context-to-prompts).

106 106 

env-vars.md +3 −3

Details

316| `CLAUDE_CODE_FORCE_TERMINAL_IMAGES` | Set to `1` to draw [mod `Image` elements](https://code.claude.com/docs/en/plugins/mods/reference#elements) as pictures when your terminal draws kitty graphics protocol images with Unicode placeholders and you still see an `Image`'s dimmed `alt` text. See [which terminals draw an `Image` and where not to set this variable](https://code.claude.com/docs/en/plugins/mods/gallery#image-and-client) |316| `CLAUDE_CODE_FORCE_TERMINAL_IMAGES` | Set to `1` to draw [mod `Image` elements](https://code.claude.com/docs/en/plugins/mods/reference#elements) as pictures when your terminal draws kitty graphics protocol images with Unicode placeholders and you still see an `Image`'s dimmed `alt` text. See [which terminals draw an `Image` and where not to set this variable](https://code.claude.com/docs/en/plugins/mods/gallery#image-and-client) |

317| `CLAUDE_CODE_FORK_SUBAGENT` | Controls fork mode, which is on by default and lets Claude start [forks](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation) on its own. Set to `0` to turn fork mode off, for example to [let Claude wait for a subagent](https://code.claude.com/docs/en/sub-agents.md#let-claude-wait-for-a-subagent). For versions, see [Turn fork mode off](https://code.claude.com/docs/en/sub-agents.md#turn-fork-mode-on-or-off) |317| `CLAUDE_CODE_FORK_SUBAGENT` | Controls fork mode, which is on by default and lets Claude start [forks](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation) on its own. Set to `0` to turn fork mode off, for example to [let Claude wait for a subagent](https://code.claude.com/docs/en/sub-agents.md#let-claude-wait-for-a-subagent). For versions, see [Turn fork mode off](https://code.claude.com/docs/en/sub-agents.md#turn-fork-mode-on-or-off) |

318| `CLAUDE_CODE_FORWARD_SUBAGENT_TEXT` | Set to `1` to emit [subagent](https://code.claude.com/docs/en/sub-agents.md) text and thinking blocks in `claude -p --output-format stream-json` output, the same behavior as the [`--forward-subagent-text`](https://code.claude.com/docs/en/cli-reference#cli-flags) flag. Use the variable when a harness invokes `claude` and can't pass the flag itself. Unlike the flag, which exits with an error outside non-interactive mode with stream-json output, the variable is ignored there so that nested invocations keep working when it's set process-wide. Requires Claude Code v2.1.211 or later |318| `CLAUDE_CODE_FORWARD_SUBAGENT_TEXT` | Set to `1` to emit [subagent](https://code.claude.com/docs/en/sub-agents.md) text and thinking blocks in `claude -p --output-format stream-json` output, the same behavior as the [`--forward-subagent-text`](https://code.claude.com/docs/en/cli-reference#cli-flags) flag. Use the variable when a harness invokes `claude` and can't pass the flag itself. Unlike the flag, which exits with an error outside non-interactive mode with stream-json output, the variable is ignored there so that nested invocations keep working when it's set process-wide. Requires Claude Code v2.1.211 or later |

319| `CLAUDE_CODE_FULL_SIGN_IN_LINK` | Set to `1` to print the full claude.ai login URL instead of a short one. Use it when the short URL shows an error or your script reads values from the URL. Set it in your shell or user settings. Requires Claude Code v2.1.330 or later |319| `CLAUDE_CODE_FULL_SIGN_IN_LINK` | Set to `1` to print the full login URL. Use it when a short login URL shows an error or your script reads values from the URL. Set it in your shell or user settings. Requires Claude Code v2.1.330 or later |

320| `CLAUDE_CODE_GATEWAY_HINT_HEADERS` | Set to `1` to send the [gateway hint headers](https://code.claude.com/docs/en/llm-gateway-protocol.md#gateway-hint-headers), such as `x-claude-code-request-class` and `x-claude-code-compaction`, on a custom proxy or a third-party provider such as Amazon Bedrock or Claude Platform on AWS. Set to `0` to stop sending them on every connection, including a direct connection to the Anthropic API, where Claude Code sends them by default. Requires Claude Code v2.1.273 or later |320| `CLAUDE_CODE_GATEWAY_HINT_HEADERS` | Set to `1` to send the [gateway hint headers](https://code.claude.com/docs/en/llm-gateway-protocol.md#gateway-hint-headers), such as `x-claude-code-request-class` and `x-claude-code-compaction`, on a custom proxy or a third-party provider such as Amazon Bedrock or Claude Platform on AWS. Set to `0` to stop sending them on every connection, including a direct connection to the Anthropic API, where Claude Code sends them by default. Requires Claude Code v2.1.273 or later |

321| `CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS` | Timeout in milliseconds for the [gateway model discovery](https://code.claude.com/docs/en/llm-gateway-protocol.md#model-discovery) request that `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY` turns on (default: `3000`). Raise it when your gateway needs longer than three seconds to answer `/v1/models` at startup. Takes plain digits only; `0`, negative values, and other spellings keep the default. Requires Claude Code v2.1.269 or later |321| `CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS` | Timeout in milliseconds for the [gateway model discovery](https://code.claude.com/docs/en/llm-gateway-protocol.md#model-discovery) request that `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY` turns on (default: `3000`). Raise it when your gateway needs longer than three seconds to answer `/v1/models` at startup. Takes plain digits only; `0`, negative values, and other spellings keep the default. Requires Claude Code v2.1.269 or later |

322| `CLAUDE_CODE_GIT_BASH_PATH` | Windows only: path to the Git Bash executable (`bash.exe`). Use when Git Bash is installed but not in your PATH. If the path doesn't exist or the file isn't named `bash.exe`, `sh.exe`, `bash`, or `sh`, Claude Code ignores the variable and auto-detects Git Bash as if it were unset, logging a warning visible with `--debug`. Before v2.1.219, Claude Code exited at startup when the path didn't exist, and used any existing file as the shell without checking that it was bash or sh. See [Windows setup](https://code.claude.com/docs/en/setup.md#set-up-on-windows) |322| `CLAUDE_CODE_GIT_BASH_PATH` | Windows only: path to the Git Bash executable (`bash.exe`). Use when Git Bash is installed but not in your PATH. If the path doesn't exist or the file isn't named `bash.exe`, `sh.exe`, `bash`, or `sh`, Claude Code ignores the variable and auto-detects Git Bash as if it were unset, logging a warning visible with `--debug`. Before v2.1.219, Claude Code exited at startup when the path didn't exist, and used any existing file as the shell without checking that it was bash or sh. See [Windows setup](https://code.claude.com/docs/en/setup.md#set-up-on-windows) |


600* Run [`claude import` or the `/import` command](https://code.claude.com/docs/en/cli-reference#cli-commands)600* Run [`claude import` or the `/import` command](https://code.claude.com/docs/en/cli-reference#cli-commands)

601* Run [`/skill-doctor`](https://code.claude.com/docs/en/skills#find-unused-skills) or open its report in the `/plugin` **Stats** tab601* Run [`/skill-doctor`](https://code.claude.com/docs/en/skills#find-unused-skills) or open its report in the `/plugin` **Stats** tab

602* Run [`/restart`](https://code.claude.com/docs/en/commands) on Pro, Max, and Ultra plans602* Run [`/restart`](https://code.claude.com/docs/en/commands) on Pro, Max, and Ultra plans

603* Run [`/ship` or `/steward`](https://code.claude.com/docs/en/ship-command)

603* Sync the [skills](https://code.claude.com/docs/en/skills.md#where-synced-skills-load) and [plugins](https://code.claude.com/docs/en/plugins/loading.md#synced-plugins) enabled for your claude.ai account into your terminal sessions604* Sync the [skills](https://code.claude.com/docs/en/skills.md#where-synced-skills-load) and [plugins](https://code.claude.com/docs/en/plugins/loading.md#synced-plugins) enabled for your claude.ai account into your terminal sessions

604* Turn on the [You should know mod](https://code.claude.com/docs/en/interactive-mode.md#you-should-know-suggestions)605* Turn on the [You should know mod](https://code.claude.com/docs/en/interactive-mode.md#you-should-know-suggestions)

605* Use [the advisor tool](https://code.claude.com/docs/en/advisor.md#requirements), except with Claude Code v2.1.300 or later on Claude Platform on AWS or [Claude Models on Google Cloud (Anthropic managed)](https://code.claude.com/docs/en/feature-availability.md#availability-by-model-provider)606* Use [the advisor tool](https://code.claude.com/docs/en/advisor.md#requirements), except with Claude Code v2.1.300 or later on Claude Platform on AWS or [Claude Models on Google Cloud (Anthropic managed)](https://code.claude.com/docs/en/feature-availability.md#availability-by-model-provider)

606* Use [MCP tasks](https://code.claude.com/docs/en/mcp.md#mcp-tasks-that-run-on-the-server)607* Use [MCP tasks](https://code.claude.com/docs/en/mcp.md#mcp-tasks-that-run-on-the-server)

607* Turn on [Code Mode](https://code.claude.com/docs/en/code-mode.md#requirements)

608* Have Claude read [another organization's public artifact](https://code.claude.com/docs/en/artifacts.md#read-an-artifact-shared-with-you)608* Have Claude read [another organization's public artifact](https://code.claude.com/docs/en/artifacts.md#read-an-artifact-shared-with-you)

609* Get the [PowerShell tool](https://code.claude.com/docs/en/tools-reference.md#powershell-tool) by default for claude.ai and Console accounts on Windows with Git Bash installed; Claude Code routes shell commands through Git Bash unless you set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1`. On Windows without Git Bash, the tool stays on609* Get the [PowerShell tool](https://code.claude.com/docs/en/tools-reference.md#powershell-tool) by default for claude.ai and Console accounts on Windows with Git Bash installed; Claude Code routes shell commands through Git Bash unless you set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1`. On Windows without Git Bash, the tool stays on

610* Get [Claude-drafted feedback](https://code.claude.com/docs/en/tools-reference.md#sendfeedback-tool-behavior), which Claude Code turns on through a fetched flag610* Get [Claude-drafted feedback](https://code.claude.com/docs/en/tools-reference.md#sendfeedback-tool-behavior), which Claude Code turns on through a fetched flag

611 611 

612### First session after an install or upgrade612### First session after an install or upgrade

613 613 

614In your first session after you install Claude Code, or upgrade to a version that adds a feature, a [flag-gated feature](#features-that-need-feature-flag-fetching) can be missing. When Claude Code fetches its feature flags during that session, it saves them on the machine, so your next session on that machine has the feature.614In your first session after you install Claude Code, or upgrade to a version that adds a feature, a [flag-gated feature](#features-that-need-feature-flag-fetching) can be missing. The same holds in your first session after Anthropic turns a feature on. When Claude Code fetches its feature flags during that session, it saves them on the machine, so you have the feature the next time you start Claude Code there.

615 615 

616In setups such as these, sessions after the first also start without freshly fetched flags:616In setups such as these, sessions after the first also start without freshly fetched flags:

617 617 

errors.md +1 −1

Details

6022**What to do:**6022**What to do:**

6023 6023 

6024* Fix the condition the error code names: free disk space for `ENOSPC`; raise or clear the quota for `EDQUOT`; restore write access to the transcript location for `EACCES`, `EPERM`, or `EROFS`6024* Fix the condition the error code names: free disk space for `ENOSPC`; raise or clear the quota for `EDQUOT`; restore write access to the transcript location for `EACCES`, `EPERM`, or `EROFS`

6025* The warning clears on its own at the next successful write; no restart is needed6025* The warning clears on its own at the next successful write

6026* Messages sent while the warning was showing may still be missing when you resume the session later6026* Messages sent while the warning was showing may still be missing when you resume the session later

6027 6027 

6028### Transcript saving is off because CLAUDE\_CODE\_SKIP\_PROMPT\_HISTORY is set6028### Transcript saving is off because CLAUDE\_CODE\_SKIP\_PROMPT\_HISTORY is set

Details

52* [Cloud scheduled tasks](https://code.claude.com/docs/en/routines.md) (`/schedule`)52* [Cloud scheduled tasks](https://code.claude.com/docs/en/routines.md) (`/schedule`)

53* [Ultrareview](https://code.claude.com/docs/en/ultrareview.md)53* [Ultrareview](https://code.claude.com/docs/en/ultrareview.md)

54* [Code Review](https://code.claude.com/docs/en/code-review.md): Team and Enterprise plans54* [Code Review](https://code.claude.com/docs/en/code-review.md): Team and Enterprise plans

55* [PR Steward](https://code.claude.com/docs/en/pr-steward.md): Team and Enterprise plans

56* [Claude Approvals](https://code.claude.com/docs/en/approvals.md): Team and Enterprise plans

55* [Remote Control](https://code.claude.com/docs/en/remote-control.md)57* [Remote Control](https://code.claude.com/docs/en/remote-control.md)

56* [Chrome extension](https://code.claude.com/docs/en/chrome.md)58* [Chrome extension](https://code.claude.com/docs/en/chrome.md)

57* [Computer use](https://code.claude.com/docs/en/computer-use.md): Pro, Max, and Ultra plans59* [Computer use](https://code.claude.com/docs/en/computer-use.md): Pro, Max, and Ultra plans


347| [Computer use](https://code.claude.com/docs/en/computer-use.md) | ✓ | ✓ | ✓ | ✗ | ✗ |349| [Computer use](https://code.claude.com/docs/en/computer-use.md) | ✓ | ✓ | ✓ | ✗ | ✗ |

348| Dispatch ([Desktop](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch)) | Not available to new users | Not available to new users | Not available to new users | ✗ | ✗ |350| Dispatch ([Desktop](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch)) | Not available to new users | Not available to new users | Not available to new users | ✗ | ✗ |

349| [Code Review](https://code.claude.com/docs/en/code-review.md) | ✗ | ✗ | ✗ | ✓ | ✓ |351| [Code Review](https://code.claude.com/docs/en/code-review.md) | ✗ | ✗ | ✗ | ✓ | ✓ |

352| [PR Steward](https://code.claude.com/docs/en/pr-steward.md) | ✗ | ✗ | ✗ | ✓ | ✓ |

353| [Claude Approvals](https://code.claude.com/docs/en/approvals.md) | ✗ | ✗ | ✗ | ✓ | ✓ |

350| [Artifacts](https://code.claude.com/docs/en/artifacts.md) | ✓ | ✓ | ✓ | ✓ | ✓ |354| [Artifacts](https://code.claude.com/docs/en/artifacts.md) | ✓ | ✓ | ✓ | ✓ | ✓ |

351| [Analytics dashboard and contribution metrics](https://code.claude.com/docs/en/analytics.md) | ✗ | ✗ | ✗ | ✓ | ✓ |355| [Analytics dashboard and contribution metrics](https://code.claude.com/docs/en/analytics.md) | ✗ | ✗ | ✗ | ✓ | ✓ |

352| [Enterprise Analytics API](https://code.claude.com/docs/en/analytics.md#access-data-programmatically) | ✗ | ✗ | ✗ | ✗ | ✓ |356| [Enterprise Analytics API](https://code.claude.com/docs/en/analytics.md#access-data-programmatically) | ✗ | ✗ | ✗ | ✗ | ✓ |

Details

52 52 

53### Build your setup over time53### Build your setup over time

54 54 

55You don't need to configure everything up front. Each feature has a recognizable trigger, and most teams add them in roughly this order:55Each feature has a recognizable trigger, and most teams add them in roughly this order:

56 56 

57| Trigger | Add |57| Trigger | Add |

58| :- | :- |58| :- | :- |

fullscreen.md +2 −2

Details

93 93 

94* **Click in the prompt input** to position your cursor anywhere in the text you're typing.94* **Click in the prompt input** to position your cursor anywhere in the text you're typing.

95* **Click a suggestion in the `/` command or `@` file list** to accept it. Hovering highlights the row under your cursor.95* **Click a suggestion in the `/` command or `@` file list** to accept it. Hovering highlights the row under your cursor.

96* **Click an option in a select menu** to choose it. This covers permission prompts, `/model`, `/config`, and other dialogs that show a list of options.96* **Click an option in a select menu** to choose it, such as in `/model` or a permission prompt. If a click doesn't choose the option, click again or use the keyboard.

97* **Click an option in a multi-select menu** to toggle it, and click the submit button to confirm your choices. Clicking a free-text row, such as the `Other` row in a multiple-choice question, focuses its input field so you can type an answer.97* **Click an option in a multi-select menu** to toggle it, and click the submit button to confirm your choices. Clicking a free-text row, such as the `Other` row in a multiple-choice question, focuses its input field so you can type an answer.

98* **Click a setting's value in the `/config` panel** to change it, and scroll the settings list with the mouse wheel. Requires Claude Code v2.1.271 or later.98* **Click a setting's value in the `/config` panel** to change it, and scroll the settings list with the mouse wheel. Requires Claude Code v2.1.271 or later.

99* **Scroll a select or multi-select menu with the mouse wheel** when it has more options than it shows at once, such as the `/model` list in a short terminal window. The wheel scrolls the list while the pointer is over its options. Requires Claude Code v2.1.280 or later.99* **Scroll a select or multi-select menu with the mouse wheel** when it has more options than it shows at once, such as the `/model` list in a short terminal window. The wheel scrolls the list while the pointer is over its options. Requires Claude Code v2.1.280 or later.


187 187 

188In the JetBrains IDE terminal, Claude Code applies its own scroll handling and ignores `CLAUDE_CODE_SCROLL_SPEED`. The terminal sends scroll events at a much higher rate than other emulators, so a multiplier tuned elsewhere overshoots here.188In the JetBrains IDE terminal, Claude Code applies its own scroll handling and ignores `CLAUDE_CODE_SCROLL_SPEED`. The terminal sends scroll events at a much higher rate than other emulators, so a multiplier tuned elsewhere overshoots here.

189 189 

190In 2025.2, the terminal also has scroll-wheel bugs that produce spurious arrow keys and wrong-direction events. Claude Code detects these at runtime and mitigates them automatically, so trackpad and mouse wheel scrolling work without configuration. For the best scroll experience, upgrade to 2025.3 or later. Claude Code shows a hint the first time you scroll if it detects the bug.190In 2025.2, the terminal also has scroll-wheel bugs that produce spurious arrow keys and wrong-direction events. Claude Code detects these at runtime and mitigates them automatically. For the best scroll experience, upgrade to 2025.3 or later. Claude Code shows a hint the first time you scroll if it detects the bug.

191 191 

192## Search and review the conversation192## Search and review the conversation

193 193 

Details

53 53 

54**5. Enable Code Review**54**5. Enable Code Review**

55 55 

56Go to [claude.ai/admin-settings/claude-code](https://claude.ai/admin-settings/claude-code) and enable [Code Review](https://code.claude.com/docs/en/code-review-setup.md) for your GHES repositories using the same configuration as github.com.56Go to [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-code#code-review) and enable [Code Review](https://code.claude.com/docs/en/code-review-setup.md) for your GHES repositories using the same configuration as github.com.

57 57 

58### GitHub App permissions58### GitHub App permissions

59 59 


91 91 

92Claude Code detects your GHES hostname automatically from the git remote in your working directory.92Claude Code detects your GHES hostname automatically from the git remote in your working directory.

93 93 

94Clone a repository from your GHES instance as you normally would, replacing `github.example.com` and the repository path with your GHES hostname and repository:94Clone a repository from your GHES instance, replacing `github.example.com` and the repository path with your GHES hostname and repository:

95 95 

96```bash theme={null}96```bash theme={null}

97git clone git@github.example.com:platform/api-service.git97git clone git@github.example.com:platform/api-service.git

glossary.md +1 −1

Details

12 12 

13### AGENTS.md13### AGENTS.md

14 14 

15A markdown file of project instructions you write for AI coding agents. If your repository has one and no [CLAUDE.md](#claude-md), Claude reads it as your project instructions without you adding a second file. You can change the **Project instructions** setting in `/config` to have Claude read both files or only `CLAUDE.md`. Reading `AGENTS.md` directly requires Claude Code v2.1.277 or later. In some sessions Claude [can't read `AGENTS.md`](https://code.claude.com/docs/en/memory#when-agents-md-support-is-unavailable), so [import it from a `CLAUDE.md`](https://code.claude.com/docs/en/memory#share-one-file-with-other-coding-tools) there instead.15A markdown file of project instructions you write for AI coding agents. If your repository has one and no [CLAUDE.md](#claude-md), Claude reads it as your project instructions. You can change the **Project instructions** setting in `/config` to have Claude read both files or only `CLAUDE.md`. Reading `AGENTS.md` directly requires Claude Code v2.1.277 or later. In some sessions Claude [can't read `AGENTS.md`](https://code.claude.com/docs/en/memory#when-agents-md-support-is-unavailable), so [import it from a `CLAUDE.md`](https://code.claude.com/docs/en/memory#share-one-file-with-other-coding-tools) there instead.

16 16 

17Learn more: [AGENTS.md](https://code.claude.com/docs/en/memory.md#agents-md)17Learn more: [AGENTS.md](https://code.claude.com/docs/en/memory.md#agents-md)

18 18 

Details

123# export ANTHROPIC_VERTEX_BASE_URL=https://aiplatform.googleapis.com123# export ANTHROPIC_VERTEX_BASE_URL=https://aiplatform.googleapis.com

124 124 

125# When CLOUD_ML_REGION=global, override region for models that don't support global endpoints125# When CLOUD_ML_REGION=global, override region for models that don't support global endpoints

126export VERTEX_REGION_CLAUDE_HAIKU_4_5=us-east5126# export VERTEX_REGION_CLAUDE_HAIKU_4_5=us-east5

127export VERTEX_REGION_CLAUDE_4_6_SONNET=europe-west1127# export VERTEX_REGION_CLAUDE_4_6_SONNET=europe-west1

128```128```

129 129 

130Most model versions have a corresponding `VERTEX_REGION_CLAUDE_*` variable. See the [Environment variables reference](https://code.claude.com/docs/en/env-vars.md#variables) for the full list. Check [Google Cloud's Agent Platform Model Garden](https://console.cloud.google.com/vertex-ai/model-garden) to determine which models support global endpoints versus regional only.130Most model versions have a corresponding `VERTEX_REGION_CLAUDE_*` variable. See the [Environment variables reference](https://code.claude.com/docs/en/env-vars.md#variables) for the full list. Check [Google Cloud's Agent Platform Model Garden](https://console.cloud.google.com/vertex-ai/model-garden) to determine which models support global endpoints versus regional only.

headless.md +1 −1

Details

341 341 

342Pass `--permission-prompts none` when nobody is available to answer permission prompts, for example in a scheduled job. The flag matters most when your run has a permission host: an Agent SDK app with a [`canUseTool` callback](https://code.claude.com/docs/en/agent-sdk/user-input), or an MCP tool you pass with [`--permission-prompt-tool`](https://code.claude.com/docs/en/cli-reference#cli-flags). Without the flag or the [`permissions.denyInsteadOfPrompting`](https://code.claude.com/docs/en/settings-reference#permissions-denyinsteadofprompting) setting, your run waits for that host to answer each permission request.342Pass `--permission-prompts none` when nobody is available to answer permission prompts, for example in a scheduled job. The flag matters most when your run has a permission host: an Agent SDK app with a [`canUseTool` callback](https://code.claude.com/docs/en/agent-sdk/user-input), or an MCP tool you pass with [`--permission-prompt-tool`](https://code.claude.com/docs/en/cli-reference#cli-flags). Without the flag or the [`permissions.denyInsteadOfPrompting`](https://code.claude.com/docs/en/settings-reference#permissions-denyinsteadofprompting) setting, your run waits for that host to answer each permission request.

343 343 

344With the flag, your run doesn't consult the host or wait on it. Anything that would prompt is denied unless a `PermissionRequest` hook allows it, Claude is told that nobody can approve the request and not to retry it, and the run continues. In a `-p` run with no host, these requests are denied either way, and the flag also tells Claude not to retry them. Permission rules, [`PermissionRequest` hooks](https://code.claude.com/docs/en/hooks#permissionrequest), and the permission mode you set still decide every call first; Claude Code denies only the requests that nothing else resolves.344With the flag, your run doesn't consult the host or wait on it. Anything that would prompt is denied unless a `PermissionRequest` hook allows it, Claude is told that nobody can approve the request and not to retry it, and the run continues. Permission rules, [`PermissionRequest` hooks](https://code.claude.com/docs/en/hooks#permissionrequest), and the permission mode you set still decide every call first; Claude Code denies only the requests that nothing else resolves.

345 345 

346> [!NOTE]346> [!NOTE]

347>347>

hooks.md +12 −10

Details

1034| Hook event | Can block? | What happens on exit 2 |1034| Hook event | Can block? | What happens on exit 2 |

1035| :- | :- | :- |1035| :- | :- | :- |

1036| `PreToolUse` | Yes | Blocks the tool call |1036| `PreToolUse` | Yes | Blocks the tool call |

1037| `PermissionRequest` | No | Exit code 2 isn't honored for this event and the permission flow proceeds unchanged. Deny through the [`decision` object](#permissionrequest-decision-control) instead |1037| `PermissionRequest` | No | Not read as a decision. Deny through the [`decision` object](#permissionrequest-decision-control) instead |

1038| `UserPromptSubmit` | Yes | Blocks the prompt. See [What a blocked prompt leaves behind](#what-a-blocked-prompt-leaves-behind) |1038| `UserPromptSubmit` | Yes | Blocks the prompt. See [What a blocked prompt leaves behind](#what-a-blocked-prompt-leaves-behind) |

1039| `UserPromptExpansion` | Yes | Blocks the expansion |1039| `UserPromptExpansion` | Yes | Blocks the expansion |

1040| `Stop` | Yes | Prevents Claude from stopping, continues the conversation |1040| `Stop` | Yes | Prevents Claude from stopping, continues the conversation |


1226 1226 

1227* `PreToolUse`: `updatedInput` directly under `hookSpecificOutput` replaces a tool's arguments before it runs. See [PreToolUse decision control](#pretooluse-decision-control)1227* `PreToolUse`: `updatedInput` directly under `hookSpecificOutput` replaces a tool's arguments before it runs. See [PreToolUse decision control](#pretooluse-decision-control)

1228* `PermissionRequest`: `updatedInput` inside the `decision` object. See [PermissionRequest decision control](#permissionrequest-decision-control)1228* `PermissionRequest`: `updatedInput` inside the `decision` object. See [PermissionRequest decision control](#permissionrequest-decision-control)

1229* `PostToolUse`: `updatedToolOutput` replaces the tool's result. In a [Cowork](https://claude.com/docs/cowork/overview) cloud session, Claude Code ignores `updatedToolOutput` when the tool is `AskUserQuestion` or `ExitPlanMode`, and Claude reads the original answer or plan. See [PostToolUse decision control](#posttooluse-decision-control)1229* `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

1230* `UserPromptSubmit`: can't replace the prompt; it only injects `additionalContext` alongside it1230* `UserPromptSubmit`: can't replace the prompt; it only injects `additionalContext` alongside it

1231 1231 

1232For 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.1232For 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.


1444 1444 

1445### Setup1445### Setup

1446 1446 

1447Fires only when you launch Claude Code with `--init-only`, or with `--init` or `--maintenance` in [non-interactive mode](https://code.claude.com/docs/en/headless.md) with the `-p` flag. It doesn't fire on normal startup. Use it for one-time dependency installation or scheduled cleanup that you trigger explicitly from CI or scripts, separate from normal session startup. For per-session initialization, use [SessionStart](#sessionstart) instead.1447Fires only when you launch Claude Code with `--init-only`, or with `--init` or `--maintenance` in [non-interactive mode](https://code.claude.com/docs/en/headless.md) with the `-p` flag. Use it for one-time dependency installation or scheduled cleanup that you trigger explicitly from CI or scripts. For per-session initialization, use [SessionStart](#sessionstart) instead.

1448 1448 

1449The matcher value corresponds to the CLI flag that triggered the hook:1449The matcher value corresponds to the CLI flag that triggered the hook:

1450 1450 


2160 2160 

2161### PermissionRequest2161### PermissionRequest

2162 2162 

2163Runs when Claude Code is about to ask you for permission to use a tool. In sessions that can't show a prompt, such as background subagents in [non-interactive mode](https://code.claude.com/docs/en/headless.md), Claude Code still runs these hooks, and if no hook returns a decision, it denies the tool call. For a call that reaches a `--permission-prompt-tool` or the Agent SDK's [`canUseTool` callback](https://code.claude.com/docs/en/agent-sdk/permissions), the hooks run alongside your host, and whichever decides first applies.2163Runs when Claude Code is about to ask you for permission to use a tool. For a call that reaches a `--permission-prompt-tool` or the Agent SDK's [`canUseTool` callback](https://code.claude.com/docs/en/agent-sdk/permissions), the hooks run alongside your host, and whichever decides first applies.

2164Use [PermissionRequest decision control](#permissionrequest-decision-control) to allow or deny on behalf of the user.2164Use [PermissionRequest decision control](#permissionrequest-decision-control) to allow or deny on behalf of the user.

2165 2165 

2166In a `-p` run outside [`dontAsk` mode](https://code.claude.com/docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode) with neither a `--permission-prompt-tool` nor a `canUseTool` callback, nobody can answer a prompt. A call that would prompt you is denied there unless something approves it, such as a PermissionRequest hook.

2167 

2166Use this event when you need a signal the moment Claude asks for permission to use a tool. Claude Code runs a [Notification](#notification) hook with the `permission_prompt` type only after the prompt has waited about six seconds.2168Use this event when you need a signal the moment Claude asks for permission to use a tool. Claude Code runs a [Notification](#notification) hook with the `permission_prompt` type only after the prompt has waited about six seconds.

2167 2169 

2168Claude Code doesn't run PermissionRequest hooks for a sandboxed command's [network request](https://code.claude.com/docs/en/sandboxing.md#network-isolation). To get a signal for that prompt, use the `permission_prompt` notification type.2170Claude Code doesn't run PermissionRequest hooks for a sandboxed command's [network request](https://code.claude.com/docs/en/sandboxing.md#network-isolation). To get a signal for that prompt, use the `permission_prompt` notification type.


2214 2216 

2215To allow or rewrite a Monitor command, see [Match Monitor commands](#match-monitor-commands).2217To allow or rewrite a Monitor command, see [Match Monitor commands](#match-monitor-commands).

2216 2218 

2217A hook that exits 2 without a `decision` object leaves the permission flow unchanged, and its stderr is discarded. To grant or deny the request, return the `decision` object.2219Claude Code doesn't read exit code 2 as a decision on this event. To grant or deny the request, return the `decision` object.

2218 2220 

2219```json theme={null}2221```json theme={null}

2220{2222{


2330| `reason` | Explanation shown to Claude when `decision` is `"block"` |2332| `reason` | Explanation shown to Claude when `decision` is `"block"` |

2331| `additionalContext` | String added to Claude's context alongside the tool result. See [Add context for Claude](#add-context-for-claude) |2333| `additionalContext` | String added to Claude's context alongside the tool result. See [Add context for Claude](#add-context-for-claude) |

2332| `classifierContext` | Short note about this call's result for the [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) classifier rather than for Claude. See [Annotate a result for the auto mode classifier](#annotate-a-result-for-the-auto-mode-classifier). Requires Claude Code v2.1.236 or later |2334| `classifierContext` | Short note about this call's result for the [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) classifier rather than for Claude. See [Annotate a result for the auto mode classifier](#annotate-a-result-for-the-auto-mode-classifier). Requires Claude Code v2.1.236 or later |

2333| `updatedToolOutput` | Replaces the tool's output with the provided value before it is sent to Claude. The value must match the tool's output shape. In a [Cowork](https://claude.com/docs/cowork/overview) cloud session, Claude Code ignores this field when the tool is `AskUserQuestion` or `ExitPlanMode`, and Claude reads the original answer or plan |2335| `updatedToolOutput` | Replaces the tool's output with the provided value before it is sent to Claude. The value must match the tool's output shape. In a [Cowork](https://claude.com/docs/cowork/overview) cloud session, Claude Code ignores this field and `updatedMCPToolOutput` for some tools, such as `AskUserQuestion` and `ExitPlanMode`. Claude then reads the original result |

2334| `updatedMCPToolOutput` | Replaces the output for [MCP tools](#match-mcp-tools) only. Prefer `updatedToolOutput`, which also works for built-in tools |2336| `updatedMCPToolOutput` | Replaces the output for [MCP tools](#match-mcp-tools) only. Prefer `updatedToolOutput`, which also works for built-in tools |

2335 2337 

2336The example below replaces the output of a `Bash` call. The replacement value matches the `Bash` tool's output shape:2338The example below replaces the output of a `Bash` call. The replacement value matches the `Bash` tool's output shape:


3358 * **You exit a worktree session, or Claude calls `ExitWorktree`**: Claude Code removes the path your WorktreeCreate hook returned as `git worktree remove --force` would, so a worktree git recognizes is removed. A worktree git doesn't recognize, for example one your hook created with a non-git version control system, stays on disk.3360 * **You exit a worktree session, or Claude calls `ExitWorktree`**: Claude Code removes the path your WorktreeCreate hook returned as `git worktree remove --force` would, so a worktree git recognizes is removed. A worktree git doesn't recognize, for example one your hook created with a non-git version control system, stays on disk.

3359 * **`claude remote-control` cleans up a session's worktree**: the worktree stays on disk, and the terminal running `claude remote-control` shows `worktree removal failed, kept: <path>`.3361 * **`claude remote-control` cleans up a session's worktree**: the worktree stays on disk, and the terminal running `claude remote-control` shows `worktree removal failed, kept: <path>`.

3360 * **You delete a background session**: see [What deleting a session removes](https://code.claude.com/docs/en/agent-view.md#what-deleting-a-session-removes).3362 * **You delete a background session**: see [What deleting a session removes](https://code.claude.com/docs/en/agent-view.md#what-deleting-a-session-removes).

3361* **Hook exits 0**: the worktree counts as removed. Claude Code reads nothing else from the hook, so make sure your hook deleted the directory.3363* **Hook exits 0**: if the worktree's directory is still there, remove it yourself, because Claude Code doesn't fall back to git.

3362* **Hook exits non-zero**: the removal fails if the directory at `worktree_path` still exists afterward, and the worktree stays on disk with no git fallback. A hook that deleted the directory before exiting non-zero counts as removed. For how the failure is reported, see [WorktreeRemove input](#worktreeremove-input).3364* **Hook exits non-zero**: the removal fails if the directory at `worktree_path` still exists afterward, and the worktree stays on disk with no git fallback. A hook that deleted the directory before exiting non-zero counts as removed. For how the failure is reported, see [WorktreeRemove input](#worktreeremove-input).

3363 3365 

3364Claude Code never deletes a branch belonging to a hook-created worktree, because it only knows the path your WorktreeCreate hook returned. If your WorktreeCreate hook creates a branch, delete it in your WorktreeRemove hook. Claude Code discards a WorktreeRemove hook's [JSON output fields](#json-output), such as `systemMessage` and `continue`.3366Claude Code never deletes a branch belonging to a hook-created worktree, because it only knows the path your WorktreeCreate hook returned. If your WorktreeCreate hook creates a branch, delete it in your WorktreeRemove hook. Claude Code discards a WorktreeRemove hook's [JSON output fields](#json-output), such as `systemMessage` and `continue`.


3398}3400}

3399```3401```

3400 3402 

3401A WorktreeRemove hook's exit code decides the outcome. When a hook exits non-zero and the directory at `worktree_path` still exists afterward, the removal fails:3403When a hook exits non-zero and the directory at `worktree_path` still exists afterward, the removal fails:

3402 3404 

3403* If you were deleting a background session, the session stays too. The refusal message in [agent view](https://code.claude.com/docs/en/agent-view.md#what-deleting-a-session-removes) reports how the hook ended, such as `exited 1`, quotes the start of its stderr, and says whether deleting the session again removes the directory anyway.3405* If you were deleting a background session, the session stays too. The refusal message in [agent view](https://code.claude.com/docs/en/agent-view.md#what-deleting-a-session-removes) reports how the hook ended, such as `exited 1`, quotes the start of its stderr, and says whether deleting the session again removes the directory anyway.

3404* If `claude remote-control` was cleaning up a session's worktree, the terminal running it shows `worktree removal failed, kept: <path>`.3406* If `claude remote-control` was cleaning up a session's worktree, the terminal running it shows `worktree removal failed, kept: <path>`.


3741 "cwd": "/Users/...",3743 "cwd": "/Users/...",

3742 "hook_event_name": "Elicitation",3744 "hook_event_name": "Elicitation",

3743 "mcp_server_name": "my-mcp-server",3745 "mcp_server_name": "my-mcp-server",

3744 "message": "Please provide your credentials",3746 "message": "Please provide your username",

3745 "mode": "form",3747 "mode": "form",

3746 "requested_schema": {3748 "requested_schema": {

3747 "type": "object",3749 "type": "object",


4106* `PostToolUseFailure` and `TaskCreated`: the reason is returned to Claude as a tool error and the turn continues, regardless of `continueOnBlock`4108* `PostToolUseFailure` and `TaskCreated`: the reason is returned to Claude as a tool error and the turn continues, regardless of `continueOnBlock`

4107* `TaskCompleted` on a `TaskUpdate` call: Claude receives the reason as the tool result and the turn continues, regardless of `continueOnBlock`4109* `TaskCompleted` on a `TaskUpdate` call: Claude receives the reason as the tool result and the turn continues, regardless of `continueOnBlock`

4108* `TeammateIdle`, and `TaskCompleted` at the end of a teammate's turn: by default the teammate goes idle and the reason appears in its transcript. Set `continueOnBlock: true` to send the reason to the teammate and keep it working4110* `TeammateIdle`, and `TaskCompleted` at the end of a teammate's turn: by default the teammate goes idle and the reason appears in its transcript. Set `continueOnBlock: true` to send the reason to the teammate and keep it working

4109* `PermissionRequest`: `ok: false` has no effect. To deny an approval from a hook, use a [command hook](#command-hook-fields) returning `hookSpecificOutput.decision.behavior: "deny"`4111* `PermissionRequest`: `ok: false` doesn't deny the request. To deny an approval from a hook, use a [command hook](#command-hook-fields) returning `hookSpecificOutput.decision.behavior: "deny"`

4110* `PermissionDenied`: `ok: false` has no effect because the denial already happened. The only output this event reads is `hookSpecificOutput.retry`, which prompt and agent hooks can't set. They run on this event, but their output is discarded. Use a [command hook](#command-hook-fields) to return `retry`4112* `PermissionDenied`: `ok: false` has no effect because the denial already happened. The only output this event reads is `hookSpecificOutput.retry`, which prompt and agent hooks can't set. They run on this event, but their output is discarded. Use a [command hook](#command-hook-fields) to return `retry`

4111 4113 

4112If you need finer control on any event, use a [command hook](#command-hook-fields) with the per-event fields described in [Decision control](#decision-control).4114If you need finer control on any event, use a [command hook](#command-hook-fields) with the per-event fields described in [Decision control](#decision-control).

hooks-guide.md +1 −1

Details

944 * `agent`: 60 seconds.944 * `agent`: 60 seconds.

945 * [`SessionEnd`](https://code.claude.com/docs/en/hooks#sessionend) hooks of any type share a 1.5-second budget. If your settings set a longer per-hook `timeout`, Claude Code raises the budget to match, up to 60 seconds.945 * [`SessionEnd`](https://code.claude.com/docs/en/hooks#sessionend) hooks of any type share a 1.5-second budget. If your settings set a longer per-hook `timeout`, Claude Code raises the budget to match, up to 60 seconds.

946* `PostToolUse` hooks can't undo actions since the tool has already executed.946* `PostToolUse` hooks can't undo actions since the tool has already executed.

947* [`PermissionRequest`](https://code.claude.com/docs/en/hooks#permissionrequest) hooks fire when Claude Code is about to ask you for permission, or when it would otherwise auto-deny a call that can't prompt. In [non-interactive mode](https://code.claude.com/docs/en/headless.md) with the `-p` flag, they still run outside [`dontAsk` mode](https://code.claude.com/docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode), and a call that no hook decides and nothing else can answer is denied.947* [`PermissionRequest`](https://code.claude.com/docs/en/hooks#permissionrequest) hooks fire when Claude Code is about to ask you for permission. In a [`-p` run](https://code.claude.com/docs/en/headless) with no [permission host](https://code.claude.com/docs/en/headless.md#turn-off-permission-prompts-in-unattended-runs), outside [`dontAsk` mode](https://code.claude.com/docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode), a call that would prompt you is denied unless something approves it, such as one of these hooks.

948* `Stop` hooks fire whenever Claude finishes responding, not only at task completion. They don't fire on user interrupts. API errors fire [StopFailure](https://code.claude.com/docs/en/hooks.md#stopfailure) instead.948* `Stop` hooks fire whenever Claude finishes responding, not only at task completion. They don't fire on user interrupts. API errors fire [StopFailure](https://code.claude.com/docs/en/hooks.md#stopfailure) instead.

949* When multiple `PreToolUse` hooks return [`updatedInput`](https://code.claude.com/docs/en/hooks#pretooluse) to rewrite a tool's input, Claude Code doesn't merge the rewrites or guarantee which rewrite the tool runs with. Avoid having more than one hook rewrite the same tool's input.949* When multiple `PreToolUse` hooks return [`updatedInput`](https://code.claude.com/docs/en/hooks#pretooluse) to rewrite a tool's input, Claude Code doesn't merge the rewrites or guarantee which rewrite the tool runs with. Avoid having more than one hook rewrite the same tool's input.

950 950 

Details

100 100 

101Each Claude Code conversation is a session tied to your current directory. The `/resume` picker shows sessions from the current worktree by default, with keyboard shortcuts to widen the list to other worktrees or projects. See [Manage sessions](https://code.claude.com/docs/en/sessions.md#use-the-session-picker) for the full list of picker shortcuts and how name resolution works.101Each Claude Code conversation is a session tied to your current directory. The `/resume` picker shows sessions from the current worktree by default, with keyboard shortcuts to widen the list to other worktrees or projects. See [Manage sessions](https://code.claude.com/docs/en/sessions.md#use-the-session-picker) for the full list of picker shortcuts and how name resolution works.

102 102 

103Claude sees your current branch's files. When you switch branches, Claude sees the new branch's files, but your conversation history stays the same. Claude remembers what you discussed even after switching.103Claude sees your current branch's files. When you switch branches, Claude sees the new branch's files, but your conversation history stays the same.

104 104 

105Since sessions are tied to directories, you can run parallel Claude sessions by using [git worktrees](https://code.claude.com/docs/en/worktrees.md), which create separate directories for individual branches.105Since sessions are tied to directories, you can run parallel Claude sessions by using [git worktrees](https://code.claude.com/docs/en/worktrees.md), which create separate directories for individual branches.

106 106 


187 187 

188### It's a conversation188### It's a conversation

189 189 

190Claude Code is conversational. You don't need perfect prompts. Start with what you want, then refine:190Claude Code is conversational, so start with what you want, then refine:

191 191 

192```text theme={null}192```text theme={null}

193Fix the login bug193Fix the login bug

Details

4 4 

5# Interactive mode5# Interactive mode

6 6 

7> Complete reference for keyboard shortcuts, input modes, and interactive features in Claude Code sessions.7> Reference for keyboard shortcuts, input modes, and interactive features in Claude Code sessions.

8 8 

9## Keyboard shortcuts9## Keyboard shortcuts

10 10 


687 687 

688In the [VS Code extension](https://code.claude.com/docs/en/vs-code.md#use-the-prompt-box)'s chat panel, `/btw` opens a panel rather than the overlay this section describes, and you ask follow-up questions right in the panel. The panel's thread survives window reloads, on the retention schedule that page describes. You need the extension at v2.1.227 or later. Earlier extension versions don't offer `/btw`.688In the [VS Code extension](https://code.claude.com/docs/en/vs-code.md#use-the-prompt-box)'s chat panel, `/btw` opens a panel rather than the overlay this section describes, and you ask follow-up questions right in the panel. The panel's thread survives window reloads, on the retention schedule that page describes. You need the extension at v2.1.227 or later. Earlier extension versions don't offer `/btw`.

689 689 

690* **Available while Claude is working**: you can run `/btw` even while Claude is processing a response. The side question runs independently and doesn't interrupt the main turn. It sees everything in the conversation so far, except the reply Claude is still writing.690* **Available while Claude is working**: you can run `/btw` while Claude is processing a response. The side question runs independently and doesn't interrupt the main turn. It sees everything in the conversation so far, except the reply Claude is still writing.

691* **No tool access**: side questions answer only from what is already in context. Claude can't read files, run commands, or search when answering a side question. If Claude writes out tool calls as text anyway, the answer ends with a note that nothing was executed.691* **No tool access**: side questions answer only from what is already in context. Claude can't read files, run commands, or search when answering a side question. If Claude writes out tool calls as text anyway, the answer ends with a note that nothing was executed.

692* **Single response**: there are no follow-up turns in the overlay. To continue the thread, ask another `/btw` question. To continue with full tool access in a local session, press `f` to fork this question and answer into a [background subagent](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation).692* **Single response**: there are no follow-up turns in the overlay. To continue the thread, ask another `/btw` question. To continue with full tool access in a local session, press `f` to fork this question and answer into a [background subagent](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation).

693* **Low cost**: while the conversation's [prompt cache](https://code.claude.com/docs/en/prompt-caching.md) is warm, a side question costs little beyond the answer itself.693* **Low cost**: while the conversation's [prompt cache](https://code.claude.com/docs/en/prompt-caching.md) is warm, a side question costs little beyond the answer itself.

Details

151 151 

152### Block reads of generated and vendored code152### Block reads of generated and vendored code

153 153 

154Claude's content searches respect `.gitignore` by default, so paths already listed there, such as `node_modules/`, `dist/`, and `build/`, stay out of search results without additional configuration.154Claude's content searches respect `.gitignore` by default, so paths already listed there, such as `node_modules/`, `dist/`, and `build/`, stay out of search results.

155 155 

156For paths that are checked in, such as a vendored SDK or committed generated code, add `Read` deny rules in `permissions.deny` to block Claude from opening those files.156For paths that are checked in, such as a vendored SDK or committed generated code, add `Read` deny rules in `permissions.deny` to block Claude from opening those files.

157 157 

Details

8 8 

9This page documents the requests Claude Code sends to a gateway, including the endpoints it calls, the headers and body fields the gateway must forward, and which features stop working when it doesn't. It is written for operators configuring a gateway product to work with Claude Code.9This page documents the requests Claude Code sends to a gateway, including the endpoints it calls, the headers and body fields the gateway must forward, and which features stop working when it doesn't. It is written for operators configuring a gateway product to work with Claude Code.

10 10 

11The [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), Anthropic's self-hosted gateway, serves its own endpoint reference at `GET /protocol`, covering that gateway's sign-in, inference, managed settings, model discovery, and telemetry endpoints. It is a separate document from this guide.11The [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), Anthropic's self-hosted gateway, serves its own endpoint reference at `GET /protocol`, covering that gateway's sign-in, inference, managed settings, model discovery, and telemetry endpoints.

12 12 

13> [!NOTE]13> [!NOTE]

14>14>

managed-mcp.md +1 −1

Details

369Three groups of servers skip the allowlist check, in addition to the in-process `type: "sdk"` servers that skip [all three checks](#how-a-server-is-evaluated):369Three groups of servers skip the allowlist check, in addition to the in-process `type: "sdk"` servers that skip [all three checks](#how-a-server-is-evaluated):

370 370 

371* The organization's own servers: every `managedMcpServers` entry, and any `managed-mcp.json` entry whose values use no `${VAR}` expansion outside `env`.371* The organization's own servers: every `managedMcpServers` entry, and any `managed-mcp.json` entry whose values use no `${VAR}` expansion outside `env`.

372* Built-in servers, such as Claude in Chrome, the `ide` server Claude Code connects to in a running VS Code or JetBrains IDE, and servers the CLI itself configures.372* Some built-in servers, such as the `ide` server Claude Code connects to in a running VS Code or JetBrains IDE, and Claude in Chrome in terminal sessions.

373* A [Claude Tag](https://code.claude.com/docs/en/claude-tag.md) session's Slack tools: the servers it uses to read the thread and post its replies load without an allowlist entry.373* A [Claude Tag](https://code.claude.com/docs/en/claude-tag.md) session's Slack tools: the servers it uses to read the thread and post its replies load without an allowlist entry.

374 374 

375A `managed-mcp.json` server that uses `${VAR}` expansion in its command, arguments, URL, or headers is still checked. Claude Code also checks every server a user, a plugin, or claude.ai adds, and every server a user passes with `--mcp-config`. For the versions that changed which `managed-mcp.json` servers are checked, and how to keep one from loading, see [How allowlists and denylists apply to the managed set](#how-allowlists-and-denylists-apply-to-the-managed-set).375A `managed-mcp.json` server that uses `${VAR}` expansion in its command, arguments, URL, or headers is still checked. Claude Code also checks every server a user, a plugin, or claude.ai adds, and every server a user passes with `--mcp-config`. For the versions that changed which `managed-mcp.json` servers are checked, and how to keep one from loading, see [How allowlists and denylists apply to the managed set](#how-allowlists-and-denylists-apply-to-the-managed-set).

mcp.md +2 −2

Details

765 765 

766### Local scope766### Local scope

767 767 

768Local scope is the default. A local-scoped server loads only in the project where you added it and stays private to you. Claude Code stores it in `~/.claude.json` under that project's path, so the same server won't appear in your other projects. Use local scope for personal development servers, experimental configurations, or servers with credentials you don't want in version control.768Local scope is the default. A local-scoped server loads only in the project where you added it and stays private to you. Claude Code stores it in `~/.claude.json` under that project's path. Use local scope for personal development servers, experimental configurations, or servers with credentials you don't want in version control.

769 769 

770> [!NOTE]770> [!NOTE]

771>771>


1676 1676 

1677Servers can request input in two ways:1677Servers can request input in two ways:

1678 1678 

1679* **Form mode**: Claude Code shows a dialog with form fields defined by the server (for example, a username and password prompt). Fill in the fields and submit.1679* **Form mode**: Claude Code shows a dialog with form fields defined by the server, such as a project name and a due date. Fill in the fields and submit.

1680* **URL mode**: Claude Code asks whether to open a link in your browser. Servers use this mode for a flow that finishes outside the terminal, such as sign-in.1680* **URL mode**: Claude Code asks whether to open a link in your browser. Servers use this mode for a flow that finishes outside the terminal, such as sign-in.

1681 1681 

1682In URL mode, Claude Code passes the URL as a command-line argument to your system's URL handler, and caps how long that argument can be. When the URL, once escaped for the command line, is over that cap, you can only decline the request. Every character that needs escaping, such as `%` or `&`, counts four times toward the cap: its own character plus three escape characters. A URL with none of them reaches the cap at about 8,000 characters. A URL built largely of percent-escapes, where every third character is a `%`, reaches it at roughly 4,000.1682In URL mode, Claude Code passes the URL as a command-line argument to your system's URL handler, and caps how long that argument can be. When the URL, once escaped for the command line, is over that cap, you can only decline the request. Every character that needs escaping, such as `%` or `&`, counts four times toward the cap: its own character plus three escape characters. A URL with none of them reaches the cap at about 8,000 characters. A URL built largely of percent-escapes, where every third character is a `%`, reaches it at roughly 4,000.

memory.md +1 −1

Details

547 547 

548### How it works548### How it works

549 549 

550While auto memory is on, the first 200 lines or 25KB of `MEMORY.md`, whichever comes first, load at session start. Content beyond that threshold is not loaded at session start. Claude keeps `MEMORY.md` concise by moving detailed notes into separate topic files.550While auto memory is on, the first 200 lines or 25KB of `MEMORY.md`, whichever comes first, load at session start. Claude keeps `MEMORY.md` concise by moving detailed notes into separate topic files.

551 551 

552After Claude writes to `MEMORY.md`, Claude Code measures the file against the 200-line and 25KB read limits. If the file is near a limit, Claude Code reminds Claude to shorten it: keep one line per entry, move detail into topic files, and merge or drop stale entries. If the file is over a limit, the write still succeeds, but Claude Code returns an [error telling Claude to rewrite the index](https://code.claude.com/docs/en/errors.md#memory-index-is-over-its-read-limit), because everything past the limit is dropped on the next load.552After Claude writes to `MEMORY.md`, Claude Code measures the file against the 200-line and 25KB read limits. If the file is near a limit, Claude Code reminds Claude to shorten it: keep one line per entry, move detail into topic files, and merge or drop stale entries. If the file is over a limit, the write still succeeds, but Claude Code returns an [error telling Claude to rewrite the index](https://code.claude.com/docs/en/errors.md#memory-index-is-over-its-read-limit), because everything past the limit is dropped on the next load.

553 553 

model-config.md +5 −5

Details

369* **`model`**: sets the initial model selection when a session starts369* **`model`**: sets the initial model selection when a session starts

370* **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** / **`ANTHROPIC_DEFAULT_FABLE_MODEL`**: control what the `sonnet`, `opus`, `haiku`, and `fable` aliases resolve to, and which version the [account-type default](#default-model-setting) uses370* **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** / **`ANTHROPIC_DEFAULT_FABLE_MODEL`**: control what the `sonnet`, `opus`, `haiku`, and `fable` aliases resolve to, and which version the [account-type default](#default-model-setting) uses

371 371 

372This example starts users on Sonnet 4.5, limits the picker to Sonnet and Haiku, and ensures Default resolves to a model on the allowlist rather than the tier default:372This example starts users on Sonnet 5, limits the picker to Sonnet 5.x and Haiku, and ensures Default resolves to a model on the allowlist:

373 373 

374```json theme={null}374```json theme={null}

375{375{

376 "model": "claude-sonnet-4-5",376 "model": "claude-sonnet-5",

377 "availableModels": ["claude-sonnet-4-5", "haiku"],377 "availableModels": ["claude-sonnet-5", "haiku"],

378 "enforceAvailableModels": true,378 "enforceAvailableModels": true,

379 "env": {379 "env": {

380 "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5"380 "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5"

381 }381 }

382}382}

383```383```


685>685>

686> A level you pick from the effort control on a phone or browser connected through [Remote Control](https://code.claude.com/docs/en/remote-control.md#what-connected-devices-see) applies to that session only.686> A level you pick from the effort control on a phone or browser connected through [Remote Control](https://code.claude.com/docs/en/remote-control.md#what-connected-devices-see) applies to that session only.

687 687 

688When you set a level with `/effort` in a [`-p` run](https://code.claude.com/docs/en/headless), Claude Code applies it to that session only and doesn't save it as your default.688When you set a level with `/effort` in a [`-p` run](https://code.claude.com/docs/en/headless), Claude Code applies it to that session only.

689 689 

690The `/effort` slider also has an **Ultracode** toggle. Ultracode is a Claude Code setting rather than a model effort level: with it on, Claude orchestrates [dynamic workflows](https://code.claude.com/docs/en/workflows.md) for substantive tasks, at whichever effort level the session runs at. For where it can be set persistently, see the [`ultracode`](https://code.claude.com/docs/en/settings-reference#ultracode) setting.690The `/effort` slider also has an **Ultracode** toggle. Ultracode is a Claude Code setting rather than a model effort level: with it on, Claude orchestrates [dynamic workflows](https://code.claude.com/docs/en/workflows.md) for substantive tasks, at whichever effort level the session runs at. For where it can be set persistently, see the [`ultracode`](https://code.claude.com/docs/en/settings-reference#ultracode) setting.

691 691 

Details

867* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)867* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)

868* `tool_name`: Name of the tool868* `tool_name`: Name of the tool

869* `tool_use_id`: Unique identifier for this tool invocation. Matches the `tool_use_id` passed to hooks, allowing correlation between OTel events and hook-captured data.869* `tool_use_id`: Unique identifier for this tool invocation. Matches the `tool_use_id` passed to hooks, allowing correlation between OTel events and hook-captured data.

870* `request_id`: the [`request_id`](#event-correlation-attributes) of the API response that contained this tool call, so you can join the call to that response's API events. Absent when that response had no request ID, or when no API response contained the call. Requires Claude Code v2.1.310 or later870* `request_id`: the [`request_id`](#event-correlation-attributes) of the API response that contained this tool call or the [Code Mode](https://code.claude.com/docs/en/code-mode.md#monitor-code-mode-with-opentelemetry) code that made it. Use it to join the call to that response's API events. Absent when that response had no request ID, or when no API response contained the call or its code. Requires Claude Code v2.1.310 or later

871* `success`: `"true"` or `"false"`871* `success`: `"true"` or `"false"`

872* `duration_ms`: Execution time in milliseconds872* `duration_ms`: Execution time in milliseconds

873* `error_type`: Error category string when the tool failed, such as `"Error:ENOENT"` or `"ShellError"`873* `error_type`: Error category string when the tool failed, such as `"Error:ENOENT"` or `"ShellError"`


1021* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)1021* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)

1022* `tool_name`: Name of the tool (for example, "Read", "Edit", "Write", "NotebookEdit")1022* `tool_name`: Name of the tool (for example, "Read", "Edit", "Write", "NotebookEdit")

1023* `tool_use_id`: Unique identifier for this tool invocation. Matches the `tool_use_id` passed to hooks, allowing correlation between OTel events and hook-captured data.1023* `tool_use_id`: Unique identifier for this tool invocation. Matches the `tool_use_id` passed to hooks, allowing correlation between OTel events and hook-captured data.

1024* `request_id`: the [`request_id`](#event-correlation-attributes) of the API response that contained this tool call, so you can join the call to that response's API events. Absent when that response had no request ID, or when no API response contained the call. Requires Claude Code v2.1.310 or later1024* `request_id`: the [`request_id`](#event-correlation-attributes) of the API response that contained this tool call or the [Code Mode](https://code.claude.com/docs/en/code-mode.md#monitor-code-mode-with-opentelemetry) code that made it. Use it to join the call to that response's API events. Absent when that response had no request ID, or when no API response contained the call or its code. Requires Claude Code v2.1.310 or later

1025* `decision`: Either `"accept"` or `"reject"`1025* `decision`: Either `"accept"` or `"reject"`

1026* `tool_source`: Always present. The tool's provenance, as a closed set of CLI-authored values:1026* `tool_source`: Always present. The tool's provenance, as a closed set of CLI-authored values:

1027 * `"builtin"`: the CLI's own tools1027 * `"builtin"`: the CLI's own tools


1058 1058 

1059 * An allow or deny [permission rule](https://code.claude.com/docs/en/permissions.md#manage-permissions) decided the call1059 * An allow or deny [permission rule](https://code.claude.com/docs/en/permissions.md#manage-permissions) decided the call

1060 * Claude Code approved the call in auto mode without asking the classifier1060 * Claude Code approved the call in auto mode without asking the classifier

1061 * In [Code Mode](https://code.claude.com/docs/en/code-mode.md#monitor-code-mode-with-opentelemetry), the classifier's review of the code covered the call

1061 * The user answered the prompt Claude Code showed after [repeated blocks](https://code.claude.com/docs/en/permission-modes.md#repeated-block-thresholds)1062 * The user answered the prompt Claude Code showed after [repeated blocks](https://code.claude.com/docs/en/permission-modes.md#repeated-block-thresholds)

1062 * In a `-p` run without `--permission-prompt-tool`, Claude Code denied the call after repeated blocks because there was nobody to answer a prompt. That event reports `decision` as `"reject"` and `source` as `"config"`1063 * In a `-p` run without `--permission-prompt-tool`, Claude Code denied the call after repeated blocks because there was nobody to answer a prompt. That event reports `decision` as `"reject"` and `source` as `"config"`

1063* `classifier_category` (when `OTEL_LOG_TOOL_DETAILS=1`): The name of the [policy](https://code.claude.com/docs/en/auto-mode-config.md#fix-a-policy-denial) or [built-in rule](https://code.claude.com/docs/en/auto-mode-config.md#inspect-the-defaults-and-your-effective-config) the classifier named when it blocked the call, in lowercase with underscores, such as `"data_exfiltration"` for the Data Exfiltration rule. Requires Claude Code v2.1.301 or later. The attribute is present when both of these hold:1064* `classifier_category` (when `OTEL_LOG_TOOL_DETAILS=1`): The name of the [policy](https://code.claude.com/docs/en/auto-mode-config.md#fix-a-policy-denial) or [built-in rule](https://code.claude.com/docs/en/auto-mode-config.md#inspect-the-defaults-and-your-effective-config) the classifier named when it blocked the call, in lowercase with underscores, such as `"data_exfiltration"` for the Data Exfiltration rule. Requires Claude Code v2.1.301 or later. The attribute is present when both of these hold:

Details

59 59 

60### Explanatory60### Explanatory

61 61 

62In the Explanatory style, Claude does the task the way it does in the Default style and adds short explanations of why it made the choices it made. Each explanation appears in the conversation, before or after the code it's about, in a block labeled `Insight`. The explanations aren't written into your files as comments.62In the Explanatory style, Claude does the task the way it does in the Default style and adds short explanations of why it made the choices it made. Each explanation appears in the conversation, before or after the code it's about, in a block labeled `Insight`.

63 63 

64An `Insight` block carries two or three points about your codebase or the code Claude wrote, such as this one after adding an API endpoint:64An `Insight` block carries two or three points about your codebase or the code Claude wrote, such as this one after adding an API endpoint:

65 65 


164| `name` | No | Name of the output style, shown in the `/config` picker. Default: the file name |164| `name` | No | Name of the output style, shown in the `/config` picker. Default: the file name |

165| `description` | No | Description of the output style, shown in the `/config` picker |165| `description` | No | Description of the output style, shown in the `/config` picker |

166| `keep-coding-instructions` | No | Set to `true` to keep Claude Code's section of built-in software engineering instructions, which only the full system prompt includes, alongside your style. See [How output styles work](#how-output-styles-work). Default: `false` |166| `keep-coding-instructions` | No | Set to `true` to keep Claude Code's section of built-in software engineering instructions, which only the full system prompt includes, alongside your style. See [How output styles work](#how-output-styles-work). Default: `false` |

167| `force-for-plugin` | No | Plugin output styles only. Set to `true` to apply this style automatically whenever the plugin is enabled, without requiring users to select it. Overrides the user's `outputStyle` setting. If multiple enabled plugins set this, Claude Code uses the first one loaded. Default: `false` |167| `force-for-plugin` | No | Plugin output styles only. Set to `true` to apply this style automatically whenever the plugin is enabled. Overrides the user's `outputStyle` setting. If multiple enabled plugins set this, Claude Code uses the first one loaded. Default: `false` |

168 168 

169## Choose between an output style and other features169## Choose between an output style and other features

170 170 

Details

294 294 

295What happens to a shell command during planning depends on the session, and the first of these cases that matches applies:295What happens to a shell command during planning depends on the session, and the first of these cases that matches applies:

296 296 

297* **Interactive terminal sessions with bypass permissions available**: neither the classifier nor a prompt applies to planning commands. [Skip all checks with bypassPermissions mode](#skip-all-checks-with-bypasspermissions-mode) covers the few things that still prompt there.297* **Interactive terminal sessions with bypass permissions available**: planning commands can run with neither the classifier nor a prompt. [Skip all checks with bypassPermissions mode](#skip-all-checks-with-bypasspermissions-mode) covers what still prompts there.

298* **[Auto mode](https://code.claude.com/docs/en/auto-mode-config.md) available and the `useAutoModeDuringPlan` setting on**, which it is by default: the classifier reviews shell commands other than [critical-path removals](#critical-paths) instead of prompting you. Approved commands run, and rejected ones are blocked.298* **[Auto mode](https://code.claude.com/docs/en/auto-mode-config.md) available and the `useAutoModeDuringPlan` setting on**, which it is by default: the classifier reviews shell commands other than [critical-path removals](#critical-paths) instead of prompting you. Approved commands run, and rejected ones are blocked.

299* **Auto mode not available, or `useAutoModeDuringPlan` off**: commands outside the [built-in read-only set](https://code.claude.com/docs/en/permissions.md#read-only-commands) prompt for approval, including when the sandbox's [auto-allow mode](https://code.claude.com/docs/en/sandboxing.md#sandbox-modes) is enabled.299* **Auto mode not available, or `useAutoModeDuringPlan` off**: commands outside the [built-in read-only set](https://code.claude.com/docs/en/permissions.md#read-only-commands) prompt for approval, including when the sandbox's [auto-allow mode](https://code.claude.com/docs/en/sandboxing.md#sandbox-modes) is enabled.

300 300 


326 326 

327## Eliminate permission prompts with auto mode327## Eliminate permission prompts with auto mode

328 328 

329Auto mode lets Claude execute without routine permission prompts. A separate classifier model reviews actions before they run, blocking anything that escalates beyond your request, targets unrecognized infrastructure, or appears driven by hostile content Claude read. Explicit [ask rules](https://code.claude.com/docs/en/permissions.md#manage-permissions) still force a prompt.329Auto mode lets Claude execute without routine permission prompts. A separate classifier model reviews actions before they run and blocks the ones it [judges risky](#what-the-classifier-blocks-by-default). It looks for actions that go beyond your request, target unrecognized infrastructure, or follow hostile content Claude read.

330 330 

331With Claude Code v2.1.283 or later, auto mode is the [built-in starting permission mode](#which-mode-a-session-starts-in) for interactive terminal and VS Code sessions on every plan and provider. On earlier versions, it's the built-in starting permission mode only on Pro, Max, Ultra, and Team plans.331With Claude Code v2.1.283 or later, auto mode is the [built-in starting permission mode](#which-mode-a-session-starts-in) for interactive terminal and VS Code sessions on every plan and provider. On earlier versions, it's the built-in starting permission mode only on Pro, Max, Ultra, and Team plans.

332 332 


545 545 

546The classifier treats boundaries you state in the conversation as a block signal. If you tell Claude "don't push" or "wait until I review before deploying", the classifier blocks matching actions [it reviews](#how-the-classifier-evaluates-actions) even when the default rules would allow them. A boundary stays in force until you lift it in a later message. Claude's own judgment that a condition was met does not lift it.546The classifier treats boundaries you state in the conversation as a block signal. If you tell Claude "don't push" or "wait until I review before deploying", the classifier blocks matching actions [it reviews](#how-the-classifier-evaluates-actions) even when the default rules would allow them. A boundary stays in force until you lift it in a later message. Claude's own judgment that a condition was met does not lift it.

547 547 

548Boundaries are not stored as rules. The classifier re-reads them from the transcript on each check, so a boundary can be lost if [context compaction](https://code.claude.com/docs/en/costs.md#reduce-token-usage) removes the message that stated it. For a hard guarantee, add a [deny rule](https://code.claude.com/docs/en/permissions.md#permission-rule-syntax) instead.548Boundaries are not stored as rules. The classifier re-reads them from the transcript on each check, so a boundary can be lost if [context compaction](https://code.claude.com/docs/en/costs.md#reduce-token-usage) removes the message that stated it. To keep the boundary from being lost, add a [deny rule](https://code.claude.com/docs/en/permissions.md#permission-rule-syntax) instead.

549 549 

550### Approvals you state in conversation550### Approvals you state in conversation

551 551 


686* The [`isolatePeerMachines`](https://code.claude.com/docs/en/settings-reference#isolatepeermachines) approval prompt for messages to your sessions beyond this machine still appears.686* The [`isolatePeerMachines`](https://code.claude.com/docs/en/settings-reference#isolatepeermachines) approval prompt for messages to your sessions beyond this machine still appears.

687* When no [`crossSessionInbound`](https://code.claude.com/docs/en/cross-session-messaging#control-inbound-messages) value applies, Claude Code holds an inbound message from another of your sessions for your approval, and delivers without asking only when the sending session identifies itself as also bypassing permission prompts. If you leave the permission mode while messages are held, Claude Code re-applies the inbound rules and delivers any held message they now accept.687* When no [`crossSessionInbound`](https://code.claude.com/docs/en/cross-session-messaging#control-inbound-messages) value applies, Claude Code holds an inbound message from another of your sessions for your approval, and delivers without asking only when the sending session identifies itself as also bypassing permission prompts. If you leave the permission mode while messages are held, Claude Code re-applies the inbound rules and delivers any held message they now accept.

688 688 

689In interactive terminal sessions with bypass permissions available, Claude Code also doesn't enforce [plan mode's](#analyze-before-you-edit-with-plan-mode) blocks. Claude is still instructed to plan without editing, but a file edit or shell command it attempts during planning runs without prompting. Explicit [ask rules](https://code.claude.com/docs/en/permissions.md#manage-permissions) and recognized `rm` and `rmdir` [critical-path removals](#critical-paths) still prompt.689In interactive terminal sessions with bypass permissions available, don't rely on [plan mode's](#analyze-before-you-edit-with-plan-mode) blocks. A file edit or shell command Claude attempts during planning can run without prompting. Explicit [ask rules](https://code.claude.com/docs/en/permissions.md#manage-permissions) and recognized `rm` and `rmdir` [critical-path removals](#critical-paths) still prompt.

690 690 

691Plan mode keeps its blocks wherever Claude Code runs without an interactive terminal, including [non-interactive runs](https://code.claude.com/docs/en/headless.md) with `-p`, [Agent SDK](https://code.claude.com/docs/en/agent-sdk/permissions.md#plan-mode-plan) sessions, and conversations in the [VS Code extension](https://code.claude.com/docs/en/vs-code.md)'s chat panel. There, `--allow-dangerously-skip-permissions` makes `bypassPermissions` selectable later.691Plan mode keeps its blocks wherever Claude Code runs without an interactive terminal, including [non-interactive runs](https://code.claude.com/docs/en/headless.md) with `-p`, [Agent SDK](https://code.claude.com/docs/en/agent-sdk/permissions.md#plan-mode-plan) sessions, and conversations in the [VS Code extension](https://code.claude.com/docs/en/vs-code.md)'s chat panel. There, `--allow-dangerously-skip-permissions` makes `bypassPermissions` selectable later.

692 692 

permissions.md +1 −1

Details

84>84>

85> In `bypassPermissions` mode, Claude Code skips permission prompts, including for writes to [protected paths](https://code.claude.com/docs/en/permission-modes.md#protected-paths) such as `.git` and `.claude`. The [cross-session messaging safeguards](https://code.claude.com/docs/en/permission-modes.md#skip-all-checks-with-bypasspermissions-mode) still apply. Only use this mode in isolated environments like containers or VMs where Claude Code can't cause damage.85> In `bypassPermissions` mode, Claude Code skips permission prompts, including for writes to [protected paths](https://code.claude.com/docs/en/permission-modes.md#protected-paths) such as `.git` and `.claude`. The [cross-session messaging safeguards](https://code.claude.com/docs/en/permission-modes.md#skip-all-checks-with-bypasspermissions-mode) still apply. Only use this mode in isolated environments like containers or VMs where Claude Code can't cause damage.

86 86 

87To prevent `bypassPermissions` or `auto` mode from being used, set `permissions.disableBypassPermissionsMode` or `permissions.disableAutoMode` to `"disable"` in any [settings file](https://code.claude.com/docs/en/settings.md#where-settings-live). These are most useful in [managed settings](#managed-settings) where they can't be overridden.87To prevent `bypassPermissions` or `auto` mode from being used, set [`permissions.disableBypassPermissionsMode`](https://code.claude.com/docs/en/settings-reference#permissions-disablebypasspermissionsmode) or [`permissions.disableAutoMode`](https://code.claude.com/docs/en/settings-reference#disableautomode) to `"disable"`. These are most useful in [managed settings](#managed-settings) where they can't be overridden.

88 88 

89To deny calls that would wait on a permission prompt, so an unattended session keeps working, set [`permissions.denyInsteadOfPrompting`](https://code.claude.com/docs/en/settings-reference#permissions-denyinsteadofprompting) to `true` in your user or managed settings. `dontAsk` is a permission mode of its own, while this key works with the permission mode you're in.89To deny calls that would wait on a permission prompt, so an unattended session keeps working, set [`permissions.denyInsteadOfPrompting`](https://code.claude.com/docs/en/settings-reference#permissions-denyinsteadofprompting) to `true` in your user or managed settings. `dontAsk` is a permission mode of its own, while this key works with the permission mode you're in.

90 90 

Details

69>69>

70> The last sentence of the summary tells you whether the plugin is usable in this session yet:70> The last sentence of the summary tells you whether the plugin is usable in this session yet:

71>71>

72> * **Active now**: `Plugin is now active.` No reload is needed.72> * **Active now**: `Plugin is now active.`

73> * **Active, but a server needs setup**: `Plugin is now active.` is followed by a note that starts `Its bundled MCP server needs`. The plugin's [bundled MCP server](https://code.claude.com/docs/en/plugins/components.md#include-a-packaged-mcpb-server) can't start until you set its options. Select the plugin on the **Installed** tab in `/plugin` and choose **Configure**.73> * **Active, but a server needs setup**: `Plugin is now active.` is followed by a note that starts `Its bundled MCP server needs`. The plugin's [bundled MCP server](https://code.claude.com/docs/en/plugins/components.md#include-a-packaged-mcpb-server) can't start until you set its options. Select the plugin on the **Installed** tab in `/plugin` and choose **Configure**.

74> * **Reload needed**: `Run /reload-plugins to apply.` The panel closes and Claude Code runs that reload for you. If the reload would [invalidate the prompt cache](https://code.claude.com/docs/en/prompt-caching.md#enabling-or-disabling-a-plugin), it warns and leaves the plugin pending instead. Run `/reload-plugins --force` to activate it anyway, which costs one uncached request.74> * **Reload needed**: `Run /reload-plugins to apply.` The panel closes and Claude Code runs that reload for you. If the reload would [invalidate the prompt cache](https://code.claude.com/docs/en/prompt-caching.md#enabling-or-disabling-a-plugin), it warns and leaves the plugin pending instead. Run `/reload-plugins --force` to activate it anyway, which costs one uncached request.

75> * **Load failed**: the summary includes `The plugin couldn't`. Open the **Errors** tab in `/plugin` for the reason, then see [After install: plugin not working](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-installed-but-not-working).75> * **Load failed**: the summary includes `The plugin couldn't`. Open the **Errors** tab in `/plugin` for the reason, then see [After install: plugin not working](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-installed-but-not-working).


123 123 

124> [tab] Cloud session124> [tab] Cloud session

125>125>

126> A [cloud session](https://code.claude.com/docs/en/cloud-environments.md), including [the browser at claude.ai/code](https://code.claude.com/docs/en/claude-code-on-the-web.md), has no plugin browser and doesn't load the plugins you installed at user or local scope. For plugins your organization distributes through managed settings, see [Manage plugins for your organization](https://code.claude.com/docs/en/plugins/org.md).126> To use a plugin in a [cloud session](https://code.claude.com/docs/en/cloud-environments.md), add it to your claude.ai account at [claude.ai/customize/plugins](https://claude.ai/customize/plugins), then start a new session. You can [pick a listed plugin, add a marketplace, or upload a plugin](https://claude.com/docs/plugins/overview#find-and-add-a-plugin). On Team and Enterprise plans, an [Owner](https://code.claude.com/docs/en/server-managed-settings.md#access-control) controls which of these you can use. For a self-hosted environment, see [what differs on Amazon Bedrock or Google Cloud's Agent Platform](https://code.claude.com/docs/en/self-hosted-environments-configuration.md#what-differs-from-sessions-on-the-anthropic-api).

127>127>

128> See [which parts of your setup are also available in a cloud session](https://code.claude.com/docs/en/cloud-environments.md#what-carries-over-from-your-setup) for the rest of your setup.128> Plugins you install on your computer at user or local scope aren't available in cloud sessions. For plugins your organization distributes through managed settings, see [Manage plugins for your organization](https://code.claude.com/docs/en/plugins/org.md). For the rest of your setup, see [What carries over from your setup](https://code.claude.com/docs/en/cloud-environments.md#what-carries-over-from-your-setup).

129 129 

130### Choose an install scope130### Choose an install scope

131 131 

Details

114 114 

115For the components Cowork loads, see the [component support table](https://claude.com/docs/plugins/platform-support#compare-component-support-by-app) on claude.com.115For the components Cowork loads, see the [component support table](https://claude.com/docs/plugins/platform-support#compare-component-support-by-app) on claude.com.

116 116 

117Synced plugins load in Cowork sessions and in terminal sessions where you sign in with your claude.ai account:117Synced plugins load in Cowork sessions, cloud sessions, and terminal sessions where you sign in with your claude.ai account:

118 118 

119* **[Cowork](https://claude.com/product/cowork)**: Claude Code downloads them into the session's own environment when the session starts119* **[Cowork](https://claude.com/product/cowork)**: Claude Code downloads them into the session's own environment when the session starts

120* **[Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md)**: they download when you start a session or Claude starts a thread in your [project](https://code.claude.com/docs/en/claude-projects.md). For a self-hosted environment, see [what differs on Amazon Bedrock or Google Cloud's Agent Platform](https://code.claude.com/docs/en/self-hosted-environments-configuration.md#what-differs-from-sessions-on-the-anthropic-api)

120* **Terminal sessions**: each time you start Claude Code, it syncs once in the background, downloading new and updated plugins and removing the ones that you or your organization turned off. Syncing in terminal sessions requires Claude Code v2.1.273 or later121* **Terminal sessions**: each time you start Claude Code, it syncs once in the background, downloading new and updated plugins and removing the ones that you or your organization turned off. Syncing in terminal sessions requires Claude Code v2.1.273 or later

121 122 

122#### Sync timing in cloud Cowork sessions123#### Sync timing in cloud Cowork sessions

Details

4 4 

5# Plugin manifest reference5# Plugin manifest reference

6 6 

7> Complete reference for plugin.json: fields with types and defaults, accepted path forms, and the userConfig and environment variable schemas.7> Reference for plugin.json: fields with types and defaults, accepted path forms, and the userConfig and environment variable schemas.

8 8 

9A plugin manifest is the `plugin.json` file in a plugin's `.claude-plugin/` directory. It carries the plugin's metadata and the [`userConfig`](#user-configuration) values that Claude Code prompts the user for. It also declares any component that you define inline or keep outside its [default location](#standard-layout).9A plugin manifest is the `plugin.json` file in a plugin's `.claude-plugin/` directory. It carries the plugin's metadata and the [`userConfig`](#user-configuration) values that Claude Code prompts the user for. It also declares any component that you define inline or keep outside its [default location](#standard-layout).

10 10 

Details

4 4 

5# Marketplace reference5# Marketplace reference

6 6 

7> Complete reference for marketplace.json fields, plugin entries, and the plugin and marketplace source objects, with where each is valid.7> Reference for marketplace.json fields, plugin entries, and the plugin and marketplace source objects, with where each is valid.

8 8 

9`marketplace.json` is the file that defines a plugin marketplace. It contains the marketplace's name, its owner, and one entry per plugin. Each entry's plugin source says where Claude Code fetches that plugin from.9`marketplace.json` is the file that defines a plugin marketplace. It contains the marketplace's name, its owner, and one entry per plugin. Each entry's plugin source says where Claude Code fetches that plugin from.

10 10 


210 210 

211* It must itself be a relative path inside the marketplace.211* It must itself be a relative path inside the marketplace.

212* It has no effect on a source that already starts with `./`.212* It has no effect on a source that already starts with `./`.

213* A source that contains a `/`, such as `team-a/formatter`, isn't a bare name and still needs the `./` prefix, even when `metadata.pluginRoot` is set.213* A source that contains a `/`, such as `team-a/formatter`, isn't a bare name and still needs the `./` prefix.

214 214 

215### github plugin source215### github plugin source

216 216 

Details

124| `session.append{door=hook-context}` | The stored row for context from a settings hook |124| `session.append{door=hook-context}` | The stored row for context from a settings hook |

125| `session.append{door=compaction}` | The stored rows for a compaction's summary and boundary |125| `session.append{door=compaction}` | The stored rows for a compaction's summary and boundary |

126 126 

127The guard also passes over a user's hooks in some other cases, such as the descriptions of your organization's tools, on [`tool.describe`](https://code.claude.com/docs/en/plugins/mods/reference#tools), and the stored row for a skill's text. `/plugin` shows no note for those. If a hook on another event does nothing, see [Find out why a mod does nothing](https://code.claude.com/docs/en/plugins/mods/troubleshoot.md#find-out-why-a-mod-does-nothing).127The guard also passes over a user's hooks in some other cases, such as the descriptions of your organization's tools, on [`tool.describe`](https://code.claude.com/docs/en/plugins/mods/reference#tools). `/plugin` shows no note for that case. If a hook on another event does nothing, see [Find out why a mod does nothing](https://code.claude.com/docs/en/plugins/mods/troubleshoot.md#find-out-why-a-mod-does-nothing).

128 128 

129The note appears in the plugin's details and in the **Errors** tab of `/plugin`. It requires Claude Code v2.1.299 or later. It names each hook from the table as the mod registered it, as in this example:129The note appears in the plugin's details and in the **Errors** tab of `/plugin`. It requires Claude Code v2.1.299 or later. It names each hook from the table as the mod registered it, as in this example:

130 130 

Details

396 396 

397### Handle the settings hook events397### Handle the settings hook events

398 398 

399Settings hooks are the command, HTTP, prompt, and agent hooks you configure in settings files. Each [settings hook event](https://code.claude.com/docs/en/hooks.md#hook-events), such as `Stop`, `SessionEnd`, or `PostToolUse`, is also an event named `classic.` followed by the settings hook event's name, such as `classic.Stop`. `e` is the JSON a settings hook receives on stdin, including `transcript_path`. Where the [built-in guard](https://code.claude.com/docs/en/plugins/mods/admin.md#know-what-happens-by-default) loads, [a hook on these events in a mod you install doesn't run](https://code.claude.com/docs/en/plugins/mods/admin.md#hooks-the-guard-passes-over).399To handle a [settings hook event](https://code.claude.com/docs/en/hooks.md#hook-events), add the `classic.` prefix to its name, as in `classic.Stop`. Where the [built-in guard](https://code.claude.com/docs/en/plugins/mods/admin.md#know-what-happens-by-default) loads, [a hook on these events in a mod you install doesn't run](https://code.claude.com/docs/en/plugins/mods/admin.md#hooks-the-guard-passes-over).

400 

401On `classic.PreToolUse`, `e` describes only the tool call: the tool's name in `e.tool` and a built-in tool's arguments as fields, such as `e.command` for Bash. On other events, `e` has the fields their settings hooks read from stdin.

400 402 

401This hook uses `Stop`, which fires when Claude finishes responding, to log where the session's transcript is saved:403This hook uses `Stop`, which fires when Claude finishes responding, to log where the session's transcript is saved:

402 404 

Details

207 207 

208### Settings hook events208### Settings hook events

209 209 

210Each [settings hook event](https://code.claude.com/docs/en/hooks.md#hook-events) is an event named `classic.<Event>`, such as `classic.Stop` or `classic.PostToolUse`. `e` is the hook's stdin JSON.210Each [settings hook event](https://code.claude.com/docs/en/hooks.md#hook-events) is an event named `classic.<Event>`, such as `classic.Stop`. For the fields on `e`, see [Handle the settings hook events](https://code.claude.com/docs/en/plugins/mods/events.md#hook-the-settings-hook-events).

211 211 

212### Mods API calls212### Mods API calls

213 213 

Details

68 68 

69### Messages from the built-in guard69### Messages from the built-in guard

70 70 

71Where the [built-in guard](https://code.claude.com/docs/en/plugins/mods/admin.md#know-what-happens-by-default) loads, it can refuse a mod or one of its answers. Some messages name the option your organization's administrator sets to change the rule.71Where the [built-in guard](https://code.claude.com/docs/en/plugins/mods/admin.md#know-what-happens-by-default) loads, it can refuse a mod or one of its answers or calls. Some messages name the option your organization's administrator sets to change the rule.

72 72 

73| Message contains | What it means | Where it appears |73| Message contains | What it means | Where it appears |

74| :- | :- | :- |74| :- | :- | :- |

75| `mods are limited to your organization's by policy (allowManagedModsOnly)` | Your organization allows only [its own mods](https://code.claude.com/docs/en/plugins/mods/admin.md#install-your-organizations-mods), so yours was refused | The debug log, and the transcript in a [session that hot-reloads a plugin directory](#find-out-why-a-mod-does-nothing) |75| `mods are limited to your organization's by policy (allowManagedModsOnly)` | Your organization allows only [its own mods](https://code.claude.com/docs/en/plugins/mods/admin.md#install-your-organizations-mods), so yours was refused | The debug log, and the transcript in a [session that hot-reloads a plugin directory](#find-out-why-a-mod-does-nothing) |

76| `tried to lift a deny rule in your settings` | Your mod's [`tool.check`](https://code.claude.com/docs/en/plugins/mods/reference#tools) hook approved a call that a `deny` rule refuses. The call stays denied. | The transcript and the debug log, once for each mod in a session. In a `claude -p` run, the debug log. |76| `tried to lift` or `tried to reword`, such as `tried to lift a deny rule in your settings` | A hook in your mod, such as [`tool.check`](https://code.claude.com/docs/en/plugins/mods/events#approve-or-refuse-a-tool-call-before-the-user-is-asked), tried to loosen or reword the decision the message names. That decision stands. Return what `await next(e)` gives you, or a stricter decision. | The transcript and the debug log. In a `claude -p` run, the debug log. |

77| `the rules and hooks in your settings could not be checked for this call, so it is refused` | The guard failed while checking a call that a mod approved, so it refused the call | The reason Claude reads for the denied call |77| `the rules and hooks in your settings could not be checked for this call, so it is refused` | The guard failed while checking a call that a mod approved, so it refused the call | The reason Claude reads for the denied call |

78| `is not for plugins outside policy to change` | Your mod tried to change an environment variable the guard refuses. Remove that `$.env.set` call. | The error `$.env.set` throws |

79| `would be named as a tool of one of the organization's servers` | One cause is a plugin name that matches one of your organization's MCP server or plugin names. Rename the plugin and update hooks that match the tool's old [full name](https://code.claude.com/docs/en/plugins/mods/api.md#add-a-tool). If the error stays, ask an administrator whether [`managed-mcp.json`](https://code.claude.com/docs/en/managed-mcp#deploy-managed-mcp-json) is readable and valid. | The error `$.tool.register` throws |

78 80 

79### `validate` passes and lists no `hooks` line81### `validate` passes and lists no `hooks` line

80 82 

Details

72 72 

73![Diagram of the marketplace path in three boxes, left to right. A marketplace, a catalog of plugins, lists a plugin. The plugin is one directory installed as a unit, holding skills, agents, hooks, MCP servers, and other components. You install the plugin into Claude Code, which loads its components.](https://mintcdn.com/claude-code/2Q_GtOEovg5qaBem/images/plugins-model.svg?fit=max\&auto=format\&n=2Q_GtOEovg5qaBem\&q=85\&s=4196344954b7c2e27fc0bd6a9a1113a1)73![Diagram of the marketplace path in three boxes, left to right. A marketplace, a catalog of plugins, lists a plugin. The plugin is one directory installed as a unit, holding skills, agents, hooks, MCP servers, and other components. You install the plugin into Claude Code, which loads its components.](https://mintcdn.com/claude-code/2Q_GtOEovg5qaBem/images/plugins-model.svg?fit=max\&auto=format\&n=2Q_GtOEovg5qaBem\&q=85\&s=4196344954b7c2e27fc0bd6a9a1113a1)

74 74 

75[Install and manage plugins](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin) has the install steps for each place you run Claude Code. While you're developing a plugin, you don't need a marketplace: load it straight from its folder with `--plugin-dir`, as [Develop without a marketplace](https://code.claude.com/docs/en/plugins/create.md#develop-without-a-marketplace) shows.75[Install and manage plugins](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin) has the install steps for each place you run Claude Code. While you're developing a plugin, load it straight from its folder with `--plugin-dir`, as [Develop without a marketplace](https://code.claude.com/docs/en/plugins/create.md#develop-without-a-marketplace) shows.

76 76 

77### Make an installed plugin available in your session77### Make an installed plugin available in your session

78 78 

Details

30 30 

31You typed `/plugin` somewhere other than a Claude Code terminal session, and Claude replied with this line instead of opening anything.31You typed `/plugin` somewhere other than a Claude Code terminal session, and Claude replied with this line instead of opening anything.

32 32 

33You get this reply in a session that has no terminal to draw the `/plugin` panel in: [non-interactive mode](https://code.claude.com/docs/en/headless.md) with `claude -p`, the Agent SDK, the Claude desktop app's Code tab, the VS Code extension panel, and the browser at claude.ai/code.33For example, you see this reply in [non-interactive mode](https://code.claude.com/docs/en/headless.md) with `claude -p`, the Agent SDK, and the VS Code extension panel.

34 34 

35In the VS Code extension panel, only a `/plugin` line with something after it, such as `/plugin install <plugin>@<marketplace>`, gets this reply. `/plugin` or `/plugins` typed alone opens the **Manage plugins** dialog.35In the VS Code extension panel, only a `/plugin` line with something after it, such as `/plugin install <plugin>@<marketplace>`, gets this reply. `/plugin` or `/plugins` typed alone opens the **Manage plugins** dialog.

36 36 

37Install the plugin from the surface you're on instead:37Install the plugin from the surface you're on instead:

38 38 

39* **Claude desktop app, local or SSH session**: use the **Desktop app** tab under [Install a plugin](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin)

40* **VS Code extension**: use the **VS Code** tab under [Install a plugin](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin)39* **VS Code extension**: use the **VS Code** tab under [Install a plugin](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin)

41* **Claude Code on the web, or a desktop cloud session**: a cloud session has no plugin browser. See the **Cloud session** tab under [Install a plugin](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin) for what a cloud session loads

42* **A terminal you have access to**: run `claude` and type `/plugin` there, or run `claude plugin install <plugin>@<marketplace>` in your shell without starting a session40* **A terminal you have access to**: run `claude` and type `/plugin` there, or run `claude plugin install <plugin>@<marketplace>` in your shell without starting a session

43 41 

44When a terminal install works, `/plugin` prints an install summary that starts with `✓ Installed <plugin>.` and `claude plugin install` prints `Installed plugin: <plugin>@<marketplace>`.42When a terminal install works, `/plugin` prints an install summary that starts with `✓ Installed <plugin>.` and `claude plugin install` prints `Installed plugin: <plugin>@<marketplace>`.

pr-steward.md +72 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# PR Steward

6 

7> Let PR Steward push fixes to your GitHub pull requests for failing checks, merge conflicts, and review feedback

8 

9PR Steward is an agent that works on your team's open GitHub pull requests. It pushes commits to address review feedback, and attempts to fix failing checks and resolve merge conflicts. With it on, you can open a pull request and start your next change while PR Steward works on the failing checks, conflicts, and review comments that follow. It's in public beta on Team and Enterprise plans.

10 

11> [!TIP]

12>

13> To turn on PR Steward, follow [Set up PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md), which takes an Owner role in your Claude organization.

14 

15PR Steward picks up a problem on GitHub, works on it in a cloud session, and reports back on the pull request:

16 

17![Diagram of PR Steward: a failing check, review comment, or merge conflict goes to PR Steward in a cloud session, and its commits and replies appear on GitHub.](https://mintcdn.com/claude-code/sMH7RDpTvyWlAkrg/images/pr-steward-flow.svg?fit=max\&auto=format\&n=sMH7RDpTvyWlAkrg\&q=85\&s=4a1de46fbee43c2a00ef78c3dca36e59)

18 

19To stop PR Steward on a pull request, remove the `claude-pr-steward-watching` label or [comment `@claude stop`](https://code.claude.com/docs/en/pr-steward-pull-requests#start-or-stop-pr-steward-on-one-pull-request).

20 

21Steward is designed not to approve or merge pull requests. Use branch protection to require the approvals you want before anything merges. See [Limits on approvals and merges](https://code.claude.com/docs/en/pr-steward-security.md#limits-on-approvals-and-merges).

22 

23## What PR Steward does on a pull request

24 

25While PR Steward watches a pull request, it pushes commits and replies to comments without asking first, and the pull request has the `claude-pr-steward-watching` label. See [what PR Steward adds to a pull request](https://code.claude.com/docs/en/pr-steward-pull-requests.md#what-pr-steward-adds-to-a-pull-request).

26 

27### When PR Steward starts

28 

29In a repository where an Owner set PR Steward to **On**, it starts when you open a pull request, reopen one, or mark a draft as ready for review. It also starts at the next push to an open pull request that it hasn't started on before.

30 

31PR Steward skips drafts, pull requests from forks, pull requests that a bot opened, and authors without write access to the repository. An Owner can [change the repository's setting](https://code.claude.com/docs/en/pr-steward-setup.md#choose-when-pr-steward-starts-in-each-repository) so that PR Steward includes drafts, or normally starts only when someone asks it to.

32 

33### What PR Steward fixes

34 

35PR Steward works on failing checks, merge conflicts, review feedback, and the Claude Approvals check:

36 

37* **A failing check**: attempts a fix when the cause is in code that the pull request touches

38* **A merge conflict**: attempts to merge the base branch in and resolve the conflicts

39* **A person's review comment**: attempts small, specific changes and replies to the comment. Can reply without pushing when the request is large or about the design

40* **A review bot's finding**: works on the findings that [Code Review](https://code.claude.com/docs/en/code-review.md) marks **Important**. For other bots, works on lint findings and bugs

41* **The [Claude Approvals](https://code.claude.com/docs/en/approvals.md) check**: where the check waits for something that a commit can fix, such as open Code Review findings, works on that. Where the check waits for people's approvals, leaves it. After PR Steward pushes, the check can [ask for approvals again](https://code.claude.com/docs/en/approvals-policy.md#earlier-approvals-after-a-new-push)

42 

43### Stop or limit PR Steward

44 

45To stop PR Steward on one pull request, remove the `claude-pr-steward-watching` label or [comment `@claude stop`](https://code.claude.com/docs/en/pr-steward-pull-requests#start-or-stop-pr-steward-on-one-pull-request). To turn off or limit PR Steward on the pull requests that you open later, go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** or **Settings > Claude Code**.

46 

47## Decide whether PR Steward fits your team

48 

49PR Steward is one of the [Claude Ship](https://code.claude.com/docs/en/claude-ship.md) agents, alongside Code Review and Claude Approvals. Before you turn it on, compare it with auto-fix and `/steward`, check that your organization qualifies, and see how it's billed.

50 

51### How PR Steward differs from auto-fix and /steward

52 

53[Auto-fix](https://code.claude.com/docs/en/claude-code-on-the-web.md#auto-fix-pull-requests) and the [`/steward` command](https://code.claude.com/docs/en/ship-command#start-a-watch-with-%2Fsteward) also work on failing checks and review comments. They run in your own sessions, and they act as you and count against your own usage. PR Steward acts as the [Claude GitHub App](https://github.com/apps/claude) and bills your organization.

54 

55If you ask to auto-fix a pull request that PR Steward is watching, the request fails. See [Auto-fix is unavailable](https://code.claude.com/docs/en/pr-steward-troubleshooting.md#auto-fix-is-unavailable).

56 

57### Availability

58 

59PR Steward works with repositories on github.com or a connected [GitHub Enterprise Server](https://code.claude.com/docs/en/github-enterprise-server.md) instance on port 443. You need a Claude organization on a [Team or Enterprise plan](https://code.claude.com/docs/en/feature-availability.md#features-that-require-a-claude-subscription).

60 

61PR Steward isn't available to organizations with [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md) enabled, the [HIPAA configuration](https://code.claude.com/docs/en/hipaa-setup.md) applied, or customer-managed encryption keys.

62 

63### What PR Steward costs

64 

65PR Steward's usage is billed by tokens to your organization's [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans). It has no spend limit of its own until you [set one](https://code.claude.com/docs/en/pr-steward-setup.md#set-pr-steward’s-spend-limits), which takes an Owner role.

66 

67## Next steps

68 

69* [Set up PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md), which takes an Owner

70* [Work with PR Steward](https://code.claude.com/docs/en/pr-steward-pull-requests.md) on your pull requests

71* [What PR Steward can access](https://code.claude.com/docs/en/pr-steward-security.md)

72* [Troubleshoot PR Steward](https://code.claude.com/docs/en/pr-steward-troubleshooting.md)

pr-steward-pull-requests.md +247 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Work with PR Steward on a pull request

6 

7> See what PR Steward adds to your GitHub pull request, give it instructions, start or stop it with a comment or a label, and limit what it does for you

8 

9[PR Steward](https://code.claude.com/docs/en/pr-steward.md) is an agent that works on the GitHub pull requests that you open, in repositories where it's on. It pushes commits to address review feedback, and attempts to fix failing checks and resolve merge conflicts.

10 

11You can [tell it what to work on](#change-what-pr-steward-does) or [turn it off for yourself](#turn-off-or-limit-pr-steward-on-all-your-pull-requests). To stop it on one pull request, remove the `claude-pr-steward-watching` label, or comment `@claude stop`.

12 

13## What PR Steward adds to a pull request

14 

15On github.com, PR Steward posts its comments as `claude[bot]`, the account of the [Claude GitHub App](https://github.com/apps/claude).

16 

17PR Steward adds these labels, comments, and commits to a pull request:

18 

19![Diagram of what PR Steward leaves on a pull request: the claude-pr-steward-watching label while PR Steward watches, a comment headed Claude PR Steward when it first starts, progress comments before and after a piece of work, and ordinary commits on your branch by Claude.](https://mintcdn.com/claude-code/sMH7RDpTvyWlAkrg/images/pr-steward-pull-request.svg?fit=max\&auto=format\&n=sMH7RDpTvyWlAkrg\&q=85\&s=2c76cf9593743c0a05718e7a90c45796)

20 

21PR Steward adds each one at these times:

22 

23| What PR Steward adds | When |

24| :- | :- |

25| The `claude-pr-steward-watching` label | While it watches the pull request |

26| The `claude-pr-steward-is-working` label | While it works |

27| A comment headed **Claude PR Steward** | When it first starts on the pull request |

28| A progress comment | Before and after a piece of work |

29| Commits whose author and committer are `Claude <noreply@anthropic.com>` | When it pushes a fix |

30 

31The progress comment after a push names the commits to revert if you want to [undo the push](#undo-a-fix-that-pr-steward-pushed).

32 

33### Example of a fix for a failing check

34 

35In this example, you open a pull request in a repository where PR Steward starts by itself, and a test of the code that you changed fails. Claude writes the progress comments, so their wording varies.

36 

371. **PR Steward starts**: it adds the `claude-pr-steward-watching` label and posts a first comment. The emoji and the opening words change from one pull request to the next, and the rest reads like this:

38 

39 ```text wrap theme={null}

40 🛠️ Claude PR Steward — On it. I'll chase down CI failures, work through review comments, and push fixes until it's green. Ask me anything in a comment and I'll answer or take action. I'll check for a steward skill at .claude/skills/steward/SKILL.md for any repo-specific behavior I should follow.

41 

42 Remove the claude-pr-steward-watching label any time to take over.

43 

44 React with 👍 or 👎 to provide feedback · Settings

45 ```

46 

472. **The test fails**: PR Steward adds the `claude-pr-steward-is-working` label and says what it plans to do:

48 

49 ```text wrap theme={null}

50 The unit-tests check failed on test_parse_date. I'll find the cause and push a fix.

51 

52 – Claude PR steward · Settings

53 ```

54 

553. **PR Steward pushes a fix**: PR Steward can wait before it pushes, for example while other checks are still running, and says so in a comment. Then a commit by `Claude <noreply@anthropic.com>` appears on your branch. A second progress comment says what changed and how to undo it:

56 

57 ```text wrap theme={null}

58 Pushed a1b2c3d: parse_date now accepts a date with no time zone, which is the case that test_parse_date covers. To undo it, revert a1b2c3d, or remove the claude-pr-steward-watching label to stop me entirely.

59 

60 – Claude PR steward · Settings

61 ```

62 

634. **The work ends**: PR Steward removes the `claude-pr-steward-is-working` label and continues to watch the pull request

64 

65## Change what PR Steward does

66 

67PR Steward starts from [default instructions](#default-instructions-for-pr-steward) on how to handle failing checks, review comments, and the base branch. You can change what it does for one pull request, for every pull request that you open, or for a whole repository:

68 

69* **For one pull request that you opened**: [start a comment with `@claude`](#give-pr-steward-instructions-in-a-comment) on that pull request

70* **For every pull request that you open**: in your settings on claude.ai, [turn it off or limit it](#turn-off-or-limit-pr-steward-on-all-your-pull-requests), [choose what it works on](#choose-what-pr-steward-works-on), or [enter instructions](#save-pr-steward-instructions-for-every-pull-request-you-open)

71* **For everyone's pull requests in a repository**: [save a file at `.claude/skills/steward/SKILL.md`](#save-pr-steward-instructions-for-everyone-in-a-repository) in that repository

72 

73### Default instructions for PR Steward

74 

75PR Steward's default instructions are instructions to Claude, so they describe what PR Steward aims to do.

76 

77With no instructions from you, PR Steward follows defaults such as these:

78 

79| Work | By default |

80| :- | :- |

81| Failing checks | Fixes and pushes when the failure is in code that the pull request touches |

82| Flaky checks | Re-runs a failed job once, when the job failed before any test ran or passed earlier on the same commit |

83| Base branch | Merges the base branch into yours when there's a conflict. Can also merge it when your branch is behind |

84| Lockfiles and generated files | Regenerates them |

85| Small review requests, such as a rename or an added test | Pushes the change and resolves the thread |

86| Large or design-level review requests | Replies, and doesn't push or resolve the thread, unless the reviewer says which change to make |

87| Code Review's optional findings | Replies and resolves the thread. Doesn't push for these alone |

88| Choice of approach | Picks one itself, and doesn't ask you which to take |

89 

90To change most of these defaults for everyone's pull requests in a repository, [save instructions at `.claude/skills/steward/SKILL.md`](#save-pr-steward-instructions-for-everyone-in-a-repository) in that repository.

91 

92### Give PR Steward instructions in a comment

93 

94On a pull request that you opened, start a comment with `@claude` and say what you want.

95 

96This comment asks PR Steward to fix one kind of failure:

97 

98```text theme={null}

99@claude only fix the lint failures. I'm still working on the tests.

100```

101 

102### Turn off or limit PR Steward on all your pull requests

103 

104Go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** or **Settings > Claude Code** on claude.ai and select how much PR Steward does on the pull requests that you open. To change the setting, you need a [connected GitHub account](https://code.claude.com/docs/en/web-quickstart.md#connect-github).

105 

106| Option | What PR Steward does on your pull requests |

107| :- | :- |

108| **Off** | Starts only when you add the `claude-pr-steward-watching` label or comment `@claude steward` yourself |

109| **Only when tagged** | Starts only when you or a teammate with write access adds the `claude-pr-steward-watching` label or comments `@claude steward` |

110| **Act on its own** | Starts on each [eligible pull request](https://code.claude.com/docs/en/pr-steward.md#when-pr-steward-starts), including in repositories that an Owner [set to **Manual**](https://code.claude.com/docs/en/pr-steward-setup.md#choose-when-pr-steward-starts-in-each-repository) |

111| **Customize** | Follows each repository's own setting for when to start. You [choose what it works on](#choose-what-pr-steward-works-on) |

112 

113Before you choose an option, the settings page shows **Act on its own** as selected. Until you choose one, PR Steward follows each repository's own setting.

114 

115PR Steward reads your settings when it starts on a pull request, so a change applies to later starts.

116 

117### Choose what PR Steward works on

118 

119To tell PR Steward what to work on, for every pull request that you open, use the toggles in your settings. A repository's `.claude/skills/steward/SKILL.md` can say something else, so see [which instructions take priority](#which-pr-steward-instructions-take-priority).

120 

1211. Go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** or **Settings > Claude Code** on claude.ai

1222. For **How much should Steward do on its own?**, select [**Customize**](#turn-off-or-limit-pr-steward-on-all-your-pull-requests)

1233. Turn off the toggle for each thing that you don't want PR Steward to do. Each toggle is on until you turn it off:

124 * **Failing CI and merge conflicts**

125 * **Issues found by Code Review and other review bots**

126 * **Comments from human reviewers**

127 * **Reply to reviewers and resolve their threads**, which needs **Comments from human reviewers** on

128 * **Include my draft PRs**

129 

130With **Customize** selected, the settings look like this:

131 

132![PR Steward settings with Customize selected, showing switches for failing CI and merge conflicts, review bot issues, human reviewer comments, replies to reviewers, and draft PRs, and a menu for updating from the base branch.](https://mintcdn.com/claude-code/sMH7RDpTvyWlAkrg/images/pr-steward-customize.png?fit=max\&auto=format\&n=sMH7RDpTvyWlAkrg\&q=85\&s=10695821d6e7766ee94cdb5706c1319f)

133 

134> [!NOTE]

135>

136> **Customize** also changes when PR Steward starts: it follows each repository's own setting. If you had **Off** or **Only when tagged** selected before, it can then start by itself.

137 

138While **Include my draft PRs** is on, PR Steward works on your drafts in repositories that an Owner set to include drafts. PR Steward also works on your drafts in a repository that an Owner set to **Manual**, when someone asks for it on the draft. While it's off, PR Steward doesn't start on your drafts.

139 

140While **Failing CI and merge conflicts** is on, you can also say when PR Steward merges the base branch into yours. Set **Updating my branch from the base branch** to **Whenever my branch falls behind**, **Only when there is a conflict**, or **Never, I update it myself**.

141 

142### Save PR Steward instructions for every pull request you open

143 

144To give PR Steward the same instructions on every pull request that you open, go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** or **Settings > Claude Code** on claude.ai. Under **My instructions for Steward**, enter up to 1,000 characters.

145 

146These instructions ask for small commits and no replies to reviewers:

147 

148```text theme={null}

149Keep commits small.

150Don't reply to reviewers for me.

151```

152 

153### Save PR Steward instructions for everyone in a repository

154 

155To set how PR Steward behaves for everyone in a repository, save a file at `.claude/skills/steward/SKILL.md` and merge it to the default branch.

156 

157This example tells PR Steward which work to take on, and how to handle one file and one flaky check:

158 

159```markdown theme={null}

160---

161name: steward

162description: House rules for PR Steward in this repository

163user-invocable: false

164disable-model-invocation: true

165---

166 

167- Work on failing checks, merge conflicts, and Important findings from Code Review.

168- Leave comments from human reviewers to the author.

169- Regenerate `package-lock.json` with `npm install`. Don't edit it directly.

170- The `e2e-nightly` check is flaky. Re-run it once before you look for a cause.

171```

172 

173To check that PR Steward follows the file:

174 

1751. Open a test pull request after the file reaches the default branch.

1762. If the `claude-pr-steward-watching` label doesn't appear by itself, comment `@claude steward`.

1773. Once the label is on, have a teammate leave a review comment.

178 

179The example leaves comments from human reviewers to the author, so PR Steward should push no fix for that review comment.

180 

181PR Steward also reads instructions from files such as `CLAUDE.md`, `.claude/CLAUDE.md`, `.claude/rules/`, and `AGENTS.md` at the repository's root. It reads them from the default branch.

182 

183> [!NOTE]

184>

185> The `/ship` and `/steward` commands in Claude Code read the same file. During a watch, Claude [follows the copy in your checkout](https://code.claude.com/docs/en/ship-command.md#save-instructions-for-watches-in-a-repository).

186 

187### Which PR Steward instructions take priority

188 

189Your settings, the repository's file, and your comments can disagree. PR Steward settles that this way:

190 

191* **Whether PR Steward starts**: [the option that you select](#turn-off-or-limit-pr-steward-on-all-your-pull-requests) and [**Include my draft PRs**](#choose-what-pr-steward-works-on) are checked before PR Steward reads any instructions

192* **What PR Steward does after it starts**: where your own settings and the repository's [`.claude/skills/steward/SKILL.md`](#save-pr-steward-instructions-for-everyone-in-a-repository) disagree, that file applies. Your comments on the pull request override your own settings there, and a comment that asks PR Steward to stop or hold off also overrides that file

193 

194## Start or stop PR Steward

195 

196Use a comment or a label to start or stop PR Steward on one pull request. To turn it off or limit it on every pull request that you open, [change your settings](#turn-off-or-limit-pr-steward-on-all-your-pull-requests).

197 

198### Start or stop PR Steward on one pull request

199 

200To stop PR Steward on a pull request, remove the `claude-pr-steward-watching` label, or comment `@claude stop`.

201 

202To start or stop PR Steward with a comment, put one of these commands at the start of a top-level comment on an open pull request:

203 

204| Comment | What it does |

205| :- | :- |

206| `@claude stop` | Stops PR Steward. Make the command the whole comment |

207| `@claude steward stop` or `@claude unwatch` | Stops PR Steward |

208| `@claude steward` | Starts PR Steward |

209| `@claude babysit`, `@claude watch`, `@claude babysit stop`, `@claude watch stop` | Other spellings of the start and stop commands |

210 

211After a stop command, PR Steward removes its labels and confirms in a comment. After you remove the label, it stops without a comment.

212 

213PR Steward stays stopped when you push or comment later. To restart it, comment `@claude steward` or add the label again. If it doesn't start, see [PR Steward didn't start on a pull request](https://code.claude.com/docs/en/pr-steward-troubleshooting.md#pr-steward-didn’t-start-on-a-pull-request).

214 

215### Undo a fix that PR Steward pushed

216 

217After a revert, PR Steward can make the same fix again, so take these steps in order:

218 

2191. **Hold PR Steward back**: [stop it](#start-or-stop-pr-steward-on-one-pull-request).

2202. **Revert the commits**: revert the commits by `Claude <noreply@anthropic.com>` that you don't want.

221 

222### Keep PR Steward off a pull request from the start

223 

224Include this marker in the description when you open the pull request:

225 

226```html theme={null}

227<!-- claude-pr-steward-disable -->

228```

229 

230To start PR Steward on that pull request later, remove the marker first.

231 

232### Who can start and stop PR Steward

233 

234Starting or stopping PR Steward takes this access to the repository:

235 

236| Action | Who can do it |

237| :- | :- |

238| Start or stop PR Steward with a comment | A person with write access to the repository |

239| Start PR Steward by adding the `claude-pr-steward-watching` label | A person with write access |

240| Stop PR Steward by removing the label | Any person GitHub allows to remove labels |

241 

242## Related resources

243 

244* [PR Steward](https://code.claude.com/docs/en/pr-steward.md)

245* [Troubleshoot PR Steward](https://code.claude.com/docs/en/pr-steward-troubleshooting.md)

246* [What PR Steward can access](https://code.claude.com/docs/en/pr-steward-security.md)

247* [Set up PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md)

pr-steward-security.md +69 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# What PR Steward can access

6 

7> Check which GitHub identity, permissions, and repositories PR Steward uses, where its sessions run, and what limits approvals and merges

8 

9[PR Steward](https://code.claude.com/docs/en/pr-steward.md) is an agent that works on your team's open GitHub pull requests. It acts on GitHub as the [Claude GitHub App](https://github.com/apps/claude) and works on each pull request in a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md). On GitHub Enterprise Server, it acts as [the app that your organization created](https://code.claude.com/docs/en/github-enterprise-server.md#admin-setup).

10 

11The access and limits here are those of a session in an Anthropic-hosted environment. For a self-hosted one, see [Run PR Steward in a self-hosted environment](https://code.claude.com/docs/en/pr-steward-setup.md#run-pr-steward-in-a-self-hosted-environment). For how session data is handled, see [Data usage](https://code.claude.com/docs/en/data-usage.md).

12 

13## PR Steward's identity and permissions

14 

15Check what a PR Steward session can reach on GitHub, then how the session itself is set up.

16 

17### PR Steward's GitHub access

18 

19As its GitHub App, a PR Steward session acts on GitHub with these repositories, permissions, and token:

20 

21| Topic | What PR Steward uses |

22| :- | :- |

23| Repositories | A session starts with the pull request's own repository, which it reads and writes. GitHub search on github.com can return results from other github.com repositories that your organization has added for PR Steward. A session can fetch public repositories on github.com |

24| Permissions | Read and write on contents, pull requests, and issues. Where your installation of the app grants them, it also has read on checks and statuses and write on Actions. On github.com, the installation can also grant write on workflows, which lets PR Steward push changes to workflow files. See the app's [permission list](https://code.claude.com/docs/en/github-actions.md#github-app-permissions) |

25| Token | The app's token is kept outside the session's sandbox. By default, the session's `gh` and `git` requests go through Anthropic's service, which adds the token |

26 

27### PR Steward's session environment

28 

29Check where a PR Steward session runs, how it handles permission prompts, and which comments and instruction files it reads:

30 

31| Topic | How a session works |

32| :- | :- |

33| Where the code runs | In a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md). See [the environment that PR Steward runs in](https://code.claude.com/docs/en/pr-steward-setup.md#choose-the-environment-pr-steward-runs-in) |

34| Permission prompts | The session is started in [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), and a request for permission is denied |

35| Comments | Anthropic's service sends a session the comments and reviews of the pull request's author, people with write access to the repository, and bots. When a session reads the pull request directly, it can also see what anyone else wrote there |

36| Instruction files | PR Steward [reads them from the default branch](https://code.claude.com/docs/en/pr-steward-pull-requests.md#save-pr-steward-instructions-for-everyone-in-a-repository) |

37 

38## Limits on approvals and merges

39 

40Steward is designed not to approve or merge pull requests. Use branch protection to require the approvals you want before anything merges.

41 

42In an Anthropic-hosted environment, Anthropic's service refuses some requests that a PR Steward session makes as its GitHub App, and leaves others to GitHub's branch rules.

43 

44### Requests that Anthropic's service refuses

45 

46Anthropic's service refuses these requests from a PR Steward session that acts as its GitHub App:

47 

48* Approving a pull request

49* Changing branch protection, rulesets, or statuses, or writing check runs

50* Deleting a branch

51* Pushing tags

52 

53### Requests left to GitHub's branch rules

54 

55Anthropic's service allows requests such as these. GitHub's branch rules control them, on the branches that have rules:

56 

57* **Merging, turning on auto-merge, and force-pushing**: before GitHub's branch rules apply, two checks run on the commands that Claude runs

58* **Pushing to a branch other than the pull request's**: a session can push to any branch in that repository that GitHub lets the Claude GitHub App push to

59* **Dismissing a review**: to limit who can do it, use GitHub's branch rules, for example **Restrict who can dismiss pull request reviews** in a classic branch protection rule

60 

61Two checks run on a command that merges, turns on auto-merge, or force-pushes. Permission rules deny the usual commands for these actions. [Auto mode's check](https://code.claude.com/docs/en/permission-modes.md#how-auto-mode-evaluates-actions) judges commands that no rule matches. The rules match a command's text and the check is a model's judgment, so a command that's written another way can pass both.

62 

63To have GitHub enforce reviews on what PR Steward pushes, [require reviews with branch rules](https://code.claude.com/docs/en/pr-steward-setup.md#require-reviews-with-branch-rules) and keep the Claude GitHub App off each ruleset's bypass list. In a classic branch protection rule, keep it off the **Allow specified actors to bypass required pull requests** list.

64 

65## Related resources

66 

67* [Set up PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md)

68* [PR Steward](https://code.claude.com/docs/en/pr-steward.md)

69* [Data usage](https://code.claude.com/docs/en/data-usage.md)

pr-steward-setup.md +211 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Set up PR Steward

6 

7> Turn on PR Steward for your Claude organization: require reviews, add a repository, set spend limits, and choose when it starts and for which authors

8 

9To set up [PR Steward](https://code.claude.com/docs/en/pr-steward.md), turn it on for your Claude organization and then for each repository. You need an [Owner role](https://code.claude.com/docs/en/server-managed-settings.md#access-control).

10 

11Once it's on in a repository, PR Steward pushes commits to pull requests there to address review feedback, and attempts to fix failing checks and resolve merge conflicts. It starts by itself or when someone asks for it, [as you choose for each repository](#choose-when-pr-steward-starts-in-each-repository).

12 

13## Prerequisites

14 

15Check that your organization [qualifies for PR Steward](https://code.claude.com/docs/en/pr-steward.md#availability).

16 

17In your Claude organization, which you manage at [claude.ai](https://claude.ai/admin-settings), you need:

18 

19* An [Owner role](https://code.claude.com/docs/en/server-managed-settings.md#access-control)

20* [Usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans), which pay for PR Steward's work

21* The GitHub connector, turned on at [**Organization settings > Connectors**](https://claude.ai/admin-settings/connectors). With it on, people in your organization can [connect their GitHub accounts](https://code.claude.com/docs/en/web-quickstart.md#connect-github) to Claude

22 

23On GitHub, you need this access, or someone who has it:

24 

25* Owner of the GitHub organization, to install the [Claude GitHub App](https://github.com/apps/claude) and [link it to your Claude organization](https://code.claude.com/docs/en/admin-setup.md#connected-github-accounts)

26* Admin of the repository, to add branch rules. A private repository also needs a [paid GitHub plan](https://docs.github.com/en/get-started/learning-about-github/githubs-plans)

27* Push access to the repository, from the GitHub account that you connect to Claude

28 

29## Require reviews with branch rules

30 

31Add these rules in GitHub before you turn on PR Steward.

32 

33**1. Require an approval**

34 

35Add a ruleset rule on the default branch that requires a pull request with at least one approval.

36 

37**2. Require a new approval after a push**

38 

39In that rule, dismiss stale approvals when new commits are pushed, or require approval of the most recent push.

40 

41**3. Check the ruleset's bypass list**

42 

43Keep the Claude GitHub App off the ruleset's bypass list. On GitHub Enterprise Server, that's [the app that your organization created](https://code.claude.com/docs/en/github-enterprise-server.md#admin-setup). If PR Steward runs in a [self-hosted environment](#run-pr-steward-in-a-self-hosted-environment), keep the runner's git identity off it.

44 

45**4. Protect other branches**

46 

47Add rules to any other branch that PR Steward shouldn't push to, and block force pushes where you don't want them.

48 

49> [!NOTE]

50>

51> Where a [Claude Approvals policy lets Claude approve](https://code.claude.com/docs/en/approvals-github-rules.md#merges-without-human-review), Claude's review can count as the approval in step 1. An approval from a session in a [self-hosted environment](#run-pr-steward-in-a-self-hosted-environment) can count as well.

52 

53## Turn on PR Steward and add repositories

54 

55Start on [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship).

56 

57The **Repositories** table on that page lists each repository with its **Steward** setting:

58 

59![The Repositories table on the Claude Ship page, with an Add button and three repositories whose Steward setting is Manual, Off, and On. Each row has an Edit button.](https://mintcdn.com/claude-code/cMjxXVBUSLLh9iVu/images/pr-steward-setup-repositories.png?fit=max\&auto=format\&n=cMjxXVBUSLLh9iVu\&q=85\&s=a76bbd05275c5a96053cbbe7e6f1a547)

60 

61> [!WARNING]

62>

63> Adding a repository can start [Code Review](https://code.claude.com/docs/en/code-review-setup.md) there, which is billed.

64>

65> * **No repository is listed yet**: a dialog asks what Claude does on the repositories that you add, and **Code review** is selected by default. If you select **Steward** in the dialog, PR Steward turns on for the organization and those repositories before you've set a spend limit.

66> * **Others are already listed**: no dialog opens, and the new one is set up for review at every push by default.

67>

68> To change that, [set when reviews run](https://code.claude.com/docs/en/code-review-setup.md#set-when-reviews-run) or [turn off Code Review](https://code.claude.com/docs/en/code-review-setup.md#turn-off-code-review-or-remove-a-repository) for the repository.

69 

70**1. Add a repository**

71 

72If the repository is already listed under **Repositories**, skip this step. Otherwise, click **Add**, connect your GitHub account if asked, and select the repository. If a dialog then asks what Claude does on it, click **Not now**, which keeps the repository listed.

73 

74**2. Set which authors PR Steward works for**

75 

76Under the **Steward** switch, use **Runs for** to set whose pull requests PR Steward works on. Select **All eligible authors**, or select **Listed users only** to pilot with a few people, and enter their GitHub usernames.

77 

78On GitHub Enterprise Server, select **All eligible authors**, because PR Steward doesn't start there with a list.

79 

80**3. Turn on PR Steward for the organization**

81 

82Click the **Steward** switch, then click **Turn on**.

83 

84**4. Set PR Steward's monthly limit**

85 

86Go to [**Organization settings > Usage**](https://claude.ai/admin-settings/usage). Under **Services**, set the limit in the **PR Steward** row. PR Steward has no spend limit of its own until you set one.

87 

88**5. Turn on PR Steward for the repository**

89 

90On the **Claude Ship** page, click **Edit** beside the repository. Set **Steward** to [**Manual (@claude steward)**](#choose-when-pr-steward-starts-in-each-repository). Click **Change** beside **Steward spend cap** and enter the cap, in US dollars. See [how the cap works](#set-pr-steward’s-spend-limits).

91 

92**6. Test PR Steward**

93 

94Open a pull request from an account that has write access and that **Runs for** covers. Comment `@claude steward`. The `claude-pr-steward-watching` label and a comment headed **Claude PR Steward** appear.

95 

96If they don't appear, see [Troubleshoot PR Steward](https://code.claude.com/docs/en/pr-steward-troubleshooting.md).

97 

98## Roll out PR Steward to more pull requests

99 

100When PR Steward's fixes match what your reviewers would do, set the repository to **On**. For each repository that you add later, [require reviews](#require-reviews-with-branch-rules) there first. Then repeat these steps from [Turn on PR Steward and add repositories](#turn-on-pr-steward-and-add-repositories): add the repository, turn on PR Steward for it, and test PR Steward. PR Steward can be on in up to 256 repositories.

101 

102### Choose when PR Steward starts in each repository

103 

104On the **Claude Ship** page, click **Edit** beside a repository and open the **Steward** menu:

105 

106![The Steward menu in a repository's Edit dialog, listing Off, On, On (including drafts), and Manual (@claude steward), which is selected.](https://mintcdn.com/claude-code/cMjxXVBUSLLh9iVu/images/pr-steward-setup-edit-options-light.png?fit=max\&auto=format\&n=cMjxXVBUSLLh9iVu\&q=85\&s=6dd7aaf84aa00b6893b9e7533b1089d7)

107 

108Select when you want PR Steward to start:

109 

110| Option | When PR Steward starts |

111| :- | :- |

112| **Manual (@claude steward)** | When a person with write access comments `@claude steward` or adds the `claude-pr-steward-watching` label |

113| **On** | When a pull request that [PR Steward doesn't skip](https://code.claude.com/docs/en/pr-steward.md#when-pr-steward-starts) is opened, reopened, or marked ready for review. Also at the next push to an open one that it hasn't started on before |

114| **On (including drafts)** | The same as **On**, and on draft pull requests |

115| **Off** | PR Steward doesn't start in the repository |

116 

117In a **Manual** repository, a comment or the label can start PR Steward on [a draft](https://code.claude.com/docs/en/pr-steward-pull-requests.md#choose-what-pr-steward-works-on). It doesn't start PR Steward on the other pull requests that [PR Steward skips](https://code.claude.com/docs/en/pr-steward.md#when-pr-steward-starts).

118 

119PR Steward also starts there on the pull requests of a developer who selects [**Act on its own**](https://code.claude.com/docs/en/pr-steward-pull-requests.md#turn-off-or-limit-pr-steward-on-all-your-pull-requests).

120 

121### Limit which authors PR Steward works for

122 

123To skip an author, add their GitHub username to **Excluded users**, under the **Steward** switch.

124 

125## Control what PR Steward spends

126 

127Billing [continues while usage credits are turned off](https://code.claude.com/docs/en/claude-ship.md#how-each-claude-ship-agent-is-billed).

128 

129### See what PR Steward spent

130 

131To see the average for each merged pull request, open a repository's **Edit** dialog. For your organization's total over the last 30 days, go to [claude.ai/analytics/pr-steward](https://claude.ai/analytics/pr-steward).

132 

133### Set PR Steward's spend limits

134 

135Change the monthly limit in [**Organization settings > Usage**](https://claude.ai/admin-settings/usage), under **Services**, in the **PR Steward** row. The row appears after you first turn on PR Steward. Change the spend cap in the repository's **Edit** dialog. When PR Steward reaches a limit, look for its comment on the pull request:

136 

137* **Its monthly limit, or your organization's usage-credit limit**: PR Steward pauses. It picks up again at the next push or comment once usage credits can pay again

138* **The spend cap**: PR Steward stops on that pull request. Spend can pass the cap before it stops. A person with write access can start it again, with the full cap. When PR Steward works on a pull request for more than about a week, it can start a new [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md), and the full cap then applies again

139 

140With no usage credits left to spend, PR Steward doesn't start, and the **Claude Ship** page shows **Steward cannot start on pull requests**. Add usage credits or raise the limit on the **Usage** page.

141 

142## Set up PR Steward's build environment

143 

144Choose an environment for PR Steward when it needs more to build and test your code.

145 

146### Choose the environment PR Steward runs in

147 

148To add a setup script, environment variables, or different network access, use an [organization-shared environment](https://code.claude.com/docs/en/cloud-environments.md#organization-shared-environments). On the **Claude Ship** page, select a **Default environment** under **Where it runs**. To override it for one repository, click **Change** beside **Environment** in the **Edit** dialog.

149 

150With neither set, PR Steward can use your organization's [default environment](https://code.claude.com/docs/en/cloud-environments.md#the-default-environment). Without one, it runs in an Anthropic-hosted environment with no setup script and no environment variables.

151 

152### Run PR Steward in a self-hosted environment

153 

154For the environment that PR Steward runs in, you can select a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments). The [limits on approvals and merges](https://code.claude.com/docs/en/pr-steward-security.md#limits-on-approvals-and-merges) are described for Anthropic-hosted sessions only. On a runner without [Anthropic-managed git](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#use-the-anthropic-git-proxy), PR Steward pushes with the runner's own git credentials.

155 

156> [!WARNING]

157>

158> In a self-hosted environment, Claude can reach GitHub directly with [any GitHub credential that a session can read](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#harden-your-deployment). Anthropic's service can't refuse an approval that's made that way. GitHub can count it toward the approvals that you require.

159 

160In a self-hosted environment, PR Steward doesn't load a `CLAUDE.md` or rules file from the runner or from the runner's checkout of the pull request. It doesn't load a [managed `CLAUDE.md`](https://code.claude.com/docs/en/memory#deploy-organization-wide-claude-md). Put what PR Steward should follow [on the repository's default branch](https://code.claude.com/docs/en/pr-steward-pull-requests.md#save-pr-steward-instructions-for-everyone-in-a-repository).

161 

162### Give PR Steward credentials from a Claude Tag bundle

163 

164To give PR Steward a credential, such as a login for a private package registry, keep it in a [Claude Tag bundle](https://claude.com/docs/claude-tag/concepts/glossary#bundle) and turn on the bundle for PR Steward. PR Steward can use a bundle when it runs in an Anthropic-hosted environment, which is any environment other than a [self-hosted one](#run-pr-steward-in-a-self-hosted-environment).

165 

166To put a credential in a bundle, [set up Claude Tag](https://claude.com/docs/claude-tag/admins/setup-overview) and [create a bundle](https://claude.com/docs/claude-tag/admins/add-connections#create-a-bundle).

167 

168> [!WARNING]

169>

170> PR Steward works unattended and [reads pull request text that other people write](https://code.claude.com/docs/en/pr-steward-security.md#pr-steward’s-session-environment), which could steer how it uses a credential. [Limit each credential](https://claude.com/docs/claude-tag/admins/add-connections#limit-access-to-specific-resources) to the hosts and permissions that building and testing your code needs.

171 

172To turn on the bundle for PR Steward:

173 

174**1. Open the bundle**

175 

176Go to [**Organization settings > Claude Tag**](https://claude.ai/admin-settings/claude-tag), select the **Bundles** tab, and open the bundle.

177 

178**2. Turn on PR Steward for the bundle**

179 

180Under **Where it applies**, turn on the switch in the **PR Steward** row and click **Save changes**.

181 

182The bundle is then on for PR Steward across your organization, and the switch covers every credential in the bundle.

183 

184An install or a test in a PR Steward session can fail with a 403 that starts with this text:

185 

186```text wrap theme={null}

187denied by policy: this host's bundle of logins and rules isn't turned on for PR Steward

188```

189 

190If PR Steward needs that host to build or test your code, turn on the **PR Steward** switch for the bundle that holds the host's credential. That can be a bundle with **Everywhere** turned on, because the two switches are separate. If the bundle holds more than PR Steward needs, [create a bundle](https://claude.com/docs/claude-tag/admins/add-connections#create-a-bundle) with that credential alone, and turn on PR Steward for that one.

191 

192## Turn off PR Steward

193 

194When you turn off PR Steward, new starts stop. It keeps working for a time on pull requests that already have the `claude-pr-steward-watching` label. When you turn it off for one author, that time can be about a week.

195 

196To stop PR Steward there as well, first remove the label from the pull requests that the change covers.

197 

198Then turn off PR Steward on the **Claude Ship** page:

199 

200| To turn off PR Steward for | Then |

201| :- | :- |

202| The organization | Click the **Steward** switch |

203| One repository | Click **Edit** beside the repository and set **Steward** to **Off** |

204| One author | Add their GitHub username to **Excluded users** |

205 

206If you turned it off first, remove the labels afterward to stop PR Steward, unless your GitHub organization is linked to more than one Claude organization.

207 

208## Next steps

209 

210* [Work with PR Steward](https://code.claude.com/docs/en/pr-steward-pull-requests.md)

211* [What PR Steward can access](https://code.claude.com/docs/en/pr-steward-security.md)

pr-steward-troubleshooting.md +103 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Troubleshoot PR Steward

6 

7> Fix a PR Steward that didn't start, stopped, or paused on a GitHub pull request, and resolve the messages that an Owner sees while setting it up

8 

9When [PR Steward](https://code.claude.com/docs/en/pr-steward.md) doesn't do what you expect on a pull request, look for a comment from it first. If PR Steward posted one, [match the comment](#pr-steward-posted-a-comment-that-says-why). If it left nothing on the pull request, check [why it didn't start](#pr-steward-didn’t-start-on-a-pull-request).

10 

11## PR Steward didn't start on a pull request

12 

13Some causes leave nothing on the pull request, so check each of these sections.

14 

15### PR Steward didn't respond to your comment

16 

17If you commented `@claude steward` on github.com and PR Steward didn't start, look at your comment:

18 

19| What you see | What to check |

20| :- | :- |

21| No 👀 reaction | That it's a new comment and not an edit, and that you have write access |

22| A 👀 reaction, and no `claude-pr-steward-watching` label after it | That the command is at the start of a top-level comment. Then check the other sections under [PR Steward didn't start on a pull request](#pr-steward-didn’t-start-on-a-pull-request) |

23 

24### Pull requests that PR Steward doesn't start on

25 

26Check whether your pull request is one that PR Steward skips:

27 

28| Cause | What to do |

29| :- | :- |

30| The pull request is a draft | Mark it ready for review. For work on drafts, see [**Include my draft PRs**](https://code.claude.com/docs/en/pr-steward-pull-requests.md#choose-what-pr-steward-works-on) |

31| The pull request comes from a fork, a bot opened it, or its author lacks write access to the repository | PR Steward doesn't start on these |

32| The description contains `<!-- claude-pr-steward-disable -->` | Remove the marker from the description, then comment `@claude steward` |

33| Another Claude session is already watching the pull request, for example a cloud session with [auto-fix](https://code.claude.com/docs/en/claude-code-on-the-web.md#auto-fix-pull-requests) on | Turn off auto-fix in that session, then comment `@claude steward` again |

34 

35### A setting keeps PR Steward off

36 

37A setting can keep PR Steward from starting:

38 

39| Cause | What to do |

40| :- | :- |

41| The repository is [set to **Manual**](https://code.claude.com/docs/en/pr-steward-setup.md#choose-when-pr-steward-starts-in-each-repository), or [your own option](https://code.claude.com/docs/en/pr-steward-pull-requests.md#turn-off-or-limit-pr-steward-on-all-your-pull-requests) is **Off** or **Only when tagged** | Comment `@claude steward` |

42| The pull request is a teammate's, and their own option is **Off** | Ask them to comment `@claude steward` |

43| PR Steward is off for the repository or for the author's GitHub account | Ask an [Owner](https://code.claude.com/docs/en/server-managed-settings.md#access-control) of your Claude organization to [add the repository](https://code.claude.com/docs/en/pr-steward-setup.md#turn-on-pr-steward-and-add-repositories) or to change [which authors PR Steward works for](https://code.claude.com/docs/en/pr-steward-setup.md#limit-which-authors-pr-steward-works-for) |

44 

45To confirm the last cause, have the author open their [PR Steward settings page](https://claude.ai/settings/claude-code#pr-steward). It shows a banner when your organization has turned off PR Steward. It also shows one when the GitHub account that they connected there is excluded.

46 

47### Many pull requests opened in a short time

48 

49If PR Steward started on many pull requests in your organization in a short time, comment `@claude steward`. If the `claude-pr-steward-watching` label still doesn't appear, comment again later.

50 

51## PR Steward posted a comment that says why

52 

53Find the words of PR Steward's comment in one of these tables.

54 

55### Comments when PR Steward can't start

56 

57If PR Steward commented and didn't start, find the comment's words here:

58 

59| Comment says | What to do |

60| :- | :- |

61| `PR Steward didn't start: only someone with write access` | Have a person with write access add the `claude-pr-steward-watching` label or comment `@claude steward` |

62| `PR Steward hasn't started: your organization has no extra usage available` | Ask an Owner to add usage credits or raise the spend limit in [**Organization settings > Usage**](https://claude.ai/admin-settings/usage). If you asked PR Steward to start, it then starts when you ask again. Otherwise, it starts at the next push |

63| `PR Steward hasn't started: billing for PR Steward isn't set up` | Ask an Owner to pick a repository where PR Steward is on and [change its **Steward** setting](https://code.claude.com/docs/en/pr-steward-setup.md#choose-when-pr-steward-starts-in-each-repository) to another option than **Off**. They can change it back straight away |

64| `Claude PR Steward couldn't start, so it isn't watching this pull request` | Add the label or comment `@claude steward` to try again |

65| `Claude PR Steward couldn't start on this pull request because the setup script` | Ask someone who can edit the [environment that PR Steward runs in](https://code.claude.com/docs/en/pr-steward-setup.md#choose-the-environment-pr-steward-runs-in) to fix its setup script, then start PR Steward again |

66| `this repository has PR Steward enabled in more than one Claude workspace` | Ask the Owners to keep the repository in one Claude organization and remove it from the others |

67 

68### Comments when PR Steward stops or pauses

69 

70If PR Steward commented and then stopped or paused, find the comment's opening words here:

71 

72| Comment says | What it means | What to do |

73| :- | :- | :- |

74| `PR Steward is paused on this pull request` | Usage credits ran out while PR Steward was working, or billing setup is unfinished, as the comment says | Ask an Owner to add usage credits or raise the spend limit, or to finish billing setup as the comment describes. PR Steward picks up again at the next push or comment |

75| `Claude PR Steward stopped watching this pull request: this session's spend reached the repository's PR Steward budget` | This session reached the [spend cap](https://code.claude.com/docs/en/pr-steward-setup.md#set-pr-steward’s-spend-limits) that's set for the repository | Finish the remaining work yourself, or add the `claude-pr-steward-watching` label again to start a new session |

76| `Claude PR Steward stopped watching this pull request because your organization's PR Steward settings no longer cover it` | An Owner turned off PR Steward, or removed the repository or the author | After the settings cover the pull request again, add the label or comment `@claude steward` |

77| `Claude PR Steward stopped watching this pull request because for <N> days no person has commented or reviewed here` | No person has commented or reviewed, and nobody but PR Steward has pushed, for the number of days that the comment gives | Add the label or comment `@claude steward` |

78 

79## Auto-fix is unavailable

80 

81In a repository where PR Steward works on your pull requests, the **Auto-fix** toggle on a cloud session is unavailable. If you ask to auto-fix a pull request that PR Steward is watching, the request fails. At claude.ai/code, the message is `PR Steward is already watching this PR.` To use [auto-fix](https://code.claude.com/docs/en/claude-code-on-the-web.md#auto-fix-pull-requests) in that repository, turn PR Steward off for yourself:

82 

83* **Later pull requests**: set [your own PR Steward option](https://code.claude.com/docs/en/pr-steward-pull-requests.md#turn-off-or-limit-pr-steward-on-all-your-pull-requests) to **Off**, which covers your pull requests in every repository

84* **A pull request that PR Steward is already watching**: also [stop PR Steward there](https://code.claude.com/docs/en/pr-steward-pull-requests.md#start-or-stop-pr-steward-on-one-pull-request)

85 

86## Messages while you set up PR Steward

87 

88While you [set up PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md), you can see these messages on the [**Claude Ship**](https://claude.ai/admin-settings/claude-ship) page:

89 

90| What you see | What to do |

91| :- | :- |

92| **The GitHub connector is not enabled for your organization.** | Turn on the connector at [**Organization settings > Connectors**](https://claude.ai/admin-settings/connectors) |

93| A repository is missing from the list of repositories when you click **Add** | Go to [**Organization settings > Git providers**](https://claude.ai/admin-settings/source-control), install the [Claude GitHub App](https://github.com/apps/claude) on your GitHub organization, and include the repository |

94| A message that says your GitHub account "cannot push to that repository", or that adding it "needs write access" | Connect an account that can push, or ask an Owner who can push to do it |

95| `PR Steward can't be enabled right now: billing setup is temporarily unavailable` | Try again in a few minutes |

96| **PR Steward isn’t available for your organization.** | Check the [requirements](https://code.claude.com/docs/en/pr-steward.md#availability). If [**Runs for**](https://code.claude.com/docs/en/pr-steward-setup.md#turn-on-pr-steward-and-add-repositories) is **Listed users only**, add a username |

97| **PR Steward is on but not watching any repositories yet.** | [Turn on PR Steward for a repository](https://code.claude.com/docs/en/pr-steward-setup.md#turn-on-pr-steward-and-add-repositories) |

98 

99## Related resources

100 

101* [Work with PR Steward on a pull request](https://code.claude.com/docs/en/pr-steward-pull-requests.md)

102* [Set up PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md)

103* [PR Steward](https://code.claude.com/docs/en/pr-steward.md)

Details

174 174 

175### Compacting the conversation175### Compacting the conversation

176 176 

177[Compaction](https://code.claude.com/docs/en/context-window.md#what-survives-compaction) replaces your message history with a summary. By design, this invalidates the conversation layer: the next request has a new, shorter history that doesn't share a prefix with the old one.177[Compaction](https://code.claude.com/docs/en/context-window.md#what-survives-compaction) replaces your message history with a summary. This invalidates the conversation layer: the next request has a new, shorter history that doesn't share a prefix with the old one.

178 178 

179* **System prompt**: when the conversation's prompt is current, the next request reads this layer from the cache. If that prompt is out of date, such as after you [resume the conversation](#resuming-a-session), Claude Code switches to the current prompt and the next request rebuilds this layer's cache once.179* **System prompt**: when the conversation's prompt is current, the next request reads this layer from the cache. If that prompt is out of date, such as after you [resume the conversation](#resuming-a-session), Claude Code switches to the current prompt and the next request rebuilds this layer's cache once.

180* **Project context**: Claude Code reloads this layer from disk. It's cached together with the conversation, so after `/compact` or automatic compaction its cache is rebuilt even if its files are unchanged.180* **Project context**: Claude Code reloads this layer from disk. It's cached together with the conversation, so after `/compact` or automatic compaction its cache is rebuilt even if its files are unchanged.

Details

13* **Use your full local environment remotely**: your filesystem, [MCP servers](https://code.claude.com/docs/en/mcp.md), tools, and project configuration all stay available, and typing `@` autocompletes file paths from your local project.13* **Use your full local environment remotely**: your filesystem, [MCP servers](https://code.claude.com/docs/en/mcp.md), tools, and project configuration all stay available, and typing `@` autocompletes file paths from your local project.

14* **Work from both surfaces at once**: the conversation and the progress of [subagents](https://code.claude.com/docs/en/sub-agents.md) and [dynamic workflows](https://code.claude.com/docs/en/workflows.md) stay in sync across all connected devices, so you can send messages from your terminal, browser, and phone interchangeably.14* **Work from both surfaces at once**: the conversation and the progress of [subagents](https://code.claude.com/docs/en/sub-agents.md) and [dynamic workflows](https://code.claude.com/docs/en/workflows.md) stay in sync across all connected devices, so you can send messages from your terminal, browser, and phone interchangeably.

15* **Send images and files from your phone or browser**: attach a photo or file in the Claude app or at claude.ai/code, with or without a caption. Claude sees attached photos directly as part of your message. Claude Code downloads other files to your machine and passes them to Claude as `@` file references.15* **Send images and files from your phone or browser**: attach a photo or file in the Claude app or at claude.ai/code, with or without a caption. Claude sees attached photos directly as part of your message. Claude Code downloads other files to your machine and passes them to Claude as `@` file references.

16* **Survive interruptions**: if your laptop sleeps or your network drops, Claude Code reconnects automatically when your machine comes back online.16* **Survive interruptions**: if your laptop sleeps or your network drops, Claude Code reconnects automatically when your machine comes back online, except in the cases under [Limitations](#limitations).

17 17 

18Unlike [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md), which run on cloud infrastructure, Remote Control sessions run directly on your machine and interact with your local filesystem. The web and mobile interfaces are a window into that local session, so your computer has to stay on and the `claude` process has to keep running.18Unlike [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md), which run on cloud infrastructure, Remote Control sessions run directly on your machine and interact with your local filesystem. The web and mobile interfaces are a window into that local session, so your computer has to stay on and the `claude` process has to keep running.

19 19 


66> | `--spawn <mode>` | How the server creates sessions. • `same-dir` (default when no mode is saved): all sessions share the current working directory, so they can conflict if editing the same files. • `worktree`: each on-demand session gets its own [git worktree](https://code.claude.com/docs/en/worktrees.md). Requires a git repository or a [`WorktreeCreate` hook](https://code.claude.com/docs/en/hooks#worktreecreate). • `session`: single-session mode. Serves exactly one session and rejects additional connections. Set at startup only. Press `w` at runtime to toggle between `same-dir` and `worktree`. The mode you switch to becomes the [default for this project](#set-the-default-spawn-mode-for-a-project). |66> | `--spawn <mode>` | How the server creates sessions. • `same-dir` (default when no mode is saved): all sessions share the current working directory, so they can conflict if editing the same files. • `worktree`: each on-demand session gets its own [git worktree](https://code.claude.com/docs/en/worktrees.md). Requires a git repository or a [`WorktreeCreate` hook](https://code.claude.com/docs/en/hooks#worktreecreate). • `session`: single-session mode. Serves exactly one session and rejects additional connections. Set at startup only. Press `w` at runtime to toggle between `same-dir` and `worktree`. The mode you switch to becomes the [default for this project](#set-the-default-spawn-mode-for-a-project). |

67> | `--capacity <N>` | Maximum number of concurrent sessions. Default is 32. Cannot be used with `--spawn=session`. |67> | `--capacity <N>` | Maximum number of concurrent sessions. Default is 32. Cannot be used with `--spawn=session`. |

68> | `--[no-]create-session-in-dir` | Pre-create one session in the current directory when the server starts, so you have somewhere to type immediately. In `worktree` mode this session stays in the current directory while on-demand sessions get isolated worktrees. On by default. If you pass `--no-create-session-in-dir` to start with none, Claude Code archives the server's sessions when you stop it, so there's nothing to [resume](#resume-sessions-after-stopping-the-server). |68> | `--[no-]create-session-in-dir` | Pre-create one session in the current directory when the server starts, so you have somewhere to type immediately. In `worktree` mode this session stays in the current directory while on-demand sessions get isolated worktrees. On by default. If you pass `--no-create-session-in-dir` to start with none, Claude Code archives the server's sessions when you stop it, so there's nothing to [resume](#resume-sessions-after-stopping-the-server). |

69> | `--permission-mode <mode>` | Set the starting [permission mode](https://code.claude.com/docs/en/permission-modes.md) for the server's sessions, such as `acceptEdits`. Accepts `manual` as an alias for `default`; an unrecognized mode stops the server at startup and lists the valid modes. |69> | `--permission-mode <mode>` | Set the starting [permission mode](https://code.claude.com/docs/en/permission-modes.md), such as `acceptEdits`. Accepts `manual` as an alias for `default`; an unrecognized mode stops the server at startup and lists the valid modes. |

70> | `--settings <file>` | Apply a JSON settings file to the server's sessions, at the same [precedence](https://code.claude.com/docs/en/settings.md#settings-precedence) as `claude --settings`. Give a file path, not a JSON string. Requires Claude Code v2.1.321 or later. |70> | `--settings <file>` | Apply a JSON settings file to the server's sessions, at the same [precedence](https://code.claude.com/docs/en/settings.md#settings-precedence) as `claude --settings`. Give a file path, not a JSON string. Requires Claude Code v2.1.321 or later. |

71> | `--chrome` / `--no-chrome` | Turn [Chrome integration](https://code.claude.com/docs/en/chrome.md) on or off in the sessions the server creates, so Claude can use Chrome on your machine while you work from another device. Without either flag, the session the server pre-creates and any session you start yourself from claude.ai/code or the Claude app begin with Chrome off, even if you [enabled Chrome by default](https://code.claude.com/docs/en/chrome.md#enable-chrome-by-default). A session the server starts for one of your [project](https://code.claude.com/docs/en/claude-projects.md) threads follows that setting instead, except in `bypassPermissions` mode. Requires Claude Code v2.1.273 or later. |71> | `--chrome` / `--no-chrome` | Turn [Chrome integration](https://code.claude.com/docs/en/chrome.md) on or off in the sessions the server creates, so Claude can use Chrome on your machine while you work from another device. Without either flag, the session the server pre-creates and any session you start yourself from claude.ai/code or the Claude app begin with Chrome off, even if you [enabled Chrome by default](https://code.claude.com/docs/en/chrome.md#enable-chrome-by-default). A session the server starts for one of your [project](https://code.claude.com/docs/en/claude-projects.md) threads follows that setting instead, except in `bypassPermissions` mode. Requires Claude Code v2.1.273 or later. |

72> | `-d`, `--debug[=<filter>]` | Turn on debug logging for the server, optionally filtered by category. Pass a filter only in the `=` form, such as `--debug=api,hooks`. Requires Claude Code v2.1.282 or later. |72> | `-d`, `--debug[=<filter>]` | Turn on debug logging for the server, optionally filtered by category. Pass a filter only in the `=` form, such as `--debug=api,hooks`. Requires Claude Code v2.1.282 or later. |


178A connected device shows the conversation in your terminal as it happens. These cases go beyond ordinary messages:178A connected device shows the conversation in your terminal as it happens. These cases go beyond ordinary messages:

179 179 

180* **Compaction and `/clear`**: while Claude Code [compacts the conversation](https://code.claude.com/docs/en/context-window.md#what-survives-compaction), connected devices show the progress and then where the conversation was compacted. When you run `/clear`, the conversation resets on connected devices too.180* **Compaction and `/clear`**: while Claude Code [compacts the conversation](https://code.claude.com/docs/en/context-window.md#what-survives-compaction), connected devices show the progress and then where the conversation was compacted. When you run `/clear`, the conversation resets on connected devices too.

181* **Disconnecting after `/resume` or `/teleport`**: if the connected session has a [share link](https://code.claude.com/docs/en/claude-code-on-the-web.md#share-sessions), or Claude Code can't check for one, Remote Control disconnects when either command opens another conversation. People with the link would otherwise see that conversation. To connect the new conversation, run `/remote-control` in your terminal. The share link check requires Claude Code v2.1.324 or later.181* **Disconnecting after `/resume` or `/teleport`**: if the connected session has a [share link](https://code.claude.com/docs/en/share-sessions.md), or Claude Code can't check for one, Remote Control disconnects when either command opens another conversation. People with the link would otherwise see that conversation. To connect the new conversation, run `/remote-control` in your terminal. The share link check requires Claude Code v2.1.324 or later.

182* **Switching conversations with `/resume`**: the connected device doesn't receive the switched-to conversation's title or earlier history, but new messages in both directions go to and from whichever conversation is open in your terminal. To work on the original conversation from the device again, run `/resume` in your terminal and switch back to it.182* **Switching conversations with `/resume`**: the connected device doesn't receive the switched-to conversation's title or earlier history, but new messages in both directions go to and from whichever conversation is open in your terminal. To work on the original conversation from the device again, run `/resume` in your terminal and switch back to it.

183* **Pulling a session with `/teleport`**: when you pull a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md#from-cloud-to-terminal) into your terminal with `/teleport`, the connected device doesn't receive the pulled conversation's earlier history. New messages in both directions go to and from the pulled conversation, which is now the one open in your terminal.183* **Pulling a session with `/teleport`**: when you pull a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md#from-cloud-to-terminal) into your terminal with `/teleport`, the connected device doesn't receive the pulled conversation's earlier history. New messages in both directions go to and from the pulled conversation, which is now the one open in your terminal.

184* **Messages from your other sessions**: with [cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md), the same connection carries messages between your own sessions on different machines.184* **Messages from your other sessions**: with [cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md), the same connection carries messages between your own sessions on different machines.


365 365 

366* **One remote session per interactive process**: outside of server mode, each Claude Code instance supports one remote session at a time. Use [server mode](#start-a-remote-control-session) to run multiple concurrent sessions from a single process.366* **One remote session per interactive process**: outside of server mode, each Claude Code instance supports one remote session at a time. Use [server mode](#start-a-remote-control-session) to run multiple concurrent sessions from a single process.

367* **Local process must keep running**: Remote Control runs as a local process. If you close the terminal, quit the Desktop app or VS Code that runs the session on your machine, or otherwise stop the `claude` process, the session goes offline until you [bring it back](#resume-sessions-after-stopping-the-server). If you run `claude` from a terminal on a remote machine, start it inside `tmux` or `screen` to keep the session running after you disconnect from SSH.367* **Local process must keep running**: Remote Control runs as a local process. If you close the terminal, quit the Desktop app or VS Code that runs the session on your machine, or otherwise stop the `claude` process, the session goes offline until you [bring it back](#resume-sessions-after-stopping-the-server). If you run `claude` from a terminal on a remote machine, start it inside `tmux` or `screen` to keep the session running after you disconnect from SSH.

368* **Crashed sessions in server mode**: if a session served by `claude remote-control` crashes, send it a message from a connected device. Claude Code serves it again. You don't have to restart the server. Requires Claude Code v2.1.238 or later.368* **Crashed sessions in server mode**: if a session served by `claude remote-control` crashes, send it a message from a connected device. Claude Code serves it again. Requires Claude Code v2.1.238 or later.

369* **HTTP 403 refusals on a connected session**: once an interactive session is connected, Claude Code keeps retrying for up to three minutes when something between your machine and Anthropic's servers answers with HTTP 403, as can happen after a VPN or network change. If the refusals last longer, Claude Code disconnects, and the reason names what refused: a network edge, or a proxy, VPN, or firewall on your own network.369* **HTTP 403 refusals on a connected session**: once an interactive session is connected, Claude Code keeps retrying for up to three minutes when something between your machine and Anthropic's servers answers with HTTP 403, as can happen after a VPN or network change. If the refusals last longer, Claude Code disconnects, and the reason names what refused: a network edge, or a proxy, VPN, or firewall on your own network.

370* **Extended network outage**: if your machine is awake but can't reach the network, what you do next depends on the mode:370* **Extended network outage**: if your machine is awake but can't reach the network, what you do next depends on the mode:

371 * **Server mode**: Claude Code gives up after roughly 10 minutes and the `claude remote-control` process exits. To restart the server, see [Resume sessions after stopping the server](#resume-sessions-after-stopping-the-server).371 * **Server mode**: Claude Code gives up after roughly 10 minutes and the `claude remote-control` process exits. To restart the server, see [Resume sessions after stopping the server](#resume-sessions-after-stopping-the-server).

372 * **Interactive session**: keep working locally. Claude Code retries for as long as the outage lasts and reconnects on its own when the network returns.372 * **Interactive session**: keep working locally. Until your terminal shows a Remote Control failure, Claude Code keeps retrying and reconnects on its own when the network returns. If your terminal shows a failure, wait until the network is back, then follow [the steps to reconnect after a failure](#session-ended-elsewhere).

373* **Attachments that don't download**: if a file you attach from your phone or browser can't be downloaded to your machine, Claude still receives your message and the files that were downloaded. In place of the missing files, Claude Code adds a note such as `[1 of 3 attachments did not arrive]` to the message.373* **Attachments that don't download**: if a file you attach from your phone or browser can't be downloaded to your machine, Claude still receives your message and the files that were downloaded. In place of the missing files, Claude Code adds a note such as `[1 of 3 attachments did not arrive]` to the message.

374* **Presence heartbeats failing**: if an interactive session disconnects with `could not reach the Remote Control server for about 30 minutes`, run `/remote-control` to reconnect.374* **Presence heartbeats failing**: if an interactive session disconnects with `could not reach the Remote Control server for about 30 minutes`, run `/remote-control` to reconnect.

375* **Forwarded dialogs expire**: Claude Code keeps permission prompts and `AskUserQuestion` questions open until you answer them. When Claude Code forwards another kind of dialog to the remote session, such as the model-choice prompt shown after a safety refusal, it waits five minutes by default, then closes the dialog and continues with the dialog's no-action default. Set [`dialogExpiry`](https://code.claude.com/docs/en/settings-reference#dialogexpiry) to adjust or disable the deadline. Requires Claude Code v2.1.224 or later.375* **Forwarded dialogs expire**: Claude Code keeps permission prompts and `AskUserQuestion` questions open until you answer them. When Claude Code forwards another kind of dialog to the remote session, such as the model-choice prompt shown after a safety refusal, it waits five minutes by default, then closes the dialog and continues with the dialog's no-action default. Set [`dialogExpiry`](https://code.claude.com/docs/en/settings-reference#dialogexpiry) to adjust or disable the deadline. Requires Claude Code v2.1.224 or later.

routines.md +5 −5

Details

99 99 

100**4. Select repositories**100**4. Select repositories**

101 101 

102Expand **Advanced settings**. Under **Repository** on the **General** tab, select one or more GitHub repositories for Claude to work in.102In the **Repository** row below **Trigger**, select one or more GitHub repositories for Claude to work in. If the row isn't there, expand **Advanced settings** and find **Repository** on the **General** tab.

103 103 

104Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes.104Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes.

105 105 

106**5. Select an environment**106**5. Select an environment**

107 107 

108After you select a repository, **Cloud environment** appears below it. Pick a [cloud environment](https://code.claude.com/docs/en/cloud-environments.md) for the task. If an environment is already selected, you can keep it or select a different one. Environments control what the cloud session has access to:108Find **Cloud environment** below **Trigger**, or under **Advanced settings > General** if it isn't there, and pick a [cloud environment](https://code.claude.com/docs/en/cloud-environments.md) for the task. If an environment is already selected, you can keep it or select a different one. Environments control what the cloud session has access to:

109 109 

110* **Network access**: set the level of internet access available during each run110* **Network access**: set the level of internet access available during each run

111* **Environment variables**: provide values Claude can use during each run. They're [visible to anyone who uses the environment](https://code.claude.com/docs/en/cloud-environments.md#what-carries-over-from-your-setup), so in an Anthropic-hosted environment, store keys for the APIs Claude calls during a run as [network secrets](https://code.claude.com/docs/en/cloud-environments.md#add-network-secrets) instead. That section also lists the requests that never get a secret111* **Environment variables**: provide values Claude can use during each run. They're [visible to anyone who uses the environment](https://code.claude.com/docs/en/cloud-environments.md#what-carries-over-from-your-setup), so in an Anthropic-hosted environment, store keys for the APIs Claude calls during a run as [network secrets](https://code.claude.com/docs/en/cloud-environments.md#add-network-secrets) instead. That section also lists the requests that never get a secret


121 121 

122**7. Review connectors**122**7. Review connectors**

123 123 

124Switch to the **Connectors** tab of **Advanced settings**. All of your connected [MCP connectors](https://code.claude.com/docs/en/mcp.md) are included by default. Remove any the task doesn't need: Claude can use an included connector during a run, including writes. For when a run stops to ask you first, see [Permission prompts during a run](#permission-prompts-during-a-run).124Expand **Advanced settings** and open the **Connectors** tab. All of your connected [MCP connectors](https://code.claude.com/docs/en/mcp.md) are included by default. Remove any the task doesn't need: Claude can use an included connector during a run, including writes. For when a run stops to ask you first, see [Permission prompts during a run](#permission-prompts-during-a-run).

125 125 

126**8. Create the task**126**8. Create the task**

127 127 


441 441 

442**2. Open the environment selector**442**2. Open the environment selector**

443 443 

444Go to **Advanced settings > General > Cloud environment**, expanding **Advanced settings** first if it's collapsed. Click the cloud icon showing your environment's name, such as **Default**.444Find **Cloud environment** below **Trigger**, or under **Advanced settings > General** if it isn't there. Click the cloud icon showing your environment's name, such as **Default**.

445 445 

446**3. Open the environment settings**446**3. Open the environment settings**

447 447 


479 479 

480## Where the name routines still appears480## Where the name routines still appears

481 481 

482Scheduled tasks were previously called routines, and these places keep the earlier name. Each one refers to the same feature:482Scheduled tasks were previously called routines, and these places keep the earlier name:

483 483 

484* **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).484* **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).

485* **Web address**: `claude.ai/code/routines`485* **Web address**: `claude.ai/code/routines`

Details

27/plugin install security-guidance@claude-plugins-official27/plugin install security-guidance@claude-plugins-official

28```28```

29 29 

30`/plugin` opens an interactive panel in the terminal CLI. If Claude replies that `/plugin` isn't available in this environment, install another way:30`/plugin` opens an interactive panel in the terminal CLI. Outside the terminal, install another way:

31 31 

32* **Claude desktop app, local or SSH session**: use the **Desktop app** tab under [Install a plugin](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin)32* **Claude desktop app, local or SSH session**: use the **Desktop app** tab under [Install a plugin](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin)

33* **VS Code extension**: install from the [**Manage plugins** dialog](https://code.claude.com/docs/en/vs-code.md#manage-plugins)33* **VS Code extension**: install from the [**Manage plugins** dialog](https://code.claude.com/docs/en/vs-code.md#manage-plugins)

Details

618A session that sends model requests to Amazon Bedrock or Google Cloud's Agent Platform differs from a session on the Anthropic API in these ways:618A session that sends model requests to Amazon Bedrock or Google Cloud's Agent Platform differs from a session on the Anthropic API in these ways:

619 619 

620* **Policy from claude.ai**: [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) don't reach these sessions. Neither do the organization policies an Owner sets in Claude Code admin settings, so Claude Code doesn't enforce them inside the session. Put the rules you rely on in the runner image's [managed settings file](https://code.claude.com/docs/en/managed-settings.md#delivery-mechanisms).620* **Policy from claude.ai**: [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) don't reach these sessions. Neither do the organization policies an Owner sets in Claude Code admin settings, so Claude Code doesn't enforce them inside the session. Put the rules you rely on in the runner image's [managed settings file](https://code.claude.com/docs/en/managed-settings.md#delivery-mechanisms).

621* **Account skills**: these sessions don't download the skills enabled for a person's claude.ai account. See [How each session's config is assembled](#how-each-session’s-config-is-assembled).621* **Account skills and plugins**: these sessions don't download the skills or plugins enabled for a person's claude.ai account. See [How each session's config is assembled](#how-each-session’s-config-is-assembled).

622* **Files**: files that people attach to a session in claude.ai or the mobile or desktop app don't reach it, and Claude can't send files back with the [`SendUserFile` tool](https://code.claude.com/docs/en/tools-reference). Put input files in the repository or on the runner instead.622* **Files**: files that people attach to a session in claude.ai or the mobile or desktop app don't reach it, and Claude can't send files back with the [`SendUserFile` tool](https://code.claude.com/docs/en/tools-reference). Put input files in the repository or on the runner instead.

623* **Model selection**: Anthropic's control plane sends each session's model, and when a session starts without one, Claude Code uses its default for the provider. You can't choose the model with `ANTHROPIC_MODEL` or `ANTHROPIC_DEFAULT_MODEL` in the runner's environment, but you can pin what an alias resolves to:623* **Model selection**: Anthropic's control plane sends each session's model, and when a session starts without one, Claude Code uses its default for the provider. You can't choose the model with `ANTHROPIC_MODEL` or `ANTHROPIC_DEFAULT_MODEL` in the runner's environment, but you can pin what an alias resolves to:

624 * **`ANTHROPIC_MODEL` and `ANTHROPIC_DEFAULT_MODEL`**: the runner removes them from the environment it passes to sessions, even though the provider pages' examples set `ANTHROPIC_MODEL`.624 * **`ANTHROPIC_MODEL` and `ANTHROPIC_DEFAULT_MODEL`**: the runner removes them from the environment it passes to sessions, even though the provider pages' examples set `ANTHROPIC_MODEL`.


861 861 

862### How each session's config is assembled862### How each session's config is assembled

863 863 

864The runner gives each session its own config directory, seeded from a snapshot of the host's `~/.claude/` that the runner captures once at startup: `settings.json`, `CLAUDE.md`, hooks, agents, commands, and skills in your runner image apply to every session as the user-level baseline. If you change config on a running host, the change takes effect only after you restart the runner.864A self-hosted runner gives each session its own config directory, seeded from a snapshot of the host's `~/.claude/` that the runner captures once at startup. The `settings.json`, `CLAUDE.md`, hooks, agents, commands, and skills in your runner image apply to sessions as the user-level baseline. If you change config on a running host, the change takes effect only after you restart the runner.

865 865 

866Set `SELF_HOSTED_RUNNER_HOST_CONFIG_DIR` to seed from a different path, or point it at an empty directory to disable seeding.866Set `SELF_HOSTED_RUNNER_HOST_CONFIG_DIR` to seed from a different path, or point it at an empty directory to disable seeding.

867 867 


872 872 

873For the order these sources apply in, see [settings precedence](https://code.claude.com/docs/en/settings.md#settings-precedence).873For the order these sources apply in, see [settings precedence](https://code.claude.com/docs/en/settings.md#settings-precedence).

874 874 

875> [!NOTE]

876>

877> In a [PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md#choose-the-environment-pr-steward-runs-in) session, Claude Code loads no `CLAUDE.md` or rules file from the runner. That covers your runner image and the repository's checkout. PR Steward reads the repository's instruction files [from its default branch](https://code.claude.com/docs/en/pr-steward-pull-requests.md#save-pr-steward-instructions-for-everyone-in-a-repository), so put what it should follow there.

878 

875When Anthropic's control plane supplies a session with [Claude Code hooks](https://code.claude.com/docs/en/hooks.md), the runner installs them alongside, not over, your own configuration. Requires Claude Code v2.1.229 or later; older runners ignore supplied hooks. The supplied hooks run `python3`, so install `python3` in your [runner image](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#build-the-runner-image).879When Anthropic's control plane supplies a session with [Claude Code hooks](https://code.claude.com/docs/en/hooks.md), the runner installs them alongside, not over, your own configuration. Requires Claude Code v2.1.229 or later; older runners ignore supplied hooks. The supplied hooks run `python3`, so install `python3` in your [runner image](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#build-the-runner-image).

876 880 

877* **Where they land**: the runner writes each supplied hook script to a reserved `hooks/.ccr-launcher/` subdirectory of the session's config directory and registers the scripts in a separate settings file it passes to the session with `--settings`, leaving the seeded `settings.json` and your own scripts at `hooks/<name>` untouched. The runner recreates the reserved subdirectory for each session and doesn't seed host content at `~/.claude/hooks/.ccr-launcher/` into sessions.881* **Where they land**: the runner writes each supplied hook script to a reserved `hooks/.ccr-launcher/` subdirectory of the session's config directory and registers the scripts in a separate settings file it passes to the session with `--settings`, leaving the seeded `settings.json` and your own scripts at `hooks/<name>` untouched. The runner recreates the reserved subdirectory for each session and doesn't seed host content at `~/.claude/hooks/.ccr-launcher/` into sessions.


914* **`--capacity 1`, the default, with the built-in checkout**: the session starts in the first repository in its list of repositories. That repository's `.claude/settings.json` takes effect as project settings and its [`.mcp.json`](#mcp-servers) loads, and the other repositories' don't.918* **`--capacity 1`, the default, with the built-in checkout**: the session starts in the first repository in its list of repositories. That repository's `.claude/settings.json` takes effect as project settings and its [`.mcp.json`](#mcp-servers) loads, and the other repositories' don't.

915* **A `--capacity` above one, or a [`checkout` hook](#checkout)**: the session starts in a per-session directory that contains the checkouts. No repository's `.claude/settings.json` takes effect as project settings, no repository's `.mcp.json` loads, and [`$CLAUDE_PROJECT_DIR`](https://code.claude.com/docs/en/hooks#reference-scripts-by-path) in a hook command is that directory, not a checkout.919* **A `--capacity` above one, or a [`checkout` hook](#checkout)**: the session starts in a per-session directory that contains the checkouts. No repository's `.claude/settings.json` takes effect as project settings, no repository's `.mcp.json` loads, and [`$CLAUDE_PROJECT_DIR`](https://code.claude.com/docs/en/hooks#reference-scripts-by-path) in a hook command is that directory, not a checkout.

916 920 

917Each repository's `CLAUDE.md` loads wherever the session starts. Outside a project thread, its skills load too. The runner passes every repository to Claude Code as an [additional directory](https://code.claude.com/docs/en/permissions.md#additional-directories-grant-file-access-not-configuration), so outside a project thread, Claude Code also reads the `enabledPlugins` and `extraKnownMarketplaces` keys from each repository's `.claude/settings.json`. If you start the runner with [`--trust-workspace false`](https://code.claude.com/docs/en/self-hosted-environments-reference#runner-cli-flags), Claude Code skips both keys. Skipping `enabledPlugins` requires Claude Code v2.1.323 or later.921Each repository's `CLAUDE.md` loads wherever the session starts. Outside a project thread, its skills load too. The runner passes every repository to Claude Code as an [additional directory](https://code.claude.com/docs/en/permissions.md#additional-directories-grant-file-access-not-configuration). Outside a project thread, the `enabledPlugins` and `extraKnownMarketplaces` keys can also come from each repository's `.claude/settings.json`. If you start the runner with [`--trust-workspace false`](https://code.claude.com/docs/en/self-hosted-environments-reference#runner-cli-flags), Claude Code skips both keys. Skipping `enabledPlugins` requires Claude Code v2.1.323 or later.

918 922 

919To run a hook or apply a permission rule in every session, put it in `~/.claude/settings.json` on the runner host. The runner [seeds the host file into every session](#how-each-session’s-config-is-assembled), wherever the session starts. Write a path in a `Read` or `Edit` rule as a `//` absolute or `~/` home-relative [pattern](https://code.claude.com/docs/en/permissions.md#read-and-edit), because other patterns anchor at the settings source or the current directory.923To run a hook or apply a permission rule in every session, put it in `~/.claude/settings.json` on the runner host. The runner [seeds the host file into every session](#how-each-session’s-config-is-assembled), wherever the session starts. Write a path in a `Read` or `Edit` rule as a `//` absolute or `~/` home-relative [pattern](https://code.claude.com/docs/en/permissions.md#read-and-edit), because other patterns anchor at the settings source or the current directory.

920 924 

Details

107claude self-hosted-runner --environment-secret-file '/etc/claude/environment-secret' --base-dir '<writable-dir>'107claude self-hosted-runner --environment-secret-file '/etc/claude/environment-secret' --base-dir '<writable-dir>'

108```108```

109 109 

110The runner logs `Registered: runner_id=<runner-id>` once it has registered with your environment, then begins polling for work. Started with this command, it exits by design after serving one session, not after each turn. To serve more sessions, start the runner again each time it exits. See [If the runner exits](#if-the-runner-exits) for when that happens and what the runner logs.110The runner logs `Registered: runner_id=<runner-id>` once it has registered with your environment, then begins polling for work. Started with this command, it exits after serving one session, not after each turn. To serve more sessions, start the runner again each time it exits. See [If the runner exits](#if-the-runner-exits) for when that happens and what the runner logs.

111 111 

112**3. Verify the runner appears**112**3. Verify the runner appears**

113 113 

Details

4 4 

5# Self-hosted environments reference5# Self-hosted environments reference

6 6 

7> Complete reference for the self-hosted runner and orchestrator: CLI flags, environment variables, and Prometheus metrics.7> Reference for the self-hosted runner and orchestrator: CLI flags, environment variables, and Prometheus metrics.

8 8 

9> [!NOTE]9> [!NOTE]

10>10>


12 12 

13This page is the reference for the two processes you run in a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments): the runner, which executes Claude Code [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) on your hosts, and the optional autoscaling orchestrator, which starts runners as sessions queue. Each has its own flag table. Both run on Linux or macOS hosts, which the defaults such as `/workspace` and `~/.claude` assume. Run `claude self-hosted-runner --help` for the authoritative list on your installed version.13This page is the reference for the two processes you run in a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments): the runner, which executes Claude Code [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) on your hosts, and the optional autoscaling orchestrator, which starts runners as sessions queue. Each has its own flag table. Both run on Linux or macOS hosts, which the defaults such as `/workspace` and `~/.claude` assume. Run `claude self-hosted-runner --help` for the authoritative list on your installed version.

14 14 

15Metric series and a few API fields still use `pool` for what these pages call an environment; both terms name the same thing. The environment ID is the `pool_id` field, with the form `ccpool_...`: wherever these pages show a `pool` identifier, it names the environment. CLI flags and environment variables spell it `environment`, such as `--environment-secret-file`; the deprecated `pool` spellings still work, as the [`--environment-secret-file` row](#runner-cli-flags) describes.15Metric series and a few API fields still use `pool` for what these pages call an environment. The environment ID is the `pool_id` field, with the form `ccpool_...`: wherever these pages show a `pool` identifier, it names the environment. CLI flags and environment variables spell it `environment`, such as `--environment-secret-file`; the deprecated `pool` spellings still work, as the [`--environment-secret-file` row](#runner-cli-flags) describes.

16 16 

17## Runner CLI flags17## Runner CLI flags

18 18 

Details

190 190 

191### Per-key exceptions across managed sources191### Per-key exceptions across managed sources

192 192 

193These keys are exceptions to the no-merge rule:193By default, Claude Code reads most keys from [one managed source](#settings-precedence). Exceptions include:

194 194 

195* **Cross-source lock keys**: a small set of keys, such as the sandbox allowlist locks, [listed on the managed settings page](https://code.claude.com/docs/en/managed-settings.md#precedence-within-the-managed-tier). Claude Code honors them when any admin-controlled managed source sets them; the user-writable HKCU registry tier is excluded.195* **Cross-source lock keys**: a small set of keys, such as the sandbox allowlist locks, [listed on the managed settings page](https://code.claude.com/docs/en/managed-settings.md#precedence-within-the-managed-tier). Claude Code honors them when any admin-controlled managed source sets them; the user-writable HKCU registry tier is excluded.

196 196 

settings.md +1 −1

Details

155 155 

156### Change a setting for one session156### Change a setting for one session

157 157 

158To try a value without saving it, set it when you start Claude Code. The value applies to that session and your settings files stay as they were. You have three ways to do it:158To try a value without saving it, set it when you start Claude Code. You have three ways to do it:

159 159 

160* **`--settings`**: pass a key as JSON, inline or as a path to a file. Claude Code applies it above your user, project, and local files and below managed settings. With `--settings`, you can't set [`Managed` or `Global config`](https://code.claude.com/docs/en/settings-reference#scopes) keys or some user settings keys, such as [`prependPlugins`](https://code.claude.com/docs/en/settings-reference#prependplugins).160* **`--settings`**: pass a key as JSON, inline or as a path to a file. Claude Code applies it above your user, project, and local files and below managed settings. With `--settings`, you can't set [`Managed` or `Global config`](https://code.claude.com/docs/en/settings-reference#scopes) keys or some user settings keys, such as [`prependPlugins`](https://code.claude.com/docs/en/settings-reference#prependplugins).

161* **A flag for that key**: some keys have their own flag, such as `--model` for `model` and `--effort` for `effortLevel` and `modelSettings`.161* **A flag for that key**: some keys have their own flag, such as `--model` for `model` and `--effort` for `effortLevel` and `modelSettings`.

Details

4 4 

5# All settings5# All settings

6 6 

7> Complete reference for every Claude Code settings.json key: where each one goes, its type and default, and a paste-ready example, with an index of every key.7> Reference for Claude Code settings.json keys: where each one goes, its type and default, and a paste-ready example, with an index of keys.

8 8 

9[Back to index](#all-settings)9[Back to index](#all-settings)

10 10 


2913 2913 

2914When a turn completes, Claude Code matches each entry's `pattern` regex against the turn output on the main thread, so a slow regex blocks the UI until it finishes. Nested quantifiers such as `(a+)+$` can take exponentially long against certain inputs and freeze the session, so keep each `pattern` linear and avoid nesting `+` or `*`.2914When a turn completes, Claude Code matches each entry's `pattern` regex against the turn output on the main thread, so a slow regex blocks the UI until it finishes. Nested quantifiers such as `(a+)+$` can take exponentially long against certain inputs and freeze the session, so keep each `pattern` linear and avoid nesting `+` or `*`.

2915 2915 

2916Footer badges render alongside a [custom status line](https://code.claude.com/docs/en/statusline.md) when one is configured; neither replaces the other. Use a status line for a script-driven row that computes its own content from session data, and footer badges to turn IDs from the conversation into links without a script.2916Footer badges render alongside a [custom status line](https://code.claude.com/docs/en/statusline.md) when one is configured. Use a status line for a script-driven row that computes its own content from session data, and footer badges to turn IDs from the conversation into links without a script.

2917 2917 

2918### `keybindingFlavor`2918### `keybindingFlavor`

2919 2919 


4481 4481 

4482Allowlist the MCP servers people can add. Claude Code blocks any server that doesn't match an entry wherever it's defined, including plugin servers, servers a user passes with `--mcp-config`, and servers from claude.ai.4482Allowlist the MCP servers people can add. Claude Code blocks any server that doesn't match an entry wherever it's defined, including plugin servers, servers a user passes with `--mcp-config`, and servers from claude.ai.

4483 4483 

4484Built-in servers such as Claude in Chrome, the `ide` server Claude Code connects to in a running [VS Code](https://code.claude.com/docs/en/vs-code.md#the-built-in-ide-mcp-server) or [JetBrains](https://code.claude.com/docs/en/jetbrains.md#the-built-in-ide-mcp-server) IDE, and servers the CLI itself configures are exempt from the allowlist, and the denylist still applies to them. On Claude Code v2.1.268 or later, a [Claude Tag](https://code.claude.com/docs/en/claude-tag.md) session's Slack tools are also exempt from the allowlist, and the denylist still applies to them. In-process `type: "sdk"` servers are exempt from both lists; the [app that started the session](https://code.claude.com/docs/en/mcp.md#how-connectors-reach-claude-code) registers them.4484[Some servers skip the allowlist](https://code.claude.com/docs/en/managed-mcp.md#servers-that-skip-the-allowlist-check), such as [`managedMcpServers`](#managedmcpservers) entries. A [Claude Tag](https://code.claude.com/docs/en/claude-tag.md) session's Slack tools skip it on v2.1.268 or later. Denylist entries in managed or user settings still apply to these servers. In-process `type: "sdk"` servers are exempt from both lists.

4485 

4486Servers your organization delivers are also exempt from the allowlist, and the denylist still applies to them. The exemption covers every [`managedMcpServers`](#managedmcpservers) entry, and any [`managed-mcp.json`](https://code.claude.com/docs/en/managed-mcp#exclusive-control-with-managed-mcp-json) entry whose values use [no `${VAR}` expansion outside `env`](https://code.claude.com/docs/en/managed-mcp#how-allowlists-and-denylists-apply-to-the-managed-set). See [How a server is evaluated](https://code.claude.com/docs/en/managed-mcp.md#how-a-server-is-evaluated) for the full check order. Before v2.1.259, servers from `managed-mcp.json` had to match too.

4487 4485 

4488* **Scope**: [`Any file`](#scopes). For servers users add, entries from every file merge into one allowlist unless [`allowManagedMcpServersOnly`](#allowmanagedmcpserversonly) is set. To keep users from adding entries, deploy both keys in managed settings.4486* **Scope**: [`Any file`](#scopes). For servers users add, entries from every file merge into one allowlist unless [`allowManagedMcpServersOnly`](#allowmanagedmcpserversonly) is set. To keep users from adding entries, deploy both keys in managed settings.

4489* **Type**: array of objects, each with exactly one key. Use `serverName`, a string limited to letters, numbers, hyphens, and underscores; `serverCommand`, an array of the command and its arguments matched exactly; or `serverUrl`, a URL pattern with `*` wildcards4487* **Type**: array of objects, each with exactly one key. Use `serverName`, a string limited to letters, numbers, hyphens, and underscores; `serverCommand`, an array of the command and its arguments matched exactly; or `serverUrl`, a URL pattern with `*` wildcards

setup.md +29 −7

Details

185 185 

186Run `claude doctor` in your shell to see the result of the last update attempt Claude Code recorded. On a native installation, if it reports a failed attempt, see [`Auto-update failed` in the session footer](https://code.claude.com/docs/en/troubleshoot-install#auto-update-failed) for what to do next.186Run `claude doctor` in your shell to see the result of the last update attempt Claude Code recorded. On a native installation, if it reports a failed attempt, see [`Auto-update failed` in the session footer](https://code.claude.com/docs/en/troubleshoot-install#auto-update-failed) for what to do next.

187 187 

188On macOS and Linux, the native installer manages the launcher at `~/.local/bin/claude` as a symlink into `~/.local/share/claude/versions/`. If you replace that launcher with your own script or symlink, auto-update and `claude update` leave it in place: new versions still install under the `versions/` directory, and your launcher decides which version runs.

189 

190With a custom launcher, Claude Code also keeps every installed version on disk because it can't tell which version the launcher needs. `claude doctor` reports a launcher that the native installer didn't create.

191 

192To let Claude Code manage the launcher again, remove `~/.local/bin/claude` and run `claude update`.

193 

194If an npm global install can't auto-update because the npm global directory isn't writable, Claude Code shows a one-time notice at startup, and `claude doctor` lists the available fixes. See [permission errors during installation](https://code.claude.com/docs/en/troubleshoot-install.md#permission-errors-during-installation) for details.188If an npm global install can't auto-update because the npm global directory isn't writable, Claude Code shows a one-time notice at startup, and `claude doctor` lists the available fixes. See [permission errors during installation](https://code.claude.com/docs/en/troubleshoot-install.md#permission-errors-during-installation) for details.

195 189 

196> [!NOTE]190> [!NOTE]


205>199>

206> Homebrew keeps old versions on disk after upgrades. Run `brew cleanup` periodically to reclaim disk space.200> Homebrew keeps old versions on disk after upgrades. Run `brew cleanup` periodically to reclaim disk space.

207 201 

202#### Custom launchers

203 

204On macOS and Linux, the native installer manages the launcher at `~/.local/bin/claude` as a symlink into `~/.local/share/claude/versions/`. If you replace it with your own script, your script stays in place through auto-update and `claude update`. New versions still install under `versions/`, but you keep running whichever version your launcher starts.

205 

206With a custom launcher, Claude Code also keeps every installed version on disk because it can't tell which version the launcher needs. `claude doctor` reports that the launcher `was not created by the native installer`.

207 

208#### Restore the managed launcher

209 

210To let Claude Code manage `~/.local/bin/claude` again, replace your custom launcher with a symlink to an installed version:

211 

2121. If you want to keep your launcher, copy `~/.local/bin/claude` to another folder. Step 3 overwrites it.

213 

2142. In your shell, list the installed versions:

215 

216 ```bash theme={null}

217 ls ~/.local/share/claude/versions/

218 ```

219 

2203. Create the symlink. For `VERSION`, use a version number from the list.

221 

222 ```bash theme={null}

223 ln -sfn ~/.local/share/claude/versions/VERSION ~/.local/bin/claude

224 ```

225 

2264. Run `claude doctor` and check that the launcher warning is gone.

227 

208### Configure release channel228### Configure release channel

209 229 

210Control which release channel Claude Code follows for auto-updates and `claude update` with the `autoUpdatesChannel` setting:230Control which release channel Claude Code follows for auto-updates and `claude update` with the `autoUpdatesChannel` setting:


481* **Delete an old version only when no machine can still be running it**: a machine can't see processes running on other machines, so checking for running processes before you delete isn't enough.501* **Delete an old version only when no machine can still be running it**: a machine can't see processes running on other machines, so checking for running processes before you delete isn't enough.

482* **Turn off Claude Code's own updates**: set [`DISABLE_UPDATES`](https://code.claude.com/docs/en/env-vars) and install new versions with your own tooling. Otherwise an auto-update of an npm installation on one machine runs the same in-place upgrade and removes the binary that sessions on other machines are running. Setting `DISABLE_AUTOUPDATER` alone isn't enough, because users can still run `claude update` and `claude install`. See [Disable auto-updates](#disable-auto-updates).502* **Turn off Claude Code's own updates**: set [`DISABLE_UPDATES`](https://code.claude.com/docs/en/env-vars) and install new versions with your own tooling. Otherwise an auto-update of an npm installation on one machine runs the same in-place upgrade and removes the binary that sessions on other machines are running. Setting `DISABLE_AUTOUPDATER` alone isn't enough, because users can still run `claude update` and `claude install`. See [Disable auto-updates](#disable-auto-updates).

483 503 

484The native installer deletes old versions from `~/.local/share/claude/versions/` on its own, which matters when that directory is on shared storage. Besides the version the launcher points to and any version a session on the same machine is running, it keeps the two newest versions and deletes the rest. A session on another machine that is running a deleted version loses its binary. With a [custom launcher](#auto-updates), Claude Code keeps every installed version and leaves cleanup to you.504The native installer deletes old versions from `~/.local/share/claude/versions/` on its own, which matters when that directory is on shared storage. Besides the version the launcher points to and any version a session on the same machine is running, it keeps the two newest versions and deletes the rest.

505 

506A session on another machine that is running a deleted version loses its binary. With a [custom launcher](#custom-launchers), Claude Code keeps every installed version and leaves cleanup to you.

485 507 

486### Binary integrity and code signing508### Binary integrity and code signing

487 509 

share-sessions.md +115 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Share a cloud or Remote Control session

6 

7> Check what recipients of a shared Claude Code session can read, choose who can open the link, and stop sharing.

8 

9You can share a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) or a [Remote Control](https://code.claude.com/docs/en/remote-control.md) session with a link so that other people can read the conversation.

10 

11> [!NOTE]

12>

13> To share a claude.ai chat, see [Share and unshare chats](https://support.claude.com/en/articles/10593882-share-and-unshare-chats).

14 

15## What recipients see

16 

17When you share a cloud or Remote Control session, recipients see the conversation so far, with Claude's tool calls and their results, including content such as:

18 

19* **Messages**: your prompts, images you added, the names of files you attached, and Claude's replies and thinking

20* **Code and commands**: file contents that Claude read, wrote, or edited, and commands that you or Claude ran, with their output

21* **Credentials**: keys or tokens that appear in a message, a file, or command output

22* **Other repositories**: results of Claude's GitHub searches, which can include private repositories that recipients can't open

23* **Connector results**: what a [connector](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai) returned, such as emails, documents, and Slack messages

24* **Web content**: pages that Claude read and screenshots it took

25* **Your setup**: names of connectors Claude used, and names and descriptions of any connectors, [skills](https://code.claude.com/docs/en/skills.md), and [plugins](https://code.claude.com/docs/en/plugins/overview.md) it looked up

26 

27Your display name appears on the shared session. On a Max, Ultra, or Pro plan, you can [hide it](#share-from-a-max-or-pro-account).

28 

29A recipient's view doesn't update in real time. When they reload the page or open the link again, they see messages added to the session after you shared, until you [stop sharing](#stop-sharing-a-session).

30 

31### What recipients see in a Remote Control session

32 

33When you share a Remote Control session, recipients can also see:

34 

35* The contents of files Claude read on your computer during the session, including files outside the folder you started the session in

36* Text and screenshots of pages Claude opened during the session through the [Claude in Chrome extension](https://code.claude.com/docs/en/chrome.md), including sites where you're signed in

37 

38## Share a session

39 

40[Check the session](#check-a-session-before-you-share) first. Then select **Share** at the top of the session, choose **Team** or **Public**, whichever your plan offers, select **Copy link**, and send the link.

41 

42### Check a session before you share

43 

44Read the conversation, expand the tool calls, and look for the content listed in [What recipients see](#what-recipients-see). If the conversation holds something recipients shouldn't see, keep the session **Private**.

45 

46The server [blocks sharing in some cases](#unshareable-sessions), but a session it lets you share can hold sensitive content.

47 

48### Share from an Enterprise or Team account

49 

50On Enterprise and Team plans, other members of your claude.ai organization may be able to open a session you share:

51 

52* **Visibility options**: **Private** and **Team**

53* **Repository access**: to open a cloud session you shared, recipients need access to each of its private repositories through their [connected GitHub account](https://code.claude.com/docs/en/web-quickstart.md#connect-github). Members without repository access may be able to open a Remote Control session's link.

54 

55### Share from a Max, Ultra, or Pro account

56 

57On Max, Ultra, and Pro plans, anyone who has the link and is signed in to claude.ai may be able to open a session you share:

58 

59* **Visibility options**: **Private** and **Public**

60* **Repository access**: **Require repository access** is off by default. Turn it on to limit the cloud sessions you share to recipients with access to each session's private repositories. People without repository access may be able to open a Remote Control session's link.

61 

62To turn on **Require repository access** or turn off **Show your name**, open Settings on claude.ai, then:

63 

64* **If the Settings menu shows Code instead of Claude Code**: go to [**Privacy**](https://claude.ai/settings/data-privacy-controls)

65* **Otherwise**: go to [**Claude Code > Sharing settings**](https://claude.ai/settings/claude-code)

66 

67## Stop sharing a session

68 

69To stop sharing a session you shared, set its visibility back to **Private**. Do this before you move on from a session or an organization, because the link keeps working after you:

70 

71* Archive the session

72* Turn off Remote Control or close your terminal

73* Leave or are removed from the organization, for a link you shared as **Team**

74 

75For what ends a link without you setting it to **Private**, see [Links that stop opening](#links-that-stop-opening).

76 

77## Troubleshoot sharing

78 

79You can't share a session when your organization has turned sharing off or the server refuses that session. A link can also stop opening after you share it.

80 

81### Sharing is turned off for your organization

82 

83If **Share** is dimmed with "Sharing is disabled by your organization.", ask an [Owner](https://code.claude.com/docs/en/server-managed-settings.md#access-control) to turn on **Share cloud sessions** in [**Organization settings > Data and privacy**](https://claude.ai/admin-settings/data-privacy-controls). You need this setting on to share Remote Control sessions too.

84 

85Under some compliance configurations, you can't share sessions even with the setting on.

86 

87### Sessions you can't share

88 

89You can't share some sessions because they may hold content that recipients shouldn't see. If sharing fails with a message such as "This session can't be shared.", trying again doesn't help.

90 

91For example, on Enterprise and Team plans, you can't share a cloud session that uses [uploaded code](https://code.claude.com/docs/en/claude-code-on-the-web.md#send-local-repositories-without-github), because there's no way to check who's allowed to see that code. To share work on that code, start a new session whose repository is on github.com and wasn't uploaded.

92 

93### Links that stop opening

94 

95If recipients can't open a link, check for these causes:

96 

97* **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).

98* **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).

99* **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.

100* **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.

101* **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.

102* **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.

103* **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).

104 

105You can't restore the link in these cases:

106 

107* The session was deleted

108* The session became [one you can't share](#unshareable-sessions)

109* You shared a **Public** link, then [moved your personal account](https://support.claude.com/en/articles/9267400-move-your-personal-claude-account-to-a-team-or-enterprise-organization) into an existing organization

110* Anthropic turned off the link, for example after an abuse or copyright review. The session shows as **Private**, and sharing it again fails with "Couldn't share this session. Try again."

111 

112## Related resources

113 

114* [Use Claude Code in the cloud](https://code.claude.com/docs/en/claude-code-on-the-web.md): archive, delete, and move cloud sessions

115* [Remote Control](https://code.claude.com/docs/en/remote-control.md): continue a local session from another device

ship-command.md +265 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Get a pull request ready with /ship and /steward

6 

7> Run `/ship` to open a GitHub pull request, get a review, and have Claude work on feedback and failing checks, or `/steward` to skip the review on an open one.

8 

9`/ship` is a Claude Code command that opens a GitHub pull request for your change if your branch doesn't have one. Claude reviews your change and works on feedback and failing checks to help get it ready to merge.

10 

11If your pull request is already open and you don't want a review, type [`/steward`](#start-a-watch-with-%2Fsteward). It skips the review, and Claude does the same work on feedback and failing checks.

12 

13> [!NOTE]

14>

15> Run either command from the Claude Code CLI in a terminal, in your local clone of the repository. Cloud sessions don't have them.

16 

17After you type `/ship`, your change goes through these steps:

18 

19![Diagram of what happens after you type /ship. In your session, Claude Code opens a pull request and reviews it with /code-review. Then the watch starts: Claude pushes fixes to your branch and responds to checks, comments, and conflicts. When the pull request is ready, you merge it.](https://mintcdn.com/claude-code/sMH7RDpTvyWlAkrg/images/ship-flow.svg?fit=max\&auto=format\&n=sMH7RDpTvyWlAkrg\&q=85\&s=ccfa7e5848711d691b8cdf65ac22b26e)

20 

211. **Pull request**: `/ship` can [commit your work, push your branch, and open the pull request](#what-%2Fship-commits-and-pushes) as you

222. **Review**: Claude reviews your change with [`/code-review`](https://code.claude.com/docs/en/code-review-local)

233. **Watch**: Claude keeps checking the pull request from your Claude Code session. It works on failing checks, merge conflicts, reviewers' comments, and the findings from its review, and pushes fixes. This ongoing work is called a watch

244. **Merge**: once the pull request is ready, merge it yourself

25 

26`/steward` skips steps 1 and 2 and starts the watch.

27 

28## When to use /ship and /steward

29 

30With either command, Claude works on your pull request's feedback and failing checks. Choose between `/ship` and `/steward` by where your change is:

31 

32* **`/ship`**: your change is finished, and you want Claude to review it and then work on the feedback and failing checks that follow

33* **`/steward`**: your pull request is already open and you don't want a review first, or a watch ended and you want to start it again

34 

35Both commands run in your session, so their work counts against your usage.

36 

37If you want something else, such as a review alone or fixes from a cloud session, use one of these:

38 

39| You want | Use |

40| :- | :- |

41| A review alone | [`/code-review`](https://code.claude.com/docs/en/code-review-local) |

42| Fixes as feedback arrives, from a cloud session | [Auto-fix](https://code.claude.com/docs/en/claude-code-on-the-web.md#auto-fix-pull-requests) or `/autofix-pr` |

43| Agents for whole repositories, billed to an organization | [Claude Ship](https://code.claude.com/docs/en/claude-ship.md) |

44 

45## Prerequisites for /ship and /steward

46 

47Install or update these tools:

48 

49* Claude Code v2.1.330 or later. If `/ship` is missing, see [/ship isn't available in your session](https://code.claude.com/docs/en/ship-command-troubleshooting.md#%2Fship-isn’t-available-in-your-session)

50* The [GitHub CLI](https://cli.github.com) 2.63 or later, signed in with `gh auth login`. With an older version, Claude can't push fixes

51* git 2.38 or later, to merge new commits into your branch. With an older git, Claude leaves those merges to you

52 

53Then get your change and your session ready:

54 

55* **A finished change, for `/ship`**: have it in your local clone of a repository on GitHub. It can be uncommitted, committed on a branch other than the default branch, or already in an open pull request of yours. If the repository is hosted somewhere other than GitHub, `/ship` opens no pull request, and Claude reviews your change

56* **Only the files that you want in the pull request, for `/ship`**: `/ship` can commit all your uncommitted changes, new files included. In your shell, run `git status`. Delete each new file that you don't want in the pull request, or stash the file with `git stash push -u -- <file>`

57* **No secrets in those files, for `/ship`**: `/ship` looks for secrets by file name, such as `.env`, so look inside your files yourself. A deny rule such as `Read(./notes.txt)` doesn't keep a file out of the commit

58* **An open pull request on GitHub, for `/steward`**: it has to be your own, with its branch checked out in your local clone

59* **Permission mode**: choose [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) if you want Claude to work on the pull request unattended. In most other permission modes, Claude waits at each prompt. In `bypassPermissions` mode, no watch starts

60 

61On native Windows, [no watch starts](https://code.claude.com/docs/en/ship-command-troubleshooting.md#cases-where-no-watch-can-start).

62 

63> [!WARNING]

64>

65> Run a watch only where you trust everyone who can merge to the base branch or push to your branch. Any of them can run programs on your computer with your credentials.

66 

67## Run /ship or /steward

68 

69In a terminal, open Claude Code in your clone, then type `/ship` or `/steward` at the prompt. Both take [arguments](#arguments-for-%2Fship-and-%2Fsteward), such as a pull request's number.

70 

71### Run /ship on a finished change

72 

73If you made the change with Claude, use that same session, because Claude writes the commit message from the session's conversation. Anyone who can see the pull request can read that message.

74 

75> [!NOTE]

76>

77> `/ship` proceeds with no confirmation prompt. After you press Enter, it can [commit your work, push your branch, and open the pull request](#what-%2Fship-commits-and-pushes) as you. Before the commit, and again before the push, a line that ends `Esc to cancel` says what's about to happen. If you do nothing, `/ship` continues after a few seconds.

78 

79If you cancel before the push, a commit that `/ship` made stays. To undo it and keep your files, run `git reset HEAD~1` in your shell.

80 

81### What /ship commits and pushes

82 

83In a repository on github.com that isn't a fork, `/ship` can commit your uncommitted changes, push the branch, and open the pull request before the review. On the default branch, it commits on a new branch and switches your checkout to that branch. If your work is already committed on another branch, `/ship` pushes that branch and opens the pull request.

84 

85`/ship` doesn't commit your uncommitted changes in these cases. Take the first one that fits:

86 

87* **A pull request is already open for the branch**: commit and push anything that you want in the pull request

88* **The repository is public**: if you're on a branch other than the default branch and it has commits of its own, `/ship` pushes those and opens a pull request without your uncommitted changes. Otherwise, commit your work on a branch other than the default branch, then run `/ship` again

89* **An uncommitted file's name suggests a secret, such as `.env`**: in a repository that isn't public, `/ship` doesn't commit or push anything. See [/ship committed or pushed nothing](https://code.claude.com/docs/en/ship-command-troubleshooting.md#%2Fship-committed-or-pushed-nothing)

90 

91Open the pull request yourself, then run `/ship`, if you want any of these:

92 

93* A draft pull request

94* Another base branch

95* Your repository's pull request template

96* A pull request on [GitHub Enterprise or from a fork](https://code.claude.com/docs/en/ship-command-troubleshooting.md#github-enterprise-and-forks)

97 

98If `/ship` commits or pushes nothing and these cases don't say why, see [/ship committed or pushed nothing](https://code.claude.com/docs/en/ship-command-troubleshooting.md#%2Fship-committed-or-pushed-nothing).

99 

100### Start a watch with /steward

101 

102To start a watch with no review first, type `/steward` at the Claude Code prompt. Use it on your own open pull request, or to start again after a watch ends. Before you leave a watch alone, see [Code that a watch runs on your computer](#code-that-a-watch-runs-on-your-computer).

103 

104`/steward` is separate from [PR Steward](https://code.claude.com/docs/en/pr-steward.md), the agent that an organization sets up. Where PR Steward is already working on your pull request, no watch starts.

105 

106## What Claude does during a watch

107 

108A watch is Claude's ongoing work on your pull request, which starts after `/ship`'s review or when you type `/steward`. Claude uses your `gh` and `git` sign-ins, so its work on GitHub appears under your name.

109 

110In auto mode, Claude takes these actions without asking:

111 

112* Works on the review findings that it judges to be problems

113* Can post one comment that sums up its review

114* Pushes commits to your branch

115* Merges the base branch into yours, to resolve conflicts or bring your branch up to date

116* Works on failing checks, and re-runs failed ones

117* Answers review comments, resolves threads, and re-requests reviews

118 

119Claude reads comments from you and from people with write access. On github.com, it also reads comments from Claude's bot. To have Claude read another bot's comments, type `/steward +` and the bot's name, as in `/steward +my-lint-bot`.

120 

121When checks pass and comments are answered, Claude says so in the session. Merge the pull request yourself. What can merge depends on your permissions and your repository's branch rules. See [When a watch can lead to a merge](#when-a-watch-can-lead-to-a-merge).

122 

123### Keep working while a watch runs

124 

125While a watch runs, keep the session open and [in the foreground](https://code.claude.com/docs/en/agent-view.md#send-the-session-to-the-background), the computer awake, and your pull request's branch checked out. Claude edits files in the same checkout as you.

126 

127* **To start your next change**: work in another folder, such as a second clone of the repository, and open another Claude Code session there

128* **To push your own commits**: name the remote and branch, as in `git push origin <branch>`. If you change git's settings, for example with `git push -u` or `git branch -u`, the watch ends

129* **Commits that you haven't pushed**: they can go up with Claude's next push

130* **Your uncommitted work**: Claude can edit a file that you're working on, and can commit it. When Claude acts without a message from you, Claude Code refuses these commands from Claude: `git stash`, `git reset`, `git checkout`, `git add -A`, and `git commit -a`

131 

132### Ask Claude to check with you first

133 

134To see `/ship`'s review findings or a reviewer's comment before Claude acts on them, say so in a message at the Claude Code prompt. To see the findings before Claude fixes anything, send the message while the review is running.

135 

136This example asks Claude to show you its findings, and to ask before it pushes or replies:

137 

138```text theme={null}

139From now on, don't push code changes or reply to reviewers without asking me first. Show me the review findings and wait.

140```

141 

142That message is a request to Claude, and Claude Code doesn't enforce it.

143 

144### Save instructions for watches in a repository

145 

146To tell Claude how to look after pull requests in a repository, save a file at `.claude/skills/steward/SKILL.md` in the repository's top folder. [PR Steward reads the same file](https://code.claude.com/docs/en/pr-steward-pull-requests.md#save-pr-steward-instructions-for-everyone-in-a-repository), so one file can serve both, and that section has an example.

147 

148During a watch, Claude reads the copy in your checkout and follows it as instructions, for example on which checks matter and how to run the tests, within these limits:

149 

150* **Installs and downloads**: Claude can skip a line that installs or downloads something, such as the `npm install` line in that example

151* **Blocked commands**: the file doesn't change [what Claude Code blocks during a watch](#what-claude-code-blocks-during-a-watch)

152* **Changes to the file**: if you add or edit it yourself while a watch runs, the watch ends. For whose other changes can reach it, see [Code that a watch runs on your computer](#code-that-a-watch-runs-on-your-computer)

153 

154## Check, stop, or restart a watch

155 

156A watch is Claude's ongoing work on your pull request, which starts after `/ship`'s review or when you type `/steward`. It runs in your session, so you check it and stop it at the Claude Code prompt.

157 

158### Check whether a watch is running

159 

160Type `/tasks` at the Claude Code prompt. Once the review is done and while Claude isn't working, a running watch appears in the list as a scheduled task whose name starts with `/steward --tend`.

161 

162### What ends a watch

163 

164After a watch ends, look for a line that starts `Stopped watching pull request`. [A watch stopped](https://code.claude.com/docs/en/ship-command-troubleshooting.md#a-watch-stopped) lists reasons that it gives.

165 

166The watch ends in cases such as these:

167 

168| Where | What ends the watch |

169| :- | :- |

170| On the pull request | It's merged or closed, [PR Steward](https://code.claude.com/docs/en/pr-steward.md) labels it, or seven days pass |

171| At the keyboard | You press `Esc` or `Ctrl+C` at the prompt or while Claude is working. One press can end the watch, with no confirmation |

172| In your checkout | You check out another branch, or change git's settings |

173| In the session | The session ends, you send it to the background, you start another watch or a `/loop` with a task, or you run `/clear`, `/resume`, or `/branch` |

174| After a failure | An error, a declined prompt, or a usage limit can end it early |

175 

176### Stop or restart a watch

177 

178To end a watch, type `/ship stop` at the Claude Code prompt in the session that runs it. If Claude is working when you type it, the watch ends when the current turn does, so what Claude pushes or posts in that turn still reaches the pull request. To stop the turn as well, press `Esc`.

179 

180To start a watch again, type [`/steward`](#start-a-watch-with-%2Fsteward).

181 

182## Decide where to run a watch

183 

184A watch is Claude's ongoing work on your pull request, which starts after `/ship`'s review or when you type `/steward`. Claude works with your `gh` and `git` sign-ins. Before you leave a watch alone, check what Claude Code blocks, which code can run on your computer, and what can still lead to a merge.

185 

186### What Claude Code blocks during a watch

187 

188When Claude acts without a message from you, Claude Code blocks `gh` and `git` commands that merge the pull request, approve it, turn on auto-merge, or force-push. At those times, Claude Code also limits Claude's `gh` and `git` commands to a short list, and refuses tools that the watch doesn't need, such as connectors, `WebFetch`, and `WebSearch`. To see these limits in Claude Code, type `/ship terms` at the prompt.

189 

190> [!WARNING]

191>

192> The limits on a watch don't cover everything. The watch uses your `gh` and `git` sign-ins, so it could merge a pull request that your repository's branch rules let you merge without another person's approval. See [When a watch can lead to a merge](#when-a-watch-can-lead-to-a-merge). A setting in your session, such as a permission rule or a hook, can [let commands past the limits](https://code.claude.com/docs/en/ship-command-troubleshooting.md#messages-during-a-watch).

193 

194### Code that a watch runs on your computer

195 

196Code from each of these sources can run on your computer during a watch, with your credentials:

197 

198| Source | What happens |

199| :- | :- |

200| The base branch | To resolve conflicts or bring your branch up to date, Claude merges the base branch into yours, including scripts that run by themselves |

201| Other people's pushes to your branch | Claude is instructed to merge them in |

202| Programs from your branch, such as your tests | Claude runs them. They can merge or force-push with your credentials. Claude Code checks only the command that starts them, under the session's permission mode |

203| Your Claude Code hooks | They run without asking, and may run a file that Claude has edited |

204| [`.claude/skills/steward/SKILL.md`](https://code.claude.com/docs/en/pr-steward-pull-requests#save-pr-steward-instructions-for-everyone-in-a-repository) | Claude follows it if your checkout has one. Anyone who can merge to the repository can write that file |

205 

206If Claude Code sees that a merge of the base branch or of other people's pushes would change its settings, `.mcp.json`, or git's config files, Claude leaves that merge to you.

207 

208### When a watch can lead to a merge

209 

210Cases such as these can lead to a merge:

211 

212| Case | What happens |

213| :- | :- |

214| Auto-merge is on for the pull request | GitHub merges once the checks and reviews allow. What Claude does during the watch, such as pushing a fix, can bring that about. To turn it off, run `gh pr merge --disable-auto <number>` in your shell |

215| In a terminal session, you type a message while Claude is idle | [Claude Code's limits](#what-claude-code-blocks-during-a-watch) are off while Claude answers your message. They're also off while Claude handles a background task's result that arrives during that time. In auto mode, Claude may then be allowed to merge |

216| You send a session that you started in your terminal to the background during the review or the watch, for example by pressing `←` | The watch ends. Work under way can go on there without these limits. To end that work, [stop that session](https://code.claude.com/docs/en/agent-view.md#manage-sessions-from-the-shell) |

217 

218### Permission rules and hooks that apply to /ship and /steward

219 

220Claude Code runs `/ship`'s own commit, push, and pull request commands itself, [outside the sandbox](https://code.claude.com/docs/en/sandboxing.md#what-runs-outside-the-sandbox). During a watch, when Claude acts without a message from you, it writes its git fetches, merges, commits, and pushes in the form `git -c core.hooksPath=/dev/null push`.

221 

222Rules and hooks apply this way, whether they're in your own settings or in managed settings:

223 

224| Setting | For `/ship`'s own commit and push | During a watch |

225| :- | :- | :- |

226| A [deny rule](https://code.claude.com/docs/en/permissions.md#manage-permissions) such as `Bash(git push *)` | `/ship` leaves those steps to you | No watch starts |

227| A rule that asks on `Bash(git push *)` | Claude Code doesn't consult it | It [doesn't match](https://code.claude.com/docs/en/permissions.md#bash-rule-limits) that form, so it adds no prompt |

228| A rule that asks on `Bash(git *)` | Claude Code doesn't consult it | It matches, and the watch waits at each prompt, including in auto mode |

229| Auto mode's check, and tool hooks such as `PreToolUse` | They don't run | They don't apply to the `gh` and `git` commands that Claude Code runs itself, outside the sandbox, for example to read the pull request |

230| Git hooks in the repository's hooks folder | They run | They don't run for Claude's fetches, merges, commits, and pushes on those turns |

231 

232## Turn off /ship and /steward for your organization

233 

234To turn off both commands, set these keys under [`skillOverrides`](https://code.claude.com/docs/en/skills#override-skill-visibility-from-settings) in [managed settings](https://code.claude.com/docs/en/managed-settings.md). `ship-local` is the skill behind `/ship`.

235 

236This example turns off both:

237 

238```json theme={null}

239{

240 "skillOverrides": {

241 "ship-local": "off",

242 "steward": "off"

243 }

244}

245```

246 

247To stop `/ship`'s own pushes, put a [deny rule](https://code.claude.com/docs/en/permissions.md#manage-permissions) such as `Bash(git push *)` in managed settings. With that rule, no watch starts.

248 

249## Arguments for /ship and /steward

250 

251Type an argument after `/ship` or `/steward` at the Claude Code prompt. To combine arguments, put the effort level first, as in `/ship low 41 +my-lint-bot`.

252 

253| You type | Commands | What it does |

254| :- | :- | :- |

255| `low`, `medium`, `high`, `xhigh`, or `max` | `/ship` | Asks for a review at that effort level. The default is `high` |

256| `41`, or a pull request's URL | `/ship`, `/steward` | Works on that pull request. For a watch, it has to be your own, with its branch checked out |

257| `+botname` | `/ship`, `/steward` | Also reads that bot's comments. Repeat it when you start a watch again |

258| `stop` | `/ship`, `/steward` | Ends the watch |

259| `terms` | `/ship`, `/steward` | Shows what Claude may do during a watch and what limits it |

260 

261## Related resources

262 

263* [Troubleshoot `/ship` and `/steward`](https://code.claude.com/docs/en/ship-command-troubleshooting): messages that the commands print, and what to do

264* [Review code locally](https://code.claude.com/docs/en/code-review-local.md): the review that `/ship` runs

265* [Permission modes](https://code.claude.com/docs/en/permission-modes.md): auto mode and the other permission modes

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Troubleshoot /ship and /steward

6 

7> Look up a message or a symptom from `/ship` or `/steward`: a missing command, nothing committed or pushed, a watch that didn't start, or one that stopped.

8 

9[`/ship`](https://code.claude.com/docs/en/ship-command) is a Claude Code command that opens a GitHub pull request for your change and has Claude review it. Claude then keeps working on the pull request from your session. This ongoing work is called a watch. `/steward` starts a watch on a pull request that's already open.

10 

11Find what happened in the first column, or search for words from the message that Claude Code printed:

12 

13| What happened | Go to |

14| :- | :- |

15| `/ship` isn't in the `/` menu, or Claude Code doesn't recognize it | [/ship isn't available in your session](#%2Fship-isn’t-available-in-your-session) |

16| You typed the command and it printed a message without starting | [/ship or /steward printed a message and didn't start](#%2Fship-or-%2Fsteward-printed-a-message-and-didn’t-start) |

17| It ran, and nothing was committed or pushed | [/ship committed or pushed nothing](#%2Fship-committed-or-pushed-nothing) |

18| The pull request is open, and Claude isn't following up on it | [No watch started](#no-watch-started) |

19| Claude was following up, and stopped | [A watch stopped](#a-watch-stopped) |

20| A message appeared while Claude was following up | [Messages during a watch](#messages-during-a-watch) |

21| The pull request isn't what you expected | [Pull request results that you didn't expect](#pull-request-results-that-you-didn’t-expect) |

22| A custom `/ship` or `/steward` command stopped working | [A custom /ship or /steward command stopped loading](#a-custom-%2Fship-or-%2Fsteward-command-stopped-loading) |

23 

24## /ship or /steward is missing or doesn't start

25 

26Start here when the command isn't offered, or when it prints a message.

27 

28### /ship isn't available in your session

29 

30`/ship` is missing from the `/` menu, typing it starts `/code-review`, or you see `Unknown command: /ship`. Cloud sessions don't have `/ship`.

31 

32On your own machine, take these steps:

33 

341. Run `claude update` in your shell, then quit and start `claude` again.

352. If `/ship` is still missing, quit and start `claude` once more, because a new feature [can take a second start](https://code.claude.com/docs/en/env-vars.md#first-session-after-an-install-or-upgrade) to show.

363. Run `/status` at the Claude Code prompt. Its `Setting sources` line lists the settings that loaded. In each one that's your own [settings file](https://code.claude.com/docs/en/settings.md#find-or-create-your-settings-files), remove [`disableBundledSkills`](https://code.claude.com/docs/en/settings-reference#disablebundledskills) and any `ship-local` entry under [`skillOverrides`](https://code.claude.com/docs/en/skills#override-skill-visibility-from-settings). To change managed settings, ask your administrator.

374. Check whether your session [skips feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), for example because `DISABLE_TELEMETRY` is set or you use a third-party provider. `/ship` isn't available in those sessions.

38 

39### A skillOverrides entry turns off /ship or /steward

40 

41`Skill "ship-local" is disabled via skillOverrides`, or the same message for `steward`, means that a [`skillOverrides`](https://code.claude.com/docs/en/skills#override-skill-visibility-from-settings) entry in your settings turns off the command. Remove the entry. To change an entry in managed settings, ask your administrator.

42 

43### /ship or /steward printed a message and didn't start

44 

45Find the opening words of the message:

46 

47| Message | What to do |

48| :- | :- |

49| `This session was started by another session` | Run it in a session that you started yourself |

50| `Usage: /ship` or `Usage: /steward` | Check what you typed against [the arguments](https://code.claude.com/docs/en/ship-command.md#arguments-for-%2Fship-and-%2Fsteward) |

51| `Nothing started. /ship starts only from a line that you type`, or the same for `/steward` | Type the command yourself at the Claude Code prompt. It doesn't start from `claude -p` or from a program |

52| `/ship didn't start:` or `/steward didn't start:` | The rest of the message says what to check |

53| `/ship is turned off right now`, or the same for `/steward` | Run `/login` at the Claude Code prompt, as the message says, then run the command again |

54| `/ship can't start from a queued message` or `/steward can't start from a queued message` | Wait until Claude has finished, then run it again |

55 

56### The GitHub CLI isn't ready

57 

58`/ship` and `/steward` reach GitHub through the GitHub CLI, `gh`:

59 

60| Message | What to do |

61| :- | :- |

62| `GitHub CLI (gh) isn't installed` or `GitHub CLI (gh) isn't signed in` | Install it, run `gh auth login` in your shell, then run the command again |

63| `gh couldn't tell me about a pull request here` | The words in parentheses say what failed. To see `gh`'s own error, run `gh pr view` in your shell. One cause is that none of your checkout's remotes is on a GitHub host that `gh` is signed in to. For GitHub Enterprise, run `gh auth login --hostname HOST` in your shell |

64 

65## /ship committed or pushed nothing

66 

67In some cases, `/ship` leaves the commit or the push to you and says why. Its message can start with `Nothing committed or pushed`, `Nothing pushed`, `I didn't push anything`, `There is no pull request to watch`, or `This branch has no open pull request`.

68 

69Find your case, take the step in its row, then run `/ship` again. In these cases, if nothing is pushed and the branch has no pull request, Claude reviews your change and [no watch starts](#no-watch-started).

70 

71### Public repositories and files that /ship doesn't commit

72 

73`/ship` looks at the repository and at each changed file's name before it commits:

74 

75| Case | What to do |

76| :- | :- |

77| `For a public repository /ship doesn't commit anything for you` | Commit your work yourself, on a branch other than the default branch |

78| `By its name, this file may hold secrets` or `By their names, these files may hold secrets`, for a changed file such as `.env` or `password.txt` | If it holds no secret, commit your work yourself, on a branch other than the default branch. Otherwise, set it aside, for example with `git stash push -u -- <file>` in your shell |

79| The message names empty files that you didn't create, such as `.bashrc` or `.gitconfig` | On Linux and WSL2, the [sandbox](https://code.claude.com/docs/en/sandboxing.md) keeps empty files in your checkout while a sandboxed command runs. The sandbox needs them until the command ends, so don't stash, commit, or delete them before then. Stop the command, for example from [`/tasks`](https://code.claude.com/docs/en/commands#all-commands), or wait for it to end, and the sandbox removes them. If they stay with no sandboxed command running, [remove the leftover files](https://code.claude.com/docs/en/errors.md#stale-sandbox-mask-files-left-by-a-killed-session) |

80| You changed a file that configures git, CI, or a coding agent, such as `.gitignore`, `CLAUDE.md`, or anything under `.github/` | Commit your work yourself, on a branch other than the default branch |

81 

82### Branches that /ship can't commit to or push

83 

84`/ship` needs a branch that it can commit to and push:

85 

86| Case | What to do |

87| :- | :- |

88| `there is nothing here to open one for`: you have no uncommitted changes, and every commit on the branch is already on the default branch | Make a change, or check out the branch that holds your work |

89| The default branch holds your commits, and nothing is uncommitted | Move the commits to a new branch, for example with `git switch -c <branch>` in your shell |

90| You're in detached HEAD state, or in the middle of a rebase | Check out a branch, or finish the rebase |

91 

92### Deny rules that forbid a commit or push

93 

94A [deny rule](https://code.claude.com/docs/en/permissions.md#manage-permissions), such as `Bash(git push *)`, can forbid the commit, the push, or opening the pull request. If whoever set the rule agrees, take those steps yourself.

95 

96A watch needs `git commit` and `git push` as well. If the rule forbids one of them, [have it removed](#a-tool-rule-or-hook-blocks-a-watch) before you run `/ship` again.

97 

98### GitHub Enterprise and forks

99 

100`/ship` doesn't open a pull request on GitHub Enterprise or from a fork. Push the branch and open the pull request yourself, then run `/ship`. From a fork, the checkout also needs a remote for the repository that the pull request goes to, or no watch starts.

101 

102## No watch started

103 

104A watch is Claude's ongoing work on your pull request, which starts after `/ship`'s review or when you type `/steward`. In some cases, no watch starts and Claude says why. Its message can contain `/steward didn't start.`, `I can't watch`, or `is running on pull request`.

105 

106Fix the cause, then type `/steward` to start the watch with no second review, or `/ship` if the branch still has no pull request.

107 

108### Your pull request or branch isn't ready for a watch

109 

110Check the pull request and your checkout first:

111 

112| Cause | What to do |

113| :- | :- |

114| The branch has no pull request, and `/steward` doesn't open one | See [/ship committed or pushed nothing](#%2Fship-committed-or-pushed-nothing) |

115| The pull request's branch isn't checked out in this session | Check it out |

116| The pull request carries one of [PR Steward](https://code.claude.com/docs/en/pr-steward.md)'s labels, such as `claude-pr-steward-watching` | To take over, remove the label and pull the branch, as Claude's message says |

117 

118### A session setting blocks a watch

119 

120Some settings of the session keep a watch from starting:

121 

122| Cause | What to do |

123| :- | :- |

124| The session is in `bypassPermissions` mode | Press `Shift+Tab` to switch to a permission mode other than plan mode |

125| [Remote Control](https://code.claude.com/docs/en/remote-control.md) is on | Run `/rc`, then select **Disconnect this session** |

126| `your PATH has a relative or empty entry` | `/ship` with no pull request number reviews your change, and doesn't commit, push, or look for a pull request. Take the empty or relative entry out of `PATH`, such as a trailing `:`, or `;` on Windows. Start `claude` again, then run `/ship` |

127| Your `PATH` holds a folder inside the checkout. This happens, for example, when you activate a Python virtual environment that's in the checkout, or start `claude` through `npx` or a package script | To start a session without that folder, run `deactivate` in your shell if you use a virtual environment, then start `claude` directly |

128 

129### A tool, rule, or hook blocks a watch

130 

131A watch needs `gh`, `git commit`, and `git push`, and it doesn't start where a project's hook could approve commands:

132 

133| Cause | What to do |

134| :- | :- |

135| `gh` isn't installed or signed in | See [The GitHub CLI isn't ready](#the-github-cli-isn’t-ready) |

136| A deny rule forbids a command that the watch needs, such as `git push` | Claude's message names the command and the settings that hold the rule. If whoever set it agrees, remove it there. To change a rule in managed settings, ask your administrator |

137| The project sets a hook that could approve commands, for example a `PreToolUse` or `PermissionRequest` [hook](https://code.claude.com/docs/en/hooks.md) on shell commands in the checkout's `.claude/settings.json` | The message names the file and says what to change |

138 

139### Cases where no watch can start

140 

141In these cases, `/ship` can still review your change:

142 

143* You're on native Windows

144* Someone else opened the pull request

145* You can't push to the repository that the pull request goes to, and another person has commented or reviewed. If this happens while a watch is running, the watch ends

146 

147## A watch stopped

148 

149A watch is Claude's ongoing work on your pull request, which starts after `/ship`'s review or when you type `/steward`. After one ends, look for a line that starts `Stopped watching pull request`, which gives the reason.

150 

151To start the watch again, type the command that the line gives, if it gives one. To check whether a watch is still running, type [`/tasks`](https://code.claude.com/docs/en/ship-command#check-whether-a-watch-is-running) at the Claude Code prompt while Claude is idle.

152 

153Find the words that follow "because" in that line:

154 

155| Reason | What happened |

156| :- | :- |

157| `its check-in was cancelled` | You pressed `Esc` or `Ctrl+C` at the prompt or while Claude was working, or stopped the task in `/tasks`. Claude's messages call its work on the pull request a check-in. An `Esc` that closes the `/tasks` list leaves a watch running |

158| `the watch couldn't go on` | Claude's reply may give the cause. One cause is that the pull request's branch is no longer checked out. Check it out in the folder where you started, then type `/steward` |

159| `a watch doesn't carry over when a session is resumed` | The process that ran the watch has ended, for example because you closed the terminal. Running `claude --continue` in your shell brings back the conversation without the watch |

160| `you moved to another session` | `/clear`, `/resume`, or `/branch` can do that |

161| `its check-ins were replaced` | You started a `/loop` |

162| `your new command took over this session` | You ran `/ship` or `/steward` again |

163| `a deny rule now forbids a command that the watch runs` | Type `/permissions` at the Claude Code prompt to see the rule. See [A tool, rule, or hook blocks a watch](#a-tool-rule-or-hook-blocks-a-watch) |

164| `the watch reached its time limit` | About seven days passed |

165| `no next check-in was set` | A declined permission prompt, an error, or a usage limit can do that |

166| `a file that gh, git, or /steward relies on changed` | See [A file that the watch relies on changed](#a-file-that-the-watch-relies-on-changed) |

167 

168`No pull request is being watched in this session` means that you typed `/ship stop` or `/steward stop` and no watch was running. Scroll up for a `Stopped watching pull request` line.

169 

170### A file that the watch relies on changed

171 

172A watch ends when something changes a file that `gh`, `git`, or `/steward` relies on. Files such as these count:

173 

174* **Git's settings**: `git push -u`, `git branch -u`, and `git remote add` change them. An editor such as VS Code can also add a setting to `.git/config` when it opens the repository or you switch back to it

175* **`.claude/settings.local.json`**: Claude Code writes it when you answer a permission prompt with "Yes, and don't ask again"

176 

177Review the change, then type `/steward` to start the watch again.

178 

179If you changed none, one cause on Linux and WSL2 is a [sandboxed](https://code.claude.com/docs/en/sandboxing.md) command that starts or ends during the watch. Stop the command or wait for it to end.

180 

181## Messages during a watch

182 

183These messages appear in your session during a watch:

184 

185| Message, or what you see | What to do |

186| :- | :- |

187| `Claude Code did not run this`, or `Not run · permission denied` | Claude tried a step, and a [limit on the watch](https://code.claude.com/docs/en/ship-command.md#what-claude-code-blocks-during-a-watch) or one of your rules or hooks refused it. The message also appears when the watch had already ended. Claude's messages call those limits "the fence" |

188| `In this session there's a way around my limits` | A setting in your session, such as a rule, a hook, a plugin, or the sandbox, lets some commands past the [limits on the watch](https://code.claude.com/docs/en/ship-command.md#what-claude-code-blocks-during-a-watch). The text after the message names it. To see your rules, type `/permissions` at the Claude Code prompt. To end the watch while you decide, type `/steward stop` |

189| A line such as `1 comment not read (no write access, or a bot that you haven't named)` | Claude [skipped a comment](https://code.claude.com/docs/en/ship-command.md#what-claude-does-during-a-watch). Open the link in the message to read it. For a bot that you want Claude to read, type `/steward +botname`. For a person's comment that you agree with, tell Claude what to change |

190| `gh couldn't say where the pull request's head and base stand` | One cause is a GitHub CLI older than 2.63. Run `gh --version` in your shell to check. Update it, then type `/steward` to start the watch again |

191| `Claude resuming /loop wakeup` or `/steward --tend` in the session | Claude Code enters them when Claude checks the pull request during a watch. You can keep working as you are |

192 

193## Pull request results that you didn't expect

194 

195Start here when `/ship` ran, and something on GitHub or in your repository surprised you:

196 

197| What you see | Why, and what to do |

198| :- | :- |

199| The pull request's title is a line such as `Update greet.py and 1 more` | `/ship` falls back to that title when Claude can't write one from the session's conversation, for example in a session where you didn't discuss the change. Edit the title and description on GitHub. Next time, run `/ship` in the session where you made the change, or commit your work yourself first, on a branch other than the default branch |

200| Claude pushed commits or answered a reviewer before you saw them | In auto mode, or where your rules or the sandbox allow a command, a watch works that way. See [Ask Claude to check with you first](https://code.claude.com/docs/en/ship-command.md#ask-claude-to-check-with-you-first) |

201| New uncommitted changes didn't reach the open pull request | Once a pull request is open, `/ship` doesn't commit your work. Commit it, then push it, as in `git push origin <branch>` in your shell |

202| `git pull` or `git push` asks for an upstream branch | `/ship` sets no upstream. Name the remote and branch, as in `git push origin <branch>`. Setting an upstream changes git's settings, which [ends a running watch](https://code.claude.com/docs/en/ship-command.md#keep-working-while-a-watch-runs) |

203 

204## A custom /ship or /steward command stopped loading

205 

206A `Not loaded: a custom /ship` or `Not loaded: custom /ship, /steward` notice is about a custom skill or command. Its name is one that the built-in commands reserve, such as `ship`, `ship-local`, or `steward`. Rename it, then restart Claude Code.

207 

208Leave a repository's `.claude/skills/steward/SKILL.md` as it is, because PR Steward and the watch read it as instructions. The notice doesn't count that file, so a notice that names `/steward` is about another skill or command.

209 

210## Related resources

211 

212* [`/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

213* [Permission modes](https://code.claude.com/docs/en/permission-modes.md): auto mode and the other permission modes

214* [Hooks](https://code.claude.com/docs/en/hooks.md): the `PreToolUse` and `PermissionRequest` hooks

skills.md +10 −5

Details

213| Same name in | Which one runs |213| Same name in | Which one runs |

214| :- | :- |214| :- | :- |

215| Two of enterprise, personal, and project | Enterprise over personal, and personal over project. With `deploy` in both `~/.claude/skills/` and the project's `.claude/skills/`, `/deploy` runs the personal one |215| Two of enterprise, personal, and project | Enterprise over personal, and personal over project. With `deploy` in both `~/.claude/skills/` and the project's `.claude/skills/`, `/deploy` runs the personal one |

216| Any of those locations and a [bundled skill](#bundled-skills) | Your skill replaces the bundled command, but not its aliases. A project `code-review` skill replaces `/code-review`, and the bundled alias `/review` never runs your skill |216| Any of those locations and a [bundled skill](#bundled-skills) with a name other than `ship`, `ship-local`, or `steward` | Your skill replaces the bundled command, but not its aliases. A project `code-review` skill replaces `/code-review`, and the bundled alias `/review` doesn't run your skill |

217| Any of those locations and a [built-in command](https://code.claude.com/docs/en/commands.md) | In a local terminal session, your skill replaces the built-in command, but not its aliases. A project `usage` skill replaces `/usage`, and the built-in alias `/cost` still runs the built-in command |217| Any of those locations and a [built-in command](https://code.claude.com/docs/en/commands.md) | In a local terminal session, your skill replaces the built-in command, but not its aliases. A project `usage` skill replaces `/usage`, and the built-in alias `/cost` still runs the built-in command |

218| A skill and a file in `.claude/commands/` | The skill |218| A skill and a file in `.claude/commands/` | The skill |

219| A skill or command of yours named `ship`, `ship-local`, or `steward` | Where `/ship` is available, the bundled `/ship` or `/steward`. Claude Code [doesn't load yours](https://code.claude.com/docs/en/ship-command-troubleshooting.md#a-custom-%2Fship-or-%2Fsteward-command-stopped-loading) |

219| A project-root skill and a nested skill | Both load. See [monorepos and subdirectories](#discovery-from-parent-and-nested-directories) |220| A project-root skill and a nested skill | Both load. See [monorepos and subdirectories](#discovery-from-parent-and-nested-directories) |

220| An enterprise, personal, or project skill and a skill in an [added directory outside the project](#skills-from-additional-directories) | The enterprise, personal, or project skill, while the added directory's skill runs under a prefixed name. See [run a same-named skill from an added directory](#run-a-same-named-skill-from-an-added-directory) |221| An enterprise, personal, or project skill and a skill in an [added directory outside the project](#skills-from-additional-directories) | The enterprise, personal, or project skill, while the added directory's skill runs under a prefixed name. See [run a same-named skill from an added directory](#run-a-same-named-skill-from-an-added-directory) |

221| Two [added directories](#skills-from-additional-directories) outside the project | The skill from the directory added first, in `--add-dir` or `/add-dir` order. The other runs under a [prefixed name](#run-a-same-named-skill-from-an-added-directory) |222| Two [added directories](#skills-from-additional-directories) outside the project | The skill from the directory added first, in `--add-dir` or `/add-dir` order. The other runs under a [prefixed name](#run-a-same-named-skill-from-an-added-directory) |


271 272 

272To stop syncing on a machine, set [`syncClaudeAiSkills`](https://code.claude.com/docs/en/settings-reference#syncclaudeaiskills) to `false` in your user settings. Claude Code stops downloading, and the next time it starts it moves the skills it already synced to `~/.claude/skills/.trash/` and no longer loads them. Your organization can turn syncing off for everyone by turning off Skills on claude.ai. To stop syncing while leaving Skills on, it can set the same key in [managed settings](https://code.claude.com/docs/en/managed-settings.md).273To stop syncing on a machine, set [`syncClaudeAiSkills`](https://code.claude.com/docs/en/settings-reference#syncclaudeaiskills) to `false` in your user settings. Claude Code stops downloading, and the next time it starts it moves the skills it already synced to `~/.claude/skills/.trash/` and no longer loads them. Your organization can turn syncing off for everyone by turning off Skills on claude.ai. To stop syncing while leaving Skills on, it can set the same key in [managed settings](https://code.claude.com/docs/en/managed-settings.md).

273 274 

274If your organization turns Skills off on claude.ai, Claude Code removes the downloaded skills and they stop loading. The removed skills move to `~/.claude/skills/.trash/`, where you can recover the files until the [retention sweep](https://code.claude.com/docs/en/claude-directory.md#cleaned-up-automatically) deletes them. Once your organization turns Skills back on, Claude Code downloads the skills you enabled at the next sync.275> [!NOTE]

276>

277> If your organization turns Skills off on claude.ai, Claude Code removes the downloaded skills and they stop loading. The removed skills move to `~/.claude/skills/.trash/`, where you can recover the files until Claude Code [deletes them](https://code.claude.com/docs/en/claude-directory.md#cleaned-up-automatically). Once your organization turns Skills back on, Claude Code downloads the skills you enabled at the next sync.

275 278 

276#### When a synced skill name matches another command279#### When a synced skill name matches another command

277 280 


319 322 

320### Edit a skill during a session323### Edit a skill during a session

321 324 

322Claude Code watches skill directories for file changes, except in [bare mode](https://code.claude.com/docs/en/headless.md#start-faster-with-bare-mode). When you add, edit, or remove a skill under `~/.claude/skills/`, the project `.claude/skills/`, or a `.claude/skills/` inside an `--add-dir` directory, Claude Code picks up the change within the current session, without a restart.325Claude Code watches skill directories for file changes, except in [bare mode](https://code.claude.com/docs/en/headless.md#start-faster-with-bare-mode). When you add, edit, or remove a skill under `~/.claude/skills/`, the project `.claude/skills/`, or a `.claude/skills/` inside an `--add-dir` directory, Claude Code picks up the change within the current session.

323 326 

324If a new skill doesn't appear, run [`/reload-skills`](https://code.claude.com/docs/en/commands#all-commands).327If a new skill doesn't appear, run [`/reload-skills`](https://code.claude.com/docs/en/commands#all-commands).

325 328 


1053* A **bar chart** breaking down the codebase by file type (top 8 by size)1056* A **bar chart** breaking down the codebase by file type (top 8 by size)

1054* A **collapsible tree** where you can expand and collapse directories, with color-coded file type indicators1057* A **collapsible tree** where you can expand and collapse directories, with color-coded file type indicators

1055 1058 

1056The script requires Python 3 but uses only built-in libraries, so there are no packages to install:1059The script requires Python 3 but uses only built-in libraries:

1057 1060 

1058```python expandable theme={null}1061```python expandable theme={null}

1059#!/usr/bin/env python31062#!/usr/bin/env python3


1252 1255 

1253Before v2.1.280, a file named `manifest.json` in `~/.claude/skills/` caused Claude Code to move the skill folders that file listed into a timestamped folder under `~/.claude/skills/.trash/`, and those skills stopped loading.1256Before v2.1.280, a file named `manifest.json` in `~/.claude/skills/` caused Claude Code to move the skill folders that file listed into a timestamped folder under `~/.claude/skills/.trash/`, and those skills stopped loading.

1254 1257 

1255To restore a skill, move its folder from the timestamped folder back into `~/.claude/skills/`. Do this before the [retention sweep](https://code.claude.com/docs/en/claude-directory.md#cleaned-up-automatically) deletes trash entries, by default 30 days after they were moved to the trash.1258> [!TIP]

1259>

1260> To restore a skill, move its folder from the timestamped folder back into `~/.claude/skills/`. Do this before Claude Code [deletes it](https://code.claude.com/docs/en/claude-directory.md#cleaned-up-automatically).

1256 1261 

1257## Related resources1262## Related resources

1258 1263 

statusline.md +16 −4

Details

163 163 

164### Size output to the terminal164### Size output to the terminal

165 165 

166Claude Code captures your script's output instead of connecting it directly to the terminal, so `tput cols` and language-level width detection cannot read the terminal size from inside the script. Read the `COLUMNS` and `LINES` environment variables instead. Claude Code sets these to the current terminal dimensions before running your script.166To fit your status line to the terminal, read the size that Claude Code passes to your script. Claude Code puts the width in the `COLUMNS` environment variable and the height in `LINES`, and updates both each time it [runs your script](#when-the-status-line-updates). Calls that ask the terminal directly, such as `stty size`, can fail because your script isn't connected to the terminal.

167 

168To keep a line from being cut off with `…`, make it at least four columns narrower than the terminal. Those four columns leave room for the spacing Claude Code adds on each side.

169 

170This Bash example calculates the widest your output can be:

171 

172```bash theme={null}

173max_width=$((COLUMNS - 4))

174```

175 

176In an 80-column terminal, `max_width` is 76. If you set [`padding`](#manually-configure-a-status-line), also subtract twice its value from `max_width`.

177 

178When you measure a line, count an emoji such as 📁 as two columns.

167 179 

168## Available data180## Available data

169 181 


205| `agent.name` | Agent name when running with the `--agent` flag or agent settings configured |217| `agent.name` | Agent name when running with the `--agent` flag or agent settings configured |

206| `pr.number`, `pr.url` | Open pull request for the current branch. Mirrors the PR badge in the footer. In a repository with a GitLab remote, Claude Code fills these fields from the branch's open [merge request](https://code.claude.com/docs/en/interactive-mode.md#gitlab-merge-requests) instead, so `pr.number` is the merge request number. Merge request data requires Claude Code v2.1.234 or later. Absent when not in a git repository, until a pull request or merge request is found, or once it merges or closes |218| `pr.number`, `pr.url` | Open pull request for the current branch. Mirrors the PR badge in the footer. In a repository with a GitLab remote, Claude Code fills these fields from the branch's open [merge request](https://code.claude.com/docs/en/interactive-mode.md#gitlab-merge-requests) instead, so `pr.number` is the merge request number. Merge request data requires Claude Code v2.1.234 or later. Absent when not in a git repository, until a pull request or merge request is found, or once it merges or closes |

207| `pr.review_state` | Review status of the open PR: `approved`, `pending`, `changes_requested`, or `draft`. May be independently absent even when `pr` is present |219| `pr.review_state` | Review status of the open PR: `approved`, `pending`, `changes_requested`, or `draft`. May be independently absent even when `pr` is present |

208| `pr.kind` | `mr` when `pr` describes a [GitLab merge request](https://code.claude.com/docs/en/interactive-mode.md#gitlab-merge-requests). Absent for GitHub pull requests, so scripts written before this field keep working. For a merge request, Claude Code sets `review_state` to `approved` when GitLab reports it mergeable, `pending` for any other open state, and `draft` for a draft. Requires Claude Code v2.1.234 or later |220| `pr.kind` | `mr` when `pr` describes a [GitLab merge request](https://code.claude.com/docs/en/interactive-mode.md#gitlab-merge-requests). Absent for GitHub pull requests. For a merge request, Claude Code sets `review_state` to `approved` when GitLab reports it mergeable, `pending` for any other open state, and `draft` for a draft. Requires Claude Code v2.1.234 or later |

209| `worktree.name` | Name of the active worktree. Present only while the session is in a [worktree session](https://code.claude.com/docs/en/worktrees.md) |221| `worktree.name` | Name of the active worktree. Present only while the session is in a [worktree session](https://code.claude.com/docs/en/worktrees.md) |

210| `worktree.path` | Absolute path to the worktree directory |222| `worktree.path` | Absolute path to the worktree directory |

211| `worktree.branch` | Git branch name for the worktree (for example, `"worktree-my-feature"`). Absent for hook-based worktrees |223| `worktree.branch` | Git branch name for the worktree (for example, `"worktree-my-feature"`). Absent for hook-based worktrees |


367 379 

368For what the cache fields mean and how they're billed, see [check cache performance](https://code.claude.com/docs/en/prompt-caching.md#check-cache-performance).380For what the cache fields mean and how they're billed, see [check cache performance](https://code.claude.com/docs/en/prompt-caching.md#check-cache-performance).

369 381 

370The `used_percentage` field is calculated from input tokens only: `input_tokens + cache_creation_input_tokens + cache_read_input_tokens`. It does not include `output_tokens`.382The `used_percentage` field is calculated from input tokens only: `input_tokens + cache_creation_input_tokens + cache_read_input_tokens`.

371 383 

372If you calculate context percentage manually from `current_usage`, use the same input-only formula to match `used_percentage`.384If you calculate context percentage manually from `current_usage`, use the same input-only formula to match `used_percentage`.

373 385 


1167 1179 

1168* System notifications like MCP server errors and auto-updates display on the right side of the row. Transient notifications such as the context-low warning also cycle through this area.1180* System notifications like MCP server errors and auto-updates display on the right side of the row. Transient notifications such as the context-low warning also cycle through this area.

1169* Enabling verbose mode adds a token counter to this area, showing the size of your context as the last API response reported it, not the [per-turn count beside the spinner](https://code.claude.com/docs/en/costs.md#read-the-token-count-beside-the-spinner)1181* Enabling verbose mode adds a token counter to this area, showing the size of your context as the last API response reported it, not the [per-turn count beside the spinner](https://code.claude.com/docs/en/costs.md#read-the-token-count-beside-the-spinner)

1170* On narrow terminals, these notifications may truncate your status line output1182* When a notification doesn't fit beside your status line, the notification moves to a row below

sub-agents.md +4 −4

Details

624 624 

625 If a subagent asks for permission while the main conversation is in `bypassPermissions`, check whether its tool call is one of the [actions no mode auto-approves](https://code.claude.com/docs/en/permission-modes.md#actions-no-mode-auto-approves).625 If a subagent asks for permission while the main conversation is in `bypassPermissions`, check whether its tool call is one of the [actions no mode auto-approves](https://code.claude.com/docs/en/permission-modes.md#actions-no-mode-auto-approves).

626* When the main conversation is in `plan` mode, the subagent stays in plan mode whichever `permissionMode` you set, unless it runs as an [agent team teammate](#subagent-names) under the [agent teams rules](https://code.claude.com/docs/en/agent-teams.md#have-teammates-plan-before-implementing). If you set `dontAsk`, the subagent also doesn't prompt you: an action that plan mode would ask you to approve is denied instead.626* When the main conversation is in `plan` mode, the subagent stays in plan mode whichever `permissionMode` you set, unless it runs as an [agent team teammate](#subagent-names) under the [agent teams rules](https://code.claude.com/docs/en/agent-teams.md#have-teammates-plan-before-implementing). If you set `dontAsk`, the subagent also doesn't prompt you: an action that plan mode would ask you to approve is denied instead.

627* When the main conversation is in `default` or `dontAsk` mode, the subagent runs in the permission mode you set. It keeps the main conversation's permission mode instead in these cases:627* When the main conversation is in `default` or `dontAsk` mode, the subagent runs in the permission mode you set. It keeps the main conversation's permission mode instead in cases such as these:

628 * You set `bypassPermissions`. The `bypassPermissions` exception requires Claude Code v2.1.267 or later.628 * You set `bypassPermissions`. The `bypassPermissions` exception requires Claude Code v2.1.267 or later.

629 * You set `auto` and [auto mode isn't available](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) to the subagent, such as when a settings file sets [`disableAutoMode`](https://code.claude.com/docs/en/settings-reference#disableautomode) or the subagent's model doesn't support auto mode.629 * You set `auto` and [auto mode isn't available](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) to the subagent, such as when a settings file sets [`disableAutoMode`](https://code.claude.com/docs/en/settings-reference#disableautomode) or the subagent's model doesn't support auto mode.

630 630 


1150 1150 

1151#### Resume subagents1151#### Resume subagents

1152 1152 

1153Each subagent invocation creates a new instance rather than continuing an earlier one. To continue an existing subagent's work instead of starting over, ask Claude to resume it.1153Each subagent invocation creates a new instance rather than continuing an earlier one. To continue an existing subagent's work, ask Claude to resume it.

1154 1154 

1155Resumed subagents retain their full conversation history, including all previous tool calls, results, and reasoning. If the subagent spawned [background subagents of its own](#let-subagents-spawn-their-own-subagents), that history includes the results they delivered while it ran. Before v2.1.304, a subagent that Claude messaged or resumed right after it finished could forget its most recent work.1155Resumed subagents retain their full conversation history, including all previous tool calls, results, and reasoning. If the subagent spawned [background subagents of its own](#let-subagents-spawn-their-own-subagents), that history includes the results they delivered while it ran. Before v2.1.304, a subagent that Claude messaged or resumed right after it finished could forget its most recent work.

1156 1156 


1158* For work you'll continue later, use `general-purpose` or a custom subagent. The built-in Explore and Plan agents can finish without giving Claude an ID to resume them with.1158* For work you'll continue later, use `general-purpose` or a custom subagent. The built-in Explore and Plan agents can finish without giving Claude an ID to resume them with.

1159* When a subagent stops at its [`maxTurns`](#supported-frontmatter-fields) limit, Claude Code marks the returned output as partial, and Claude can resume the subagent to continue its work.1159* When a subagent stops at its [`maxTurns`](#supported-frontmatter-fields) limit, Claude Code marks the returned output as partial, and Claude can resume the subagent to continue its work.

1160 1160 

1161Claude uses the `SendMessage` tool with the agent's ID or name as the `to` field to resume it. `SendMessage` doesn't require [agent teams](https://code.claude.com/docs/en/agent-teams.md) to be enabled; only structured team-protocol messages such as `shutdown_request` and `plan_approval_response` do. Beyond subagents and teammates, in sessions where cross-session messaging is enabled, Claude can use the same tool to message [your other Claude Code sessions](https://code.claude.com/docs/en/cross-session-messaging.md), on this machine or [beyond it](https://code.claude.com/docs/en/cross-session-messaging.md#message-sessions-on-other-machines).1161Claude uses the `SendMessage` tool with the agent's ID or name as the `to` field to resume it. `SendMessage` doesn't require [agent teams](https://code.claude.com/docs/en/agent-teams.md) to be enabled. Only structured team-protocol messages such as `shutdown_request` and `plan_approval_response` require them.

1162 1162 

1163To resume a subagent, ask Claude to continue the previous work:1163To resume a subagent, ask Claude to continue the previous work:

1164 1164 


1170[Claude resumes the subagent with full context from previous conversation]1170[Claude resumes the subagent with full context from previous conversation]

1171```1171```

1172 1172 

1173When Claude sends a completed subagent a message with the `SendMessage` tool, the subagent resumes in the background without a new `Agent` invocation. The same applies to a subagent that Claude stopped with the `TaskStop` tool, once its stopped run has exited. The resumed run keeps the [tool set from where the subagent first ran](#run-subagents-in-foreground-or-background) and can keep reading the [prompt cache the original run warmed](https://code.claude.com/docs/en/prompt-caching.md#subagents-and-the-cache).1173When Claude sends a completed subagent a message with the `SendMessage` tool, the subagent can resume in the background without a new `Agent` invocation. The same applies to a subagent that Claude stopped with the `TaskStop` tool, once its stopped run has exited. The resumed run keeps the [tool set from where the subagent first ran](#run-subagents-in-foreground-or-background) and can keep reading the [prompt cache the original run warmed](https://code.claude.com/docs/en/prompt-caching.md#subagents-and-the-cache).

1174 1174 

1175A subagent that has the `SendMessage` tool can send that message too. In an interactive session, the resumed agent then reports back to the subagent that resumed it, not to your main conversation. That subagent waits for the result before finishing its own work. When a subagent messages an agent it reports to, such as its own launcher, Claude Code resumes that agent without redirecting its results.1175A subagent that has the `SendMessage` tool can send that message too. In an interactive session, the resumed agent then reports back to the subagent that resumed it, not to your main conversation. That subagent waits for the result before finishing its own work. When a subagent messages an agent it reports to, such as its own launcher, Claude Code resumes that agent without redirecting its results.

1176 1176 

Details

6 6 

7> Fix Shift+Enter for newlines, get a terminal bell when Claude finishes, configure tmux, match the color theme, and enable Vim mode in the Claude Code CLI.7> Fix Shift+Enter for newlines, get a terminal bell when Claude finishes, configure tmux, match the color theme, and enable Vim mode in the Claude Code CLI.

8 8 

9Claude Code works in any terminal without configuration. This page is for when something specific is not behaving the way you expect. Find your symptom below. If everything already feels right, you do not need this page.9Claude Code works in any terminal without configuration. This page is for when something specific isn't behaving the way you expect. Find your symptom below.

10 10 

11* [Shift+Enter submits instead of inserting a newline](#enter-multiline-prompts)11* [Shift+Enter submits instead of inserting a newline](#enter-multiline-prompts)

12* [Option-key shortcuts do nothing on macOS](#enable-option-key-shortcuts-on-macos)12* [Option-key shortcuts do nothing on macOS](#enable-option-key-shortcuts-on-macos)


41* If Claude Code can't read or parse the keymap, can't back it up, or can't verify the merged result, it [leaves the file unchanged and prints the keybinding block to add yourself](https://code.claude.com/docs/en/errors.md#terminal-setup-left-your-zed-keymap-unchanged)41* If Claude Code can't read or parse the keymap, can't back it up, or can't verify the merged result, it [leaves the file unchanged and prints the keybinding block to add yourself](https://code.claude.com/docs/en/errors.md#terminal-setup-left-your-zed-keymap-unchanged)

42* If the keymap is a symlink, [add the keybinding yourself](https://code.claude.com/docs/en/errors.md#terminal-setup-left-your-zed-keymap-unchanged)42* If the keymap is a symlink, [add the keybinding yourself](https://code.claude.com/docs/en/errors.md#terminal-setup-left-your-zed-keymap-unchanged)

43 43 

44If you are running inside tmux, Shift+Enter also requires the [tmux configuration below](#configure-tmux) even when the outer terminal supports it.44If you are running inside tmux, Shift+Enter also requires the [tmux configuration below](#configure-tmux).

45 45 

46To bind newline to a different key, or to swap behavior so Enter inserts a newline and Shift+Enter submits, map the `chat:newline` and `chat:submit` actions in your [keybindings file](https://code.claude.com/docs/en/keybindings.md).46To bind newline to a different key, or to swap behavior so Enter inserts a newline and Shift+Enter submits, map the `chat:newline` and `chat:submit` actions in your [keybindings file](https://code.claude.com/docs/en/keybindings.md).

47 47 


169| `base` | string | Built-in preset the theme starts from: `dark`, `light`, `dark-daltonized`, `light-daltonized`, `dark-ansi`, or `light-ansi`. Defaults to `dark` |169| `base` | string | Built-in preset the theme starts from: `dark`, `light`, `dark-daltonized`, `light-daltonized`, `dark-ansi`, or `light-ansi`. Defaults to `dark` |

170| `overrides` | object | Map of color token names to color values. Tokens not listed here fall through to the base preset |170| `overrides` | object | Map of color token names to color values. Tokens not listed here fall through to the base preset |

171 171 

172Color values accept `#rrggbb`, `#rgb`, `rgb(r,g,b)`, `ansi256(n)`, or `ansi:<name>` where `<name>` is one of the 16 standard ANSI color names such as `red` or `cyanBright`. Unknown tokens and invalid color values are ignored, so a typo cannot break rendering.172Color values accept `#rrggbb`, `#rgb`, `rgb(r,g,b)`, `ansi256(n)`, or `ansi:<name>` where `<name>` is one of the 16 standard ANSI color names such as `red` or `cyanBright`. Unknown tokens and invalid color values are ignored.

173 173 

174The following example defines a theme that keeps the dark preset but recolors the prompt accent, error text, and success text:174The following example defines a theme that keeps the dark preset but recolors the prompt accent, error text, and success text:

175 175 


185}185}

186```186```

187 187 

188Claude Code watches `~/.claude/themes/` and reloads when a file is added or changed, so edits made in your editor apply to a running session without a restart. If the `~/.claude/themes/` folder itself didn't exist when Claude Code started, restart once after creating your first theme file. After that, changes apply without a restart.188Claude Code watches `~/.claude/themes/` and reloads when a file is added or changed, so edits made in your editor apply to a running session without a restart. If the `~/.claude/themes/` folder itself didn't exist when Claude Code started, restart once after creating your first theme file.

189 189 

190The reference below covers the tokens you can set in `overrides`. The interactive editor in `/theme` shows the same tokens with a live preview, plus a few single-purpose accents such as onboarding screen colors that are omitted here.190The reference below covers the tokens you can set in `overrides`. The interactive editor in `/theme` shows the same tokens with a live preview, plus a few single-purpose accents such as onboarding screen colors that are omitted here.

191 191 

Details

141 141 

142## Configure proxies and gateways142## Configure proxies and gateways

143 143 

144Most organizations can use a cloud provider directly without additional configuration. However, you may need to configure a corporate proxy or LLM gateway if your organization has specific network or management requirements. These are different configurations that can be used together:144You may need to configure a corporate proxy or LLM gateway if your organization has specific network or management requirements. These are different configurations that can be used together:

145 145 

146* **Corporate proxy**: Routes traffic through an HTTP/HTTPS proxy. Use this if your organization requires all outbound traffic to pass through a proxy server for security monitoring, compliance, or network policy enforcement. Configure with the `HTTPS_PROXY` or `HTTP_PROXY` environment variables. Learn more in [Enterprise network configuration](https://code.claude.com/docs/en/network-config.md).146* **Corporate proxy**: Routes traffic through an HTTP/HTTPS proxy. Use this if your organization requires all outbound traffic to pass through a proxy server for security monitoring, compliance, or network policy enforcement. Configure with the `HTTPS_PROXY` or `HTTP_PROXY` environment variables. Learn more in [Enterprise network configuration](https://code.claude.com/docs/en/network-config.md).

147* **LLM Gateway**: A service that sits between Claude Code and the cloud provider to handle authentication and routing. Use this if you need centralized usage tracking across teams, custom rate limiting or budgets, or centralized authentication management. Configure with the `ANTHROPIC_BASE_URL`, `ANTHROPIC_BEDROCK_BASE_URL`, `ANTHROPIC_AWS_BASE_URL`, `ANTHROPIC_VERTEX_BASE_URL`, or `ANTHROPIC_FOUNDRY_BASE_URL` environment variables. Learn more in [LLM gateways](https://code.claude.com/docs/en/llm-gateway).147* **LLM Gateway**: A service that sits between Claude Code and the cloud provider to handle authentication and routing. Use this if you need centralized usage tracking across teams, custom rate limiting or budgets, or centralized authentication management. Configure with the `ANTHROPIC_BASE_URL`, `ANTHROPIC_BEDROCK_BASE_URL`, `ANTHROPIC_AWS_BASE_URL`, `ANTHROPIC_VERTEX_BASE_URL`, or `ANTHROPIC_FOUNDRY_BASE_URL` environment variables. Learn more in [LLM gateways](https://code.claude.com/docs/en/llm-gateway).

Details

4 4 

5# Tools reference5# Tools reference

6 6 

7> Complete reference for the tools Claude Code can use, including permission requirements and per-tool behavior.7> Reference for the tools Claude Code can use, including permission requirements and per-tool behavior.

8 8 

9Claude Code has access to a set of built-in tools that help it understand and modify your codebase. The tool names are the exact strings you use in [permission rules](https://code.claude.com/docs/en/permissions.md#tool-specific-permission-rules), [subagent tool lists](https://code.claude.com/docs/en/sub-agents.md), and [hook matchers](https://code.claude.com/docs/en/hooks.md).9Claude Code has access to a set of built-in tools that help it understand and modify your codebase. The tool names are the exact strings you use in [permission rules](https://code.claude.com/docs/en/permissions.md#tool-specific-permission-rules), [subagent tool lists](https://code.claude.com/docs/en/sub-agents.md), and [hook matchers](https://code.claude.com/docs/en/hooks.md).

10 10 

Details

274> ls -la ~/.local/bin/claude274> ls -la ~/.local/bin/claude

275> ```275> ```

276>276>

277> A native install shows a symlink into `~/.local/share/claude/versions/`. A script or a symlink you created yourself at this path is a custom launcher, which [auto-update leaves in place](https://code.claude.com/docs/en/setup.md#auto-updates).277> A native install shows a symlink into `~/.local/share/claude/versions/`. If you put your own launcher at this path, see [Custom launchers](https://code.claude.com/docs/en/setup.md#custom-launchers).

278>278>

279> If either `ls` command prints `No such file or directory`, that's not an error. It means nothing is installed at that location, so move on to the next check.279> If either `ls` command prints `No such file or directory`, that's not an error. It means nothing is installed at that location, so move on to the next check.

280>280>

Details

871. Press Ctrl+C to attempt to cancel the current operation871. Press Ctrl+C to attempt to cancel the current operation

882. If unresponsive, you may need to close the terminal and restart882. If unresponsive, you may need to close the terminal and restart

89 89 

90Restarting doesn't lose your conversation. Run `claude --resume` in the same directory to pick the session back up.90Run `claude --resume` in the same directory to pick the session back up.

91 91 

92### Garbled or corrupted text in an editor's integrated terminal92### Garbled or corrupted text in an editor's integrated terminal

93 93 


180 180 

181### Slow or incomplete search results on WSL181### Slow or incomplete search results on WSL

182 182 

183Disk read performance penalties when [working across file systems on WSL](https://learn.microsoft.com/en-us/windows/wsl/filesystems) may result in fewer-than-expected matches when using Claude Code on WSL. Search still functions, but returns fewer results than on a native filesystem.183Disk read performance penalties when [working across file systems on WSL](https://learn.microsoft.com/en-us/windows/wsl/filesystems) may result in fewer-than-expected matches when using Claude Code on WSL.

184 184 

185> [!NOTE]185> [!NOTE]

186>186>

vs-code.md +1 −1

Details

857 857 

858Because the extension exposes the transcript as a labeled region, you can also move focus to the transcript itself with `Tab` and read it at your own pace. To move focus to the newest message or a waiting permission prompt instead, run **Claude Code: Focus last message** from the [Command Palette](#vs-code-commands-and-shortcuts).858Because the extension exposes the transcript as a labeled region, you can also move focus to the transcript itself with `Tab` and read it at your own pace. To move focus to the newest message or a waiting permission prompt instead, run **Claude Code: Focus last message** from the [Command Palette](#vs-code-commands-and-shortcuts).

859 859 

860When a permission prompt option saves a permission rule or directory access, its label ends by naming where the approval is saved, such as "all projects" or "this session". To change the destination:860When a permission prompt option saves a permission rule or directory access, its label names where the approval is saved, such as "all projects" or "this session". To change the destination:

861 861 

862* With that option focused, press the `Left` or `Right` arrow key. The extension announces each destination as you move to it. The arrow keys require Claude Code v2.1.268 or later.862* With that option focused, press the `Left` or `Right` arrow key. The extension announces each destination as you move to it. The arrow keys require Claude Code v2.1.268 or later.

863* Click the destination in the label.863* Click the destination in the label.

workflows.md +15 −3

Details

122 122 

123#### Dismiss or turn off the keyword123#### Dismiss or turn off the keyword

124 124 

125If you didn't mean to start a workflow, press `Option+W` on macOS or `Alt+W` on Windows and Linux to dismiss the highlight for this prompt, or press backspace while the cursor is right after the highlighted keyword. To stop the keyword from triggering at all, turn off Ultracode keyword trigger in `/config`.125To use the word `ultracode` without asking for a workflow, skip the keyword for one prompt or turn the keyword off for every prompt:

126 

127* **One prompt, as you type**: put the word in backticks.

128 

129 For example, this prompt is a regular request to search your files:

130 

131 ```text wrap theme={null}

132 find every file that mentions `ultracode`

133 ```

134* **One prompt, already highlighted in your terminal**: press Backspace right after the word, or press `Alt+W`. On macOS, that key is `Option+W` with [Option as Meta](https://code.claude.com/docs/en/terminal-config.md#enable-option-key-shortcuts-on-macos).

135* **Every prompt**: turn off [**Ultracode keyword trigger**](https://code.claude.com/docs/en/settings-reference.md#workflowkeywordtriggerenabled) in `/config`.

126 136 

127#### Where the keyword works137#### Where the keyword works

128 138 


223Run /triage-issues on issues 1024, 1025, and 1030233Run /triage-issues on issues 1024, 1025, and 1030

224```234```

225 235 

226Claude passes the list as structured data, so the script can call array and object methods on `args` directly without parsing it first. If `args` is omitted, the global is `undefined` inside the script.236Claude passes the list as structured data, so the script can call array and object methods on `args` directly. If `args` is omitted, the global is `undefined` inside the script.

227 237 

228## Example workflow prompts238## Example workflow prompts

229 239 


279 289 

280### What the saved script looks like290### What the saved script looks like

281 291 

282When you [save a workflow](#save-the-workflow-for-reuse), the file in `.claude/workflows/` holds a `meta` block followed by a script body that orchestrates subagents. You usually don't need to edit it, but here is the shape of a small one so you can recognize what Claude generated:292When you [save a workflow](#save-the-workflow-for-reuse), the file in `.claude/workflows/` holds a `meta` block followed by a script body that orchestrates subagents.

293 

294Here is the shape of a small one so you can recognize what Claude generated:

283 295 

284```javascript theme={null}296```javascript theme={null}

285export const meta = {297export const meta = {

worktrees.md +2 −2

Details

145 145 

146Claude Code runs a periodic sweep that removes worktrees that Claude created for subagents and [background sessions](https://code.claude.com/docs/en/agent-view.md#how-file-edits-are-isolated) once they are older than your [`cleanupPeriodDays`](https://code.claude.com/docs/en/settings-reference#cleanupperioddays) setting, following the [retention sweep rules](https://code.claude.com/docs/en/claude-directory.md#cleaned-up-automatically).146Claude Code runs a periodic sweep that removes worktrees that Claude created for subagents and [background sessions](https://code.claude.com/docs/en/agent-view.md#how-file-edits-are-isolated) once they are older than your [`cleanupPeriodDays`](https://code.claude.com/docs/en/settings-reference#cleanupperioddays) setting, following the [retention sweep rules](https://code.claude.com/docs/en/claude-directory.md#cleaned-up-automatically).

147 147 

148When 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 these cases:148When 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:

149 149 

150* The worktree still holds work: changed or untracked files, or unpushed commits.150* The worktree still holds work: changed or untracked files, or unpushed commits.

151* 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.151* 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.


257A worktree gets its own files and branch, but it shares the following with the main checkout:257A worktree gets its own files and branch, but it shares the following with the main checkout:

258 258 

259* **The repository's `.git` directory**: git commands in a worktree write to the main repository's shared `.git` directory. With the [sandbox](https://code.claude.com/docs/en/sandboxing.md#filesystem-isolation) enabled, commands such as `git commit` work in a session at the worktree's root, which is where `--worktree` starts one. By default, they [fail with an `index.lock` error if you run `claude` in a subdirectory of the worktree](https://code.claude.com/docs/en/sandboxing#git-index-lock).259* **The repository's `.git` directory**: git commands in a worktree write to the main repository's shared `.git` directory. With the [sandbox](https://code.claude.com/docs/en/sandboxing.md#filesystem-isolation) enabled, commands such as `git commit` work in a session at the worktree's root, which is where `--worktree` starts one. By default, they [fail with an `index.lock` error if you run `claude` in a subdirectory of the worktree](https://code.claude.com/docs/en/sandboxing#git-index-lock).

260* **Plugins**: plugins installed at [project scope](https://code.claude.com/docs/en/plugins/loading.md#find-where-a-plugin-is-enabled) from the main checkout also load in worktrees of the same repository, so you don't need to reinstall them per worktree.260* **Plugins**: plugins installed at [project scope](https://code.claude.com/docs/en/plugins/loading.md#find-where-a-plugin-is-enabled) from the main checkout also load in worktrees of the same repository.

261* **Permission approvals**: choosing "Yes, and don't ask again" for a Bash command in a worktree session saves the rule to the main checkout's `.claude/settings.local.json`. The rule applies in the main checkout and in every other worktree of the repository, and it survives the worktree's removal.261* **Permission approvals**: choosing "Yes, and don't ask again" for a Bash command in a worktree session saves the rule to the main checkout's `.claude/settings.local.json`. The rule applies in the main checkout and in every other worktree of the repository, and it survives the worktree's removal.

262 262 

263 On Windows and in the other cases where Claude Code [doesn't use the repository root](https://code.claude.com/docs/en/settings.md#where-claude-code-looks-for-each-file), the rule stays with that worktree. See [where approvals are saved](https://code.claude.com/docs/en/permissions.md#permission-system).263 On Windows and in the other cases where Claude Code [doesn't use the repository root](https://code.claude.com/docs/en/settings.md#where-claude-code-looks-for-each-file), the rule stays with that worktree. See [where approvals are saved](https://code.claude.com/docs/en/permissions.md#permission-system).