OmniscioGuidesExamplesTriage new issues
Claude Code Action: triage new issues
Save whichever workflow you pick as a file under .github/workflows/ in your repository — triage.yml will do — and it runs the next time someone opens an issue. Both need the Claude GitHub App installed and the ANTHROPIC_API_KEY secret; the setup guide covers that, or /install-github-app does it for you.
Two workflows follow. The first is Anthropic's published example, reproduced whole — and it will not work until you also copy three files into your repository. The second does the same job with nothing but the GitHub CLI, and is the one to paste if you want it running today.
Last checked against Anthropic's documentation and the action's examples on November 25, 2026. By the Omniscio team. Updated .
When it runs
On issues with the opened type: the moment an issue is created. Nothing else fires it, so the cost is one run per issue rather than one per comment.
Two other types are available on the same event if you want them later. assigned fires when an issue is assigned, and the action's assignee_trigger input narrows that to a particular user. labeled fires when a label is applied, which is how you make triage a person's decision rather than an automatic one.
Sources: the trigger in examples/issue-triage.yml; the event list in Custom Automations; the assignee_trigger and label_trigger rows in Usage. Read November 25, 2026.
Anthropic's workflow
This is examples/issue-triage.yml, whole, including its own warning comment.
name: Claude Issue Triage
description: Run Claude Code for issue triage in GitHub Actions
on:
issues:
types: [opened]
jobs:
triage-issue:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Run Claude Code for Issue Triage
uses: anthropics/claude-code-action@v1
with:
# NOTE: /label-issue requires .claude/commands/label-issue.md and scripts/edit-issue-labels.sh in your repo (see this repo for examples)
prompt: "/label-issue REPO: ${{ github.repository }} ISSUE_NUMBER: ${{ github.event.issue.number }}"
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
allowed_non_write_users: "*" # Required for issue triage workflow, if users without repo write access create issues
github_token: ${{ secrets.GITHUB_TOKEN }}Read that comment again, because it is the whole story of this page's common failure. The prompt is one slash command, /label-issue, and the command lives in the action's own repository, together with two scripts it calls: scripts/edit-issue-labels.sh applies the labels, and scripts/gh.sh is the wrapper that lets the command read the repository. Copy the workflow into your repository and it starts, finds no such command, and stops.
The file also carries a top-level description: line, which is not one of the keys GitHub's workflow-syntax reference defines. Delete it if the Actions tab or your editor reports an unexpected key; nothing else in the file refers to it.
Source: examples/issue-triage.yml, read November 25, 2026.
The self-contained version
Same job, no helper files. Claude reads the issue, picks from the labels that already exist in your repository, applies them, and names a likely duplicate — all through the GitHub CLI, which is already installed on the runner image that the published examples call gh from.
name: Issue Triage
on:
issues:
types: [opened]
jobs:
triage:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Label the issue
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
allowed_non_write_users: "*"
prompt: |
ISSUE NUMBER: ${{ github.event.issue.number }}
Read issue #${{ github.event.issue.number }} with `gh issue view`, then:
1. Decide whether it is a bug report, a feature request or a question.
2. Decide a priority: critical, high, medium or low.
3. Run `gh label list` and use only labels that appear in that output.
4. Run `gh issue list --search` to check for an existing duplicate.
5. Apply one or two labels with `gh issue edit --add-label`.
6. If it looks like a duplicate, post one comment with `gh issue comment`
naming the other issue.
claude_args: |
--max-turns 12
--allowedTools "Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh issue edit:*),Bash(gh label list:*),Bash(gh issue comment:*)" Three things in that file are deliberate:
- The prompt carries a number, not the issue text. Anyone can open an issue, so its title and body are an outsider's words. Passing only the number and letting Claude read the rest with
gh issue viewis what Anthropic's own triage prompt does. - Step 3 is there because the CLI cannot invent labels.
gh label listprints the labels your repository has, so the names Claude applies are ones that exist.gh issue editonly takes a label name; there is no flag that creates one. --max-turns 12leaves room for six steps. A cap that lands mid-task ends the run with nothing applied and still exits green, which is the hardest kind of run to notice. Triage is short, but not two turns short.
Sources: "Issue Auto-Triage and Labeling" in Solutions for the number-only prompt and label workflow; gh issue edit for --add-label; gh issue list for --search; gh issue view. Read November 25, 2026.
What each key does
| Key | What it does here |
|---|---|
timeout-minutes: 10 | Stops a stuck job after ten minutes. Anthropic's published file sets it on the job, which bounds everything the job does rather than one step. |
contents: read | The checkout. The first workflow needs it to read its slash command and scripts; in the second it puts your CLAUDE.md on the runner, which is context worth having when Claude decides what a bug report is. |
issues: write | The only write the job needs: labels and comments. |
prompt | Its presence puts the action in automation mode. It names the issue number and the steps, nothing else. |
allowed_non_write_users | Lets a person without write access trigger the run — necessary here, because the person opening an issue almost never has it. Only works together with github_token. |
github_token | ${{ secrets.GITHUB_TOKEN }}, GitHub's automatic workflow token, scoped to the permissions the job declares and expiring when the job ends. Anthropic is explicit: use this token here, never a personal access token. |
claude_args | --allowedTools names the five gh subcommands the prompt uses, so each one runs without an approval prompt that nobody is there to answer. |
Sources: the input rows for allowed_non_write_users and github_token in Usage; "Access Control" in the Security guide; "Manage costs" in Anthropic's GitHub Actions page. Read November 25, 2026.
Secrets and permissions
ANTHROPIC_API_KEY— the usual credential. A subscription token works the same way: swap the input forclaude_code_oauth_token.GITHUB_TOKEN— not a secret you create. GitHub injects it, and it is available assecrets.GITHUB_TOKEN. It is what makesallowed_non_write_userswork.contents: readandissues: write— the two scopes this job declares. A triage workflow needs nothing else, and that narrowness is the main defence onceallowed_non_write_usersis on.- No
id-token: write— becausegithub_tokenis passed, the action does not do the GitHub App exchange. This is the one example here where the App is not in play.
The risk you are accepting. allowed_non_write_users bypasses the action's primary check: on a public repository, anyone who can open an issue can spend your tokens, and an issue's text can try to steer the run. Anthropic calls it a significant risk and says to use it only where the workflow's own permissions are extremely limited — this one's are — and to allow only the commands the job needs.
Two ways to narrow it. Instead of "*", list the people you trust: allowed_non_write_users: "alice,bob" — the input is comma-separated. And Bash(gh issue edit:*) is wider than labelling: it also permits retitling and rewriting any issue's body. If that matters to you, drop it and give Claude the narrower route instead, or keep the helper script, which accepts only --add-label and --remove-label and reads the issue number from the event rather than the prompt.
The input also keeps the earlier permission defaults instead of auto mode, which is why every gh command the prompt uses is named in claude_args.
Sources: "⚠️ Non-Write User Access (RISKY)" in the Security guide; "Permission Mode" in Usage. Read November 25, 2026.
How to confirm it ran
- On the issue. Labels appear in the sidebar, and a duplicate comment arrives on the thread. That is the output; there is no tracking comment, because automation mode does not create one by default.
- In the Actions tab. One run per opened issue, under the workflow's name. If no run appears at all, the event did not reach the workflow: check that issues are enabled for the repository and that the file is on the default branch, where GitHub looks for workflows.
- In the run log. The full trace, including which
ghcommands were attempted. This is where a refused command shows up — a green run that labelled nothing is usually a tool that was not allowed.
Sources: "Mode Detection & Tracking Comments" in Custom Automations; "How can I debug what Claude is doing?" in the FAQ. Read November 25, 2026.
The common failure
The published example fails on /label-issue. Its prompt is a slash command defined in the action's repository, not yours. The YAML's own comment says what it needs: .claude/commands/label-issue.md and scripts/edit-issue-labels.sh. Either copy those two files in, or use the self-contained workflow above.
Two more, both of which look like Claude misbehaving and are not:
- The run is refused as not permitted. Whoever opened the issue has no write access, and
allowed_non_write_usersis missing or set withoutgithub_token. The input only works together with that token. - Claude answers but no label is applied. Either the tool was never allowed, or the name it chose is not a label you have.
gh issue edittakes a label name and has no flag that creates one, which is what step 3'sgh label listprevents.
Sources: the inline note in examples/issue-triage.yml; "Why does Claude say I don't have permission to trigger it?" in the FAQ; the allowed_non_write_users row in Usage; gh issue edit. Read November 25, 2026.
Where these answers come from
- examples/issue-triage.yml — the first workflow on this page, reproduced whole.
- Solutions & Use Cases — "Issue Auto-Triage and Labeling", the source of the number-only prompt and the tool list.
- Usage —
allowed_non_write_users,github_token,assignee_trigger,label_trigger, and the permission mode. - Security — why
allowed_non_write_usersis risky and how to narrow it. - gh issue edit, gh issue list, gh issue view, gh issue comment and gh label list — every CLI flag the second workflow uses.
- Setup, and what the other four workflows look like: Claude Code GitHub Actions and the examples hub.
Common questions
Why does triage never run when someone opens an issue?
Whoever opens an issue usually has no write access, and the action refuses a run whose triggering user has none. Triage needs allowed_non_write_users plus github_token: ${{ secrets.GITHUB_TOKEN }}.
Why does the published example fail on /label-issue?
That command and the two scripts it calls — scripts/edit-issue-labels.sh and scripts/gh.sh — must exist in your repository. They ship in the action's own repository. Copy all three in, or use the self-contained workflow that calls gh directly.
Is allowed_non_write_users safe?
Anthropic calls it a significant security risk, and it is the one input here you should not paste without reading this section. Keep the job's permissions minimal, allow only the commands it needs, and prefer a list of names to "*".
Can Claude label an issue without a helper script?
Yes. The GitHub CLI is on the runner, so gh label list, gh issue list --search and gh issue edit --add-label are enough once claude_args allows them.