Scaling AI Agents for Production Codebases: Patterns for Accuracy and Efficiency

This ad is not shown to multipass and full ticket holders
JS Nation
JSNation 2026
June 11 - 15, 2026
Amsterdam & Online
The main JavaScript conference of the year
Upcoming event
JSNation 2026
JSNation 2026
June 11 - 15, 2026. Amsterdam & Online
Learn more
Bookmark
Rate this content
Sentry
Promoted
Code breaks, fix it faster

Crashes, slowdowns, regressions in prod. Seer by Sentry unifies traces, replays, errors, profiles to find root causes fast.

As codebases grow, AI coding assistants struggle. Context windows overflow, agents lose track of dependencies, and simple text search fails to capture the semantic relationships that define real software. This talk explores three proven architectural patterns that enable AI agents to work effectively with production-scale codebases: semantic code intelligence through Language Server Protocol integration, specialized agent skills via context and tool bundling, and subagent delegation for efficient context management. Through live demonstrations on a popular open-source project like ShadCN, you'll see these techniques tackle the complexity of real-world software—multi-file refactorings,cross-module changes, and dependency tracking that would overwhelm traditional approaches.

You'll leave with practical, product-agnostic strategies for building or enhancing AI agents that can handle large codebases with accuracy and efficiency. We'll examine why semantic understanding outperforms text search, how to design focused agent skills that improve task completion, and how parallel subagent architectures prevent context window exhaustion. Whether you're building AI developer tools, architecting multi-agent systems, or contributing to open source, these patterns will help you bridge the gap between toy demos and production-grade AI assistance.

This talk has been presented at AI Coding Summit 2026, check out the latest edition of this Tech Conference.

FAQ

The top three AI coding best practices in 2026 for large production codebases include using the Language Server Protocol (LSP) for efficient code refactoring, employing context window management with subagents, and adopting spec-driven development for precise and efficient code updates.

LSP is critical for refactoring large production codebases because it enables semantic understanding and abstract syntax tree (AST) analysis, allowing agents to understand code structures and relationships beyond simple text matching. This leads to faster, error-free refactoring compared to brute force methods.

Context window management improves AI coding efficiency by using subagents to handle different parts of a codebase simultaneously. This prevents context window overflow and allows each subagent to work independently and efficiently, reducing time and resources spent on tasks.

Subagents are specialized agents that run in parallel to manage different parts of a project, such as front-end, back-end, and database code. They have separate context windows, allowing them to work without interfering with each other, thus improving efficiency and reducing resource consumption.

Spec-driven development benefits AI coding projects by aligning agents with predefined requirements and design documents. This structured approach ensures that code updates are precise, reducing errors and improving the overall efficiency of the development process.

Kiro is an agentic AI development platform that integrates with IDEs like VS Code to assist in coding tasks. It enables the use of LSP and supports spec-driven development by generating requirements, design documents, and task lists for structured coding workflows.

The Language Server Protocol (LSP) offers semantic and AST-based understanding of code, allowing for accurate code refactoring and understanding, while traditional grep search relies on brute force text matching, which can lead to errors and inefficiencies, especially in large codebases.

Common issues with using brute force methods, such as grep, in AI coding include increased processing time, errors due to incorrect pattern matching, and higher resource consumption, which can lead to inefficient coding practices and increased costs.

AI coding in 2026 leverages asynchronous operations through the use of subagents that can perform tasks in parallel, significantly reducing the time required for tasks like code reviews or security audits across different parts of a project.

The advantage of using a tool like Kiro for managing large-scale codebases lies in its ability to integrate AI-driven coding assistance, leveraging LSP and subagents for efficient task management, and supporting spec-driven development for precise and structured code updates.

Saurabh Dahal
Saurabh Dahal
24 min
26 Feb, 2026

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Discussing top AI coding best practices in 2026, including semantic understanding and context window management. Exploring the role of Language Server Protocol (LSP) in code refactoring. Efficient code renaming using LSP and code intelligence in Kiro. Impact of not using LSP on code renaming efficiency. Manual approaches without LSP significantly impact efficiency and resource consumption. Context window usage doubles without LSP, affecting code handling. Utilizing subagents for specialized tasks enhances codebase security. Spec-driven development and detailed design documents for efficient agent alignment.

1. AI Coding Best Practices in 2026

Short description:

Discussing top AI coding best practices in 2026 for large production codebases, including tips, tools, and strategies. Exploring the importance of semantic understanding in coding and context window management tricks for AI outputs.

Hi, everybody. Today I want to talk about the top three AI coding best practices of 2026, especially as it pertains to large production codebases. And it's particularly important when we talk about large production codebases, because that's where AI can really mess up a lot. And if AI messes things up in production, then your app is not producing and that can be a problem. So let's talk about some tips, tools and strategies that we can use today in 2026 to get ourselves started right when it comes to working with large production codebases and using AI coding assistance.

My name is Saurabh Dhalal. I'm a developer advocate here at Amazon Web Services on the Agentic AI platform team. And I will be guiding you through these three best practices. Here's the agenda of the day. We're going to first take a look at an example of an open source production codebase with over half of a million lines of code. That's right. Half a million lines of code. So that is a large codebase. And then we're going to talk about the one tool that you must use when refactoring code bases, especially when it comes to production codebases, so that you do not waste your money, your tokens or your AI credits. And also you reduce errors. We're going to talk about the difference between semantic understanding of your code versus brute force text matching and what that involves and why it's relevant to you.

And lastly, we're going to talk about context window management tricks so that you get the best outputs from your AI and also how you can leverage that towards spec-driven development when you're building out a new feature on a production codebase. So let's get started. So the production codebase that we are going to talk about today. Open source, ShadCN repository here. There's two repositories I'm actually going to be covering from the ShadCN GitHub page. The UI repository, which is very, very large. Over half a million lines of code. And then Taxonomy codebase, which is also pretty large. This one is going to be a full stack application. So I want to show something with a full stack application, but also something with a really, really large codebase, whether it's full stack or not. So let's get started. Take a look at a use case. So what is the secret tool? The tool that will result in the difference between typing in the same prompts to refactor a codebase, the result would be either 38 seconds for that prompt to be completed with no errors or over 10 minutes with multiple errors and then probably hours of debugging after those 10 minutes are over because of the errors. The secret tool, LSP, Language Server Protocol.

2. LSP Tool for Code Refactoring

Short description:

Exploring the critical role of Language Server Protocol (LSP) in semantic understanding and refactoring within large production code bases.

That's what LSP stands for. It is the same tool that is in your IDEs that when you hover over, for example, when I hover over some code. Like right here. Right. If I hover over some code, it's the same tool that will be able to understand what type my certain variables are, what kind of function inputs and outputs my functions have. Things like that. So that's language server protocol. And that's LSP.

And we're going to talk about how this LSP tool is super critical when it comes to refactoring a large production code base. So let's take a look at what it really entails. With LSP, it's the difference between semantic understanding and AST, which stands for abstract syntax tree understanding of your code base, where your agent actually understands the symbols and the connections of all the code files and functions and imports, exports, interfaces, classes, objects in your code as actual code rather than just pure brute force text matching of your code, which is grep search. We don't want to do the grep search. We want to do semantic and AST understanding. And that's what LSP enabled coding agent allows us to do.

So let's take a look at a demo for renaming this commonly used function name called CN into a different name. Once again, our large production code base, I'm going to go ahead and clone it. I'm on GitHub, chat CN UI. This is the one that I want to clone. Let's go ahead and do get clone. So I have cloned a very large production code base with over five hundred thousand lines of code. I'm going to see the into this code base. And then PNPM. Let's install the dependencies by using PNPM install and once that's finished, let's take a look at how language server protocol makes a huge difference when it comes to refactoring our code base. Now that the packages have been installed, I'm going to clear out my terminal and I'm in Kiro I.D.E. So this is an app called Kiro. You can find it at. Kiro dot dev. It's an agentic AI development platform. Fork off of V.S. code and it has agents in here and in the terminal, I will be demonstrating the concept of language server protocol being used by agents for refactoring a code base.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Scaling Up with Remix and Micro Frontends
Remix Conf Europe 2022Remix Conf Europe 2022
23 min
Scaling Up with Remix and Micro Frontends
Top Content
This talk discusses the usage of Microfrontends in Remix and introduces the Tiny Frontend library. Kazoo, a used car buying platform, follows a domain-driven design approach and encountered issues with granular slicing. Tiny Frontend aims to solve the slicing problem and promotes type safety and compatibility of shared dependencies. The speaker demonstrates how Tiny Frontend works with server-side rendering and how Remix can consume and update components without redeploying the app. The talk also explores the usage of micro frontends and the future support for Webpack Module Federation in Remix.
Understanding React’s Fiber Architecture
React Advanced 2022React Advanced 2022
29 min
Understanding React’s Fiber Architecture
Top Content
This Talk explores React's internal jargon, specifically fiber, which is an internal unit of work for rendering and committing. Fibers facilitate efficient updates to elements and play a crucial role in the reconciliation process. The work loop, complete work, and commit phase are essential steps in the rendering process. Understanding React's internals can help with optimizing code and pull request reviews. React 18 introduces the work loop sync and async functions for concurrent features and prioritization. Fiber brings benefits like async rendering and the ability to discard work-in-progress trees, improving user experience.
Thinking Like an Architect
Node Congress 2025Node Congress 2025
31 min
Thinking Like an Architect
Top Content
In modern software development, architecture is more than just selecting the right tech stack; it involves decision-making, trade-offs, and considering the context of the business and organization. Understanding the problem space and focusing on users' needs are essential. Architectural flexibility is key, adapting the level of granularity and choosing between different approaches. Holistic thinking, long-term vision, and domain understanding are crucial for making better decisions. Effective communication, inclusion, and documentation are core skills for architects. Democratizing communication, prioritizing value, and embracing adaptive architectures are key to success.
Full Stack Components
Remix Conf Europe 2022Remix Conf Europe 2022
37 min
Full Stack Components
Top Content
RemixConf EU discussed full stack components and their benefits, such as marrying the backend and UI in the same file. The talk demonstrated the implementation of a combo box with search functionality using Remix and the Downshift library. It also highlighted the ease of creating resource routes in Remix and the importance of code organization and maintainability in full stack components. The speaker expressed gratitude towards the audience and discussed the future of Remix, including its acquisition by Shopify and the potential for collaboration with Hydrogen.
The Dark Side of Micro-Frontends
React Advanced 2025React Advanced 2025
29 min
The Dark Side of Micro-Frontends
In the Talk, various key points were discussed regarding micro-front-end architecture. These included challenges with micro-intents, common mistakes in system design, the differences between micro-intents and components, granularity in software architecture, optimizing micro-front-end architecture, efficient routing and deployment strategies, edge computing strategies, global state and data sharing optimization, managing data context, governance and fitness functions, architectural testing, adaptive growth, value of micro-frontends, repository selection, repo structures, and web component usage.
The Eternal Sunshine of the Zero Build Pipeline
React Finland 2021React Finland 2021
36 min
The Eternal Sunshine of the Zero Build Pipeline
For many years, we have migrated all our devtools to Node.js for the sake of simplicity: a common language (JS/TS), a large ecosystem (NPM), and a powerful engine. In the meantime, we moved a lot of computation tasks to the client-side thanks to PWA and JavaScript Hegemony.
So we made Webapps for years, developing with awesome reactive frameworks and bundling a lot of dependencies. We progressively moved from our simplicity to complex apps toolchains. We've become the new Java-like ecosystem. It sucks.
It's 2021, we've got a lot of new technologies to sustain our Users eXperience. It's time to have a break and rethink our tools rather than going faster and faster in the same direction. It's time to redesign the Developer eXperience. It's time for a bundle-free dev environment. It's time to embrace a new frontend building philosophy, still with our lovely JavaScript.
Introducing Snowpack, Vite, Astro, and other Bare Modules tools concepts!

Workshops on related topic

AI on Demand: Serverless AI
DevOps.js Conf 2024DevOps.js Conf 2024
163 min
AI on Demand: Serverless AI
Top Content
Featured WorkshopFree
Nathan Disidore
Nathan Disidore
In this workshop, we discuss the merits of serverless architecture and how it can be applied to the AI space. We'll explore options around building serverless RAG applications for a more lambda-esque approach to AI. Next, we'll get hands on and build a sample CRUD app that allows you to store information and query it using an LLM with Workers AI, Vectorize, D1, and Cloudflare Workers.
High-performance Next.js
React Summit 2022React Summit 2022
50 min
High-performance Next.js
Workshop
Michele Riva
Michele Riva
Next.js is a compelling framework that makes many tasks effortless by providing many out-of-the-box solutions. But as soon as our app needs to scale, it is essential to maintain high performance without compromising maintenance and server costs. In this workshop, we will see how to analyze Next.js performances, resources usage, how to scale it, and how to make the right decisions while writing the application architecture.
Model Context Protocol (MCP) Deep Dive: 2-Hour Interactive Workshop
AI Coding Summit 2025AI Coding Summit 2025
86 min
Model Context Protocol (MCP) Deep Dive: 2-Hour Interactive Workshop
Workshop
Stepan Suvorov
Stepan Suvorov
Join a focused 2-hour session covering MCP's purpose, architecture, hands-on server implementation, and future directions. Designed for developers and system architects aiming to integrate contextual data with ML models effectively. Agenda:- Introduction & Why MCP? Key challenges MCP solves and core benefits.- Architecture Deep Dive: components, interactions, scalability principles. - Building Your Own MCP Server: guided walkthrough with code snippets and best practices; live demo or code review.- Future of MCP Developments: potential enhancements, emerging trends, real-world scenarios.
Key Takeaways:- Clear understanding of MCP's rationale.- Insight into design patterns and scaling considerations.- Practical steps to implement a prototype server.- Awareness of upcoming trends and how to apply MCP in projects. 
Node's Concurrency With the Strength of a Bull With BullMQ
Node Congress 2026Node Congress 2026
95 min
Node's Concurrency With the Strength of a Bull With BullMQ
Workshop
Edy Silva
Douglas Marques
2 authors
Node's concurrent nature is powerful already, but often we need to push work out of the main server for several reasons. In this work, we will explore a few scenarios in which work is cleverly pushed to another Node process to resolve.
Once we use a queue to distribute workloads, we need to identify the nature of the work to be done. For either I/O- or CPU-intensive work, the first is already perfectly covered by a single Node.js process; we will need to tweak the worker setup to match the available resources and throughput.