anthropics / anthropics/claude-code-action

plugin_marketplaces fails: claude install exits 0 but binary not placed at ~/.local/bin/claude

Open
#1,290 8 comments 60 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

## Summary

As of approximately 05:38 UTC on 2026-05-06, `claude-code-action@v1` fails when `plugin_marketplaces` is configured. Runs that succeeded 3 hours earlier (same action SHA, same runner image) now fail with:

```
Action failed with error: Failed to add marketplace '...': ENOENT: no such file or directory, posix_spawn '/home/runner/.local/bin/claude'
```

## Root cause (two issues)

**Issue 1 — `claude install` exits 0 despite not placing the binary**

The failing run shows the installer now emits warnings and exits 0 *without* placing the binary:

```
Setting up launcher and shell integration...
⚠ Setup notes:
● installMethod is native, but directory /home/runner/.local/bin does not exist
● installMethod is native, but claude command not found at /home/runner/.local/bin/claude

✔ Claude Code successfully installed!
Version: 2.1.129
Location: ~/.local/bin/claude
```

The "successfully installed" and "Location" lines are misleading — the binary is not actually there.

**Issue 2 — `claude-code-action` does not verify the binary exists**

`installClaudeCode()` in `src/entrypoints/run.ts` trusts the exit code and unconditionally returns `${HOME}/.local/bin/claude`, then passes that path to `installPlugins()` / `addMarketplace()`, which calls `posix_spawn` on a non-existent file.

## Timeline

- **02:20 UTC** — successful run, `2.1.129` installed fine, no warnings (run `25413013607`)
- **05:38 UTC** — first failing run, same action SHA (`7d7d3055`), same runner image (`ubuntu-24.04 20260413.86.1`), new warnings appear (run `25418483665`)

The `install.sh` script always downloads `$(curl downloads.claude.ai/claude-code-releases/latest)` regardless of the version arg, so a silent binary replacement at the same version number between those two timestamps is the most likely cause.

## Suggested fixes

1. **`claude install` should be fixed** to either create `~/.local/bin` if it doesn't exist, or exit non-zero when it cannot place the binary. Exiting 0 with a warning is incorrect behavior.
2. **`installClaudeCode()` should verify** the binary exists at the expected path before returning it — e.g., `fs.existsSync(claudePath)` — and throw if it doesn't.

## Affected configuration

```yaml
- uses: anthropics/claude-code-action@v1
with:
plugin_marketplaces: https://github.com/anthropics/claude-code.git
plugins: code-review@claude-code-plugins
```

Removing `plugin_marketplaces` unblocks the action (marketplace/plugin install is skipped entirely).

## Evidence

Failing run log excerpt (run `25418483665`, job `74555443535`):
```
Installing Claude Code v2.1.129...
Installation attempt 1...
Setting up Claude Code...
Checking installation status...
Installing Claude Code native build 2.1.129...
Setting up launcher and shell integration...
⚠ Setup notes:
● installMethod is native, but directory /home/runner/.local/bin does not exist
● installMethod is native, but claude command not found at /home/runner/.local/bin/claude

✔ Claude Code successfully installed!
Version: 2.1.129
Location: ~/.local/bin/claude

Claude Code installed successfully
...
Adding marketplace: https://github.com/anthropics/claude-code.git
##[error]Action failed with error: Failed to add marketplace '...': ENOENT: no such file or directory, posix_spawn '/home/runner/.local/bin/claude'
```

---
LLM: Claude Sonnet 4.6 (1M) | high

Contributor guide

Open the contributing guide

Research direction

Start in src/entrypoints/run.ts at installClaudeCode(), then follow the returned path into installPlugins() and addMarketplace(). Reproduce the plugin_marketplaces configuration or inspect the cited failing run to confirm the missing-binary case. Done means the action detects that ~/.local/bin/claude is absent and reports the installation failure before marketplace setup invokes it.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.