Context Engineering: Why Your AI Assistant Is Only as Good as Your Repo
Two teams can use exactly the same AI assistant and get very different results. One gets clean changes that match the house style. The other gets code that ignores every convention and reinvents helpers that already exist. The difference is rarely the prompt. It is what the assistant could see when it started.
People have begun calling this “context engineering”: the work of making sure the model has the right information, and not too much of the wrong kind, when it does a task. Much of it comes down to habits that good engineering teams have always valued.
1. Write Down How the Project Works
Most assistants now look for an instruction file in the repository and read it before they do anything. Use it. Explain how to build and test the project, where things live and which conventions matter. Keep it short and factual. It is the same thing a new teammate would want on their first day.
2. Make the Common Commands Obvious
If running the tests takes a ten-step ritual known only to two people, the assistant will not manage it and neither will your next hire. One command to build, one to test, one to lint. Put them in the instruction file.
3. Keep Documentation Next to the Code
A design note in a wiki that nobody links to is invisible to an assistant. A short README in the folder it describes is not. Decisions, constraints and “do not touch this because…” notes are most useful when they sit beside the code they are about.
4. Be Consistent
Models are pattern matchers. If your codebase handles errors three different ways, you will get a fourth. If it has one clear pattern, the assistant will usually follow it. Consistency was always good for people. Now it pays off twice.
5. Small, Well-Named Pieces
An assistant can only hold so much in view at once. Large files with vague names force it to guess. Smaller modules with clear names and clear boundaries let it find the right place and leave the rest alone.
6. Less Can Be More
It is tempting to give the model everything. In practice, too much context is as harmful as too little: the important detail gets lost in the noise. Point the assistant at the relevant files and the relevant docs, not the entire monorepo.
7. Let Tests and Types Speak
A type signature or a failing test tells the assistant precisely what is expected, with no room for interpretation. They are context too, and the most reliable kind.
Conclusion
None of this is really about AI. A repository with clear instructions, consistent patterns and good tests is easier for everyone to work in. The assistants have simply made the cost of a messy repo visible, because they hit every gap at once. If your team is getting poor results from good tools, look at the repo before you blame the model. And if you would like a second pair of eyes on it, we are happy to help.