4 4
5# Claude Code GitHub Actions5# Claude Code GitHub Actions
6 6
7> Learn about integrating Claude Code into your development workflow with Claude Code GitHub Actions7> Run Claude Code in GitHub Actions workflows to respond to @claude mentions, automate tasks, and turn issues into pull requests
8 8
9Claude Code GitHub Actions brings AI-powered automation to your GitHub workflow. With a simple `@claude` mention in any PR or issue, Claude can analyze your code, create pull requests, implement features, and fix bugs - all while following your project's standards. For automatic reviews posted on every PR without a trigger, see [GitHub Code Review](/en/code-review).9[Claude Code GitHub Actions](https://github.com/anthropics/claude-code-action) is a GitHub Action that runs Claude Code inside your repository's workflows. Mention `@claude` in a pull request or issue comment to have Claude analyze code, implement changes, and push commits. You can also give the Claude Code GitHub Action a prompt to run automatically on any GitHub event. Use it to turn issues into pull requests, fix bugs from a comment, or automate recurring tasks.
10 10
11<Note>11Several products share the Claude Code name. This page covers the `claude-code-action` workflow integration, which you configure with workflow files in your repository. For the related products, see:
12 Claude Code GitHub Actions is built on top of the [Claude Agent SDK](/en/agent-sdk/overview), which enables programmatic integration of Claude Code into your applications. You can use the SDK to build custom automation workflows beyond GitHub Actions.
13</Note>
14 12
15## Why use Claude Code GitHub Actions?13* [Code Review](/docs/en/code-review): automatic review on every pull request, without writing a workflow
14* [Claude Code on the web](/docs/en/claude-code-on-the-web): Claude Code sessions from your browser or phone
15* [Claude Agent SDK](/docs/en/agent-sdk/overview): custom automation outside GitHub Actions. The Claude Code GitHub Action is built on the SDK
16* [GitHub Enterprise Server](/docs/en/github-enterprise-server): Claude Code with self-hosted GitHub
16 17
17* **Instant PR creation**: Describe what you need, and Claude creates a complete PR with all necessary changes18## Setup
18* **Automated code implementation**: Turn issues into working code with a single command
19* **Follows your standards**: Claude respects your `CLAUDE.md` guidelines and existing code patterns
20* **Simple setup**: Get started in minutes with our installer and API key
21* **Secure by default**: Your code stays on Github's runners
22 19
23## What can Claude do?20You can set up the Claude Code GitHub Action in one of two ways:
24 21
25Claude Code provides a powerful GitHub Action that transforms how you work with code:22* **Quick setup**: run `/install-github-app` from Claude Code. Claude Code installs the GitHub App, adds your authentication secret, and prepares the workflow pull request for you
23* **Manual setup**: install the app, add the secret, and copy the workflow file into your repository yourself. Use this path when you don't run Claude Code locally, when the command fails, or when you want full control of the workflow files
26 24
27### Claude Code Action25For either path, you need admin access to the repository.
28 26
29This GitHub Action allows you to run Claude Code within your GitHub Actions workflows. You can use this to build any custom workflow on top of Claude Code.27### Quick setup
30 28
31[View repository →](https://github.com/anthropics/claude-code-action)29Before you start, install the [GitHub CLI](https://cli.github.com) and authenticate it with `gh auth login`. Claude Code checks for it and warns you if it's missing.
32 30
33## Setup31Open `claude` in the repository you want to connect, run `/install-github-app`, and follow the prompts. Claude Code installs the Claude GitHub App, then sets up an authentication secret for the workflows:
34 32
35## Quick setup33* If Claude Code already has an API key, it reuses that key, and offers to keep the repository's existing `ANTHROPIC_API_KEY` secret if one is already set
34* Otherwise, choose between creating a long-lived token with your Claude subscription and pasting in an API key
36 35
37Run `/install-github-app` in the Claude Code terminal to set up the integration interactively. The command installs the Claude GitHub App on your repository and then walks you through adding the GitHub Actions workflows and the API key secret.36Claude Code saves the credential as a repository secret, named `ANTHROPIC_API_KEY` for an API key or `CLAUDE_CODE_OAUTH_TOKEN` for a subscription token.
38 37
39After the GitHub App is installed, the command asks whether to continue with GitHub Actions setup. In Claude Code v2.1.187 and later you can choose **Skip for now** to stop with only the App installed and return to the workflow and secret steps by running `/install-github-app` again. Earlier versions proceed straight to workflow selection.38Claude Code then pushes a branch with the workflow files you select, already set to use that secret, and opens GitHub in your browser with a pull request ready to create. Create and merge that pull request, and `@claude` works in the repository.
39
40After installing the GitHub App, Claude Code asks whether to continue with GitHub Actions setup. Choose **Skip for now** to stop with only the GitHub App installed. Run `/install-github-app` again later to finish the workflow and secret steps. Before v2.1.187, Claude Code proceeded straight to workflow selection.
40 41
41<Note>42<Note>
42 * You must be a repository admin to install the GitHub app and add secrets43 * When you install the GitHub App, you grant it several permissions. See [GitHub App permissions](#github-app-permissions) for the full set
43 * The GitHub app will request read & write permissions for Contents, Issues, and Pull requests44 * Quick setup works with the Claude API and Claude subscriptions. If you use Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry, see [Use Claude Code GitHub Actions with cloud providers](/docs/en/github-actions-cloud-providers)
44 * This quickstart method is only available for direct Claude API users. If
45 you're using Amazon Bedrock or Google Cloud's Agent Platform, see the [Using
46 with Amazon Bedrock and Google Cloud](#using-with-amazon-bedrock-and-google-cloud)
47 section.
48</Note>45</Note>
49 46
50## Manual setup47### Manual setup
51 48
52If the `/install-github-app` command fails or you prefer manual setup, please follow these manual setup instructions:49To configure the Claude Code GitHub Action without running `/install-github-app`, install the app, add a secret, and copy a workflow file yourself:
53 50
541. **Install the Claude GitHub app** to your repository: [https://github.com/apps/claude](https://github.com/apps/claude)51<Steps>
52 <Step title="Install the Claude GitHub App">
53 Install the [Claude GitHub App](https://github.com/apps/claude) to your repository. The Claude Code GitHub Action relies on three of the app's permissions:
55 54
56 The Claude GitHub app requires the following repository permissions:55 * **Contents**: read and write, so Claude can modify repository files
56 * **Issues**: read and write, so Claude can respond to issues
57 * **Pull requests**: read and write, so Claude can create PRs and push changes
57 58
58 * **Contents**: Read & write (to modify repository files)59 During installation, you also grant permissions that other Claude features use. See [GitHub App permissions](#github-app-permissions) for the full set.
59 * **Issues**: Read & write (to respond to issues)60 </Step>
60 * **Pull requests**: Read & write (to create PRs and push changes)
61 61
62 For more details on security and permissions, see the [security documentation](https://github.com/anthropics/claude-code-action/blob/main/docs/security.md).62 <Step title="Add an authentication secret">
632. **Add ANTHROPIC\_API\_KEY** to your repository secrets ([Learn how to use secrets in GitHub Actions](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions))63 Add one of the following secrets to your repository, depending on how you authenticate. See GitHub's guide to [using secrets in GitHub Actions](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions).
643. **Copy the workflow file** from [examples/claude.yml](https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml) into your repository's `.github/workflows/`64
65 * `ANTHROPIC_API_KEY`: a Claude API key from the [Claude Console](https://console.anthropic.com)
66 * `CLAUDE_CODE_OAUTH_TOKEN`: an OAuth token that authenticates with your Claude subscription, available on Pro, Max, Team, and Enterprise plans. Generate one by running `claude setup-token` locally. See [Generate a long-lived token](/docs/en/authentication#generate-a-long-lived-token)
67
68 In workflow files, pass the secret to the matching input: `anthropic_api_key` for an API key, or `claude_code_oauth_token` for an OAuth token.
69 </Step>
70
71 <Step title="Copy the workflow file">
72 Copy [examples/claude.yml](https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml) into your repository's `.github/workflows/` directory. The file is a working workflow, not just an example. As committed, Claude responds whenever someone mentions `@claude` in an issue or pull request, authenticating with the `ANTHROPIC_API_KEY` secret. If you added `CLAUDE_CODE_OAUTH_TOKEN` instead, change the workflow's `anthropic_api_key` line to `claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}`.
73 </Step>
74</Steps>
65 75
66<Tip>76<Tip>
67 After completing either the quickstart or manual setup, test the action by tagging `@claude` in an issue or PR comment.77 After setup, test the Claude Code GitHub Action by tagging `@claude` in an issue or PR comment.
68</Tip>78</Tip>
69 79
70## Upgrading from Beta80### Set up for an organization
71 81
72<Warning>82With quick setup or manual setup, you configure one repository at a time. To roll the Claude Code GitHub Action out across an organization:
73 Claude Code GitHub Actions v1.0 introduces breaking changes that require updating your workflow files in order to upgrade to v1.0 from the beta version.
74</Warning>
75 83
76If you're currently using the beta version of Claude Code GitHub Actions, we recommend that you update your workflows to use the GA version. The new version simplifies configuration while adding powerful new features like automatic mode detection.84* Install the [Claude GitHub App](https://github.com/apps/claude) once at the organization level, choosing all repositories or a selected list
85* Store the authentication secret as an organization-level Actions secret so each repository doesn't need its own copy
86* Add the workflow file to each repository that should run the Claude Code GitHub Action, or define the job once as a [reusable workflow](https://docs.github.com/en/actions/using-workflows/reusing-workflows) that each repository calls
77 87
78### Essential changes88For a secret shared across repositories, authenticate with an API key from the [Claude Console](https://console.anthropic.com) rather than an OAuth token, since an OAuth token is tied to the subscription of the person who ran `claude setup-token`.
79 89
80All beta users must make these changes to their workflow files in order to upgrade:90To avoid storing a long-lived secret entirely, authenticate through workload identity federation, where the Claude Code GitHub Action exchanges the workflow's GitHub OpenID Connect (OIDC) token for Claude API access through a Claude Console service account. Set these inputs:
81 91
821. **Update the action version**: Change `@beta` to `@v1`92* `anthropic_federation_rule_id`: the federation rule ID, `fdrl_...`
832. **Remove mode configuration**: Delete `mode: "tag"` or `mode: "agent"` (now auto-detected)93* `anthropic_organization_id`: your Anthropic organization ID
843. **Update prompt inputs**: Replace `direct_prompt` with `prompt`94* `anthropic_service_account_id`: the service account ID, `svac_...`. Optional, since the federation rule you create in the Console already targets a service account
854. **Move CLI options**: Convert `max_turns`, `model`, `custom_instructions`, etc. to `claude_args`95* `anthropic_workspace_id`: the workspace ID, `wrkspc_...`. Optional when the federation rule targets a single workspace
86 96
87### Breaking Changes Reference97Grant the workflow the `id-token: write` permission, which the Claude Code GitHub Action needs for the federation exchange even when you pass your own `github_token`. See the [Claude Code GitHub Action's setup guide](https://github.com/anthropics/claude-code-action/blob/main/docs/setup.md) for the Console-side configuration.
88 98
89| Old Beta Input | New v1.0 Input |99For data handling and retention questions in a security review, see [data usage](/docs/en/data-usage) and [security](/docs/en/security).
90| --------------------- | ------------------------------------- |
91| `mode` | *(Removed - auto-detected)* |
92| `direct_prompt` | `prompt` |
93| `override_prompt` | `prompt` with GitHub variables |
94| `custom_instructions` | `claude_args: --append-system-prompt` |
95| `max_turns` | `claude_args: --max-turns` |
96| `model` | `claude_args: --model` |
97| `allowed_tools` | `claude_args: --allowedTools` |
98| `disallowed_tools` | `claude_args: --disallowedTools` |
99| `claude_env` | `settings` JSON format |
100 100
101### Before and After Example101### Uninstall
102 102
103**Beta version:**103To remove the Claude Code GitHub Action, undo each piece of the setup that applies to your installation:
104 104
105```yaml theme={null}105* **Workflow files**: delete the workflows that use `anthropics/claude-code-action` from `.github/workflows/`. If you used quick setup, look for `claude.yml` and, if you selected the review workflow, `claude-code-review.yml`. With the workflows deleted, the Claude Code GitHub Action no longer runs
106- uses: anthropics/claude-code-action@beta106* **Secrets**: delete the `ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN` secret from the repository, and from organization-level Actions secrets if you [shared it across repositories](#set-up-for-an-organization). If you delete a secret, the credential it held stays valid. To retire an API key entirely, also delete the key in the [Claude Console](https://console.anthropic.com)
107 with:107* **GitHub App**: uninstall the Claude GitHub App in your repository or organization settings under GitHub Apps, but only if you don't use it for another Claude feature, such as Code Review or web auto-fix
108 mode: "tag"
109 direct_prompt: "Review this PR for security issues"
110 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
111 custom_instructions: "Follow our coding standards"
112 max_turns: "10"
113 model: "claude-sonnet-5"
114```
115 108
116**GA version (v1.0):**109If you configured a [cloud provider](/docs/en/github-actions-cloud-providers), also delete the provider secrets, such as `AWS_ROLE_TO_ASSUME`, the `GCP_*` secrets, or the `AZURE_*` secrets, and uninstall the custom GitHub App along with its `APP_ID` and `APP_PRIVATE_KEY` secrets.
117 110
118```yaml theme={null}111### GitHub App permissions
119- uses: anthropics/claude-code-action@v1
120 with:
121 prompt: "Review this PR for security issues"
122 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
123 claude_args: |
124 --append-system-prompt "Follow our coding standards"
125 --max-turns 10
126 --model claude-sonnet-5
127```
128 112
129<Tip>113The [Claude GitHub App](https://github.com/apps/claude) is shared by every Claude feature that integrates with GitHub, including the Claude Code GitHub Action, [Code Review](/docs/en/code-review), and [auto-fix for pull requests](/docs/en/claude-code-on-the-web#auto-fix-pull-requests) on Claude Code on the web. A GitHub App has a single permission set covering all of its features, so the set includes some permissions that the Claude Code GitHub Action doesn't use.
130 The action now automatically detects whether to run in interactive mode (responds to `@claude` mentions) or automation mode (runs immediately with a prompt) based on your configuration.114
131</Tip>115When you install the app, you grant the following permissions:
116
117| Permission | Access |
118| ---------------- | -------------- |
119| Actions | Read and write |
120| Checks | Read and write |
121| Contents | Read and write |
122| Discussions | Read and write |
123| Issues | Read and write |
124| Members | Read |
125| Metadata | Read |
126| Pull requests | Read and write |
127| Repository hooks | Read and write |
128| Statuses | Read |
129| Workflows | Read and write |
130
131The permission set can also change ahead of the features that use it. When the app requests a permission it didn't have before, GitHub prompts the account owner to approve it, an organization owner for an organization install, and the installation keeps its old permissions until they do. For example, when Actions access changes from read to write, the app can re-run workflows rather than only view runs and logs, so GitHub asks the owner to approve the change.
132
133When you install the app, you accept its full permission set. GitHub doesn't let you accept a subset. If your organization requires only the permissions the Claude Code GitHub Action uses, create a custom GitHub App with Contents, Issues, and Pull requests instead, following the [Claude Code GitHub Action's setup guide](https://github.com/anthropics/claude-code-action/blob/main/docs/setup.md). A custom app covers only the Claude Code GitHub Action. Code Review and web auto-fix still require the official app.
134
135For details on how the Claude Code GitHub Action limits what Claude can do with these permissions, see the [security documentation](https://github.com/anthropics/claude-code-action/blob/main/docs/security.md).
136
137## Interactive and automation modes
138
139The Claude Code GitHub Action detects how to run from your workflow configuration:
140
141* **Interactive mode**: when the workflow provides no `prompt` input, Claude waits for the trigger phrase, `@claude` by default, in an issue or pull request comment, in a pull request review, or in the body or title of a newly opened issue, then responds to that request. Progress and results appear as a comment on the triggering issue or PR.
142* **Automation mode**: when the workflow provides a `prompt` input, Claude runs without waiting for a mention, subject only to the access checks below. Results appear in the workflow run log rather than a comment.
143
144### Who can trigger runs
145
146In both modes, the Claude Code GitHub Action runs two checks on the triggering actor before Claude starts, and the run fails when either check rejects it:
147
148* **Write access**: on issue and pull request events, the triggering user must have write access to the repository. To allow specific users without write access, set `allowed_non_write_users` and pass your own `github_token` input. Events that no user authors, such as a `schedule` trigger, skip this check.
149* **Human actor**: on every event, the Claude Code GitHub Action rejects a bot actor unless you list it in `allowed_bots`, which keeps bots from triggering Claude in a loop. This check also applies to scheduled runs, which GitHub attributes to a repository user, usually the one who last changed the workflow's `cron` schedule. If that user is a bot, list it in `allowed_bots`.
132 150
133## Example use cases151## Example use cases
134 152
135Claude Code GitHub Actions can help you with a variety of tasks. The [examples directory](https://github.com/anthropics/claude-code-action/tree/main/examples) contains ready-to-use workflows for different scenarios.153The [examples directory](https://github.com/anthropics/claude-code-action/tree/main/examples) contains ready-to-use workflows for different scenarios.
136 154
137### Basic workflow155The examples on this page show API key authentication. If you authenticate with a Claude subscription, replace the `anthropic_api_key` line in any example with `claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}`.
156
157### Respond to @claude mentions
158
159This workflow runs the Claude Code GitHub Action in interactive mode, so Claude responds whenever someone mentions `@claude` in an issue or PR comment.
138 160
139```yaml theme={null}161```yaml theme={null}
140name: Claude Code162name: Claude Code
145 types: [created]167 types: [created]
146jobs:168jobs:
147 claude:169 claude:
170 if: contains(github.event.comment.body, '@claude')
148 runs-on: ubuntu-latest171 runs-on: ubuntu-latest
172 permissions:
173 contents: write
174 pull-requests: write
175 issues: write
176 id-token: write
177 actions: read
149 steps:178 steps:
179 - uses: actions/checkout@v6
180 with:
181 fetch-depth: 1
150 - uses: anthropics/claude-code-action@v1182 - uses: anthropics/claude-code-action@v1
151 with:183 with:
152 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}184 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
153 # Responds to @claude mentions in comments
154```185```
155 186
156### Using skills187The parts of this workflow that aren't boilerplate:
157 188
158The `prompt` input accepts a [skill](/en/skills) invocation as well as plain text:189* `id-token: write`: required for the Claude Code GitHub Action's default GitHub App authentication
190* `actions: read`: lets Claude read CI results on PRs
191* `actions/checkout`: gives Claude a local copy of the repository to work in
192* `if`: keeps runners from starting on comments that don't mention `@claude`. The Claude Code GitHub Action also checks the trigger phrase itself before responding
159 193
160* For a skill in your repository's `.claude/skills/` directory, run `actions/checkout` before the action step and pass `/skill-name`.194Once the workflow is in place, mention `@claude` in any issue or PR comment with a request:
161* For a skill packaged in a plugin, install the plugin with the `plugin_marketplaces` and `plugins` inputs and pass the namespaced `/plugin-name:skill-name`.
162 195
163The following workflow installs the `code-review` plugin and runs its skill on each new or updated pull request:196```text wrap theme={null}
197@claude implement this feature based on the issue description
198@claude how should I implement user authentication for this endpoint?
199@claude fix the TypeError in the user dashboard component
200```
201
202Claude replies in a comment on the same issue or PR and updates it as it works.
203
204### Run a skill
205
206The `prompt` input accepts a [skill](/docs/en/skills) invocation as well as plain text:
207
208* For a skill in your repository's `.claude/skills/` directory, run `actions/checkout` before the `anthropics/claude-code-action` step so the skill files are available on the runner, then pass `/skill-name` as the `prompt`.
209* For a skill packaged in a [plugin](/docs/en/plugins), install the plugin with the `plugin_marketplaces` and `plugins` inputs, then pass the namespaced `/plugin-name:skill-name` as the `prompt`. The `plugins` input takes `plugin-name@marketplace-name`, where the marketplace name comes from the marketplace's own manifest rather than its repository URL.
210
211The following workflow installs the `code-review` plugin and runs its skill on each new or updated pull request. It runs the same plugin as the review workflow from quick setup. Use a workflow like this when you want to control the prompt, model, and triggers yourself. For automatic reviews without maintaining a workflow file, see [Code Review](/docs/en/code-review). On public repositories, GitHub withholds secrets from runs triggered by fork pull requests, so the review runs only on pull requests from branches in the same repository.
164 212
165```yaml theme={null}213```yaml theme={null}
166name: Code Review214name: Code Review
170jobs:218jobs:
171 review:219 review:
172 runs-on: ubuntu-latest220 runs-on: ubuntu-latest
221 permissions:
222 contents: read
223 pull-requests: read
224 issues: read
225 id-token: write
173 steps:226 steps:
227 - uses: actions/checkout@v6
228 with:
229 fetch-depth: 1
174 - uses: anthropics/claude-code-action@v1230 - uses: anthropics/claude-code-action@v1
175 with:231 with:
176 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}232 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
179 prompt: "/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}"235 prompt: "/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}"
180```236```
181 237
182### Custom automation with prompts238Claude writes its findings to the workflow run log rather than posting them on the pull request. Open the run from the repository's Actions tab to read them.
239
240### Run on a schedule
241
242With a `prompt` input, the Claude Code GitHub Action runs in automation mode on any GitHub event, including a cron schedule. For a plain-text prompt, Claude has no shell or GitHub API access until you grant the tools the prompt needs, with `--allowedTools` in `claude_args` or a [`permissions.allow` rule](/docs/en/permissions#permission-rule-syntax) in the `settings` input. If you invoke a skill instead, Claude can use the tools its [`allowed-tools` frontmatter](/docs/en/skills#pre-approve-tools-for-a-skill) grants. GitHub runs scheduled workflows only from the default branch and, in public repositories, disables the schedule after 60 days without repository activity.
243
244This workflow generates a report in the workflow run log at 09:00 UTC each day. Its `claude_args` line [passes CLI arguments](#pass-cli-arguments) that select the model and allow two GitHub MCP tools. Claude reads commits and issues through the GitHub API with those tools, so you can omit the checkout step:
183 245
184```yaml theme={null}246```yaml theme={null}
185name: Daily Report247name: Daily Report
189jobs:251jobs:
190 report:252 report:
191 runs-on: ubuntu-latest253 runs-on: ubuntu-latest
254 permissions:
255 contents: read
256 issues: read
257 id-token: write
192 steps:258 steps:
193 - uses: anthropics/claude-code-action@v1259 - uses: anthropics/claude-code-action@v1
194 with:260 with:
195 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}261 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
196 prompt: "Generate a summary of yesterday's commits and open issues"262 prompt: "Generate a summary of yesterday's commits and open issues"
197 claude_args: "--model opus"263 claude_args: |
198```264 --model claude-opus-4-8
199 265 --allowedTools "mcp__github__list_commits,mcp__github__list_issues"
200### Common use cases
201
202In issue or PR comments:
203
204```text wrap theme={null}
205@claude implement this feature based on the issue description
206@claude how should I implement user authentication for this endpoint?
207@claude fix the TypeError in the user dashboard component
208```266```
209 267
210Claude will automatically analyze the context and respond appropriately.
211
212## Best practices268## Best practices
213 269
214### CLAUDE.md configuration270### Define project standards in CLAUDE.md
215 271
216Create a `CLAUDE.md` file in your repository root to define code style guidelines, review criteria, project-specific rules, and preferred patterns. This file guides Claude's understanding of your project standards.272Create a `CLAUDE.md` file in your repository root to define code style guidelines, review criteria, project-specific rules, and preferred patterns. Claude follows these guidelines when creating PRs and responding to requests. See the [memory documentation](/docs/en/memory) for details.
217 273
218### Security considerations274### Protect your credentials
219 275
220<Warning>Never commit API keys directly to your repository.</Warning>276<Warning>
221 277 Never commit API keys or OAuth tokens directly to your repository. Always store them as GitHub Secrets and reference them in workflows, for example `anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}`.
222For comprehensive security guidance including permissions, authentication, and best practices, see the [Claude Code Action security documentation](https://github.com/anthropics/claude-code-action/blob/main/docs/security.md).278</Warning>
223
224Always use GitHub Secrets for API keys:
225
226* Add your API key as a repository secret named `ANTHROPIC_API_KEY`
227* Reference it in workflows: `anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}`
228* Limit action permissions to only what's necessary
229* Review Claude's suggestions before merging
230
231Always use GitHub Secrets (for example, `${{ secrets.ANTHROPIC_API_KEY }}`) rather than hardcoding API keys directly in your workflow files.
232
233### Optimizing performance
234
235Use issue templates to provide context, keep your `CLAUDE.md` concise and focused, and configure appropriate timeouts for your workflows.
236
237### CI costs
238 279
239When using Claude Code GitHub Actions, be aware of the associated costs:280Grant the workflow only the permissions it needs, and review Claude's changes before merging.
240 281
241**GitHub Actions costs:**282For comprehensive security guidance including permissions and authentication, see the [Claude Code Action security documentation](https://github.com/anthropics/claude-code-action/blob/main/docs/security.md).
242 283
243* Claude Code runs on GitHub-hosted runners, which consume your GitHub Actions minutes284### Manage costs
244* See [GitHub's billing documentation](https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-actions/about-billing-for-github-actions) for detailed pricing and minute limits
245 285
246**API costs:**286Each run consumes two kinds of resources:
247 287
248* Each Claude interaction consumes API tokens based on the length of prompts and responses288* **GitHub Actions minutes**: the Claude Code GitHub Action runs on GitHub-hosted runners, which consume your GitHub Actions minutes. See [GitHub's billing documentation](https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-actions/about-billing-for-github-actions) for pricing and minute limits.
249* Token usage varies by task complexity and codebase size289* **API tokens**: each interaction consumes tokens based on the length of prompts and responses, task complexity, and codebase size. See [Claude's pricing page](https://claude.com/platform/api) for current token rates. If you authenticate with an OAuth token, runs use your Claude subscription instead of API billing.
250* See [Claude's pricing page](https://claude.com/platform/api) for current token rates
251 290
252**Cost optimization tips:**291You can lower both kinds of cost by giving Claude clearer context and by capping how much work each run can do:
253 292
254* Use specific `@claude` commands to reduce unnecessary API calls293* Write specific `@claude` requests so Claude needs fewer turns to finish
255* Configure appropriate `--max-turns` in `claude_args` to prevent excessive iterations294* Use issue templates to provide context up front
295* Keep your `CLAUDE.md` concise, since Claude reads it on every run
296* Set `--max-turns` in `claude_args` to limit iterations
256* Set workflow-level timeouts to avoid runaway jobs297* Set workflow-level timeouts to avoid runaway jobs
257* Consider using GitHub's concurrency controls to limit parallel runs298* Use GitHub's concurrency controls to limit parallel runs
258
259## Configuration examples
260
261The Claude Code Action v1 simplifies configuration with unified parameters:
262
263```yaml theme={null}
264- uses: anthropics/claude-code-action@v1
265 with:
266 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
267 prompt: "Your instructions here" # Optional
268 claude_args: "--max-turns 5" # Optional CLI arguments
269```
270
271Key features:
272
273* **Unified prompt interface** - Use `prompt` for all instructions
274* **Skills** - Invoke installed [skills](/en/skills) directly from the prompt
275* **CLI passthrough** - Any Claude Code CLI argument via `claude_args`
276* **Flexible triggers** - Works with any GitHub event
277
278Visit the [examples directory](https://github.com/anthropics/claude-code-action/tree/main/examples) for complete workflow files.
279
280<Tip>
281 When responding to issue or PR comments, Claude automatically responds to @claude mentions. For other events, use the `prompt` parameter to provide instructions.
282</Tip>
283
284## Using with Amazon Bedrock and Google Cloud
285
286For enterprise environments, you can use Claude Code GitHub Actions with your own cloud infrastructure. This approach gives you control over data residency and billing while maintaining the same functionality.
287 299
288### Prerequisites300For usage tracking across your organization, see the [analytics dashboard](/docs/en/analytics) and [monitoring](/docs/en/monitoring-usage). For how usage is measured and billed, see [costs](/docs/en/costs).
289 301
290Before setting up Claude Code GitHub Actions with cloud providers, you need:302## Use a cloud provider
291 303
292#### For Google Cloud's Agent Platform:304By default, the Claude Code GitHub Action calls the Claude API directly with your API key or OAuth token. To route inference through your own cloud account instead, set the input for your provider and follow [Use Claude Code GitHub Actions with cloud providers](/docs/en/github-actions-cloud-providers):
293 305
2941. A Google Cloud Project with Google Cloud's Agent Platform enabled306* **Amazon Bedrock**: `use_bedrock: "true"`
2952. Workload Identity Federation configured for GitHub Actions307* **Google Cloud's Agent Platform**: `use_vertex: "true"`
2963. A service account with the required permissions308* **Microsoft Foundry**: `use_foundry: "true"`
2974. A GitHub App (recommended) or use the default GITHUB\_TOKEN
298 309
299#### For Amazon Bedrock:310With all three providers, you authenticate through OIDC identity federation instead of a Claude API key, so you store no static cloud credentials in your repository.
300
3011. An AWS account with Amazon Bedrock enabled
3022. GitHub OIDC Identity Provider configured in AWS
3033. An IAM role with Amazon Bedrock permissions
3044. A GitHub App (recommended) or use the default GITHUB\_TOKEN
305
306<Steps>
307 <Step title="Create a custom GitHub App (Recommended for 3P Providers)">
308 For best control and security when using 3P providers like Google Cloud's Agent Platform or Amazon Bedrock, we recommend creating your own GitHub App:
309
310 1. Go to [https://github.com/settings/apps/new](https://github.com/settings/apps/new)
311 2. Fill in the basic information:
312 * **GitHub App name**: Choose a unique name (e.g., "YourOrg Claude Assistant")
313 * **Homepage URL**: Your organization's website or the repository URL
314 3. Configure the app settings:
315 * **Webhooks**: Uncheck "Active" (not needed for this integration)
316 4. Set the required permissions:
317 * **Repository permissions**:
318 * Contents: Read & Write
319 * Issues: Read & Write
320 * Pull requests: Read & Write
321 5. Click "Create GitHub App"
322 6. After creation, click "Generate a private key" and save the downloaded `.pem` file
323 7. Note your App ID from the app settings page
324 8. Install the app to your repository:
325 * From your app's settings page, click "Install App" in the left sidebar
326 * Select your account or organization
327 * Choose "Only select repositories" and select the specific repository
328 * Click "Install"
329 9. Add the private key as a secret to your repository:
330 * Go to your repository's Settings → Secrets and variables → Actions
331 * Create a new secret named `APP_PRIVATE_KEY` with the contents of the `.pem` file
332 10. Add the App ID as a secret:
333
334 * Create a new secret named `APP_ID` with your GitHub App's ID
335
336 <Note>
337 This app will be used with the [actions/create-github-app-token](https://github.com/actions/create-github-app-token) action to generate authentication tokens in your workflows.
338 </Note>
339
340 **Alternative for Claude API or if you don't want to setup your own Github app**: Use the official Anthropic app:
341
342 1. Install from: [https://github.com/apps/claude](https://github.com/apps/claude)
343 2. No additional configuration needed for authentication
344 </Step>
345
346 <Step title="Configure cloud provider authentication">
347 Choose your cloud provider and set up secure authentication:
348
349 <AccordionGroup>
350 <Accordion title="Amazon Bedrock">
351 **Configure AWS to allow GitHub Actions to authenticate securely without storing credentials.**
352
353 > **Security Note**: Use repository-specific configurations and grant only the minimum required permissions.
354
355 **Required Setup**:
356
357 1. **Enable Amazon Bedrock**:
358 * Request access to Claude models in Amazon Bedrock
359 * For cross-region models, request access in all required regions
360
361 2. **Set up GitHub OIDC Identity Provider**:
362 * Provider URL: `https://token.actions.githubusercontent.com`
363 * Audience: `sts.amazonaws.com`
364
365 3. **Create IAM Role for GitHub Actions**:
366 * Trusted entity type: Web identity
367 * Identity provider: `token.actions.githubusercontent.com`
368 * Permissions: `AmazonBedrockFullAccess` policy
369 * Configure trust policy for your specific repository
370
371 **Required Values**:
372
373 After setup, you'll need:
374
375 * **AWS\_ROLE\_TO\_ASSUME**: The ARN of the IAM role you created
376
377 <Tip>
378 OIDC is more secure than using static AWS access keys because credentials are temporary and automatically rotated.
379 </Tip>
380
381 See [AWS documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html) for detailed OIDC setup instructions.
382 </Accordion>
383
384 <Accordion title="Google Cloud's Agent Platform">
385 **Configure Google Cloud to allow GitHub Actions to authenticate securely without storing credentials.**
386
387 > **Security Note**: Use repository-specific configurations and grant only the minimum required permissions.
388
389 **Required Setup**:
390
391 1. **Enable APIs** in your Google Cloud project:
392 * IAM Credentials API
393 * Security Token Service (STS) API
394 * Google Cloud's Agent Platform API
395
396 2. **Create Workload Identity Federation resources**:
397 * Create a Workload Identity Pool
398 * Add a GitHub OIDC provider with:
399 * Issuer: `https://token.actions.githubusercontent.com`
400 * Attribute mappings for repository and owner
401 * **Security recommendation**: Use repository-specific attribute conditions
402
403 3. **Create a Service Account**:
404 * Grant only `Vertex AI User` role
405 * **Security recommendation**: Create a dedicated service account per repository
406
407 4. **Configure IAM bindings**:
408 * Allow the Workload Identity Pool to impersonate the service account
409 * **Security recommendation**: Use repository-specific principal sets
410
411 **Required Values**:
412
413 After setup, you'll need:
414
415 * **GCP\_WORKLOAD\_IDENTITY\_PROVIDER**: The full provider resource name
416 * **GCP\_SERVICE\_ACCOUNT**: The service account email address
417
418 <Tip>
419 Workload Identity Federation eliminates the need for downloadable service account keys, improving security.
420 </Tip>
421
422 For detailed setup instructions, consult the [Google Cloud Workload Identity Federation documentation](https://cloud.google.com/iam/docs/workload-identity-federation).
423 </Accordion>
424 </AccordionGroup>
425 </Step>
426
427 <Step title="Add Required Secrets">
428 Add the following secrets to your repository (Settings → Secrets and variables → Actions):
429
430 #### For Claude API (Direct):
431
432 1. **For API Authentication**:
433 * `ANTHROPIC_API_KEY`: Your Claude API key from [console.anthropic.com](https://console.anthropic.com)
434
435 2. **For GitHub App (if using your own app)**:
436 * `APP_ID`: Your GitHub App's ID
437 * `APP_PRIVATE_KEY`: The private key (.pem) content
438
439 #### For Google Cloud's Agent Platform
440
441 1. **For GCP Authentication**:
442 * `GCP_WORKLOAD_IDENTITY_PROVIDER`
443 * `GCP_SERVICE_ACCOUNT`
444
445 2. **For GitHub App (if using your own app)**:
446 * `APP_ID`: Your GitHub App's ID
447 * `APP_PRIVATE_KEY`: The private key (.pem) content
448
449 #### For Amazon Bedrock
450
451 1. **For AWS Authentication**:
452 * `AWS_ROLE_TO_ASSUME`
453
454 2. **For GitHub App (if using your own app)**:
455 * `APP_ID`: Your GitHub App's ID
456 * `APP_PRIVATE_KEY`: The private key (.pem) content
457 </Step>
458
459 <Step title="Create workflow files">
460 Create GitHub Actions workflow files that integrate with your cloud provider. The examples below show complete configurations for both Amazon Bedrock and Google Cloud's Agent Platform:
461
462 <AccordionGroup>
463 <Accordion title="Amazon Bedrock workflow">
464 **Prerequisites:**
465
466 * Amazon Bedrock access enabled with Claude model permissions
467 * GitHub configured as an OIDC identity provider in AWS
468 * IAM role with Amazon Bedrock permissions that trusts GitHub Actions
469
470 **Required GitHub secrets:**
471
472 | Secret Name | Description |
473 | -------------------- | ------------------------------------------------- |
474 | `AWS_ROLE_TO_ASSUME` | ARN of the IAM role for Amazon Bedrock access |
475 | `APP_ID` | Your GitHub App ID (from app settings) |
476 | `APP_PRIVATE_KEY` | The private key you generated for your GitHub App |
477
478 ```yaml theme={null}
479 name: Claude PR Action
480
481 permissions:
482 contents: write
483 pull-requests: write
484 issues: write
485 id-token: write
486
487 on:
488 issue_comment:
489 types: [created]
490 pull_request_review_comment:
491 types: [created]
492 issues:
493 types: [opened, assigned]
494
495 jobs:
496 claude-pr:
497 if: |
498 (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
499 (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
500 (github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
501 runs-on: ubuntu-latest
502 env:
503 AWS_REGION: us-west-2
504 steps:
505 - name: Checkout repository
506 uses: actions/checkout@v4
507
508 - name: Generate GitHub App token
509 id: app-token
510 uses: actions/create-github-app-token@v2
511 with:
512 app-id: ${{ secrets.APP_ID }}
513 private-key: ${{ secrets.APP_PRIVATE_KEY }}
514
515 - name: Configure AWS Credentials (OIDC)
516 uses: aws-actions/configure-aws-credentials@v4
517 with:
518 role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
519 aws-region: us-west-2
520
521 - uses: anthropics/claude-code-action@v1
522 with:
523 github_token: ${{ steps.app-token.outputs.token }}
524 use_bedrock: "true"
525 claude_args: '--model us.anthropic.claude-sonnet-4-6 --max-turns 10'
526 ```
527
528 <Tip>
529 The model ID format for Amazon Bedrock includes a region prefix (for example, `us.anthropic.claude-sonnet-4-6`).
530 </Tip>
531 </Accordion>
532
533 <Accordion title="Google Cloud's Agent Platform workflow">
534 **Prerequisites:**
535
536 * Google Cloud's Agent Platform API enabled in your GCP project
537 * Workload Identity Federation configured for GitHub
538 * Service account with Google Cloud's Agent Platform permissions
539
540 **Required GitHub secrets:**
541
542 | Secret Name | Description |
543 | -------------------------------- | --------------------------------------------------------------- |
544 | `GCP_WORKLOAD_IDENTITY_PROVIDER` | Workload identity provider resource name |
545 | `GCP_SERVICE_ACCOUNT` | Service account email with Google Cloud's Agent Platform access |
546 | `APP_ID` | Your GitHub App ID (from app settings) |
547 | `APP_PRIVATE_KEY` | The private key you generated for your GitHub App |
548
549 ```yaml theme={null}
550 name: Claude PR Action
551
552 permissions:
553 contents: write
554 pull-requests: write
555 issues: write
556 id-token: write
557
558 on:
559 issue_comment:
560 types: [created]
561 pull_request_review_comment:
562 types: [created]
563 issues:
564 types: [opened, assigned]
565
566 jobs:
567 claude-pr:
568 if: |
569 (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
570 (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
571 (github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
572 runs-on: ubuntu-latest
573 steps:
574 - name: Checkout repository
575 uses: actions/checkout@v4
576
577 - name: Generate GitHub App token
578 id: app-token
579 uses: actions/create-github-app-token@v2
580 with:
581 app-id: ${{ secrets.APP_ID }}
582 private-key: ${{ secrets.APP_PRIVATE_KEY }}
583
584 - name: Authenticate to Google Cloud
585 id: auth
586 uses: google-github-actions/auth@v2
587 with:
588 workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
589 service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
590
591 - uses: anthropics/claude-code-action@v1
592 with:
593 github_token: ${{ steps.app-token.outputs.token }}
594 trigger_phrase: "@claude"
595 use_vertex: "true"
596 claude_args: '--model claude-sonnet-4-5@20250929 --max-turns 10'
597 env:
598 ANTHROPIC_VERTEX_PROJECT_ID: ${{ steps.auth.outputs.project_id }}
599 CLOUD_ML_REGION: us-east5
600 VERTEX_REGION_CLAUDE_4_5_SONNET: us-east5
601 ```
602
603 <Tip>
604 The project ID is automatically retrieved from the Google Cloud authentication step, so you don't need to hardcode it.
605 </Tip>
606 </Accordion>
607 </AccordionGroup>
608 </Step>
609</Steps>
610 311
611## Troubleshooting312## Troubleshooting
612 313
613### Claude not responding to @claude commands314### Claude not responding to @claude commands
614 315
615Verify the GitHub App is installed correctly, check that workflows are enabled, ensure API key is set in repository secrets, and confirm the comment contains `@claude` (not `/claude`).316* Verify the GitHub App is installed on the repository
317* Check that workflows are enabled for the repository
318* Ensure your API key or OAuth token is set in repository secrets
319* Confirm the comment contains `@claude` as a complete word, not `/claude` or `@claude-bot`
320* Confirm the commenting user has write access to the repository. See [Who can trigger runs](#who-can-trigger-runs) for the exceptions
616 321
617### CI not running on Claude's commits322### CI not running on Claude's commits
618 323
619Ensure you're using the GitHub App or custom app (not Actions user), check workflow triggers include the necessary events, and verify app permissions include CI triggers.324* GitHub doesn't trigger workflows on commits made with the default `GITHUB_TOKEN`. If you pass `github_token: ${{ secrets.GITHUB_TOKEN }}` to the Claude Code GitHub Action, remove it so it authenticates as the Claude GitHub App, or pass a custom app token instead
325* Check that your CI workflow's triggers include the events Claude's pushes produce, such as `push` or `pull_request`
620 326
621### Authentication errors327### Authentication errors
622 328
623Confirm API key is valid and has sufficient permissions. For Amazon Bedrock or Google Cloud's Agent Platform, check credentials configuration and ensure secrets are named correctly in workflows.329* Confirm the API key or OAuth token is valid by testing it locally with `claude` before debugging the workflow
330* For Bedrock, Agent Platform, and Foundry, see the cloud provider page's [troubleshooting section](/docs/en/github-actions-cloud-providers#troubleshooting)
331
332For more solutions, see the Claude Code GitHub Action's [FAQ](https://github.com/anthropics/claude-code-action/blob/main/docs/faq.md).
624 333
625## Advanced configuration334## Advanced configuration
626 335
627### Action parameters336### Action parameters
628 337
629The Claude Code Action v1 uses a simplified configuration:338These are the most commonly used inputs. Each maps to a `with:` key in the `anthropics/claude-code-action` step.
630 339
631| Parameter | Description | Required |340| Parameter | Description | Required |
632| --------------------- | ------------------------------------------------------------------ | -------- |341| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
633| `prompt` | Instructions for Claude (plain text or a [skill](/en/skills) name) | No\* |342| `prompt` | Instructions for Claude, as plain text or a [skill](/docs/en/skills) invocation. When omitted, Claude responds to the [trigger phrase](#interactive-and-automation-modes) instead | No |
634| `claude_args` | CLI arguments passed to Claude Code | No |343| `claude_args` | CLI arguments passed to Claude Code | No |
344| `anthropic_api_key` | Claude API key | For the Claude API, unless you use `claude_code_oauth_token` or [workload identity federation](#set-up-for-an-organization). Not used for Bedrock, Agent Platform, or Foundry |
345| `claude_code_oauth_token` | OAuth token for authenticating with a Claude subscription, generated with `claude setup-token` | No |
346| `github_token` | Token for GitHub operations. When omitted, the Claude Code GitHub Action authenticates as the Claude GitHub App | No |
635| `plugin_marketplaces` | Newline-separated list of plugin marketplace Git URLs | No |347| `plugin_marketplaces` | Newline-separated list of plugin marketplace Git URLs | No |
636| `plugins` | Newline-separated list of plugin names to install before execution | No |348| `plugins` | Newline-separated list of plugin names to install before execution | No |
637| `anthropic_api_key` | Claude API key | Yes\*\* |349| `settings` | Claude Code settings, as a JSON string or a path to a settings JSON file | No |
638| `github_token` | GitHub token for API access | No |350| `trigger_phrase` | Trigger phrase Claude responds to. Default: `@claude` | No |
639| `trigger_phrase` | Custom trigger phrase (default: "@claude") | No |351| `use_bedrock` | Use Amazon Bedrock instead of the Claude API | No |
640| `use_bedrock` | Use Amazon Bedrock instead of Claude API | No |352| `use_vertex` | Use Google Cloud's Agent Platform instead of the Claude API | No |
641| `use_vertex` | Use Google Cloud's Agent Platform instead of Claude API | No |353| `use_foundry` | Use Microsoft Foundry instead of the Claude API | No |
642 354
643\*Prompt is optional - when omitted for issue/PR comments, Claude responds to trigger phrase\355For the full input list, see the Claude Code GitHub Action's [configuration reference](https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md#inputs).
644\*\*Required for direct Claude API, not for Amazon Bedrock or Google Cloud's Agent Platform
645 356
646#### Pass CLI arguments357### Pass CLI arguments
647 358
648The `claude_args` parameter accepts any Claude Code CLI arguments:359The `claude_args` parameter accepts any [Claude Code CLI argument](/docs/en/cli-reference):
649 360
650```yaml theme={null}361```yaml theme={null}
651claude_args: "--max-turns 5 --model claude-sonnet-5 --mcp-config /path/to/config.json"362claude_args: "--max-turns 5 --model claude-sonnet-5 --mcp-config /path/to/config.json"
653 364
654Common arguments:365Common arguments:
655 366
656* `--max-turns`: Maximum conversation turns (default: 10)367* `--max-turns`: limit the number of conversation turns
657* `--model`: Model to use (for example, `claude-sonnet-5`)368* `--model`: model to use, for example `claude-sonnet-5`. Without this argument, the Claude Code GitHub Action uses the Claude Code [default model](/docs/en/model-config)
658* `--mcp-config`: Path to MCP configuration369* `--mcp-config`: path to [MCP configuration](/docs/en/mcp)
659* `--allowedTools`: Comma-separated list of allowed tools. The `--allowed-tools` alias also works.370* `--allowedTools`: comma-separated list of allowed tools. The `--allowed-tools` alias also works
660* `--debug`: Enable debug output371* `--debug`: enable debug output
661
662### Alternative integration methods
663
664While the `/install-github-app` command is the recommended approach, you can also:
665 372
666* **Custom GitHub App**: For organizations needing branded usernames or custom authentication flows. Create your own GitHub App with required permissions (contents, issues, pull requests) and use the actions/create-github-app-token action to generate tokens in your workflows.373## Upgrade from beta
667* **Manual GitHub Actions**: Direct workflow configuration for maximum flexibility
668* **MCP Configuration**: Dynamic loading of Model Context Protocol servers
669 374
670See the [Claude Code Action documentation](https://github.com/anthropics/claude-code-action/blob/main/docs) for detailed guides on authentication, security, and advanced configuration.375If your workflows still reference `anthropics/claude-code-action@beta`, update them to v1:
671 376
672### Customizing Claude's behavior3771. Change `@beta` to `@v1` in the `uses` line
3782. Remove the `mode` input, since the Claude Code GitHub Action now [detects the mode automatically](#interactive-and-automation-modes)
3793. Replace `direct_prompt` with `prompt`
3804. Move CLI options such as `max_turns` and `model` into `claude_args`. `custom_instructions` has no same-name flag and becomes `--append-system-prompt`
673 381
674You can configure Claude's behavior in two ways:382For the full input mapping and before-and-after examples, see the [migration guide](https://github.com/anthropics/claude-code-action/blob/main/docs/migration-guide.md).
675 383
6761. **CLAUDE.md**: Define coding standards, review criteria, and project-specific rules in a `CLAUDE.md` file at the root of your repository. Claude will follow these guidelines when creating PRs and responding to requests. Check out our [Memory documentation](/en/memory) for more details.384## What's next
6772. **Custom prompts**: Use the `prompt` parameter in the workflow file to provide workflow-specific instructions. This allows you to customize Claude's behavior for different workflows or tasks.
678 385
679Claude will follow these guidelines when creating PRs and responding to requests.386* [Use Claude Code GitHub Actions with cloud providers](/docs/en/github-actions-cloud-providers): route inference through Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry
387* [Configuration reference](https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md#inputs): the full list of action inputs
388* [Examples directory](https://github.com/anthropics/claude-code-action/tree/main/examples): ready-to-use workflows for more scenarios
389* [Code Review](/docs/en/code-review): automatic pull request review without maintaining a workflow file