[BUG] continuous Vite HMR reload loop on external volumes
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Vite detects file changes on every file Claude Code writes/indexes to when on external volume, causing an infinite reload loop (every 20 - 30 seconds).
What Should Happen?
Claude writes to the file and Vite reloads once as normal.
Error Messages/Logs
3:00:01 PM [vite] (client) hmr update /src/components/EmailCreateDialog.jsx, /src/components/RichTextEditor.jsx, /src/components/EmailThread.jsx, /src/components/Templates.jsx, /src/components/ContactDetail.jsx
3:00:01 PM [vite] vite.config.js changed, restarting server...
3:00:01 PM [vite] server restarted.
This repeats continuously every few seconds while Claude Code is open.
Steps to Reproduce
- Have a Vite dev server running on an external/network volume
- Open Claude Code in the same project directory
- Have Claude write to a file Vite is watching eg vite.config.js
- Vite immediately starts continuous HMR updates and config restarts
- Close Claude Code → reloading stops
- Reopen Claude Code → reloading resumes
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
v2.1.39
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
<img width="553" height="787" alt="Image" src="https://github.com/user-attachments/assets/74d284eb-080e-484a-9a16-7dc2c14d3817" />
Project is on an external volume mounted at /Volumes/{usr}/
Vite 7.3.1 with default fsevents watcher
Setting usePolling: false in Vite server config did not resolve the issue
The uvicorn backend I was using with --reload had the same issue (infinite restart loop) until --reload was removed
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗