claude-code - 💡(How to fix) Fix [BUG] FreeBSD reported as `Platform: linux` in environment block and /feedback submissions [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#51698Fetched 2026-04-22 07:55:15
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1

Error Message

Error Messages/Logs

Fix Action

Fix / Workaround

  1. Install Claude Code on a FreeBSD host (npm install from a pinned pre-native version, or via the FreeBSD port, or via the BUN_JSC_useBBQJIT=0 Linuxulator workaround from #30640).
  2. Start a session.
  3. Ask the agent what platform it thinks it's running on, or type /feedback and observe the reported environment.
  4. Note that Platform: says linux while OS Version: says FreeBSD ….

Code Example

Platform: linux
OS Version: FreeBSD 15.0-RELEASE-p2

---

$ node -e 'console.log(process.platform)'
freebsd

---

- Platform: linux
- Shell: /bin/tcsh
- OS Version: FreeBSD 15.0-RELEASE-p2
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report
  • I am using the latest version of Claude Code

What's Wrong?

Claude Code's own environment/feedback reporting mislabels FreeBSD hosts as linux.

When you run Claude Code on a native FreeBSD host (not Linuxulator, not a Linux jail — actual FreeBSD userland on an actual FreeBSD kernel), the agent's environment block reports:

Platform: linux
OS Version: FreeBSD 15.0-RELEASE-p2

These two lines contradict each other. The /feedback submission carries the same mislabel forward, so any bug report a FreeBSD user files through the in-product path arrives tagged as a Linux report.

This is a small string bug on its own, but it has real consequences:

  1. Broken telemetry. Anthropic cannot tell how many FreeBSD users are active — they're all bucketed as Linux. Decisions about dropping FreeBSD support (#30640) are being made without the data that would show the actual user count.
  2. Broken feedback loop. FreeBSD users have no working channel to flag FreeBSD-specific issues through Claude Code itself — the feedback form lies about their OS before the message ever reaches anyone.
  3. Leaks into agent behavior. When the model is told "Platform: linux", it reasons about the environment incorrectly — suggesting apt install, systemctl, /proc/*, glibc paths, etc. on a FreeBSD host. FreeBSD users see generic Linux advice they then have to correct by hand.

What Should Happen?

The platform string shown to the agent and used in feedback submissions should match process.platform / uname. On FreeBSD it should read freebsd, not linux.

Minimum viable fix: pass through process.platform verbatim to the system prompt and feedback metadata instead of collapsing non-Darwin/non-Windows to "linux".

Error Messages/Logs

Node reports the platform correctly:

$ node -e 'console.log(process.platform)'
freebsd

Claude Code's environment block, on the same host, disagrees:

- Platform: linux
- Shell: /bin/tcsh
- OS Version: FreeBSD 15.0-RELEASE-p2

Steps to Reproduce

  1. Install Claude Code on a FreeBSD host (npm install from a pinned pre-native version, or via the FreeBSD port, or via the BUN_JSC_useBBQJIT=0 Linuxulator workaround from #30640).
  2. Start a session.
  3. Ask the agent what platform it thinks it's running on, or type /feedback and observe the reported environment.
  4. Note that Platform: says linux while OS Version: says FreeBSD ….

Claude Model

Opus (claude-opus-4-7)

Is this a regression?

Not sure — may have been wrong since the platform string was first added. This was noticed today (2026-04-21) while trying to submit feedback about unrelated FreeBSD issues.

Last Working Version

N/A

Claude Code Version

2.1.111

Platform

Anthropic API

Operating System

Other (FreeBSD 15.0-RELEASE-p2, amd64)

Terminal/Shell

tcsh

Additional Information

Related but distinct from the FreeBSD support questions in #30640 and #51020. Those are about whether FreeBSD runs Claude Code at all; this one is about Claude Code telling its own users (and itself) the wrong OS name when it is running. The two problems compound: FreeBSD users have lost the native build path AND the feedback path that would let them explain why that matters.

extent analysis

TL;DR

The most likely fix is to update the platform detection logic in Claude Code to correctly identify FreeBSD hosts and report the platform as "freebsd" instead of "linux".

Guidance

  • Verify that the process.platform variable in Node.js correctly reports "freebsd" on a FreeBSD host, as shown in the issue.
  • Check the Claude Code source code to see where the platform string is being set to "linux" and update it to use the process.platform value instead.
  • Test the fix by running Claude Code on a FreeBSD host and checking the reported platform in the environment block and feedback submissions.
  • Consider adding a check to ensure that the platform string is correctly set for other non-Darwin and non-Windows platforms.

Example

No code snippet is provided as the issue does not include the relevant Claude Code source code.

Notes

The issue may have been present since the platform string was first added, and it is not clear if this is a regression or a long-standing bug. The fix may need to be verified on multiple platforms to ensure that it does not introduce new issues.

Recommendation

Apply a workaround to update the platform detection logic in Claude Code to correctly identify FreeBSD hosts, as the issue is causing broken telemetry, feedback loop, and agent behavior.

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

claude-code - 💡(How to fix) Fix [BUG] FreeBSD reported as `Platform: linux` in environment block and /feedback submissions [1 participants]