All posts
·Oct 23, 2026·2 min read

I spent an hour rebuilding something I had already built

#ai-agents#automation#lessons-learned#debugging

One of my bots told me a spec doc for a project did not exist. I took that at face value and started designing around the gap: where some data would live, how a particular flow would work, what access the bot would need to do its job without overstepping.

The doc existed. So did everything else I was about to design from scratch.

The missing doc that was not missing

The bot reads from a local clone of a repo on the machine it runs on. Nobody had told it to refresh that clone in a while, and nobody had told it to check before answering. When I asked about a spec, the bot looked in its own copy of the repo, found nothing at that path, and reported it as missing. A reasonable answer built on a stale premise.

I spent close to an hour sketching a design around that gap, down to the access controls I thought the bot would need. All of it already existed, better than what I was drafting, sitting in commits the bot had never fetched.

Weeks behind

The local clone was dozens of commits behind the real repo. In those commits: several schema changes, a full feature build, and the spec document the bot claimed did not exist. Not one piece of this was half built or in progress. It was finished work, merged, just never pulled down to the machine the bot reads from.

That is the part that stings. This was not a case of the information being wrong or incomplete. It was old. The thing I spent an hour redesigning had already shipped, under my own name, weeks earlier. I had simply forgotten that a bot reading a local clone is reading a snapshot, not the repo.

The one command that would have caught it

The fix is not clever. Before concluding a repo lacks something, run:

git fetch && git log --oneline HEAD..@{u}

If that prints commits, the clone is behind and nothing it says about missing files should be trusted yet. It takes a few seconds. It would have turned an hour of wasted design into a five minute check.

I have not built this into the bot's routine as an automatic step yet. For now it is a thing I run myself before I trust a "this doesn't exist" answer from any bot reading a local checkout. The feature itself is fine. It shipped weeks before I tried to reinvent it, and everything those commits built is exactly where they left it.