Claude CLI crashes with EOPNOTSUPP when browser bridge socket file exists
Status Fixed / completed
Maintainer reply ✓ Yes — whyuan-cc
Workaround ✓ Mentioned in thread ↓
Activity 3 comments · opened Jan 3, 2026 · closed Jan 8, 2026
💡 Likely answer: A maintainer (whyuan-cc, contributor)
responded on this thread — see the highlighted reply below.
Description
Claude CLI crashes on startup when a claude-mcp-browser-bridge-* socket file exists in the temp directory. The CLI tries to fs.watch() the socket file, which fails with EOPNOTSUPP because you cannot watch Unix socket files.
Environment
- macOS 14.x (Darwin 24.6.0)
- Bun v1.3.5
- Claude Code v2.0.76
Steps to Reproduce
- Use Claude CLI with Chrome integration (
--chromeflag or browser extension) - This creates a socket file at
$TMPDIR/claude-mcp-browser-bridge-$USER - Close the Claude session (the socket file remains)
- Start a new Claude CLI session
- CLI crashes immediately
Error Output
EOPNOTSUPP: unknown error, watch '/var/folders/xx/.../T/claude-mcp-browser-bridge-username'
path: "/var/folders/xx/.../T/claude-mcp-browser-bridge-username",
syscall: "watch",
errno: -102,
filename: "/var/folders/xx/.../T/claude-mcp-browser-bridge-username",
code: "EOPNOTSUPP"
at new FSWatcher (node:fs:29:31)
at watch (node:fs:296:10)
at AC_ (/$bunfs/root/claude:392:6265)
at PMD (/$bunfs/root/claude:392:11479)
at _watchWithNodeFs (/$bunfs/root/claude:392:6746)
at _handleFile (/$bunfs/root/claude:392:7489)
at _addToNodeFs (/$bunfs/root/claude:392:10516)
Bun v1.3.5 (macOS arm64)
Root Cause
The file at $TMPDIR/claude-mcp-browser-bridge-$USER is a Unix socket (file type s):
srw-------@ 1 user staff 0 Dec 27 07:49 claude-mcp-browser-bridge-username
fs.watch() does not support watching socket files on macOS, resulting in EOPNOTSUPP.
Workaround
Manually delete the socket file:
rm $TMPDIR/claude-mcp-browser-bridge-$USER
Or programmatically before starting Claude CLI:
// Check for and remove stale browser bridge socket files
const files = readdirSync(tmpdir());
for (const file of files) {
if (file.startsWith('claude-mcp-browser-bridge-')) {
const filePath = join(tmpdir(), file);
const stats = statSync(filePath);
if (stats.isSocket()) {
unlinkSync(filePath);
}
}
}
Expected Behavior
Claude CLI should handle the case where the browser bridge socket file already exists, either by:
- Not trying to
fs.watch()socket files - Cleaning up stale socket files before attempting to watch
- Gracefully handling the
EOPNOTSUPPerror
3 Comments
additional Bug Report: Claude Code crashes when $TMPDIR contains unix socket files
Version: Claude Code 2.0.76 (bundled via airchat-cli)
Platform: macOS arm64, Bun v1.3.5
Description
Claude Code crashes on startup when
$TMPDIRcontains unix socket files (.sock). The file watcher attempts to callfs.watch()on socket files, which throwsEOPNOTSUPPonmacOS.
Reproduction Steps
.sockfiles in your temp directory (common from VSCode, ssh-askpass, JetBrains, etc.)claudeor any command that launches Claude CodeError Output
Expected Behavior
Claude Code should skip socket files (and other non-watchable file types) when setting up file watchers.
Workaround
Suggested Fix
In the file watcher code, filter out entries where
stat.isSocket()returns true, or wrapfs.watch()calls in try/catch to gracefully handleEOPNOTSUPP.PR was merged and will be in next build.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.