claude-code - 💡(How to fix) Fix WSL: 'Exec format error' for versions > 2.1.62, binary not executable [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52865Fetched 2026-04-25 06:18:48
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Participants
Timeline (top)
labeled ×5subscribed ×1

Error Message

/bin/bash: line 1: /usr/bin/claude: cannot execute binary file: Exec format error 3. Error: cannot execute binary file: Exec format error Exec format error typically indicates an architecture mismatch (e.g. binary compiled for x86_64 but running on ARM, or wrong ELF format for the WSL kernel). Something changed in the build pipeline between 2.1.62 and 2.1.63+.

Code Example

/bin/bash: line 1: /usr/bin/claude: cannot execute binary file: Exec format error
RAW_BUFFERClick to expand / collapse

Environment

  • OS: Windows 11 with WSL
  • Shell: PowerShell → WSL bash
  • Working version: 2.1.62
  • Latest stable: 2.1.109
  • Invocation: wsl claude

Problem

Any Claude Code version newer than 2.1.62 fails to execute in WSL with:

/bin/bash: line 1: /usr/bin/claude: cannot execute binary file: Exec format error

Version 2.1.62 works correctly under the same WSL environment.

Steps to Reproduce

  1. Install Claude Code > 2.1.62 (e.g. 2.1.109) on WSL
  2. Run wsl claude from PowerShell
  3. Error: cannot execute binary file: Exec format error

Expected Behavior

Claude Code should execute normally, as it does on version 2.1.62.

Notes

Exec format error typically indicates an architecture mismatch (e.g. binary compiled for x86_64 but running on ARM, or wrong ELF format for the WSL kernel). Something changed in the build pipeline between 2.1.62 and 2.1.63+.

extent analysis

TL;DR

The issue can likely be resolved by ensuring the binary compatibility of Claude Code with the WSL environment, possibly by rebuilding or obtaining a version compiled for the correct architecture.

Guidance

  • Verify the architecture of your WSL environment and the binary format of the Claude Code versions to identify any mismatches.
  • Check the build pipeline changes between versions 2.1.62 and 2.1.63 to understand what might have caused the architecture or format change.
  • Consider reaching out to the developers or maintainers of Claude Code to report the issue and inquire about potential fixes or workarounds, especially if the issue is due to a change in the build process.
  • If possible, test the execution of Claude Code directly within the WSL bash environment (without invoking through PowerShell) to isolate if the issue is specific to the invocation method.

Example

No specific code example is applicable in this scenario as the issue pertains to binary compatibility rather than code syntax or logic.

Notes

The solution may depend on the specific details of the WSL environment's architecture and the changes made to the Claude Code build pipeline between the mentioned versions. Without more information on these aspects, the guidance is focused on diagnostic steps rather than a direct fix.

Recommendation

Apply workaround: Given the information, it seems that using version 2.1.62 is the most straightforward workaround until the compatibility issue with newer versions is addressed. This is because version 2.1.62 is known to work correctly in the user's WSL environment.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING