Reverse Engineering Cursor's LLM Client: Peeking Under the Hood of an AI Coding Assistant

2025-06-07
Reverse Engineering Cursor's LLM Client: Peeking Under the Hood of an AI Coding Assistant

This post details how the authors used the open-source framework TensorZero to build a self-hosted proxy and successfully reverse-engineered the LLM client of the AI coding assistant Cursor. By routing communication between Cursor and LLM providers through TensorZero, they could observe, analyze, and even optimize the prompts and models Cursor uses. They overcame challenges related to Cursor's server-side preprocessing and CORS issues. Ultimately, they gained complete visibility into Cursor's LLM interactions, including prompts and responses, enabling A/B testing of different LLM models. This work provides valuable insights into understanding and optimizing AI coding assistants and reveals a potential hierarchy of LLMs within Cursor.

Development