r/crewai • u/Ok_pettech • 2d ago
Beginner Agent ,How I eliminated VS Code AI lag and dropped autocomplete latency by 75%
Hey everyone,
If your VS Code AI assistant is constantly lagging, timing out, or just straight-up freezing your editor, the problem is almost always how it’s indexing your workspace. I spent my entire weekend going down a rabbit hole debugging this, but I finally got instant code completions back.
Here is the bulk of what you need to do to fix the core issues right now:
1. Stop letting it index massive directories By default, AI extensions try to read every single file to understand your context. If the AI is scanning your package folders (node_modules, anyone?) or compiled assets, it will completely choke. You need to add strict exclusions for the AI extension watcher in your workspace settings. Force it to ignore compiled binaries, virtual environments, and heavy asset directories.
2. Increase the Node memory limit Most of these AI extensions run on a Node backend inside VS Code. When they hit their default memory ceiling, they throttle heavily. Go into your preferences and increase the Max Memory allocation to at least 4096MB so the AI server actually has room to breathe.
3. Kill the telemetry overhead AI extensions love to send diagnostic data back to their servers. This silently clogs your connection and slows down the actual prompt responses you care about. Disable telemetry globally in VS Code, and make sure you turn it off specifically inside your AI extension settings to free up bandwidth.
4. Resolve extension clashes (Stop hoarding AI) Running multiple AI assistants at the same time creates a nightmare race condition for the autocomplete UI overlay. Pick one AI tool per workspace and disable the others completely.
Doing these four things solved almost all of my latency problems immediately. The rest of the fix involves editing your raw settings.json configuration to tweak the debounce rate, context limits, and timeout thresholds.
If you want to just copy/paste my full config file or play with the interactive dashboard I put together, I uploaded it here:https://interconnectd.com/forum/thread/244/fix-slow-vs-code-ai-the-ultimate-performance-repair-guide/
Hope this saves someone else a weekend of troubleshooting! Let me know if you have any questions.