[BUG] `_claude_fs_right:/Users...` URL crashes rust-analyzer

Status Closed — not planned
Maintainer reply None cached
Activity 10 comments · opened Jun 3, 2025 · closed Jan 22, 2026

originally reported at https://github.com/rust-lang/rust-analyzer/issues/19910

Environment

  • Claude CLI version: 1.0.9
  • Operating System: macOS 14.7.6
  • Terminal: VSCode 1.100.2

Bug Description

workspace/didChangeWatchedFiles LSP call with _claude_fs_right:/Users/e/Documents/GitHub/hotline/runtime/src/shim_gen.rs URL crashes rust-analyzer LSP: "relative URL without a base"

Steps to Reproduce

  1. Use Claude code to propose an edit with the Claude Code VSCode extension enabled, so it opens a VSCode native diff viewer pane
  2. Accept the diff
  3. Check the "rust-analyzer Language Server" Output pane in VSCode

Expected Behavior

No LSP crash

Actual Behavior

thread 'LspServer' panicked at crates/rust-analyzer/src/handlers/dispatch.rs:420:17:
Invalid request
Method: workspace/didChangeWatchedFiles
 error: relative URL without a base: "_claude_fs_right:/Users/e/Documents/GitHub/hotline/runtime/src/shim_gen.rs"
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rust_analyzer::handlers::dispatch::NotificationDispatcher::on_sync_mut
   3: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event
   4: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   5: rust_analyzer::main_loop::main_loop
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jod-thread-1.0.0/src/lib.rs:33:22:
called `Result::unwrap()` on an `Err` value: Any { .. }
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: stdx::thread::JoinHandle<T>::join
   4: rust_analyzer::with_extra_thread
   5: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Info  - 4:58:26 AM] Connection to server got closed. Server will restart.
true
[Error - 4:58:26 AM] Server process exited with code 101.

View original on GitHub ↗

10 Comments

anthony-c-martin · 1 year ago

We're having the same problem in the Bicep extension (https://github.com/Azure/bicep/issues/14140)

Context I shared elsewhere:

As per the LSP spec, the scheme must adhere to the standard for an RFC3986 URI: https://datatracker.ietf.org/doc/html/rfc3986#section-3.1, where it looks like _ is not technically valid.

It looks like the fix is that the claude-code extension should not be creating files with a scheme set to _claude_fs_right, and instead pick a value that adheres to the URI RFC: https://datatracker.ietf.org/doc/html/rfc3986#section-3.1

Boscop · 1 year ago

Yes, this is a very annoying issue for me too. Claude Code always crashes rust-analyzer:

thread 'LspServer' panicked at crates/rust-analyzer/src/handlers/dispatch.rs:417:17:
Invalid request
Method: workspace/didChangeWatchedFiles
 error: relative URL without a base: "_claude_fs_right:/Users/me/dev/db/src/api.rs"
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rust_analyzer::handlers::dispatch::NotificationDispatcher::on_sync_mut
   3: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event
   4: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   5: rust_analyzer::main_loop::main_loop
   6: rust_analyzer::run_server
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jod-thread-1.0.0/src/lib.rs:33:22:
called `Result::unwrap()` on an `Err` value: Any { .. }
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: stdx::thread::JoinHandle<T>::join
   4: rust_analyzer::with_extra_thread
   5: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 1:36:31 AM] Server process exited with code 101.
[Info  - 1:36:31 AM] Connection to server got closed. Server will restart.
true

thread 'LspServer' panicked at crates/rust-analyzer/src/handlers/dispatch.rs:417:17:
Invalid request
Method: workspace/didChangeWatchedFiles
 error: relative URL without a base: "_claude_fs_right:/Users/me/dev/db/src/backend.rs"
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rust_analyzer::handlers::dispatch::NotificationDispatcher::on_sync_mut
   3: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event
   4: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   5: rust_analyzer::main_loop::main_loop
   6: rust_analyzer::run_server
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jod-thread-1.0.0/src/lib.rs:33:22:
called `Result::unwrap()` on an `Err` value: Any { .. }
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: stdx::thread::JoinHandle<T>::join
   4: rust_analyzer::with_extra_thread
   5: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Info  - 1:41:33 AM] Connection to server got closed. Server will restart.
true
[Error - 1:41:33 AM] Server process exited with code 101.

thread 'LspServer' panicked at crates/rust-analyzer/src/handlers/dispatch.rs:417:17:
Invalid request
Method: workspace/didChangeWatchedFiles
 error: relative URL without a base: "_claude_fs_right:/Users/me/dev/db/src/backend.rs"
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rust_analyzer::handlers::dispatch::NotificationDispatcher::on_sync_mut
   3: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event
   4: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   5: rust_analyzer::main_loop::main_loop
   6: rust_analyzer::run_server
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jod-thread-1.0.0/src/lib.rs:33:22:
called `Result::unwrap()` on an `Err` value: Any { .. }
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: stdx::thread::JoinHandle<T>::join
   4: rust_analyzer::with_extra_thread
   5: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Info  - 1:41:41 AM] Connection to server got closed. Server will restart.
true
[Error - 1:41:41 AM] Server process exited with code 101.
2025-07-27T01:42:36.033082+03:00 ERROR Only tuple has tuple field: AssocTypeId(Id(fd197))<[?0 := AdtId(StructId(StructId(ba954)))<[]>, ?1 := 4<[?0 := !0_1321988, ?1 := !0_1321989, ?2 := !0_1321990, ?3 := !0_1321991]>, ?2 := !0_1321987]>
2025-07-27T01:42:36.033131+03:00 ERROR Only tuple has tuple field: AssocTypeId(Id(fd197))<[?0 := AdtId(StructId(StructId(ba954)))<[]>, ?1 := 4<[?0 := !0_1321988, ?1 := !0_1321989, ?2 := !0_1321990, ?3 := !0_1321991]>, ?2 := !0_1321987]>
2025-07-27T01:42:36.03314+03:00 ERROR Only tuple has tuple field: AssocTypeId(Id(fd197))<[?0 := AdtId(StructId(StructId(ba954)))<[]>, ?1 := 4<[?0 := !0_1321988, ?1 := !0_1321989, ?2 := !0_1321990, ?3 := !0_1321991]>, ?2 := !0_1321987]>
2025-07-27T01:42:36.033153+03:00 ERROR Only tuple has tuple field: AssocTypeId(Id(fd197))<[?0 := AdtId(StructId(StructId(ba954)))<[]>, ?1 := 4<[?0 := !0_1321988, ?1 := !0_1321989, ?2 := !0_1321990, ?3 := !0_1321991]>, ?2 := !0_1321987]>
2025-07-27T01:42:36.033162+03:00 ERROR Only tuple has tuple field: AssocTypeId(Id(fd197))<[?0 := AdtId(StructId(StructId(ba954)))<[]>, ?1 := 4<[?0 := !0_1321988, ?1 := !0_1321989, ?2 := !0_1321990, ?3 := !0_1321991]>, ?2 := !0_1321987]>
2025-07-27T01:42:36.049399+03:00 ERROR Only tuple has tuple field: AssocTypeId(Id(fd197))<[?0 := AdtId(StructId(StructId(ba954)))<[]>, ?1 := 4<[?0 := !0_1321988, ?1 := !0_1321989, ?2 := !0_1321990, ?3 := !0_1321991]>, ?2 := !0_1321987]>
2025-07-27T01:42:36.049436+03:00 ERROR Only tuple has tuple field: AssocTypeId(Id(fd197))<[?0 := AdtId(StructId(StructId(ba954)))<[]>, ?1 := 4<[?0 := !0_1321988, ?1 := !0_1321989, ?2 := !0_1321990, ?3 := !0_1321991]>, ?2 := !0_1321987]>
2025-07-27T01:42:36.04945+03:00 ERROR Only tuple has tuple field: AssocTypeId(Id(fd197))<[?0 := AdtId(StructId(StructId(ba954)))<[]>, ?1 := 4<[?0 := !0_1321988, ?1 := !0_1321989, ?2 := !0_1321990, ?3 := !0_1321991]>, ?2 := !0_1321987]>

thread 'LspServer' panicked at crates/rust-analyzer/src/handlers/dispatch.rs:417:17:
Invalid request
Method: workspace/didChangeWatchedFiles
 error: relative URL without a base: "_claude_fs_right:/Users/me/dev/db/src/api.rs"
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rust_analyzer::handlers::dispatch::NotificationDispatcher::on_sync_mut
   3: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event
   4: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   5: rust_analyzer::main_loop::main_loop
   6: rust_analyzer::run_server
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jod-thread-1.0.0/src/lib.rs:33:22:
called `Result::unwrap()` on an `Err` value: Any { .. }
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: stdx::thread::JoinHandle<T>::join
   4: rust_analyzer::with_extra_thread
   5: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 1:42:38 AM] Server process exited with code 101.
[Info  - 1:42:38 AM] Connection to server got closed. Server will restart.
true

thread 'LspServer' panicked at crates/rust-analyzer/src/handlers/dispatch.rs:417:17:
Invalid request
Method: workspace/didChangeWatchedFiles
 error: relative URL without a base: "_claude_fs_right:/Users/me/dev/db/src/backend.rs"
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rust_analyzer::handlers::dispatch::NotificationDispatcher::on_sync_mut
   3: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event
   4: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   5: rust_analyzer::main_loop::main_loop
   6: rust_analyzer::run_server
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jod-thread-1.0.0/src/lib.rs:33:22:
called `Result::unwrap()` on an `Err` value: Any { .. }
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: stdx::thread::JoinHandle<T>::join
   4: rust_analyzer::with_extra_thread
   5: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 1:42:51 AM] Server process exited with code 101.
[Info  - 1:42:51 AM] Connection to server got closed. Server will restart.
true

thread 'LspServer' panicked at crates/rust-analyzer/src/handlers/dispatch.rs:417:17:
Invalid request
Method: workspace/didChangeWatchedFiles
 error: relative URL without a base: "_claude_fs_right:/Users/me/dev/db/src/backend.rs"
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rust_analyzer::handlers::dispatch::NotificationDispatcher::on_sync_mut
   3: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event
   4: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   5: rust_analyzer::main_loop::main_loop
   6: rust_analyzer::run_server
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jod-thread-1.0.0/src/lib.rs:33:22:
called `Result::unwrap()` on an `Err` value: Any { .. }
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: stdx::thread::JoinHandle<T>::join
   4: rust_analyzer::with_extra_thread
   5: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 1:43:03 AM] The Rust Analyzer Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 1:43:03 AM] Server process exited with code 101.
loadingalias · 1 year ago

Any idea of a patch here? I'm using Claude Code in Cursor. The rust-analyzer is crashing every few minutes. Similar to the issues above - MacOS; Cursor; Claude Code.

loadingalias · 11 months ago

If you're having a tough time solving the issue... you can temporarily set the following in you IDE settings.json file:

  • "rust-analyzer.files.watcher": "server"

This will keep the rust-analyzer off client file-watch events; this solves the issue on my MBP while using Cursor/VS Code.

As an aside, Zed has none of these issues... even if the CC integration is less than complete. Just a note.

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

jonny-sh · 8 months ago

this is still happening as of 2.0.62

j03l · 8 months ago

Still experiencing this issue

Environment:

  • OS: Linux (WSL2 - Ubuntu on Windows)
  • VS Code with Claude Code extension
  • LSP affected: ty (Astral's type checker)

Error message:

2025-12-22 17:30:49.844931966 ERROR Encountered error when routing notification: JSON parsing failure:
Invalid notification
Method: workspace/didChangeWatchedFiles
 error: relative URL without a base: "_claude_fs_right:/home/hunter/dev/projects/python-projects/eagle-scripts/magento/product_edit/product_editor.py"

Reproduction:
Occurs when Claude Code proposes file edits and the diff viewer opens. The invalid _claude_fs_right: URI scheme is sent to LSP servers via workspace/didChangeWatchedFiles.

Additional context:
This affects multiple LSP servers - not just rust-analyzer. I'm seeing it with ty (the new type checker from Astral/ruff team). Any LSP server that strictly validates file URIs will fail on this.

Is there a timeline for a fix, or a workaround to prevent these notifications from being sent to LSP servers?

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 7 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 7 months ago

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.