Chat/Agent file links break for SvelteKit [param] folders — brackets percent-encoded (%5B / %5D)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When an agent cites a SvelteKit route file whose directory name contains literal [ and ] characters (dynamic segments), the clickable chat link percent-encodes those brackets. Clicking the link fails because the editor looks for a path that does not exist on disk.

Actual directory / file:
frontend/src/routes/crs/[crShortId]/edit/+page.svelte

Chat link is treated as:
frontend/src/routes/crs/%5BcrShortId%5D/edit/+page.svelte

The real folder is named [crShortId], not %5BcrShortId%5D.

This is related to the known Windows chat-link percent-encoding issues (%5C for backslashes), but specifically affects valid filesystem characters [ and ] used heavily by SvelteKit (and Next.js) for dynamic route folders.

Steps to Reproduce

  1. Open a SvelteKit project that has a route folder like src/routes/crs/[crShortId]/edit/+page.svelte.
  2. In Agent/Chat, ask something that causes the agent to link that file (for example: cite or open the edit page).
  3. Click the file link in the chat response.
  4. Observe that the path becomes HTML/URI-encoded with %5B / %5D and the editor cannot resolve the file.

Expected Behavior

The editor should open the real filesystem path with literal brackets:
frontend/src/routes/crs/[crShortId]/edit/+page.svelte

Chat file links should not percent-encode [ / ] when those characters are part of a valid directory name.

Operating System

Windows 10/11

Version Information

Cursor IDE (Windows)
OS: Windows 10.0.26200

Please note: exact Cursor build from Help > About Cursor can be pasted here if needed for triage. Reproduced in current Cursor Agent chat when linking SvelteKit [param] route files.

For AI issues: which model did you use?

Grok 4.5 (Agent / Chat)

Additional Information

Workaround: Ctrl+P (Go to File) and type the path with literal brackets, or open from Explorer.

Related known reports focus on Windows %5C encoding of backslashes in chat links; this report is specifically about [ / ] in SvelteKit dynamic route folder names becoming %5B / %5D.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. It’s laid out really well, and I was able to reproduce the issue.

You already found the main workaround. Ctrl+P Go to File with literal brackets opens the file fine. Another option is paths rendered in chat as inline code in backticks. Those links click correctly and avoid this encoding.

This isn’t something in your setup. It matches a broader pattern where file links in chat percent-encode path characters like \, and now also [ and ], then the click can’t resolve the file. I’ve passed this specific bracket and relative path case to the team. I can’t share an ETA yet, but I’ll post in the thread if there’s an update.