AI helping me solve a puzzle (AI generated)
AI helping me solve a puzzle (AI generated)

For most of my career, debugging has been one of the things I enjoyed a lot. It has a certain fun and thrill to it. It’s almost like conducting an actual investigation! You gather clues (the fingerprints and footprints of software: logs, memory profiles, alerts, race conditions), uncover more as you go, and try to correlate data points you have. And if you look at the pieces just right, they fit perfectly!

And I was good at it: figuring things out fast and narrowing down accurately. I became the go-to guy for debugging, not just for my own issues but for others’ as well. When all hope was lost, people came to me.

I was the fallback guy.

I don’t think I was good at it because I’m smarter than anyone else in the room, it’s because I’ve always followed the same set of steps: gather as much information as I can, form a bunch of primary hypotheses about what’s wrong, find a way to prove or disprove each one, and repeat until only one explanation is left standing.

“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” — Sherlock Holmes

The trick is how to narrow down the search space by process of elimination. Think of every possible root cause as a leaf node on a tree (the Debug tree). Instead of checking each and every cause one by one, look for a common parent node that we can eliminate deterministically, which eliminates every node under it too. If it checks out, the whole sub-tree is gone in one step. If it doesn’t, we’ve narrowed down the scope.

Contrary to what Holmes says, in the real world we never have the full set of possibilities when we set out on an investigation. Each test tells us which node to open next. We go forward with a hypothesis and eliminate whatever clearly makes no sense. And round it goes.

This came intuitively to me, because I knew the entire system in and out, not just the code. I had written or thoroughly reviewed every line of it, and read the most important parts of the docs for every integration, framework and library we used, so I knew what they could and couldn’t do, and their ups and downsides. I added logger statements at the places I felt would matter one day. So when something broke, I already knew most parts of it, and the hypotheses just came to me.

And to make things faster, I wrote hundreds of single-use / throwaway IPython notebooks and shell scripts to automate the boring parts: massaging data so it was easier to look at, reading and clearing caches, correlating logs by time when an id failed or didn’t exist across systems, grouping a bunch of commands I ran all the time, pulling logs and metrics from third-party systems, automating manual testing. Simply put, whenever something got repetitive, I turned it into code, and if I needed it in more than one project, I made it generic enough to work on any project, in any environment. No one ever asked me to write any of it!

Then AI came along, and just like any other productivity tool, I adopted it. Though initially it made me feel incredibly fast at debugging, it slowly took away my favourite parts of it, one piece at a time.

Phase 1: I hypothesize, AI tests

Early models weren’t great at figuring out what was wrong, but they were very good at doing small things when told exactly what to do. Almost like a junior engineer: you outline the exact steps, and it religiously follows each one. So, naturally, I split the investigative work. I came up with the hypotheses, and the AI did the grunt work of going through large amounts of data, looking for anything that could prove or disprove them. Then I’d go over the findings of each handed-off task myself and prune the Debug tree.

To make the AI agents better, I started turning the same scripts that used to make me productive into a harness! Years of writing code no one asked for, never officially in any repo and used almost only by me, finally paid off!! I turned everything into an MCP server: tools that gave read-only access to all the systems — logs, scrubbed, non-PII data from databases and caches, my runbooks, where I look first and what I focus on, how I isolate and test things independently so I know for sure whether something is or isn’t the root cause. Infra repos, networking configs, full staging access to reproduce issues. And well, it already had access to the code.

What used to take hours became a few lines of prompt, with results in minutes! I could run several sessions in parallel and feed my thoughts into each one as I eliminated options and zeroed in. I was taking help from AI, but I was still the one coming up with the theories, hunches and hypotheses. It shortened the dopamine cycle, and it felt like there was no stopping me. (Don’t worry, it didn’t last long enough to take the excitement out of it. It went out in a different way!)

Before AI, two things stopped anyone else from building something like this. First, nobody had the time, patience or interest to write more code than their task or feature needed. Second, even if I shared my scripts, people still had to figure out what to run when, and then fix, adjust and maintain them for their own case. They were single-use scripts, not perfect code! That was too much of a burden.

With AI, both of those went away. Nobody needs to understand my scrappily put together tools anymore. Plug in the MCP server and just prompt! And if a tool doesn’t fit someone’s use case, they can ask AI to adapt it.

Phase 2: AI needed hand-holding

As the models evolved, it didn’t need me so much anymore! It just figured things out on its own: it understood the code, went over the logs and correlated things across services, at times even better than me.

That’s when I started feeling uneasy. But hey, I had a new interesting problem to solve: AI wasn’t perfect! Without persistent memory, it kept making the same mistakes again and again in every new session, but it did solve the problem.

For example, when AI had read-only, PII-scrubbed access to the CRM and conversations, every system just had its own key as id, not lead_id or conversation_id. The correlation lived somewhere else: the conversation metadata table had a lead_id column, and the lead table had originating_source and originating_source_id. I noticed it struggling with ids as it queried different databases and systems. It would try all the ids it had, read the metadata to understand if anything could be correlated, and then try again. It definitely figured it out by itself, but it was time consuming and took a lot more tokens! And every new chat I started, it had to rebuild this context all over again.

So I added a memory doc with the different systems and how one correlates to another: which is the lead table, which column in it corresponds to the conversation id, and vice versa, both ways. So whenever it needs to go forward or backward, it now knows how to.

It did stop making the mistakes! It made the next investigation straightforward! In a way, the memory doc was doing what my Debug tree used to do: cutting off branches before AI even went down them.

But I wasn’t debugging anymore.

I just observed what it was doing, saw how it worked, and gave it more information and instructions, almost like onboarding a junior engineer. Finding the root cause was its job now. Mine was just observing and writing things down.

I’ve kept doing it since: database metadata (like the date format of a particular column), KQL queries it keeps getting wrong, query limits on production databases, ids that look alike across systems, how to correlate events across apps and services. Each entry is something I knew that AI didn’t, the assumptions we made during development, the taken for granted, the common norms across the company.

Phase 3: I am no longer needed

With the harness and the memory layers in place, AI doesn’t need my hunches, and it doesn’t need me to hold its hand anymore. It goes from the bug report to the root cause on its own!

And it’s not just for me. What set me apart was never some secret knowledge. Everyone ran into the same repetitive checks, but nobody took the time to write them down as code. I did, and that’s what made me better and faster. Now AI runs the same work, and anyone on the team can easily do what I was doing better and faster before, without ever building any of it.

That’s where the excitement went. AI has taken it out of debugging, and democratized it. It was one of the few things I truly enjoyed doing at work, and I was really good at it. All the fun of gathering clues and fitting the pieces together, AI does that now.

It doesn’t need me, and anyone can do it.

People still come to me when all hope is lost and I do keep answering their questions — less confidently as each week goes by.

What I’m still figuring out

A friend who reviewed this told me engineers with depth are still relevant, because they can read what AI is doing, steer it in the right direction, and tell whether the answer is right or wrong. I agree. I can steer it because I have understood these systems in depth until recently. Can I do that going forward? I highly doubt it.

The fewer investigations I do, the less knowledge I have about the system. And I think even an experienced engineer will not be able to catch things if they don’t understand the system anymore! A column changes its format or a new id shows up, and the memory doc goes stale without anyone noticing.

So if knowing the system in and out was my edge, what happens when I don’t need to know it anymore?

I don’t know yet, but I have a few hypotheses to test.

They are not fully formed yet. Building evals has been the hardest part, and it’s the one that actually shows all the mistakes of AI. Depth is still the king, but not exactly the way it was before, and I still don’t know how or what yet. Judgement is definitely the new edge, which is why I am focusing on my PR/code review skills, but scaling is a problem there with everyone raising large PRs every day, often more than one! And yes, I definitely should still investigate some things by hand.

None of these are proven yet. As I prove or disprove each one, they will open up the next node :)