---
title: "Iterating with shadow workspaces"
description: "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."
---

# Iterating with shadow workspaces

[Cursor](https://yomu.fyi/company/cursor) · Arvid Lunnemark · Sep 1, 2024

**Type:** Explainer

## 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.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Cursor](https://yomu.fyi/topic/cursor), [Language Server](https://yomu.fyi/topic/language-server)

- Source: [Cursor](https://cursor.com/blog/shadow-workspace)
- Source URL: https://cursor.com/blog/shadow-workspace
- Ingested by Yomu: 2026-09-02T11:46:03.693Z

[Read original post](https://cursor.com/blog/shadow-workspace)
