The Context Problem: Why AI Can't Help Teams That Don't Document
By Dave O'Dell
Here’s a scenario I see constantly: A team adopts an AI coding assistant. The first week, everyone’s impressed. By the third week, complaints start rolling in. “It doesn’t understand our codebase.” “It keeps suggesting patterns we don’t use.” “It wrote code that passed linting but broke our integration tests.”
The problem isn’t the AI. The problem is that the AI has no idea how your team builds software.
The Context Gap
Most AI coding tools are remarkably good at general programming. Ask them to write a React component, implement a sorting algorithm, or set up a REST endpoint, and you’ll get solid code. But “solid code” and “code that belongs in your codebase” are very different things.
Your codebase has opinions. Conventions that evolved over years. Patterns that exist for reasons nobody documented. Architectural decisions that constrain how new code should be written. Error handling approaches. Testing philosophies. Naming conventions that go beyond what a linter can catch.
None of this is in the AI’s training data. And if it’s not written down anywhere in your repository, the AI can’t learn it.
What Context Actually Means
When we talk about “context” for AI tools, we mean everything an experienced engineer on your team knows intuitively:
Architectural context. How services communicate. Where business logic lives versus infrastructure code. Which patterns are preferred and which are legacy. What the dependency graph looks like and why.
Convention context. How you name things. How you structure files. How you handle errors. What your PR process expects. Where tests go and what they should cover.
Historical context. Why that weird abstraction exists (it’s working around a vendor limitation). Why that service has its own database (it was acquired). Why that module has 100% test coverage (it handles payments).
Organizational context. Which team owns what. Who to ask about which subsystem. What compliance requirements affect the code. What the deployment process looks like.
An experienced engineer on your team carries all of this in their head. An AI assistant starts with none of it.
The Documentation Multiplier
Here’s the counterintuitive thing: teams that document well get dramatically more value from AI tools than teams that don’t. It’s not a small difference. It’s the difference between AI being a genuine force multiplier and AI being an expensive autocomplete.
When you have a well-maintained conventions file in your repo root that describes your patterns, architecture decisions, and coding standards, AI tools can read it. They adjust their suggestions accordingly. The code they produce actually looks like it belongs.
When you have architecture decision records that explain why your system is shaped the way it is, AI tools make suggestions that respect those constraints. They don’t propose patterns that violate your architectural boundaries.
When you have clear module documentation that describes interfaces and contracts, AI tools generate code that integrates correctly — not just code that compiles.
What to Document (and What Not To)
You don’t need to document everything. You need to document the things that trip up someone new to the codebase — because that’s exactly what an AI tool is. A very fast, very capable newcomer with zero institutional knowledge.
High-value documentation for AI context:
- Coding conventions file. Put it in the repo root. Cover naming, file structure, error handling, testing expectations. Update it when conventions change.
- Architecture overview. A single document that describes how the system fits together. Service boundaries, data flow, key abstractions.
- Pattern catalog. “When you need to do X, here’s how we do it.” Real examples from the codebase, not abstract guidelines.
- Decision records. Why did we choose this database? Why is authentication handled this way? The “why” is more valuable than the “what.”
Low-value documentation (for AI context):
- API docs that duplicate what’s in the code (AI can read the code)
- Step-by-step tutorials for basic operations
- Documentation that’s more than 6 months out of date (worse than no documentation)
The Compound Effect
Good documentation doesn’t just help AI tools. It helps the AI tools help your team help each other. Here’s the cycle:
- You document your conventions and architecture
- AI tools produce better suggestions that match your patterns
- Engineers trust the AI more and use it for more complex tasks
- AI-generated code is easier to review because it follows conventions
- Reviews go faster, so engineers document more of their decisions
- The documentation gets better, and the cycle accelerates
We’ve seen teams go from “AI is useless for our codebase” to “AI handles 60% of the boilerplate perfectly” in the span of a few weeks — just by writing better documentation.
The Real Objection
I know what you’re thinking: “We’ve tried to get the team to write documentation. It doesn’t stick.”
Fair. But the calculus has changed. Before AI tools, documentation was a nice-to-have that helped onboarding and reduced bus factor. Now it’s a direct multiplier on your AI investment. Every hour spent on good documentation saves dozens of hours of correcting AI suggestions that don’t fit your codebase.
Frame it that way to your team. Don’t say “we need better docs.” Say “the AI keeps writing code that doesn’t match our patterns because it doesn’t know our patterns. Let’s fix that.”
Start Small
You don’t need a documentation sprint. Start with one file:
Create a conventions file in your repo root. Spend an hour with your senior engineers capturing the top 20 things a new engineer would need to know. Patterns, anti-patterns, architectural constraints, naming conventions.
Then watch what happens when your AI tools read it.
The teams that get the most out of AI aren’t the ones with the best AI tools. They’re the ones whose codebases are legible — to humans and machines alike. Context isn’t just infrastructure for AI. It’s infrastructure for your entire engineering organization. AI just makes the ROI undeniable.
Want to accelerate your engineering team?
Book a 30-minute discovery call to discuss your team's AI adoption strategy.
Get in Touch