ENXIO error when using --mcp-config or --settings flags in VS Code/Cursor terminal

Resolved 💬 7 comments Opened Dec 23, 2025 by mark-goodfire Closed Feb 26, 2026

Description

Claude Code crashes with an ENXIO error when using --mcp-config or --settings CLI flags from within VS Code or Cursor's integrated terminal. The error occurs because Claude Code attempts to watch socket files in /tmp.

Reproduction

  1. Open VS Code or Cursor integrated terminal
  2. Run:

```bash
cat > /tmp/test-mcp.json << 'CONF'
{"mcpServers": {}}
CONF

cat > /tmp/test-settings.json << 'CONF'
{"permissions": {}}
CONF

claude --mcp-config /tmp/test-mcp.json --settings /tmp/test-settings.json
```

Error

This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: ENXIO: no such device or address, watch '/tmp/vscode-ipc-99f341f6-5ab5-4174-ae1c-4222ae9eaf99.sock'
    at watch (unknown)
    at new FSWatcher (node:fs:30:31)
    at watch (node:fs:300:23)
    at oMI (/$bunfs/root/claude:389:6265)
    at Nv0 (/$bunfs/root/claude:389:11478)
    at _watchWithNodeFs (/$bunfs/root/claude:389:6746)
    at _handleFile (/$bunfs/root/claude:389:7489)
    at _addToNodeFs (/$bunfs/root/claude:389:10516)
    at processTicksAndRejections (native:7:39)

Environment

  • Claude Code version: 2.0.76
  • Platform: Linux (Ubuntu)
  • Terminal: Cursor integrated terminal
  • Installation: Native binary (~/.local/bin/claude)

Notes

  • Running plain claude without these flags works fine
  • The socket file being watched (/tmp/vscode-ipc-*.sock) is a VS Code IPC socket
  • Unsetting VSCODE_IPC_HOOK_CLI and related env vars does not fix the issue
  • Setting TMPDIR to a different directory also does not help
  • Issue does not occur in external terminals (outside VS Code/Cursor)

Workaround

Use .mcp.json project file instead of --mcp-config flag, or run from an external terminal.

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗