anthropics / anthropics/claude-code-action

Claude Code Action won't run due to "app token exchange" GitHub App installation token (HTTP 401 Unauthorized)

Open
#1,206 3 comments 2 reactions 0 assignees View on GitHub
area:installation bug p2
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

**Describe the bug**
When the Claude Code action runs, I get this error about using a GitHub App installation token.
I haven't modified the workflow, I just installed it with Claude Code's slash command.
I have an Anthropic API Key and tried to set it as a variable on the repository, but that didn't change anything.

```
Downloading a new version of Bun: https://github.com/oven-sh/bun/releases/download/bun-v1.3.6/bun-linux-x64.zip
/usr/bin/unzip -o -q /home/runner/work/_temp/ef1213db-5c6c-4ca7-9e57-f69aa0939743.zip
/home/runner/.bun/bin/bun --revision
1.3.6+d530ed993
Run cd ${GITHUB_ACTION_PATH}
bun install v1.3.6 (d530ed99)

+ @actions/core@1.11.1
+ @actions/github@6.0.1
+ @anthropic-ai/claude-agent-sdk@0.2.98
+ @modelcontextprotocol/sdk@1.16.0
+ @octokit/graphql@8.2.2
+ @octokit/rest@21.1.1
+ @octokit/webhooks-types@7.6.1
+ node-fetch@3.3.2
+ shell-quote@1.8.3
+ zod@3.25.76

163 packages installed [672.00ms]
Run bun --no-env-file \
Comment contains exact trigger phrase '@claude'
Auto-detected mode: tag for event: issue_comment
Requesting OIDC token...
Attempt 1 of 3...
OIDC token successfully obtained
Exchanging OIDC token for app token...
Attempt 1 of 3...
App token exchange failed: 401 Unauthorized - Failed to get GitHub App installation token
Attempt 1 failed: Failed to get GitHub App installation token
Retrying in 5 seconds...
Attempt 2 of 3...
App token exchange failed: 401 Unauthorized - Failed to get GitHub App installation token
Retrying in 10 seconds...
Attempt 2 failed: Failed to get GitHub App installation token
Attempt 3 of 3...
App token exchange failed: 401 Unauthorized - Failed to get GitHub App installation token
Attempt 3 failed: Failed to get GitHub App installation token
Operation failed after 3 attempts
Error: Action failed with error: Failed to get GitHub App installation token
Internal error: directory mismatch for directory "/home/runner/work/_actions/anthropics/claude-code-action/v1/tsconfig.json", fd 4. You don't need to do anything, but this indicates a bug.
Error: Process completed with exit code 1.
Run BUN_BIN="${GITHUB_ACTION_PATH}/bin/bun"
Internal error: directory mismatch for directory "/home/runner/work/_actions/anthropics/claude-code-action/v1/tsconfig.json", fd 4. You don't need to do anything, but this indicates a bug.
No buffered inline comments
```

**To Reproduce**

I used the built-in slash command in Claude Code to install the workflows into my GitHub repository, and it's enabled.

**Expected behavior**

Claude Code should run successfully in my GitHub Actions workflow.

**Screenshots**

Image

Contributor guide

Open the contributing guide

Research direction

Start with the installed GitHub Actions workflow and the run log around OIDC token acquisition and GitHub App installation-token exchange. Reproduce the slash-command setup, then trace why the exchange returns HTTP 401; done means the Claude Code action completes successfully without the token-exchange error.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
authentication, ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.