File watcher EINVAL error prints over TUI input textbox

Resolved 💬 3 comments Opened Jan 21, 2026 by smm-h Closed Jan 25, 2026

Description

Occasionally, a file watcher error prints directly to stderr, corrupting the TUI display by appearing in the middle of the bottom input textbox.

Error message

Error: EINVAL: invalid argument, watch '/home/m/.claude-personal/.claude.json.tmp.1398822.1768998411416'
    at watch (unknown)
    at new FSWatcher (node:fs:30:31)
    at watch (node:fs:300:23)
    at MGL (/$bunfs/root/claude:168:12389)
    at CiB (/$bunfs/root/claude:168:17599)
    at _watchWithNodeFs (/$bunfs/root/claude:168:12870)
    at _handleFile (/$bunfs/root/claude:168:13613)
    at _addToNodeFs (/$bunfs/root/claude:168:16640)

Expected behavior

This error should be caught and handled silently (or logged to a file) rather than printed to stderr where it disrupts the TUI.

Root cause

This appears to be a race condition where the file watcher tries to watch a temporary config file (.claude.json.tmp.*) that was created during an atomic write operation but has already been renamed/deleted by the time the watcher attaches.

Environment

  • OS: Linux (Fedora, kernel 6.17.11-300.fc43.x86_64)
  • Platform: x86_64

View original on GitHub ↗

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