<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>RAG for Coding on RockB</title><link>https://baeseokjae.github.io/tags/rag-for-coding/</link><description>Recent content in RAG for Coding on RockB</description><image><title>RockB</title><url>https://baeseokjae.github.io/images/og-default.png</url><link>https://baeseokjae.github.io/images/og-default.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 14 Jul 2026 12:00:00 +0000</lastBuildDate><atom:link href="https://baeseokjae.github.io/tags/rag-for-coding/index.xml" rel="self" type="application/rss+xml"/><item><title>AI Coding Agent Dependency Bias: Why Your Assistant Plays Favorites</title><link>https://baeseokjae.github.io/posts/coding-agents-play-favorites-dependencies/</link><pubDate>Tue, 14 Jul 2026 12:00:00 +0000</pubDate><guid>https://baeseokjae.github.io/posts/coding-agents-play-favorites-dependencies/</guid><description>AI coding agents favor popular dependencies like React and Docker over niche alternatives. Here&amp;#39;s why it happens and how to work around it.</description><content:encoded><![CDATA[<h2 id="your-ai-coding-assistant-has-a-hidden-bias--and-its-reshaping-the-software-ecosystem">Your AI Coding Assistant Has a Hidden Bias — and It&rsquo;s Reshaping the Software Ecosystem</h2>
<p>I&rsquo;ve been running AI coding agents daily for over a year now — Claude Code, Cursor, GitHub Copilot — and I&rsquo;ve noticed something unsettling. When I ask them to generate a React component, the output is near-perfect on the first try. When I ask for the same thing in SvelteKit or Solid, I get hallucinated APIs, wrong imports, and code that looks like someone read a blog post from 2023 and guessed the rest.</p>
<p>This isn&rsquo;t random. Your AI coding assistant plays favorites with your dependencies, and the bias runs deep in the training data. If you&rsquo;re building on a niche stack, you&rsquo;re fighting an uphill battle that most developers don&rsquo;t even realize exists.</p>
<h2 id="why-ai-coding-agents-play-favorites-the-training-data-problem">Why AI Coding Agents Play Favorites: The Training Data Problem</h2>
<p>The root cause is straightforward: LLMs are trained on what&rsquo;s available, not what&rsquo;s good.</p>
<p>GitHub hosts over 200 million repositories, but the distribution is anything but even. Python, JavaScript, and Java dominate. React has the largest open-source ecosystem on the platform by a wide margin. Dockerfiles and docker-compose.yml files are everywhere. Stack Overflow threads, blog posts, tutorials, and documentation — all of these training sources skew heavily toward the most popular tools.</p>
<p>When a model like Claude 4 Sonnet or GPT-4o was trained, it saw React examples tens of thousands of times more often than Solid or Svelte examples. The model didn&rsquo;t learn &ldquo;how to write a frontend component&rdquo; — it learned &ldquo;how to write a React component&rdquo; and generalized poorly from there.</p>
<h3 id="github-stack-overflow-and-the-popularity-feedback-loop">GitHub, Stack Overflow, and the Popularity Feedback Loop</h3>
<p>Here&rsquo;s the cycle I&rsquo;ve observed playing out in real time:</p>
<ol>
<li>A framework gets popular → more GitHub repos, Stack Overflow questions, blog posts</li>
<li>LLM training crawls collect more data on that framework → the model generates it more accurately</li>
<li>Developers using AI tools get better results with the popular framework → they recommend it, use it more</li>
<li>The popular framework gets even more popular → step 1 repeats</li>
</ol>
<p>This is the same feedback loop that drives search engine rankings and YouTube recommendations, but applied to code generation. The consequence is that your choice of dependencies directly determines how effective your AI coding tools will be.</p>
<h3 id="the-matthew-effect-in-ai-assisted-development">The Matthew Effect in AI-Assisted Development</h3>
<p>Sociologists call this the Matthew Effect — &ldquo;the rich get richer and the poor get poorer.&rdquo; In AI-assisted development, it means popular dependencies get better AI support, which makes them even more popular, which entrenches them further.</p>
<p>I&rsquo;ve watched this happen with Docker vs Podman. Docker commands come out perfectly from every AI tool I&rsquo;ve tested. Podman-specific features like rootless mode or <code>podman pod create</code>? The AI either ignores them entirely or generates Docker syntax that doesn&rsquo;t work. The developer then has to manually fix every output, which defeats the purpose of using an AI assistant in the first place.</p>
<h2 id="real-world-examples-of-ai-dependency-bias">Real-World Examples of AI Dependency Bias</h2>
<p>Let me give you specific cases I&rsquo;ve encountered or verified through testing.</p>
<h3 id="frontend-frameworks--reacts-reign-vs-sveltes-struggle">Frontend Frameworks — React&rsquo;s Reign vs Svelte&rsquo;s Struggle</h3>
<p>I asked Claude Code, Cursor&rsquo;s Composer, and GitHub Copilot Agent to generate the same component — a data table with sorting, filtering, and pagination — in three frameworks.</p>
<p><strong>React (with TanStack Table):</strong> All three tools produced working code on the first attempt. The imports were correct, the hook usage matched the current API, and the TypeScript types were accurate.</p>
<p><strong>Svelte 5 (with runes):</strong> Claude Code generated <code>$:</code> reactive declarations that were deprecated in Svelte 5. Cursor produced a mix of Svelte 4 and Svelte 5 syntax. Copilot Agent hallucinated a <code>svelte-table</code> package that doesn&rsquo;t exist.</p>
<p><strong>SolidJS:</strong> All three tools struggled. Claude Code generated JSX that used <code>createEffect</code> where <code>createMemo</code> was appropriate. Cursor produced code that mixed Solid&rsquo;s signal syntax with React&rsquo;s <code>useState</code> patterns.</p>
<p>The difference isn&rsquo;t that React is easier to generate — it&rsquo;s that the training data contains orders of magnitude more React examples.</p>
<h3 id="container-orchestration--dockers-dominance-vs-podmans-predicament">Container Orchestration — Docker&rsquo;s Dominance vs Podman&rsquo;s Predicament</h3>
<p>I maintain a CI pipeline that uses Podman for rootless container builds. Every time I ask an AI agent to help with it, I get Docker commands back.</p>
<p>Here&rsquo;s what happened when I asked Claude Code to &ldquo;create a rootless Podman container with a bind mount&rdquo;:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># What Claude Code generated:</span>
</span></span><span style="display:flex;"><span>docker run -v /host/path:/container/path myimage
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># What actually works with Podman rootless:</span>
</span></span><span style="display:flex;"><span>podman run --userns<span style="color:#f92672">=</span>keep-id -v /host/path:/container/path:Z myimage
</span></span></code></pre></div><p>The <code>--userns=keep-id</code> flag and the <code>:Z</code> SELinux label are Podman-specific. The AI simply doesn&rsquo;t know them because Podman examples are sparse in the training data compared to Docker&rsquo;s millions of Dockerfiles and Compose files.</p>
<h3 id="backend-languages--python-and-javascript-get-all-the-love">Backend Languages — Python and JavaScript Get All the Love</h3>
<p>This extends beyond frameworks into languages themselves. I work with a Go codebase that uses <code>pgx</code> (PostgreSQL driver) and <code>sqlc</code> for query generation. When I ask AI agents to write database access code, they default to <code>database/sql</code> with raw queries — the most common pattern in Go training data — even when my project clearly uses <code>pgx</code> and <code>sqlc</code>.</p>
<p>The same happens with Rust. Ask for async HTTP server code and you&rsquo;ll get <code>actix-web</code> or <code>tokio</code> examples even when your project uses <code>axum</code>. The AI defaults to the most-represented option in its training distribution.</p>
<h2 id="the-agentic-workflow-chasm-when-bias-derails-autonomy">The Agentic Workflow Chasm: When Bias Derails Autonomy</h2>
<p>The bias problem gets worse when you move from autocomplete to autonomous agents.</p>
<p>With Copilot-style completions, you see the suggestion, accept or reject it, and move on. The cost of bias is a wrong suggestion that you ignore. Annoying, but manageable.</p>
<p>With agentic workflows — where Claude Code or Cursor&rsquo;s Agent mode plans and executes multi-step tasks — the bias compounds. The agent picks a popular library, writes code around it, hits an API that doesn&rsquo;t exist, tries to fix it by importing something else that also doesn&rsquo;t exist, and spirals into a loop of hallucinated fixes.</p>
<p>I&rsquo;ve watched Claude Code spend 45 seconds generating a plan, then 3 minutes executing it, only to produce code that doesn&rsquo;t compile because it used a library API that was deprecated two versions ago. The time cost isn&rsquo;t just the generation — it&rsquo;s the debugging, the context switching, and the frustration.</p>
<h3 id="why-enterprise-ai-agent-adoption-is-stuck-at-11">Why Enterprise AI Agent Adoption Is Stuck at 11%</h3>
<p>Industry data shows enterprise full deployment of AI agents has been stagnant at around 11% for the past year. I think this dependency bias is a major, under-discussed reason.</p>
<p>Enterprise codebases are not greenfield React apps. They&rsquo;re a decade of accumulated decisions: proprietary frameworks, internal libraries, custom ORMs, legacy middleware, and niche infrastructure tools. When an AI agent can&rsquo;t handle any of these, it becomes a net negative — generating code that doesn&rsquo;t fit the architecture, suggesting dependencies that conflict with internal standards, and requiring more human review time than it saves.</p>
<p>The 11% who have succeeded are either (a) working on modern, mainstream stacks or (b) investing heavily in custom context injection to bridge the gap. Everyone else is stuck in pilot purgatory.</p>
<h3 id="hallucinated-apis-boilerplate-and-endless-loops">Hallucinated APIs, Boilerplate, and Endless Loops</h3>
<p>The practical symptom of dependency bias in agentic mode is the hallucination cascade. Here&rsquo;s the pattern I&rsquo;ve seen repeat:</p>
<ol>
<li>Agent reads your codebase, sees you use a niche library</li>
<li>Agent decides to &ldquo;help&rdquo; by adding a popular alternative instead</li>
<li>Agent generates code using the popular library&rsquo;s API</li>
<li>The code doesn&rsquo;t compile because the popular library isn&rsquo;t in your dependencies</li>
<li>Agent adds the dependency, but now there are conflicts</li>
<li>Agent tries to resolve conflicts by modifying your existing code</li>
<li>Everything breaks</li>
</ol>
<p>I&rsquo;ve had to <code>git stash</code> more times than I&rsquo;d like to admit after letting an AI agent &ldquo;fix&rdquo; something in a codebase with non-standard dependencies.</p>
<h2 id="what-this-means-for-your-dependencies">What This Means for Your Dependencies</h2>
<p>If you&rsquo;re evaluating dependencies for a new project, the AI bias should be on your list of considerations alongside performance, ecosystem, and team expertise.</p>
<h3 id="the-dark-matter-of-undersupported-codebases">The &lsquo;Dark Matter&rsquo; of Undersupported Codebases</h3>
<p>There&rsquo;s a growing class of codebases I call &ldquo;dark matter&rdquo; — projects built on frameworks and libraries that AI tools can&rsquo;t effectively help with. These codebases become increasingly expensive to maintain because:</p>
<ul>
<li>New developers can&rsquo;t use AI to ramp up on them</li>
<li>Refactoring requires manual work that AI can&rsquo;t assist with</li>
<li>Documentation generation produces inaccurate results</li>
<li>Bug fixing becomes a solo effort</li>
</ul>
<p>If your company has a proprietary framework or a niche stack, you&rsquo;re accumulating technical debt that compounds with every AI tool release. The gap between what AI can do for mainstream stacks and what it can do for yours will only widen.</p>
<h3 id="the-hidden-cost-of-choosing-a-niche-stack">The Hidden Cost of Choosing a Niche Stack</h3>
<p>I&rsquo;m not saying you should abandon Svelte for React or Podman for Docker. But you should be honest about the cost. Every time you choose a less-popular dependency, you&rsquo;re accepting that your AI tools will be less effective.</p>
<p>For a solo developer or a small team, this can be a significant productivity hit. For a large team, it means every developer spends more time manually verifying AI output, which erodes the ROI of your AI tooling investment.</p>
<h3 id="security-implications-of-ai-preferred-dependencies">Security Implications of AI-Preferred Dependencies</h3>
<p>There&rsquo;s a subtler risk here. If AI agents consistently suggest React, Express, and Docker — the most popular options — they&rsquo;re also suggesting the most-attacked surfaces. Popular frameworks have more CVEs, more exploit code in the wild, and more attention from attackers.</p>
<p>An AI that defaults to <code>express</code> for every Node.js backend is steering you toward a framework with a well-documented history of middleware vulnerabilities. Sometimes the niche alternative is actually more secure — but the AI won&rsquo;t suggest it.</p>
<h2 id="how-to-fight-back-mitigation-strategies">How to Fight Back: Mitigation Strategies</h2>
<p>The bias is baked into the models, but you can work around it. Here&rsquo;s what I&rsquo;ve found effective.</p>
<h3 id="rag--injecting-context-at-runtime">RAG — Injecting Context at Runtime</h3>
<p>Retrieval-Augmented Generation is the most practical mitigation today. Instead of relying on the model&rsquo;s training data, you feed it relevant documentation at query time.</p>
<p>I use a local RAG pipeline that indexes my project&rsquo;s dependencies&rsquo; official docs. When I ask Claude Code or Cursor a question, the relevant docs are injected into the context. This dramatically reduces hallucinations for niche frameworks.</p>
<p>Tools like <code>context</code> (the CLI for MCP-based RAG) and <code>docs-crawler</code> can build these indexes automatically. Point them at your dependency&rsquo;s documentation site, and you get a searchable knowledge base that the AI can query.</p>
<h3 id="custom-rules-and-documentation-cursor-claude-code-copilot">Custom Rules and Documentation (Cursor, Claude Code, Copilot)</h3>
<p>Every major AI coding tool now supports some form of project-level instructions:</p>
<ul>
<li><strong>Cursor:</strong> <code>.cursor/rules/</code> directory with <code>.mdc</code> files</li>
<li><strong>Claude Code:</strong> <code>CLAUDE.md</code> at the project root</li>
<li><strong>GitHub Copilot:</strong> <code>.github/copilot-instructions.md</code></li>
</ul>
<p>I wrote a detailed guide on <a href="/posts/cursor-rules-guide-2026/">Cursor rules and .mdc files</a> that covers the syntax and activation modes. The key insight is that you should document your non-standard dependencies explicitly:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-markdown" data-lang="markdown"><span style="display:flex;"><span># CLAUDE.md — Project Rules
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## Database Layer
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">-</span> We use <span style="color:#e6db74">`pgx`</span> v5.x for PostgreSQL, NOT <span style="color:#e6db74">`database/sql`</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">-</span> Query generation uses <span style="color:#e6db74">`sqlc`</span> — do not write raw SQL strings
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">-</span> Migrations use <span style="color:#e6db74">`golang-migrate`</span>, not <span style="color:#e6db74">`prisma`</span> or <span style="color:#e6db74">`gorm`</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## Containerization
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">-</span> All containers use Podman (rootless mode)
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">-</span> Use <span style="color:#e6db74">`podman build`</span> not <span style="color:#e6db74">`docker build`</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">-</span> SELinux labels (<span style="color:#e6db74">`:Z`</span>, <span style="color:#e6db74">`:z`</span>) are required for bind mounts
</span></span></code></pre></div><p>This isn&rsquo;t perfect — the model can still fall back to its training biases — but it dramatically reduces the error rate. I covered the differences between these formats in my <a href="/posts/cursorrules-vs-claude-md-vs-agents-md-2026/">.cursorrules vs CLAUDE.md vs AGENTS.md comparison</a>.</p>
<h3 id="fine-tuning-and-domain-specific-models-for-the-deep-pockets">Fine-Tuning and Domain-Specific Models (For the Deep Pockets)</h3>
<p>If you&rsquo;re in an enterprise with a proprietary stack, fine-tuning is the nuclear option. Train a model on your internal codebase, your dependency documentation, and your coding patterns. The result is an AI that actually understands your stack.</p>
<p>This is expensive — you need the data, the compute, and the MLOps pipeline to maintain it. But for organizations with large, unique codebases, it&rsquo;s the only way to get reliable AI assistance.</p>
<h2 id="demanding-a-more-equitable-ai-ecosystem">Demanding a More Equitable AI Ecosystem</h2>
<p>The dependency bias in AI coding tools isn&rsquo;t malicious — it&rsquo;s a statistical inevitability given how these models are trained. But it has real consequences for the software ecosystem. It entrenches incumbents, penalizes innovation, and creates a growing class of &ldquo;dark matter&rdquo; codebases that become increasingly expensive to maintain.</p>
<p>As developers, we should push for:</p>
<ul>
<li><strong>Better representation in training data</strong> — model providers should actively curate diverse framework examples, not just scrape what&rsquo;s popular</li>
<li><strong>Transparent bias reporting</strong> — tools should tell you which frameworks they&rsquo;re confident about and which they&rsquo;re guessing on</li>
<li><strong>First-class custom context support</strong> — every AI coding tool should make it easy to inject project-specific knowledge</li>
</ul>
<p>In the meantime, document your non-standard dependencies in your project rules, set up a RAG pipeline for your niche frameworks, and never trust an AI agent that reaches for <code>docker</code> when your project clearly uses <code>podman</code>.</p>
<h2 id="faq">FAQ</h2>
<h3 id="why-do-ai-coding-agents-perform-better-with-popular-frameworks">Why do AI coding agents perform better with popular frameworks?</h3>
<p>AI coding agents are powered by LLMs trained on web-scale datasets. Popular frameworks like React, Docker, and Express have millions of examples in GitHub repositories, Stack Overflow threads, and technical documentation. The model sees these patterns thousands of times more often than niche alternatives, so it generates them more accurately.</p>
<h3 id="can-i-fix-ai-dependency-bias-with-better-prompts">Can I fix AI dependency bias with better prompts?</h3>
<p>Partially. Detailed prompts that specify your exact dependency versions and APIs help, but the underlying model still defaults to its training distribution. Project-level rules files (CLAUDE.md, .cursor/rules/) are more effective because they&rsquo;re applied consistently across all interactions.</p>
<h3 id="does-this-bias-affect-all-ai-coding-tools-equally">Does this bias affect all AI coding tools equally?</h3>
<p>No. Tools with stronger context injection — like Claude Code with CLAUDE.md and Cursor with .cursor/rules — handle niche dependencies better than tools that rely primarily on training data. The gap is narrowing as tools improve their context handling, but the bias is still present in the underlying models.</p>
<h3 id="is-it-safe-to-let-ai-agents-choose-dependencies-for-my-project">Is it safe to let AI agents choose dependencies for my project?</h3>
<p>Not without supervision. AI agents tend to default to the most popular option, which may not fit your project&rsquo;s architecture, licensing requirements, or security posture. Always review dependency suggestions, especially for security-critical components.</p>
<h3 id="will-ai-dependency-bias-get-better-or-worse-over-time">Will AI dependency bias get better or worse over time?</h3>
<p>It depends on the model providers. If they continue training primarily on web-crawled data, the bias will worsen as popular frameworks generate even more content. If they invest in curated, diverse training datasets and better context injection, the gap can narrow. The trend in 2026 is toward better custom context support, which is the most practical path forward.</p>
]]></content:encoded></item></channel></rss>