
Lessons from Aman Sanger
Aman Sanger co-founded Anysphere, the company behind the AI code editor Cursor. He describes building an editor around AI-assisted software development, including codebase-aware interaction and specialized models for responsive edits. — Latent Space — Aman Sanger on Cursor.
Part 1: The AI-First Paradigm
- Design the Editor Around AI: Sanger says sufficiently capable coding models require a redesigned software-development workflow inside the IDE, not just more autocomplete. — Latent Space — Aman Sanger on Cursor.
- Avoid Extension Platform Limits: Sanger says a VS Code extension depends on APIs controlled by the incumbent, limiting the interactions a new AI editor can build. — Latent Space — Aman Sanger on Cursor.
- Build for a High Product Ceiling: Sanger describes AI coding as a domain where continued model improvements leave substantial room for new product capabilities. — Lex Fridman — Cursor Team Transcript.
- Expect More Useful Coding Products: Sanger argues the best AI coding product in three or four years could be much more useful than today's, so incumbents must keep innovating. — Lex Fridman — Cursor Team Transcript.
- Expand Software Engineering Bandwidth: Sanger identifies strong ideas and difficult engineering as limits on AI progress; reducing the effort needed to implement new model ideas would allow more experiments. — Lex Fridman — Cursor Team Transcript.
- Make Software Easier to Create: Sanger describes Cursor's long-term goal as making sophisticated software easier for more people to produce. — Peak XV — Aman Sanger Interview.
- Build Around Frontier Models: Cursor combines frontier models for hard reasoning with specialized models and infrastructure for editor tasks such as fast application. — Lex Fridman — Cursor Team Transcript.
Part 2: Designing Cursor and the UX Moat
- Find the Features That Pull Users Back: Sanger says growth accelerated after Cursor introduced Command-K inline edits and codebase indexing. — Peak XV — Aman Sanger Interview.
- Retrieve Relevant Code, Not Everything: Sanger describes improving retrieval to identify the function or class relevant to a developer's question instead of handing a model an indiscriminate codebase dump. — Latent Space — Aman Sanger on Cursor.
- Explore Isolated AI Edits: Sanger discusses a possible shadow-workspace approach in which a model edits an in-memory version of files and the developer retains control of saving. — Lex Fridman — Cursor Team Transcript.
- Design for Low-Latency Assistance: Sanger explains that inline AI assistance needs small specialized models and cache reuse to keep responses fast as developers type. — Lex Fridman — Cursor Team Transcript.
- Combine Prediction with Editor Context: Sanger describes Cursor Tab as a specialized model that uses substantial surrounding code context for responsive in-editor suggestions. — Lex Fridman — Cursor Team Transcript.
- Improve Multi-File Review: Sanger argues that language models could make review of changes across files easier by directing attention to the regions that matter. — Lex Fridman — Cursor Team Transcript.
- Let Developers Supply Explicit Context: Sanger describes letting users add files or current documentation to chat or Command-K when the model needs more context. — Latent Space — Aman Sanger on Cursor.
- Move Beyond Next-Line Completion: Sanger says AI coding will require new editing workflows as models become capable of refactoring, debugging and producing larger portions of software. — Latent Space — Aman Sanger on Cursor.
Part 3: Rethinking Editor Architecture and Latency
- Build Task-Specific Editor Infrastructure: Sanger describes combining frontier models with custom models for tab completion and applying edits, rather than relying on one model for every editor task. — Lex Fridman — Cursor Team Transcript.
- Specialize a Fast-Apply Model: Cursor trained a model specifically to apply a planned code change to a file, trading generic capability for speed and accuracy on that task. — Cursor — Editing Files at 1000 Tokens per Second.
- Exploit Unchanged Code in Speculative Edits: Sanger's speculative-edits technique predicts that much of an existing file remains unchanged, allowing a full-file rewrite to run faster. — Cursor — Editing Files at 1000 Tokens per Second.
- Treat Speed Figures as Dated Benchmarks: In a May 2024 experiment, Sanger reported roughly 1,000 tokens per second for Cursor's 70B fast-apply model using specialized speculative edits; this is a historical benchmark, not a current guarantee. — Cursor — Editing Files at 1000 Tokens per Second.
- Cache Likely Next Context: Sanger describes predicting ahead after a suggestion to warm a cache for a likely next user action, reducing repeated model work. — Lex Fridman — Cursor Team Transcript.
- Match Model Architecture to Editor Latency: Sanger says long code-heavy prompts and short generated edits favor small sparse models, speculative edits and cache-aware prompting. — Lex Fridman — Cursor Team Transcript.
- Use Specialized Models for Local Edits: Sanger says frontier models can sketch a change, while Cursor's specialized Apply model handles the difficult task of translating it into a precise file edit. — Lex Fridman — Cursor Team Transcript.
- Experiment with Learning Codebase Retrieval: Sanger describes an experiment in training a model to return the relevant code symbol for a query, rather than claiming the model already memorizes an entire repository. — Latent Space — Aman Sanger on Cursor.
- Train Cursor Tab for Its Own Task: Sanger says Cursor Tab is evaluated and trained for a focused editor-completion task, where a specialized model can outperform a frontier model on that task. — Lex Fridman — Cursor Team Transcript.
- Reuse Prompt Work to Keep Tab Fast: Sanger explains that rerunning a long context on every keystroke would harm latency and GPU load, so prompts and KV caches are designed for reuse. — Lex Fridman — Cursor Team Transcript.
Part 4: The Reality of Modern Software Engineering
- Evaluate on Real Repository Tasks: Sanger cautions that a model strong on interview-style problems may not best understand rough user intent in ordinary coding work. — Lex Fridman — Cursor Team Transcript.
- Resolve Ambiguous Developer Intent: Sanger suggests an assistant ask clarifying questions or show several possible implementations when a user's request does not convey enough intent. — Lex Fridman — Cursor Team Transcript.
- Look Beyond Benchmark Scores: Sanger evaluates coding models across speed, editing, context handling and out-of-benchmark usefulness, not one benchmark score. — Lex Fridman — Cursor Team Transcript.
- Iterate in Code Quickly: Sanger says he often prefers getting into code, testing a possible implementation and iterating, rather than trying to perfect the design before building. — Lex Fridman — Cursor Team Transcript.
- Respect Tacit Developer Context: Sanger says valuable software decisions often depend on ideas and preferences in a developer's head that are difficult to convey fully to someone else. — Peak XV — Aman Sanger Interview.
- Support Editing and Debugging, Not Just New Code: Sanger says early GPT-4 experiments were useful for refactoring, editing and debugging as well as generating new code. — Latent Space — Aman Sanger on Cursor.
Part 5: From First Principles to Startup Strategy
- Run Many Product Experiments: Sanger says visible Cursor features emerged from many failed experiments; the team repeatedly tested what coding models could usefully do. — Peak XV — Aman Sanger Interview.
- Release Useful but Unfinished Features: Sanger says Cursor released early imperfect versions once they showed usefulness to the team, then improved them from real user reactions. — Peak XV — Aman Sanger Interview.
- Be a User of the Product: After exploring AI for CAD and text-to-image, Sanger says the team chose coding partly because they themselves used and understood developer tools. — Latent Space — Aman Sanger on Cursor.
- Hire Slowly Without Lowering the Bar: Sanger says four technical cofounders could build the early product before hiring, giving the team time to preserve a high hiring bar. — Peak XV — Aman Sanger Interview.
- Keep Reinventing the Product: In a later interview Sanger says coding tools must be reinvented every few months or year as model capabilities and competitors change. — Economic Times — Aman Sanger Interview.
- Find the Core Developer Loop: Sanger says initial Cursor usage fell after launch; adoption improved after Command-K edits and codebase indexing matched what developers wanted. — Peak XV — Aman Sanger Interview.
Part 6: Human Effort and The Role of the Engineer
- Move Human Effort Toward Product Judgment: Sanger expects developers to spend more effort deciding how software should work and shaping the experience as AI makes implementation easier. — Peak XV — Aman Sanger Interview.
- Keep Engineers in the Loop: Sanger expects some bounded tasks to go from prompt to code, while high-value software still needs an engineer's judgment and fast iterative supervision. — Peak XV — Aman Sanger Interview.
- Preserve Human Taste: Sanger says the taste behind product interactions and design remains central even when AI can produce code more easily. — Peak XV — Aman Sanger Interview.
- Pair Engineers with AI Tools: Sanger argues that for a long time, strong engineers working with AI tools will be more productive than fully autonomous AI coworkers. — Peak XV — Aman Sanger Interview.
- Value Love of Programming: Sanger says the strongest programmers he knows genuinely love coding and explore the details even outside working hours. — Lex Fridman — Cursor Team Transcript.
- Use Prompts for Well-Defined Work: Sanger expects simple, clearly specified applications to be built through prompt-to-code iteration, while more demanding products still require developer direction. — Peak XV — Aman Sanger Interview.
- Keep the Fast Creative Loop: Sanger says he enjoys trying an implementation directly and iterating quickly in code, rather than treating programming only as up-front design followed by execution. — Lex Fridman — Cursor Team Transcript.
Part 7: Scaling Laws and AI Optimism
- Reconsider the Implications of Scaling: Sanger recalls moving from skepticism toward optimism after discussing why model scaling could continue to produce substantial capability gains. — Lex Fridman — Cursor Team Transcript.
- Stay Optimistic with Domain Caveats: Sanger says scaling made him optimistic about progress, while emphasizing that progress will vary by domain and need not imply general intelligence. — Lex Fridman — Cursor Team Transcript.
- Measure Scaling Against Inference Cost: Sanger says model size, training data and compute are not the only variables; inference budget and context length also shape useful model design. — Lex Fridman — Cursor Team Transcript.
- Revise Training-Market Assumptions: Sanger later revised his forecast that many AI startups would train their own models: he expected most application companies to use foundation-model APIs, with fine-tuning where useful. — Latent Space — Aman Sanger on Cursor.
- Use Code History Thoughtfully: Sanger notes the large amount of public code and considers how repository data and retrieval can improve coding systems, without asserting a fixed current corpus size. — Latent Space — Aman Sanger on Cursor.
- Remove Engineering Bottlenecks in AI Research: Sanger argues that lowering the engineering cost of implementing new model ideas could let research teams test more promising architectures. — Lex Fridman — Cursor Team Transcript.
Part 8: Math, Truth, and the Path Forward
- Use Verifiable Domains for AI Progress: Sanger points to formal theorem proving as a domain where a system can receive a strong, objective signal that an answer is correct. — Lex Fridman — Cursor Team Transcript.
- Apply RL Where Answers Can Be Checked: Sanger suggests reinforcement learning may work especially well in mathematics because formal proofs offer a clear correctness signal. — Lex Fridman — Cursor Team Transcript.
- Keep Advancing Retrieval for Larger Tasks: Sanger says Cursor continues improving codebase retrieval and that its quality ceiling is higher than many expect, while treating more autonomous workflows as future possibilities. — Lex Fridman — Cursor Team Transcript.