Keeping Project Context Under One Roof
First exploration of AI at work: how to make an agent understand project context without explaining everything over and over again without giving it access to my whole computer.
For a programmer, I was pretty late to the whole AI thing. While it felt like everyone else was already rebuilding their workflows and talking about the future of software, I only started seriously bringing these tools into my day-to-day work last year.
At first, my first impression wasn't great. The agents back then were nowhere near as capable as the ones we have today. They were rigid, easily confused, and the hallucinations were relentless. Half the time, asking for help meant spending thirty minutes cleaning up a confident, completely made-up answer. It felt faster to just write the code myself.
However, I kept trying to use it.
And as those models gradually became smarter, my frustration shifted to a different problem. As they became more intelligent, and they began to offer better solutions; however, a single question or request was never enough.
For years, I had structured my projects the traditional way: separate repositories for everything. The frontend lived in one repo, the backend in another, and the apps somewhere else. It felt clean, disciplined, and familiar. And for a long time, it worked fine—mostly. I carried the invisible map of the system in another documents. When I was building a screen, I read from those documents and knew what the API returned, which fields were optional, and how a small change in the database would ripple outward.
An AI agent didn't read those docs. Every time I opened a new session, I had to reintroduce it to the project from the very beginning all over again. I asked it to to wire up a frontend feature, and ended up guessing the payload, inventing own endpoints, or miss a constraint that lived in a completely different repository. I would ask it to wire up a frontend feature, and it would guess the payload, invent an endpoint, I started feeling less like a developer and more like a translator, repeating the same context over and over just to get a usable answer. It felt like they were working in the dark.
I tried to work around it. I knew I could lean on reusable skills and custom instructions to guide how the agent behaved. That helped with coding style and habits, sure, but it couldn't fix the core issue: when I was inside the frontend repo, the truth of the backend still lived somewhere else. You can't prompt your way around an agent not being able to read the actual code.
The easy escape hatch would have been giving the LLM broad access to my entire machine so it could hop between project folders on its own. I couldn't bring myself to do that. No amount of convenience was worth handing an autonomous tool the keys to my whole computer. I wanted a firm boundary: let the agent see everything it needs for the job, and nothing beyond it.
That's what finally made me cave and try something I'd been avoiding for years. I merged everything for a project into one monorepo.
In my current project, the whole system now lives under one roof:
Project/
├── api/ Backend
├── web/ Frontend
├── contract/ Frontend SDK generated from the backend
├── shared/ Reusable components and functions
├── docs/ Architecture notes, plans, and task breakdowns
└── AGENTS.md Project-wide entry point for AI agents
I didn't make this move to follow a big-tech trend, or because I suddenly wanted to preach about monorepo architecture. I did it because I just wanted all the pieces sitting on the same table, inside one locked room.
The difference showed up almost immediately in the small, everyday moments. Now, the backend generates the contract, and that lives right inside contract/ as a typed SDK for the frontend. When I'm working in web/, the agent doesn't have to guess what the server expects—it can read the exact generated contract, or peek directly into api/ if something deeper needs to change. If it needs a button or a dialog, shared/ component is right next door.
To make sure the agent doesn't get lost in a bigger repo, I also started treating documentation as a local map. Beyond the root AGENTS.md and docs/, each directory carries its own README and docs explaining what lives there and how it fits into the rest of the system. Wherever the agent lands, it has just enough local context to orient itself without me having to narrate the entire architecture from memory.
And best of all, my boundary stayed intact. The agent has full visibility into the project it's helping me build, and zero access to anything else on my machine.
Looking back, this was really just my first chapter with AI. That single shift finally got us looking at the same blueprint—without me having to hand over the keys to my entire computer.
At the moment, I am still exploring and researching how to make the best use of this technology. This feels like a fitting starting point, and I will share further developments in a future post.