Skip to content

How AI IDEs actually work — and practical tips for getting better results

Insight: AI IDEs like Cursor, Windsurf, and Copilot are "complex wrappers around auto-complete" — an LLM + chat UI + tools (read_file, write_file, run_command) + optimized internal prompts. The key to making them work well is understanding what LLMs are good at and designing tools around their limitations: simplifying the main agent's task by offloading sub-tasks to smaller specialized models.

Detail: Architecture: The main agent produces "semantic diffs" (just the changed code with insertion comments), a cheaper/faster "apply model" writes actual file contents, and a linter provides feedback for self-correction. This is why Anthropic models excel in IDEs — they're good not just at writing code but at breaking tasks into tool calls.

Practical tips from a power user (Shrivu writes 70% of code via Cursor): 1. Use @folder/@file aggressively — explicit context produces faster, more accurate responses 2. Code comments guide the embedding model — file-level docstrings explaining what each file does semantically matter more with AI than with human readers 3. Keep files under 500 lines — the apply-model is slow and error-prone on large files 4. Use unique file names (e.g., foo-page.js not multiple page.js) to reduce tool ambiguity 5. Invest in solid linters — lint feedback is extremely high signal for agent self-correction; typed/compiled languages provide richer feedback 6. "Stop deleting random code" prompts are futile — those artifacts come from the apply-model, not the main agent. Instead, tell the main agent to provide full file contents 7. MCP will shine for giving agents more autonomy and context (e.g., headless browser screenshots for visual self-correction) 8. Choose models optimized for agentic IDEs, not just "good at coding" — the WebDev Arena leaderboard tests for this specifically

Sources