You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you finish a turn — that is, you are stopping, **not** asking the user a question and **not** mid-task — end the response with a short `## Links` block: a one-glance, copy-pasteable index of everything actionable from the turn, so the reader doesn't have to scroll back through the work to find it.
6
+
7
+
## Critical Rules - ALWAYS FOLLOW
8
+
9
+
### 1. End a stopping turn with a `## Links` block
10
+
11
+
Include every link that is actionable or referenceable from the turn:
12
+
13
+
-**PRs / branches** — any PR opened this session AND any PR referenced in-context.
Group by type when there are several; omit a group that's empty. If there are genuinely no links, **skip the section entirely** — never emit an empty heading.
19
+
20
+
### 2. Always use full, clickable URLs — never bare IDs
21
+
22
+
- Render `https://github.com/<org>/<repo>/pull/1234`, not `#1234`.
23
+
- Whenever you reference an external component by ID or name in a summary (a monitor, dashboard, ticket, build job, etc.), link it directly — a bare ID forces the reader to go search for it. This applies to **every** summary that names such a component, not only the on-stop block.
24
+
25
+
### 3. Keep it a trailing index, not the answer
26
+
27
+
The `## Links` block sits **below** the substantive response and is just URLs plus a few words of label. Don't let it crowd out or replace the actual answer.
28
+
29
+
## Why
30
+
31
+
Readers act on these links immediately — open the PR, check the live dashboard, read the ticket. A trailing, grouped, fully-linked index turns "scroll back and reconstruct what was touched" into one glance, and avoids the common failure of citing a bare ID that the reader then has to hunt down.
@@ -1022,20 +1022,20 @@ This workflow does not have outputs (reviews are submitted directly to GitHub PR
1022
1022
1023
1023
**Note**: You must provide either `ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN`. The secrets must be passed explicitly from the calling workflow.
1024
1024
1025
-
#### Permissions Required (Fixed)
1025
+
#### Permissions Required (caller must grant these)
1026
1026
1027
-
These permissions are **fixed** in the reusable workflow and cannot be overridden:
1027
+
The **calling** workflow must grant its calling job at least these permissions. A reusable workflow cannot be granted more than its caller provides, so granting fewer (for example `contents: read` here) makes GitHub reject the run with a silent `startup_failure` (a ~1s run with no logs):
1028
1028
1029
1029
```yaml
1030
1030
permissions:
1031
1031
id-token: write # Required for OIDC authentication
1032
-
contents: read # Required to read repository code
1032
+
contents: write # Required to read code AND push commits when auto_fix is enabled
1033
1033
pull-requests: write # Required to comment and submit reviews
1034
1034
issues: read # Required to read PR discussions
1035
1035
actions: read # Required to check CI status
1036
1036
```
1037
1037
1038
-
**Note**: You do NOT need to specify these permissions in your calling workflow - they are automatically set by the reusable workflow.
1038
+
**Note**: These must be declared on the calling job. See `.github/workflows/examples/08-claude-code-review-basic.yml` for a complete caller.
Copy file name to clipboardExpand all lines: .github/workflows/_claude-code-review.yml
+54-11Lines changed: 54 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -37,8 +37,10 @@ name: "[claude] Claude Code Review"
37
37
# event when re-requesting reviews from bot accounts. Use the comment trigger
38
38
# or manual workflow_dispatch instead.
39
39
#
40
-
# PERMISSIONS REQUIRED (calling workflow must grant these):
41
-
# contents: read
40
+
# PERMISSIONS REQUIRED (the calling workflow must grant its calling job at least these;
41
+
# a reusable workflow cannot be granted more than its caller provides, so granting fewer
42
+
# causes a silent startup_failure: a ~1s run with no logs):
43
+
# contents: write # read code AND push commits when auto_fix is enabled
42
44
# pull-requests: write
43
45
# issues: read
44
46
# actions: read
@@ -251,6 +253,14 @@ on:
251
253
description: "Personal Access Token with repo scope. Required for: (1) resolving review threads via GraphQL API, and (2) auto-fix pushes that trigger subsequent workflow runs. Falls back to GITHUB_TOKEN if not provided, but auto-fix pushes with GITHUB_TOKEN will NOT trigger new workflow runs."
252
254
required: false
253
255
256
+
# Disable Bun's automatic bunfig.toml loading from CWD. This workflow runs
257
+
# `bun run` against post-review scripts; if a caller checks out PR head
258
+
# content first, `bun run` would auto-load bunfig.toml from the checkout
259
+
# root and `bunfig.toml.preload` would execute arbitrary code with the
260
+
# caller's secrets. Propagates to all jobs and steps in this workflow.
261
+
env:
262
+
BUN_CONFIG_FILE: /dev/null
263
+
254
264
jobs:
255
265
claude-review:
256
266
runs-on: ubuntu-latest
@@ -262,7 +272,11 @@ jobs:
262
272
NODE_OPTIONS: ""
263
273
NPM_CONFIG_REGISTRY: ""
264
274
NODE_PATH: ""
265
-
# Fixed permissions (cannot be overridden by calling workflow)
275
+
# Permissions the CALLING workflow must grant its calling job (matching or higher).
276
+
# A reusable workflow cannot be granted more than its caller provides, so a caller that
277
+
# declares fewer (e.g. contents: read when this needs contents: write for auto_fix pushes)
278
+
# makes GitHub reject the run with a silent startup_failure: a ~1s run with no logs.
279
+
# See .github/workflows/examples/08-claude-code-review-basic.yml for a correct caller.
266
280
permissions:
267
281
id-token: write # Required for OIDC
268
282
contents: write # Required to read code and push fixes when auto_fix is enabled
@@ -275,22 +289,51 @@ jobs:
275
289
# via attacker-controlled config files (bunfig.toml, .npmrc, etc.) in fork PRs.
276
290
# If a legitimate host is missing, the workflow will fail loudly — update the
277
291
# allowlist rather than switching back to audit mode.
292
+
# Per .github/workflows/CLAUDE.md, bullfrog must be the FIRST step in
293
+
# every job on a non-macOS runner ("no exceptions"), so it runs before
294
+
# the toolkit_ref validation below. Ordering is safe: bullfrog does not
295
+
# consume toolkit_ref, and the validation runs before any step that
296
+
# downloads action.yml or post-*.ts content using it.
0 commit comments