There’s Finally A Reason To Switch To Cursor

AAI LABS
Computing/SoftwareSmall Business/StartupsInternet Technology

Transcript

00:00:00With the advancement of AI and the increasing power of each new model being released,
00:00:04the way we produce code has been completely transformed.
00:00:07There are now many tools specialized for coding, like ClodCode, Cursor, Antigravity, and others,
00:00:12each with its own unique capabilities.
00:00:14But good models alone don't determine the quality of the code you produce.
00:00:18How you use the tool and manage context matters just as much.
00:00:22All of these tools have some inherent mechanism for context engineering,
00:00:25but Cursor just made a major push for a new approach, building it natively into the app itself.
00:00:29As I went through their article, I realized these principles are genuinely strong.
00:00:33We have a lot to talk about today because these ideas can be applied broadly to any platform you use to build applications.
00:00:40Context management has always been critical when working with AI agents
00:00:44because good context management determines the output quality.
00:00:47We have previously talked in our videos about how important context management is and talked about workflows for it.
00:00:53Cursor implemented context management features directly into their product and released an article about it.
00:00:58These principles are based on their observation that, to get good results from models,
00:01:02it's better to provide as few details as possible in the context window.
00:01:06The less information the model receives at once, the less data it has to process at once,
00:01:10meaning lesser confusion and more focus on the task it needs to do at the moment,
00:01:14because only relevant information is included.
00:01:17This approach is what they call dynamic context discovery.
00:01:20The idea is structured note-taking.
00:01:22That is, the information not needed right now should not be in the context window,
00:01:26excluding potentially confusing or contradictory details,
00:01:29improves the quality of the agent's responses significantly.
00:01:32Cursor's current release adds five dynamic context management methods rolling out to users soon.
00:01:37Even though Cursor is implementing this as a product update,
00:01:40these principles are widely transferable to all AI agents.
00:01:44The first update Cursor mentioned is that long tool responses should go into files.
00:01:48MCPs often return large responses that stay in the context window.
00:01:52Not all of the information from the responses is always needed.
00:01:55Cursor mentioned that the common approach of the most coding tools is to truncate long MCP responses,
00:02:01which leads to data loss or important information that might be necessary for the context being removed.
00:02:07Claude's Chrome extension is a very tool-heavy extension,
00:02:10and just a few prompts can fill up the context because of loading a huge chunk into the context window.
00:02:15So I added an instruction in the Claude.md file that any MCP tool response greater than 50 lines
00:02:21must be saved to an MCP folder within the .context folder by running an echo command in the terminal.
00:02:27When I ran the Chrome extension to analyze the UI of a landing page,
00:02:30whenever Claude came across a tool like ReadPage that significantly bloats the context window,
00:02:35it saved the MCP response into a file for further reading,
00:02:39using which it analyzed the whole page and gave me a report.
00:02:42This workaround improved the accuracy of the tool response analysis
00:02:45by letting Claude analyze the responses from files as many times as needed
00:02:49and eliminated the need for repetitive tool calls.
00:02:52When data from previous MCP calls is needed, Claude can read it directly from the .context folder
00:02:57instead of making tool calls, saving significant time.
00:03:00Before we move on to the next change, let's hear it from our sponsor, Zen Rose.
00:03:04If you're building AI products, automations, or data-driven systems, you already know one thing,
00:03:09everything starts with reliable web data. But getting clean, structured data at scale
00:03:14is harder than it sounds. That's where Zen Rose fits perfectly into the stack.
00:03:18Zen Rose handles data extraction from complex websites while automatically
00:03:22managing anti-bot bypass so you can focus on what actually matters using the data.
00:03:27Instead of dealing with messy outputs, Zen Rose delivers structured results like JSON or Markdown
00:03:32ready to plug directly into your pipelines. It's integration-ready and business-focused,
00:03:37which makes it ideal for AI startups, data teams,
00:03:40and automation builders who don't want to babysit infrastructure.
00:03:43Whether you're enriching leads, powering AI agents, or automating research,
00:03:47Zen Rose just works. If your work depends on web data, Zen Rose belongs in your stack.
00:03:52Click the link in the pinned comment and start building today.
00:03:55We know that the summarization step when the context window is filled is messy and leads to
00:03:59losing a lot of information. Most tools, including cursor and Claude code, trigger a summarization
00:04:04step and start the session with a fresh context window with the summary as a starting point.
00:04:09When you hit compact again and again, the summary starts to forget details that
00:04:13might be important to you but that the model's summary may miss.
00:04:16There is only so much control you have over auto-compaction, and repeated compression
00:04:21leads to the loss of crucial information if you have to do it repeatedly.
00:04:24Cursor's solution is to save all previous chat history as a file for the agent to reference later.
00:04:30When we provide a very specific prompt and the model cannot find the information in the summary,
00:04:34the previous transcript serves as its knowledge base.
00:04:37The model uses that transcript to generate the solution,
00:04:40allowing it to recover anything that was lost from the summary.
00:04:43Until cursor's implementation rolls out and becomes available for everyone,
00:04:47I tried implementing this feature with Claude code.
00:04:50I added the instruction inside the Claude.md file to update the chat history after each turn,
00:04:55documenting all the key decisions and steps taken.
00:04:58It used a history folder inside the .context folder with each file's name reflecting the session.
00:05:03So whenever I ask it to perform any task, at the end of its task execution session,
00:05:07it documents the chat history into the corresponding history file, adding everything to that file.
00:05:12This way, the .context folder contains detailed records of all sessions and everything that was done.
00:05:18Agents were given skills to help manage the context problem MCPs were causing.
00:05:23The whole purpose of skills is to make agents provide better ability to use its own capabilities
00:05:28by guiding through scripts and instruction files, reducing context bloat by progressive disclosure.
00:05:33Anthropic was the first to come up with the idea, which is basically giving the agents a set of
00:05:37instructions, scripts, and resources that the agent can discover and use to perform better at specific
00:05:43tasks. Anthropic basically open-sourced these agents' skills, setting a standard that others
00:05:48could implement. Following this, Codex, Gemini, and others started implementing agents' skills,
00:05:53after which it was finally cursor's turn to do the same. cursor's skills are basically the same
00:05:58executables and scripts bundled together into a single skill that the agent can use for its
00:06:02respective tasks. Only the skills' name and description are in the static context.
00:06:06Once they are inside the static context, the agents can pull their skills on their own,
00:06:11using grep and cursor's semantic search. This is what makes it different, because cursor's
00:06:15semantic search uses its own embedding model and indexing pipelines in the background, instead of
00:06:20plain pattern matching, like regex-based searches in grep commands. Claude's skills only expose the
00:06:26name and description in the context, no matter how many files the script uses, preventing context
00:06:31bloat. In my project, I had configured 5 skills, each consuming very few tokens, only about 0.2%
00:06:37of the total, leaving more room for working. What's different is that Claude's skills can also be
00:06:42accessed via /commands, letting you manually trigger them whenever needed, addressing people's complaints
00:06:47about skills not being loaded on demand properly. MCPs contain a lot of tools all exposed in the
00:06:52context window, bloating the context window unnecessarily. Cursor took it upon themselves
00:06:57and emphasized that it is the responsibility of the coding agents, not the MCP servers,
00:07:02to fix the context bloat. The solution for this was dynamic context discovery by syncing tool
00:07:06descriptions in a folder. Cursor's idea is to have all of the MCPs with their names in separate
00:07:11folders, named after each connected MCP, and within each folder, all the tools must be listed. With
00:07:17this, the agent only receives the names of tools, and whenever it needs any tool, it looks it up
00:07:22through the folders. In the testing they did, they discovered that dynamic discovery of MCP tools
00:07:27reduced usage by 46.9%, which makes a huge difference if you are working on a long-running
00:07:32system. This implementation also helps in cases where MCP servers accidentally get disconnected
00:07:38or require re-authentication. Normally, the system would just forget about those tools,
00:07:42but now the agent can actually notify the user that re-authentication is required. Claude also has an
00:07:47advanced search tool that is specifically designed to address this problem, using a certain set of
00:07:52flags to let Claude know whether to load it or not. It implements Cursor's exact idea of dynamic
00:07:57context discovery, but this is limited to the developer platform, and only for those building
00:08:01with APIs. We cannot modify how MCPs are used in Claude code, because they are built into it
00:08:07by Anthropic. Just as I was looking for ways to implement this in Claude code, I came across a
00:08:11hidden flag. Without setting this flag, all the MCP tools I had connected were exposed in the context
00:08:17of Claude code. When I set the enable experimental MCP CLI flag, all the tools were removed from the
00:08:23context window, freeing up space that was previously occupied by the MCP tools. But that does not mean
00:08:28the MCPs get disconnected when this CLI is enabled. The only difference is that they are not exposed
00:08:34up front in the context window. Instead of putting all the schemas into the context, Claude now uses
00:08:38a middle bash layer called MCP CLI, which handles all MCP-related tasks. Claude uses this middle
00:08:44layer to search, get information, and invoke the tools. Whenever you ask Claude to perform any task
00:08:49that requires an MCP tool call, instead of using the usual method, it uses the MCPs via MCP CLI and
00:08:56performs the task it is required to do. By using this tool, Claude executes all the tasks as usual,
00:09:01just through this middle layer. Reporting terminal errors is hard in Cursor because of its limited
00:09:06access. If the terminal showed any error, you needed to add it to the chat and then have it
00:09:10fixed. Cursor's solution for this is also moving the terminal sessions to files. So whenever you
00:09:15ask it any questions, it references those history files and uses grep to extract the relevant output.
00:09:20Since server logs are usually long running and contain lots of noise for the agent,
00:09:24using the grep task is more efficient because it lets the agent pattern match. They got this idea
00:09:29from CLI-based coding agents, which run the commands, but then the output is injected into
00:09:34the context exactly the way Claude code and others do by default. Even though Claude intelligently
00:09:39handles this on its own, we can manage it even further by using instructions in Claude.md
00:09:44to instruct it to add all terminal logs into a file in the terminal folder inside the .context
00:09:49folder. Basically, if Claude runs any npm command, it runs a special command that logs both the output
00:09:55stream and the input stream into the document files. Here, 2 represents the standard error stream
00:10:00and 1 represents the standard output stream. It writes these logs to the terminal folder,
00:10:05marking them with a timestamp. Then, whenever it needs to search through them, it simply uses a
00:10:09grep command with a specified pattern and loads the last 20 lines to extract only what matters.
00:10:15So whenever I tested my development server, it used these commands and kept writing the
00:10:19terminal runs to files in accordance with the Claude.md file. After running the server,
00:10:24it referred to the log files and figured out what was causing the issue and fixed the problem for me.
00:10:29Now even though this add-on to Claude code might seem insignificant because it doesn't appear to
00:10:33have much impact on immediate work, it can be very useful when you want to refer back to your app's
00:10:38functioning. Just like when I needed to identify which service was causing my app to crash, I simply
00:10:43told Claude to refer to the test logs instead of running the tests again, saving me from rerunning
00:10:48a 2-minute test suite just to reproduce an error I had already seen. That brings us to the end of
00:10:52this video. If you'd like to support the channel and help us keep making videos like this, you can
00:10:57do so by using the super thanks button below. As always, thank you for watching and I'll see you
00:11:02See you in the next one.

Key Takeaway

Cursor's new dynamic context management approach dramatically improves AI coding quality by keeping context windows minimal and loading information on demand rather than upfront.

Highlights

Cursor introduced five dynamic context management methods to improve AI coding assistance by reducing context window bloat

Saving long MCP tool responses to files instead of keeping them in context can reduce token usage by up to 46.9%

Dynamic context discovery keeps only tool names visible, loading full descriptions only when needed

Maintaining chat history in files prevents information loss during context summarization

Agent skills expose only names and descriptions in context, loading full implementations on demand

Terminal session logs saved to files allow agents to reference errors without re-running commands

These context management principles are transferable to any AI coding platform, not just Cursor

Timeline

Introduction to AI Coding Tools and Context Management

The video introduces how AI has transformed code production through specialized tools like Claude Code, Cursor, and Antigravity. The speaker emphasizes that good models alone don't determine code quality - how you use the tool and manage context matters equally. Cursor recently made a major push for a new context management approach built natively into their app. The principles discussed apply broadly to any platform used for building applications, making this relevant beyond just Cursor users.

The Importance of Context Management and Dynamic Discovery

Context management is critical when working with AI agents because it directly determines output quality. Cursor implemented context management features based on the principle that providing fewer details in the context window leads to better results. Less information means less data to process at once, reducing confusion and increasing focus on the current task. This approach is called dynamic context discovery, which follows structured note-taking principles where information not needed right now should be excluded from the context window. Removing potentially confusing or contradictory details significantly improves agent response quality.

Method 1: Saving Long Tool Responses to Files

The first update addresses how MCPs often return large responses that bloat the context window unnecessarily. Traditional approaches truncate long MCP responses, leading to data loss or removal of important information. The speaker demonstrates implementing this in Claude Code by adding instructions to save any MCP tool response greater than 50 lines to a file in an MCP folder. When analyzing a landing page UI using Chrome extension, Claude saved large ReadPage responses to files for further reading, which improved accuracy and eliminated repetitive tool calls. This workaround allows the agent to analyze responses from files as many times as needed and read previous data directly instead of making new tool calls.

Sponsor Segment: Zen Rose

This section is a sponsored message for Zen Rose, a web data extraction service. Zen Rose is positioned as a solution for AI product builders, automation developers, and data-driven systems that need reliable web data at scale. The service handles data extraction from complex websites while managing anti-bot bypass automatically, delivering structured results in JSON or Markdown format. It's described as integration-ready and business-focused, ideal for AI startups, data teams, and automation builders who need clean data without managing infrastructure.

Method 2: Preserving Chat History in Files

The video addresses the problem of context window summarization, which is messy and leads to information loss. Most tools trigger summarization when context fills up, starting fresh with a summary that may miss important details through repeated compression. Cursor's solution saves all previous chat history as a file for the agent to reference later, serving as a knowledge base when information isn't found in the summary. The speaker implemented this in Claude Code by adding instructions to update chat history after each turn in a history folder within the .context folder. Each file name reflects the session, documenting key decisions and steps taken, allowing detailed records of all sessions to be preserved.

Method 3: Agent Skills and Progressive Disclosure

Agent skills were introduced to help manage context problems caused by MCPs through progressive disclosure. Anthropic pioneered this concept, giving agents instructions, scripts, and resources they can discover and use for specific tasks. Skills bundle executables and scripts together, with only the skill's name and description in static context. Agents pull skills on demand using grep and Cursor's semantic search, which uses embedding models and indexing pipelines instead of plain pattern matching. In the speaker's project, 5 configured skills consumed only 0.2% of total tokens, leaving more room for actual work. Claude's skills can also be accessed via /commands for manual triggering when needed.

Method 4: Dynamic MCP Tool Discovery

MCPs expose many tools in the context window, causing unnecessary bloat. Cursor emphasized it's the coding agent's responsibility, not the MCP server's, to fix this through dynamic context discovery by syncing tool descriptions in folders. Each connected MCP gets a separate folder with all tools listed inside, so agents only receive tool names and look up details when needed. Testing showed this reduced token usage by 46.9%, making a huge difference for long-running systems. This also helps when MCP servers disconnect or require re-authentication, allowing agents to notify users. Claude has an experimental MCP CLI flag that removes all MCP tools from the context window upfront, using a middle bash layer to search, get information, and invoke tools only when needed.

Method 5: Terminal Session Logs in Files

Cursor addresses the difficulty of reporting terminal errors due to limited terminal access by moving terminal sessions to files. When asked questions, the agent references history files and uses grep to extract relevant output. Since server logs are long-running and contain noise, grep pattern matching is more efficient. The speaker implemented this in Claude Code by instructing it to log all terminal output to files in a terminal folder, capturing both standard output and error streams with timestamps. When testing a development server, Claude used these commands and referred to log files to identify and fix issues. This becomes especially useful for referring back to app functioning without rerunning tests - the speaker saved 2 minutes by having Claude refer to test logs instead of rerunning the test suite.

Conclusion and Final Thoughts

The video concludes by summarizing the five context management methods demonstrated and their practical applications. The speaker encourages viewer support through the super thanks button to help continue making similar content. While this section is brief, it reinforces that these context management principles can significantly improve AI coding workflows across different platforms. The techniques shown are not just theoretical but have been practically implemented and tested by the speaker, demonstrating real-world benefits in terms of token efficiency and workflow optimization.

Community Posts

View all posts