CursorArvid LunnemarkExplainer
Iterating with shadow workspaces
Summary
Cursor’s shadow workspace addresses the problem of letting AI agents iterate on code without disrupting a developer’s active workspace. The design prioritizes LSP usability—especially lints, definition navigation, and language-server interaction—while also requiring independence, privacy, concurrency, universality, maintainability, and speed. A copied in-memory TextModel was rejected because sharing the user’s language server could introduce copied files into references, duplicate declarations, or miss errors. The implemented approach uses a reusable hidden Electron window for the workspace, routing AI edits through Cursor’s processes and returning lints independently of the visible editor. The post treats runnability as a harder future extension, with folder-proxy designs, platform limitations, and network-level independence still open questions.
Context
AI agents need to iterate inside a development environment to use lints, navigate definitions, and run code, but allowing them to modify the user’s active workspace can overwrite work, introduce uncompilable code, or otherwise disrupt the coding experience.
Approach / What changed
The implemented shadow workspace spawns and reuses a hidden Electron window for the current workspace. AI edits are applied there, separately from the visible editor, and lints are routed back to the AI. Future work may extend the design toward runnability through a folder proxy.
Takeaways
Copying an in-memory TextModel preserves the user’s file but still exposes the copied file to the same language server, causing issues such as duplicate declarations and misleading references.
The hidden-window implementation isolates AI edits from the visible workspace while reusing Cursor’s existing language-server and extension infrastructure.
Runnability remains unresolved; proposed directions include kernel-level or FUSE-based folder proxies, with macOS, Windows, and network-level independence posing open questions.
Source and freshness
- Source
- cursor.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.