This FAQ addresses common questions and gotchas when using the Claude Code GitHub Action.
The github-actions user cannot trigger subsequent GitHub Actions workflows. This is a GitHub security feature to prevent infinite loops. To make this work, you need to use a Personal Access Token (PAT) instead, which will act as a regular user, or use a separate app token of your own. When posting a comment on an issue or PR from your workflow, use your PAT instead of the GITHUB_TOKEN generated in your workflow.
Only users with write permissions to the repository can trigger Claude. This is a security feature to prevent unauthorized use. Make sure the user commenting has at least write access to the repository.
If you're in a public repository, you should be able to assign to Claude without issue. If it's a private organization repository, you can only assign to users in your own organization, which Claude isn't. In this case, you'll need to make a custom user in that case.
If you're using the default GitHub App authentication, you must add the id-token: write permission to your workflow:
permissions:
contents: read
id-token: write # Required for OIDC authenticationThe OIDC token is required in order for the Claude GitHub app to function. If you wish to not use the GitHub app, you can instead provide a github_token input to the action for Claude to operate with. See the Claude Code permissions documentation for more.
This error occurs when the action tries to fetch the authenticated user information using a GitHub App installation token. GitHub App tokens have limited access and cannot access the /user endpoint, which causes this 403 error.
Solution: The action now includes bot_id and bot_name inputs that default to Claude's bot credentials. This avoids the need to fetch user information from the API.
For the default claude[bot]:
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
# bot_id and bot_name have sensible defaults, no need to specifyFor custom bots, specify both:
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
bot_id: "12345678" # Your bot's GitHub user ID
bot_name: "my-bot" # Your bot's usernameThis issue typically only affects agent/automation mode workflows. Interactive workflows (with @claude mentions) don't encounter this issue as they use the comment author's information.
The GitHub App for Claude doesn't have workflow write access for security reasons. This prevents Claude from modifying CI/CD configurations that could potentially create unintended consequences. This is something we may reconsider in the future.
By default, Claude only uses commit tools for non-destructive changes to the branch. Claude is configured to:
- Never push to branches other than where it was invoked (either its own branch or the PR branch)
- Never force push or perform destructive operations
You can grant additional tools via the claude_args input if needed:
claude_args: |
--allowedTools "Bash(git rebase:*)" # Use with cautionClaude doesn't create PRs by default. Instead, it pushes commits to a branch and provides a link to a pre-filled PR submission page. This approach ensures your repository's branch protection rules are still adhered to and gives you final control over PR creation.
Yes! Claude can access GitHub Actions workflow runs, job logs, and test results on the PR where it's tagged. To enable this:
-
Add
actions: readpermission to your workflow:permissions: contents: write pull-requests: write issues: write actions: read
-
Configure the action with additional permissions:
- uses: anthropics/claude-code-action@v1 with: additional_permissions: | actions: read
Claude will then be able to analyze CI failures and help debug workflow issues. For running tests locally before commits, you can still instruct Claude to do so in your request.
Claude is configured to update a single comment to avoid cluttering PR/issue discussions. All of Claude's responses, including progress updates and final results, will appear in the same comment with checkboxes showing task progress.
Claude's branch behavior depends on the context:
- Open PRs: Pushes directly to the existing PR branch
- Closed/Merged PRs: Creates a new branch (cannot push to closed PR branches)
- Issues: Always creates a new branch with a timestamp
For performance, Claude uses shallow clones:
- PRs:
--depth=20(last 20 commits) - New branches:
--depth=1(single commit)
If you need full history, you can configure this in your workflow before calling Claude in the actions/checkout step.
- uses: actions/checkout@v6
depth: 0 # will fetch full repo history
The action intelligently detects whether to run in interactive mode or automation mode:
- With
promptinput: Runs in automation mode - executes immediately without waiting for @claude mentions - Without
promptinput: Runs in interactive mode - waits for @claude mentions in comments
This automatic detection eliminates the need to manually configure modes.
Example:
# Automation mode - runs automatically
prompt: "Review this PR for security vulnerabilities"
# Interactive mode - waits for @claude mention
# (no prompt provided)These inputs are deprecated in v1.0:
direct_prompt→ Usepromptinsteadcustom_instructions→ Useclaude_argswith--system-prompt
Migration examples:
# Old (v0.x)
direct_prompt: "Review this PR"
custom_instructions: "Focus on security"
# New (v1.0)
prompt: "Review this PR"
claude_args: |
--system-prompt "Focus on security"The Bash tool is disabled by default for security. To enable individual bash commands using claude_args:
claude_args: |
--allowedTools "Bash(npm:*),Bash(git:*)" # Allows only npm and git commandsNo, Claude's GitHub app token is sandboxed to the current repository only. It cannot push to any other repositories. It can, however, read public repositories, but to get access to this, you must configure it with tools to do so.
Comments appear as claude[bot] when the action uses its built-in authentication. However, if you provide a github_token in your workflow, the action will use that token's authentication instead, causing comments to appear under a different username.
Solution: Remove github_token from your workflow file unless you're using a custom GitHub App.
Note: The use_sticky_comment feature only works with claude[bot] authentication. If you're using a custom github_token, sticky comments won't update properly since they expect the claude[bot] username.
Claude Code Action automatically configures two MCP servers:
- GitHub MCP server: For GitHub API operations
- File operations server: For advanced file manipulation
However, tools from these servers still need to be explicitly allowed via claude_args with --allowedTools.
Check the GitHub Action log for Claude's run for the full execution trace.
The trigger uses word boundaries, so @claude must be a complete word. Variations like @claude-bot, @claude!, or claude@mention won't work unless you customize the trigger_phrase.
For specialized environments like Nix, NixOS, or custom container setups where you need to provide your own executables:
Using a custom Claude Code executable:
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
path_to_claude_code_executable: "/path/to/custom/claude"
# ... other inputsUsing a custom Bun executable:
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
path_to_bun_executable: "/path/to/custom/bun"
# ... other inputsCommon use cases:
- Nix/NixOS environments where packages are managed differently
- Docker containers with pre-installed executables
- Custom build environments with specific version requirements
- Debugging specific issues with particular versions
Important notes:
- Using an older Claude Code version may cause problems if the action uses newer features
- Using an incompatible Bun version may cause runtime errors
- The action will skip automatic installation when custom paths are provided
- Ensure the custom executables are available in your GitHub Actions environment
- Always specify permissions explicitly in your workflow file
- Use GitHub Secrets for API keys - never hardcode them
- Be specific with tool permissions - only enable what's necessary via
claude_args - Test in a separate branch before using on important PRs
- Monitor Claude's token usage to avoid hitting API limits
- Review Claude's changes carefully before merging
If you encounter issues not covered here:
- Check the GitHub Issues
- Review the example workflows